Пример #1
0
        public unsafe AvioContext(
            FfmpegCalls.AvioReadData readDataCallback,
            FfmpegCalls.AvioSeek seekCallback,
            FfmpegCalls.AvioWriteData writeDataCallback)
        {
            _readDataCallback  = readDataCallback;
            _seekCallback      = seekCallback;
            _writeDataCallback = writeDataCallback;

            //make sure that the buffer won't be disposed
            //the buffer may change. we always have to free _context->buffer
            _buffer = new AvioBuffer {
                SuppressAvFree = true
            };
            _context = FfmpegCalls.AvioAllocContext(_buffer, _writeDataCallback != null, IntPtr.Zero,
                                                    _readDataCallback, _writeDataCallback, _seekCallback);
        }
Пример #2
0
 internal static extern AVIOContext *avio_alloc_context(byte * @buffer, int @buffer_size, int @write_flag, void * @opaque,
                                                        [MarshalAs(UnmanagedType.FunctionPtr)] FfmpegCalls.AvioReadData @read_packet,
                                                        [MarshalAs(UnmanagedType.FunctionPtr)] FfmpegCalls.AvioWriteData @write_packet,
                                                        [MarshalAs(UnmanagedType.FunctionPtr)] FfmpegCalls.AvioSeek @seek);
Пример #3
0
 public AvioContext(
     FfmpegCalls.AvioReadData readDataCallback,
     FfmpegCalls.AvioSeek seekCallback)
     : this(readDataCallback, seekCallback, null)
 {
 }