From 96eb96dfb613e4c745db6bd1f53a92fe7e2290fc Mon Sep 17 00:00:00 2001 From: karlf Date: Thu, 11 Aug 2016 13:28:13 -0700 Subject: Updated for "Windows 10 Anniversary Update" (Version 1607) --- AVStream/avscamera/sys/VideoHwSim.cpp | 66 +++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 AVStream/avscamera/sys/VideoHwSim.cpp (limited to 'AVStream/avscamera/sys/VideoHwSim.cpp') diff --git a/AVStream/avscamera/sys/VideoHwSim.cpp b/AVStream/avscamera/sys/VideoHwSim.cpp new file mode 100644 index 00000000..33b6de90 --- /dev/null +++ b/AVStream/avscamera/sys/VideoHwSim.cpp @@ -0,0 +1,66 @@ +/************************************************************************** + + A/V Stream Camera Sample + + Copyright (c) 2014, Microsoft Corporation. + + File: + + VideoHwSim.cpp + + Abstract: + + A fake h/w simulation for the video pin. Provides Video pin specific + metadata. + + History: + + created 5/28/2014 + +**************************************************************************/ + +#include "Common.h" + + +CVideoHardwareSimulation::CVideoHardwareSimulation( + _Inout_ CSensor *Sensor, + _In_ LONG PinID +) + : CHardwareSimulation( Sensor, PinID ) +{} + + +CVideoHardwareSimulation::~CVideoHardwareSimulation() +{} + +// +// Emit metadata here for video pin. +// +void +CVideoHardwareSimulation:: +EmitMetadata( + _Inout_ PKSSTREAM_HEADER pStreamHeader +) +{ + NT_ASSERT(pStreamHeader); + + // Add the normal frame info to the metadata + // Note: This call ensures the KSSTREAM_METADATA_INFO is properly initialized. + CHardwareSimulation::EmitMetadata( pStreamHeader ); + + if (0 != (pStreamHeader->OptionsFlags & KSSTREAM_HEADER_OPTIONSF_METADATA)) + { + CExtendedVidProcSetting FaceDetect; + m_Sensor->GetFaceDetection(&FaceDetect); + + if( FaceDetect.Flags & KSCAMERA_EXTENDEDPROP_FACEDETECTION_VIDEO ) + { + DBG_TRACE("VIDEO"); + EmitFaceMetadata( + pStreamHeader, + FaceDetect.GetULONG(), + FaceDetect.Flags & KSCAMERA_EXTENDEDPROP_FACEDETECTION_ADVANCED_MASK); + } + } +} + -- cgit v1.3.1