Example #1
0
        private async Task SetResolution()
        {
            // Query all properties of the device
            var allVideoProperties = this.camera.VideoDeviceController.GetAvailableMediaStreamProperties(MediaStreamType.VideoPreview).Select(x => new StreamResolution(x));

            //16:9
            var matchingFormats = allVideoProperties.Where(x => x.AspectRatio > 1.34 && x.Height * x.Width < 1000000).OrderByDescending(x => x.Height * x.Width);

            var prop = matchingFormats.FirstOrDefault();

            if (prop != null)
            {
                this.resolution = prop;
            }
            else
            {
                this.resolution = allVideoProperties.FirstOrDefault();
            }

            await this.camera.VideoDeviceController.SetMediaStreamPropertiesAsync(MediaStreamType.VideoPreview, this.resolution.EncodingProperties);
        }
Example #2
0
 public CaptureInitializeEventArgs(StreamResolution resolution)
 {
     this._resolution = resolution;
 }