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

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