lavf: allow custom IO for all files

Multimedia / Libav - Anton Khirnov [khirnov.net] - 24 January 2016 09:45 UTC

Some (de)muxers open additional files beyond the main IO context. Currently, they call avio_open() directly, which prevents the caller from using custom IO for such streams.

This commit adds callbacks to AVFormatContext that default to avio_open2()/avio_close(), but can be overridden by the caller. All muxers and demuxers using AVIO are switched to using those callbacks instead of calling avio_open()/avio_close() directly.

(de)muxers that use the URLProtocol layer directly instead of AVIO remain unconverted for now. This should be fixed in later commits.

9f61abc lavf: allow custom IO for all files
doc/APIchanges | 4 ++++
libavformat/avformat.h | 33 +++++++++++++++++++++++++++++++++
libavformat/dashenc.c | 7 +++++--
libavformat/hdsenc.c | 25 ++++++++++---------------
libavformat/hls.c | 6 ++++--
libavformat/hlsenc.c | 15 ++++++++-------
libavformat/img2dec.c | 5 ++---
libavformat/img2enc.c | 9 ++++-----
libavformat/internal.h | 6 ++++++
libavformat/mov.c | 10 +++++-----
libavformat/movenc.c | 4 ++--
libavformat/options.c | 14 ++++++++++++++
libavformat/segment.c | 35 +++++++++++++++++------------------
libavformat/smoothstreamingenc.c | 18 +++++++++---------
libavformat/utils.c | 7 +++++++
15 files changed, 130 insertions(+), 68 deletions(-)

Upstream: git.libav.org


  • Share