private MediaCaptureConfiguration.PropertyValue <bool> GetValueBool(VideoProperty prop, bool supported) { int flags = 0; int value = 0; MediaCaptureConfiguration.PropertyValue <bool> propValue = new MediaCaptureConfiguration.PropertyValue <bool>(); if (supported && this.camera.GetProperty(prop, ref value, ref flags)) { propValue.Value = (value == 1) ? true : false; propValue.Auto = (flags == (int)VideoPropertyFlags.Auto) ? true : false; } return(propValue); }
private MediaCaptureConfiguration.PropertyValue <int> GetValueInt(ManagedCameraControlProperty prop, bool supported) { int flags = 0; int value = 0; MediaCaptureConfiguration.PropertyValue <int> propValue = new MediaCaptureConfiguration.PropertyValue <int>(); if (supported && this.camera.GetProperty(prop, ref value, ref flags)) { propValue.Value = value; propValue.Auto = (flags == (int)VideoPropertyFlags.Auto) ? true : false; } return(propValue); }
private void SetDeviceProperty(VideoProperty prop, MediaCaptureInfo.PropertyInfo propInfo, MediaCaptureConfiguration.PropertyValue <bool> value) { if (propInfo.Supported) { VideoPropertyFlags flag = (propInfo.AutoControlled && value.Auto) ? VideoPropertyFlags.Auto : VideoPropertyFlags.Manual; this.camera.SetProperty(prop, value.Value ? 1 : 0, flag); } }
private void SetDeviceProperty(ManagedCameraControlProperty prop, MediaCaptureInfo.PropertyInfo propInfo, MediaCaptureConfiguration.PropertyValue <int> value) { if (propInfo.Supported) { ManagedCameraControlPropertyFlags flag = (propInfo.AutoControlled && value.Auto) ? ManagedCameraControlPropertyFlags.Auto : ManagedCameraControlPropertyFlags.Manual; this.camera.SetProperty(prop, value.Value, flag); } }