public void Dispose() { GC.SuppressFinalize(this); if (AvioContext != null) { AvioContext.Dispose(); AvioContext = null; } }
public FfmpegStream(Stream stream, bool allowWrite) { if (stream == null) { throw new ArgumentNullException("stream"); } if (!stream.CanRead) { throw new ArgumentException("Stream is not readable.", "stream"); } _stream = stream; AvioContext = new AvioContext(ReadDataCallback, stream.CanSeek ? new FfmpegCalls.AvioSeek(SeekCallback) : null, stream.CanWrite && allowWrite ? new FfmpegCalls.AvioWriteData(WriteDataCallback) : null); }
internal static unsafe void AvformatOpenInput(AVFormatContext **formatContext, AvioContext avioContext) { (*formatContext)->pb = (AVIOContext *)avioContext.ContextPtr; int result = ffmpeg.avformat_open_input(formatContext, "DUMMY-FILENAME", null, null); FfmpegException.Try(result, "avformat_open_input"); }