/// <summary> /// Collects all available image formats from the device. /// </summary> private void fetchFormats() { formats = new List <Analog.Video.Format>(); v4l2_fmtdesc cur = new v4l2_fmtdesc(); cur.index = 0; while (ioControl.EnumerateFormats(ref cur) == 0) { formats.Add(new Analog.Video.Format(cur)); cur.index++; } }
/// <summary> /// Get all the pixel formats supported by the device. /// </summary> /// <returns>Supported pixel formats.</returns> public override IEnumerable <PixelFormat> GetSupportedPixelFormats() { Initialize(); v4l2_fmtdesc fmtdesc = new v4l2_fmtdesc { index = 0, type = v4l2_buf_type.V4L2_BUF_TYPE_VIDEO_CAPTURE }; List <PixelFormat> result = new List <PixelFormat>(); while (V4l2Struct(VideoSettings.VIDIOC_ENUM_FMT, ref fmtdesc) != -1) { result.Add(fmtdesc.pixelformat); fmtdesc.index++; } return(result); }
internal Format(v4l2_fmtdesc fmtdesc) { this.fmtdesc = fmtdesc; }
ioctl(int device, v4l2_operation request, ref v4l2_fmtdesc argp);
/// <summary> /// Calls VIDIOC_ENUM_FMT. /// </summary> public int EnumerateFormats(ref v4l2_fmtdesc fmt) { return(ioctl(deviceHandle, v4l2_operation.EnumerateFormats, ref fmt)); }