示例#1
0
文件: Adapter.cs 项目: dxball/v4l-net
        /// <summary>
        /// Queries the device for information about each requested buffer.
        /// </summary>
        /// <param name="req">Struct with information about the request buffers.</param>
        private void fetchBuffers(v4l2_requestbuffers req) {
            for(uint i=0; i < req.count; i++) {
                v4l2_buffer buffer = new v4l2_buffer();
                buffer.index = i;
                buffer.type = req.type;
                buffer.memory = req.memory;
                if(ioControl.QueryBuffer(ref buffer) < 0)
                    throw new Exception("VIDIOC_QUERYBUF");

                buffers.Add(new Analog.Buffer(this, buffer));
            }
        }
示例#2
0
文件: Adapter.cs 项目: dxball/v4l-net
        /// <summary>
        /// Requests a given number of buffers for mmap data transfer.
        /// </summary>
        private void requestBuffers() {
            v4l2_requestbuffers req = new v4l2_requestbuffers();
            req.count = bufferCount;
            req.type = v4l2_buf_type.VideoCapture;
            req.memory = v4l2_memory.MemoryMapping;
            if(ioControl.RequestBuffers(ref req) < 0)
                throw new Exception("VIDIOC_REQBUFS");

            if(req.count < bufferCount)
                throw new Exception("VIDIOC_REQBUFS [count]");

            fetchBuffers(req);
        }
示例#3
0
			ioctl(int device, v4l2_operation request, ref v4l2_requestbuffers argp);
示例#4
0
		/// <summary>
		/// Calls VIDIOC_REQBUFS.
		/// </summary>
		public int RequestBuffers(ref v4l2_requestbuffers req)
		{
			return ioctl(deviceHandle, v4l2_operation.RequestBuffers, ref req);
		}
示例#5
0
 private static extern int ioctl(int device, v4l2_operation request, ref v4l2_requestbuffers argp);