예제 #1
0
        public void Dispose()
        {
            GC.SuppressFinalize(this);

            if (AvioContext != null)
            {
                AvioContext.Dispose();
                AvioContext = null;
            }
        }
예제 #2
0
        public FfmpegStream(Stream stream)
        {
            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 ? new FfmpegCalls.AvioWriteData(WriteDataCallback) : null);
        }
예제 #3
0
        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");
        }