diff options
| author | J M Rossy <[email protected]> | 2015-07-29 15:40:09 -0700 |
|---|---|---|
| committer | J M Rossy <[email protected]> | 2015-07-29 16:34:40 -0700 |
| commit | 5d61a4a79a1e96dc5d9af1e5e712c84507307544 (patch) | |
| tree | 49ed270893578cd18758b74ffcca16dc7ab948d6 /avscamera/sys/AvsCameraDevice.cpp | |
| parent | 5d41613e26e147d2300c786bb2b34cb4b4067a25 (diff) | |
Samples update for public Windows 10 release
Fix #2 Enabling WPP Recorder in Sensors Samples causes errors
Fix #4 Add back fixed KMDOD sample
Add new BarcodeScanner sample in pos folder
Add new MagneticStripeReader sample in pos folder
Add new SynpaticsTouch sample in input folder
Add new Power Engine Plugin sample in pofx folder
Add new DeviceMft sample in avstream folder
Add new AvsCamera sample in root
Add new SimBatt sample in root
Add other pre-existing samples not yet released for Win10
Diffstat (limited to 'avscamera/sys/AvsCameraDevice.cpp')
| -rw-r--r-- | avscamera/sys/AvsCameraDevice.cpp | 99 |
1 files changed, 99 insertions, 0 deletions
diff --git a/avscamera/sys/AvsCameraDevice.cpp b/avscamera/sys/AvsCameraDevice.cpp new file mode 100644 index 00000000..ebfb589d --- /dev/null +++ b/avscamera/sys/AvsCameraDevice.cpp @@ -0,0 +1,99 @@ +/************************************************************************** + + A/V Stream Camera Sample + + Copyright (c) 2015, Microsoft Corporation. + + File: + + AvsCameraDevice.cpp + + Abstract: + + Device class implementation. Derived from CCaptureDevice. + This class overloads our base device class implementation. + + History: + + created 02/24/2015 + +**************************************************************************/ + +#include "Common.h" + +/************************************************************************** + + PAGEABLE CODE + +**************************************************************************/ + +#ifdef ALLOC_PRAGMA +#pragma code_seg("PAGE") +#endif // ALLOC_PRAGMA + +// +// DispatchCreate(): +// +// This is the Add Device dispatch for the capture device. It creates +// the CCaptureDevice and associates it with the device via the bag. +// +NTSTATUS +CAvsCameraDevice:: +DispatchCreate ( + _In_ PKSDEVICE Device +) +{ + PAGED_CODE(); + + DBG_ENTER("()"); + + CAvsCameraDevice *CapDevice = new (NonPagedPoolNx, 'eviD') CAvsCameraDevice (Device); + if( !CapDevice) + { + // + // Return failure if we couldn't create the device. + // + return STATUS_INSUFFICIENT_RESOURCES; + } + + NTSTATUS Status = CapDevice->Prepare(); + if (!NT_SUCCESS (Status)) + { + // Init failure. + delete CapDevice; + } + + DBG_LEAVE("()"); + return Status; +} + +NTSTATUS +CAvsCameraDevice:: +Initialize() +{ + PAGED_CODE(); + + static + CSensorContext Context[] = + { + { L"RFC", &AvsCameraFilterDescriptor, AcpiPldPanelBack }, + { L"FFC", &AvsCameraFilterDescriptorFFC, AcpiPldPanelFront } + }; + + m_FilterDescriptorCount = SIZEOF_ARRAY(Context); + m_Context = Context; + + return CCaptureDevice::Initialize(); +} + +CSensor * +CAvsCameraDevice:: +CreateSensor( + _In_ const KSFILTER_DESCRIPTOR *Descriptors +) +{ + PAGED_CODE(); + + return new (NonPagedPoolNx, 'sneS') CSensorSimulation( this, Descriptors ); +} + |
