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); }
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);