Пример #1
0
        /// <summary>
        /// Query controls value from the video device.
        /// </summary>
        /// <param name="type">The type of a video device's control.</param>
        /// <returns>The default and current values of a video device's control.</returns>
        public override VideoDeviceValue GetVideoDeviceValue(VideoDeviceValueType type)
        {
            Initialize();

            // Get default value
            v4l2_queryctrl query = new v4l2_queryctrl
            {
                id = type
            };

            V4l2Struct(VideoSettings.VIDIOC_QUERYCTRL, ref query);

            // Get current value
            v4l2_control ctrl = new v4l2_control
            {
                id = type,
            };

            V4l2Struct(VideoSettings.VIDIOC_G_CTRL, ref ctrl);

            return(new VideoDeviceValue
            {
                Name = type.ToString(),
                Minimum = query.minimum,
                Maximum = query.maximum,
                Step = query.step,
                DefaultValue = query.default_value,
                CurrentValue = ctrl.value
            });
        }
Пример #2
0
        /// <summary>
        /// Query controls value from the video device.
        /// </summary>
        /// <param name="type">The type of a video device's control.</param>
        /// <returns>The default and current values of a video device's control.</returns>
        public override VideoDeviceValue GetVideoDeviceValue(VideoDeviceValueType type)
        {
            Initialize();

            // Get default value
            InteropVideodev2.v4l2_queryctrl query = new InteropVideodev2.v4l2_queryctrl
            {
                id = type
            };
            V4l2Struct(InteropVideodev2.V4l2Request.VIDIOC_QUERYCTRL, ref query);

            // Get current value
            InteropVideodev2.v4l2_control ctrl = new InteropVideodev2.v4l2_control
            {
                id = type,
            };
            V4l2Struct(InteropVideodev2.V4l2Request.VIDIOC_G_CTRL, ref ctrl);

            return(new VideoDeviceValue(
                       type.ToString(),
                       query.minimum,
                       query.maximum,
                       query.step,
                       query.default_value,
                       ctrl.value));
        }
Пример #3
0
 /// <summary>
 /// Query controls value from the video device.
 /// </summary>
 /// <param name="type">The type of a video device's control.</param>
 /// <returns>The default and current values of a video device's control.</returns>
 public abstract VideoDeviceValue GetVideoDeviceValue(VideoDeviceValueType type);