Potpourri of methods managing MediaCapture
To enable the helper methods below add this NuGet package to your C# project and using MediaCaptureExtensions;
to .cs files.
var settings = new MediaCaptureInitializationSettings();
await settings.SelectVideoDeviceAsync(VideoDeviceSelection.BackOrFirst);
var capture = new MediaCapture();
await capture.InitializeAsync(settings);
var capture = new MediaCapture();
await capture.InitializeAsync();
await capture.SetPreviewRotationAsync(VideoRotation.Clockwise90Degrees);
This extension requires "unsafe" code to be enabled.
var buffer = new Buffer(100);
byte* data = buffer.GetData();
for (int i = 0; i < buffer.Capacity; i++)
{
data[i] = 42;
}
buffer.Length = buffer.Capacity;