Esempio n. 1
0
        public void Dispose()
        {
            GC.SuppressFinalize(this);

            if (AvioContext != null)
            {
                AvioContext.Dispose();
                AvioContext = null;
            }
        }
Esempio n. 2
0
        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);
        }
Esempio n. 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");
        }