Skip to content

Latest commit

 

History

History
 
 

ExtendedControlAndMetadata

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Sample UWP applications for using the Windows Media Capture APIs to interact with camera device controls and extract frame metadata from WinRT

This folder contains projects for sample applications that demonstrates the Windows Media Capture APIs:

Akin to how developers can interact with extended controls and metadata (see this documentation), these WinRT APIs are used to interact with a camera device via KSPROPERTY, and in some case specifically with the ones related to KSPROPERTYSETID_ExtendedCameraControl, in Windows 10. While most camera controls are wrapped in their own APIs and accessed using the VideoDeviceController, you can also send and receive payloads directly to and from the driver as raw byte buffers. While this has been done traditionaly in lower level code such as when writing drivers, this interaction is also possible from WinRT as shown in these samples. These raw buffers can then be serialized or deserialized according to a known format and projected for the application to use. This can be especialy useful if a driver exposes a custom control that requires a payload format known to the application or if an existing KSPROPERTY does not have its own wrapper API in WinRT.

Available samples

  • EyeGazeAndBackgroundSegmentation: sample containing a C# app and a C++/WinRT component showing how to
    • use GetDevicePropertyByExtendedId() and SetDevicePropertyByExtendedId() to set new extended camera controls that don't have dedicated APIs:

      • KSPROPERTY_CAMERACONTROL_EXTENDED_EYEGAZECORRECTION
      • KSPROPERTY_CAMERACONTROL_EXTENDED_BACKGROUNDSEGMENTATION
    • access and extract frame capture metadata (in this case KSCAMERA_METADATA_BACKGROUNDSEGMENTATIONMASK) using MediaFrameReference::Properties()

  • MediaCaptureSampleExtendedControl: C++/CLI sample for using GetDeviceProperty() and SetDeviceProperty() to set common extended camera controls