Exemple #1
0
        internal bool queryBufferCaps(eBufferType bufferType, eMemory type)
        {
            // If you want to query the capabilities with a minimum of side-effects, then this can be called with count set to 0, memory set to V4L2_MEMORY_MMAP and type set to the buffer type.
            // This will free any previously allocated buffers, so this is typically something that will be done at the start of the application.
            sRequestBuffers requestBuffers = new sRequestBuffers();

            requestBuffers.memory = type;
            requestBuffers.type   = eBufferType.VideoOutputMPlane;
            return(file.tryCall(eControlCode.REQBUFS, ref requestBuffers));
        }
Exemple #2
0
        public int allocateDecodedFrames(int frames)
        {
            sRequestBuffers rbDecoded = new sRequestBuffers()
            {
                count  = frames,
                type   = eBufferType.VideoCaptureMPlane,
                memory = eMemory.MemoryMap
            };

            file.call(eControlCode.REQBUFS, ref rbDecoded);
            return(rbDecoded.count);
        }
Exemple #3
0
        public int allocateEncodedBuffers(int encodedBuffers)
        {
            sRequestBuffers rbEncoded = new sRequestBuffers()
            {
                count  = encodedBuffers,
                type   = eBufferType.VideoOutputMPlane,
                memory = eMemory.MemoryMap
            };

            file.call(eControlCode.REQBUFS, ref rbEncoded);
            // Logger.logVerbose( "Requesting {0} encoded buffers, the driver said {1}", encodedBuffers, rbEncoded.count );
            return(rbEncoded.count);
        }
Exemple #4
0
        /// <summary>Set buffer count = 0, for both queues</summary>
        public void freeAllBuffers()
        {
            sRequestBuffers rbEncoded = new sRequestBuffers()
            {
                type   = eBufferType.VideoOutputMPlane,
                memory = eMemory.MemoryMap
            };

            file.tryCall(eControlCode.REQBUFS, ref rbEncoded);

            sRequestBuffers rbDecoded = new sRequestBuffers()
            {
                type   = eBufferType.VideoCaptureMPlane,
                memory = eMemory.MemoryMap
            };

            file.tryCall(eControlCode.REQBUFS, ref rbDecoded);
        }