Beispiel #1
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];
Beispiel #2
0
        public DecodedBuffer(int bufferIndex, VideoDevice device)
            : base(bufferIndex)
        {
            // Create small unmanaged buffer for our 2 planes
            planes = new PlanesArray(2);

            buffer.index    = bufferIndex;
            buffer.type     = eBufferType.VideoCaptureMPlane;
            buffer.field    = eField.Progressive;
            buffer.memory   = eMemory.MemoryMap;
            buffer.length   = 2;
            buffer.m.planes = planes;

            device.file.call(eControlCode.QUERYBUF, ref buffer);
            // Logger.logVerbose( "Decoded buffer: {0}", buffer );

            buffer.flags |= eBufferFlags.NoCacheInvalidate;
        }