Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
 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);
     }
 }
Ejemplo n.º 4
0
 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);
     }
 }