Пример #1
0
        /// <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++;
            }
        }
Пример #2
0
        /// <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);
        }
Пример #3
0
 internal Format(v4l2_fmtdesc fmtdesc)
 {
     this.fmtdesc = fmtdesc;
 }
Пример #4
0
 ioctl(int device, v4l2_operation request, ref v4l2_fmtdesc argp);
Пример #5
0
 /// <summary>
 /// Calls VIDIOC_ENUM_FMT.
 /// </summary>
 public int EnumerateFormats(ref v4l2_fmtdesc fmt)
 {
     return(ioctl(deviceHandle, v4l2_operation.EnumerateFormats, ref fmt));
 }