Example #1
0
        protected override void dequeue(FileHandle videoDevice)
        {
            int idx = buffer.index;

            videoDevice.call(eControlCode.DQBUF, ref buffer);
            if (buffer.index != idx)
            {
                throw new ApplicationException($"DecodedBuffer.dequeue: expecting buffer #{ idx }, got #{ buffer.index }");
            }
            // Logger.logVerbose( "DecodedBuffer.dequeue: {0}", buffer );
            // Logger.logVerbose( "DecodedBuffer.dequeue: {0}", buffer.index );
        }
Example #2
0
        public EncodedBuffer(FileHandle videoDevice, int bufferIndex) : base(bufferIndex)
        {
            // https://www.kernel.org/doc/html/v4.19/media/uapi/v4l/mmap.html#example-mapping-buffers-in-the-single-planar-api
            buffer          = default;
            buffer.type     = eBufferType.VideoOutputMPlane;
            buffer.memory   = eMemory.MemoryMap;
            buffer.index    = bufferIndex;
            buffer.length   = 1;
            planes          = new PlanesArray(1);
            buffer.m.planes = planes;
            videoDevice.call(eControlCode.QUERYBUF, ref buffer);
            // Logger.logVerbose( "eControlCode.QUERYBUF completed.\n\tbuffer: {0}\n\tplane: {1}", buffer, plane );

            ref sPlane plane = ref planes.span[0];
Example #3
0
 public override string queryStatus(FileHandle videoDevice)
 {
     videoDevice.call(eControlCode.QUERYBUF, ref buffer);
     return(buffer.ToString());
 }
Example #4
0
 protected override void enqueue(FileHandle videoDevice)
 {
     videoDevice.call(eControlCode.QBUF, ref buffer);
 }