Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

WinRT sample applications for using the Windows Media Capture APIs

This folder contains a sample application that demonstrates the Windows Media Capture API GetDeviceProperty/SetDeviceProperty with KSPROPERTYSETID_ExtendedCameraControl in Windows 10.
While most camera controls are wrapped in their own APIs and accessed using the [VideoDeviceController](https://docs.microsoft.com/en-us/uwp/api/windows.media.devices.videodevicecontroller?view=winrt-20348), you can also send and receive payloads directly to and from the driver. These raw buffers can then be serialized or deserialized according to a known format. This can be useful for example 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.

About the sample

The sample demonstrates the following:
	1. Class definition for correctly accessing/storing a KS Property Structure in WinRT
	2. Differences in using KS Properties with different payload sizes (in this case, KSCAMERA_EXTENDEDPROP_VIDEOPROCSETTING vs KSCAMERA_EXTENDEDPROP_VALUE)
	3. How to enumerate a camera using SensorGroup

Requirements

This sample is built using Visual Studio 2019 and requires [Windows SDK version 19041](https://developer.microsoft.com/en-US/windows/downloads/windows-10-sdk).

Using the samples

The easiest way to use these samples without using Git is to download the zip file containing the current version (using the following link or by clicking the "Download ZIP" button on the repo page). You can then unzip the entire archive and use the samples in Visual Studio 2017.

Download the samples ZIP

Notes:

  • Before you unzip the archive, right-click it, select Properties, and then select Unblock.
  • Be sure to unzip the entire archive, and not just individual samples. The samples all depend on the SharedContent folder in the archive.
  • In Visual Studio 2017, the platform target defaults to ARM, so be sure to change that to x64 or x86 if you want to test on a non-ARM device.

Reminder: If you unzip individual samples, they will not build due to references to other portions of the ZIP file that were not unzipped. You must unzip the entire archive if you intend to build the samples.

For more info about the programming models, platforms, languages, and APIs demonstrated in these samples, please refer to the guidance, tutorials, and reference topics provided in the Windows 10 documentation available in the Windows Developer Center. These samples are provided as-is in order to indicate or demonstrate the functionality of the programming models and feature APIs for Windows.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.