X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Favformat.h;h=34bad436cd4f56639d4cd98674e1eaca2727f428;hb=58f21b6c9354bbc8414d9ff87645a7292cbe0d92;hp=285bb16a2c1d5e0be92b8af249c888b7d85114d7;hpb=9938697c1c119a675759029ead74b91c529cdf2e;p=ffmpeg diff --git a/libavformat/avformat.h b/libavformat/avformat.h index 285bb16a2c1..34bad436cd4 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -1780,7 +1780,6 @@ typedef struct AVFormatContext { /** * User data. * This is a place for some private data of the user. - * Mostly usable with control_message_cb or any future callbacks in device's context. */ void *opaque; @@ -1811,6 +1810,7 @@ typedef struct AVFormatContext { */ enum AVCodecID data_codec_id; +#if FF_API_OLD_OPEN_CALLBACKS /** * Called to open further IO contexts when needed for demuxing. * @@ -1825,8 +1825,47 @@ typedef struct AVFormatContext { * @See av_format_set_open_cb() * * Demuxing: Set by user. + * + * @deprecated Use io_open and io_close. */ + attribute_deprecated int (*open_cb)(struct AVFormatContext *s, AVIOContext **p, const char *url, int flags, const AVIOInterruptCB *int_cb, AVDictionary **options); +#endif + + /** + * ',' separated list of allowed protocols. + * - encoding: unused + * - decoding: set by user through AVOptions (NO direct access) + */ + char *protocol_whitelist; + + /* + * A callback for opening new IO streams. + * + * Certain muxers or demuxers (e.g. for various playlist-based formats) need + * to open additional files during muxing or demuxing. This callback allows + * the caller to provide custom IO in such cases. + * + * @param s the format context + * @param pb on success, the newly opened IO context should be returned here + * @param url the url to open + * @param flags a combination of AVIO_FLAG_* + * @param options a dictionary of additional options, with the same + * semantics as in avio_open2() + * @return 0 on success, a negative AVERROR code on failure + * + * @note Certain muxers and demuxers do nesting, i.e. they open one or more + * additional internal format contexts. Thus the AVFormatContext pointer + * passed to this callback may be different from the one facing the caller. + * It will, however, have the same 'opaque' field. + */ + int (*io_open)(struct AVFormatContext *s, AVIOContext **pb, const char *url, + int flags, AVDictionary **options); + + /** + * A callback for closing the streams opened with AVFormatContext.io_open(). + */ + void (*io_close)(struct AVFormatContext *s, AVIOContext *pb); } AVFormatContext; int av_format_get_probe_score(const AVFormatContext *s); @@ -1844,8 +1883,10 @@ void * av_format_get_opaque(const AVFormatContext *s); void av_format_set_opaque(AVFormatContext *s, void *opaque); av_format_control_message av_format_get_control_message_cb(const AVFormatContext *s); void av_format_set_control_message_cb(AVFormatContext *s, av_format_control_message callback); -AVOpenCallback av_format_get_open_cb(const AVFormatContext *s); -void av_format_set_open_cb(AVFormatContext *s, AVOpenCallback callback); +#if FF_API_OLD_OPEN_CALLBACKS +attribute_deprecated AVOpenCallback av_format_get_open_cb(const AVFormatContext *s); +attribute_deprecated void av_format_set_open_cb(AVFormatContext *s, AVOpenCallback callback); +#endif /** * This function will cause global side data to be injected in the next packet