Esempio n. 1
0
			ioctl(int device, v4l2_operation request, ref v4l2_queryctrl argp);
Esempio n. 2
0
        public DeviceControl QueryControl(Control ctrl) {
            v4l2_queryctrl query = new v4l2_queryctrl();
            query.id = (uint)ctrl;
            int ret = ioControl.QueryControl(ref query);
            if(ret < 0) { throw new Exception("VIDIOC_QUERYCTRL: " + ret.ToString()); }

            DeviceControl control = new DeviceControl() {
                Id = ctrl,
                Name = query.name,
                Min = query.minimum,
                Max = query.maximum,
                Step = query.step,
                Default = query.default_value,
                Type = query.type,
                Flags = query.flags,
            };
            control.Value = GetControlValue(ctrl);
            if(control.Type == v4l2_ctrl_type.Menu || control.Type == v4l2_ctrl_type.IntegerMenu) {
                v4l2_querymenu qmenu = new v4l2_querymenu();
                qmenu.id = (uint)ctrl;
                control.MenuItems = new List<Tuple<int, string>>();
                for(int i = control.Min; i <= control.Max; i++) {
                    qmenu.index = (uint)i;
                    //Console.WriteLine("qmenu.index={0}", qmenu.index);
                    if(ioControl.QueryMenu(ref qmenu) != 0) { continue; }
                    //Console.WriteLine("MenuItem: {0}", qmenu.name);
                    control.MenuItems.Add(new Tuple<int, string>(i, qmenu.name));
                }
            }
            return control;
        }
Esempio n. 3
0
		/// <summary>
		/// Calls VIDIOC_QUERYCTRL
		/// </summary>
		public int QueryControl(ref v4l2_queryctrl control) 
		{
			return ioctl(deviceHandle, v4l2_operation.QueryControl, ref control);
		}