Esempio n. 1
0
        private void vidioc_s_ext_ctrls_(UInt32 id, Int64 value, bool int64)
        {
            Console.WriteLine("vidioc_s_ext_ctrls_");

            NativeMethods.v4l2_ext_controls ext_ctrls = new NativeMethods.v4l2_ext_controls();
            NativeMethods.v4l2_ext_control  ext_ctrl  = new NativeMethods.v4l2_ext_control();

            ext_ctrl.id           = (uint)id;
            ext_ctrl.size         = 0;
            ext_ctrl.reserved2[0] = 0;
            if (int64)
            {
                ext_ctrl.value64 = value;
            }
            else
            {
                ext_ctrl.value = (int)value;
            }
            void *p_ext_ctrl = &ext_ctrl;

            ext_ctrls.ctrl_class  = (uint)V4L2_CTRL_CLASS_USER;
            ext_ctrls.count       = 1;
            ext_ctrls.error_idx   = 0;
            ext_ctrls.reserved[0] = 0;
            ext_ctrls.reserved[1] = 0;
            ext_ctrls.controls    = (IntPtr)p_ext_ctrl;

            //int v4l2_r = NativeMethods.v4l2_ioctl(_fd, CMD64_VIDIOC_S_EXT_CTRLS, ref ext_ctrls);
            int v4l2_r = NativeMethods.ioctl(_fd, CMD64_VIDIOC_S_EXT_CTRLS, ref ext_ctrls);

            Console.WriteLine("v4l2_ioctl CMD64_VIDIOC_S_EXT_CTRLS ret = {0} id = {1} value64 = {2}", v4l2_r, id, value);
        }
Esempio n. 2
0
        private void vidioc_s_ext_ctrls_(UInt32 id, Int64 value, bool int64)
        {
            Console.WriteLine("vidioc_s_ext_ctrls_");

            NativeMethods.v4l2_ext_controls ext_ctrls = new NativeMethods.v4l2_ext_controls();
            NativeMethods.v4l2_ext_control ext_ctrl = new NativeMethods.v4l2_ext_control();

            ext_ctrl.id = (uint) id;
            ext_ctrl.size = 0;
            ext_ctrl.reserved2[0] = 0;
            if (int64)
            {
                ext_ctrl.value64 = value;
            }
            else
            {
                ext_ctrl.value = (int) value;
            }
            void* p_ext_ctrl = & ext_ctrl;

            ext_ctrls.ctrl_class = (uint) V4L2_CTRL_CLASS_USER;
            ext_ctrls.count = 1;
            ext_ctrls.error_idx = 0;
            ext_ctrls.reserved[0] = 0;
            ext_ctrls.reserved[1] = 0;
            ext_ctrls.controls = (IntPtr) p_ext_ctrl;

            //int v4l2_r = NativeMethods.v4l2_ioctl(_fd, CMD64_VIDIOC_S_EXT_CTRLS, ref ext_ctrls);
            int v4l2_r = NativeMethods.ioctl(_fd, CMD64_VIDIOC_S_EXT_CTRLS, ref ext_ctrls);
            Console.WriteLine("v4l2_ioctl CMD64_VIDIOC_S_EXT_CTRLS ret = {0} id = {1} value64 = {2}", v4l2_r, id, value);
        }