X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Favformat.h;h=a2fe7c6bb2cafe8f9c16ab541d3d70079f26ba2a;hb=c4cee261296c917c605ead5edbfb452f2aa86d92;hp=322210fae045064cd89f74567a87256fd3d16f59;hpb=936a4c04b9fda79d824ab6c95591425b37e4086f;p=ffmpeg diff --git a/libavformat/avformat.h b/libavformat/avformat.h index 322210fae04..a2fe7c6bb2c 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -845,6 +845,7 @@ typedef struct AVStreamInternal AVStreamInternal; #define AV_DISPOSITION_CAPTIONS 0x10000 #define AV_DISPOSITION_DESCRIPTIONS 0x20000 #define AV_DISPOSITION_METADATA 0x40000 +#define AV_DISPOSITION_DEPENDENT 0x80000 ///< dependent audio stream (mix_type=0 in mpegts) /** * Options for behavior on timestamp wrap detection. @@ -986,12 +987,17 @@ typedef struct AVStream { */ AVRational r_frame_rate; +#if FF_API_LAVF_FFSERVER /** * String containing pairs of key and values describing recommended encoder configuration. * Pairs are separated by ','. * Keys are separated from values by '='. + * + * @deprecated unused */ + attribute_deprecated char *recommended_encoder_configuration; +#endif /** * Codec parameters associated with this stream. Allocated and freed by @@ -1014,10 +1020,10 @@ typedef struct AVStream { ***************************************************************** */ +#define MAX_STD_TIMEBASES (30*12+30+3+6) /** * Stream information used internally by avformat_find_stream_info() */ -#define MAX_STD_TIMEBASES (30*12+30+3+6) struct { int64_t last_dts; int64_t duration_gcd; @@ -1217,11 +1223,13 @@ attribute_deprecated AVRational av_stream_get_r_frame_rate(const AVStream *s); attribute_deprecated void av_stream_set_r_frame_rate(AVStream *s, AVRational r); +#if FF_API_LAVF_FFSERVER attribute_deprecated char* av_stream_get_recommended_encoder_configuration(const AVStream *s); attribute_deprecated void av_stream_set_recommended_encoder_configuration(AVStream *s, char *configuration); #endif +#endif struct AVCodecParserContext *av_stream_get_parser(const AVStream *s); @@ -1268,6 +1276,11 @@ typedef struct AVProgram { #define AVFMTCTX_NOHEADER 0x0001 /**< signal that no header is present (streams are added dynamically) */ +#define AVFMTCTX_UNSEEKABLE 0x0002 /**< signal that the stream is definitely + not seekable, and attempts to call the + seek function will fail. For some + network protocols (e.g. HLS), this can + change dynamically at runtime. */ typedef struct AVChapter { int id; ///< unique ID to identify the chapter @@ -1382,13 +1395,33 @@ typedef struct AVFormatContext { */ AVStream **streams; +#if FF_API_FORMAT_FILENAME /** * input or output filename * * - demuxing: set by avformat_open_input() * - muxing: may be set by the caller before avformat_write_header() + * + * @deprecated Use url instead. */ + attribute_deprecated char filename[1024]; +#endif + + /** + * input or output URL. Unlike the old filename field, this field has no + * length restriction. + * + * - demuxing: set by avformat_open_input(), initialized to an empty + * string if url parameter was NULL in avformat_open_input(). + * - muxing: may be set by the caller before calling avformat_write_header() + * (or avformat_init_output() if that is called first) to a string + * which is freeable by av_free(). Set to an empty string if it + * was NULL in avformat_init_output(). + * + * Freed by libavformat in avformat_free_context(). + */ + char *url; /** * Position of the first frame of the component, in @@ -1449,7 +1482,7 @@ typedef struct AVFormatContext { #endif #define AVFMT_FLAG_FAST_SEEK 0x80000 ///< Enable fast, but inaccurate seeks for some formats #define AVFMT_FLAG_SHORTEST 0x100000 ///< Stop muxing when the shortest stream stops. -#define AVFMT_FLAG_AUTO_BSF 0x200000 ///< Wait for packet data before writing a header, and add bitstream filters as requested by the muxer +#define AVFMT_FLAG_AUTO_BSF 0x200000 ///< Add bitstream filters as requested by the muxer /** * Maximum size of the data read from input for determining @@ -1852,7 +1885,7 @@ typedef struct AVFormatContext { */ char *protocol_whitelist; - /* + /** * A callback for opening new IO streams. * * Whenever a muxer or a demuxer needs to open an IO stream (typically from @@ -1979,6 +2012,7 @@ const char *avformat_configuration(void); */ const char *avformat_license(void); +#if FF_API_NEXT /** * Initialize libavformat and register all the muxers, demuxers and * protocols. If you do not call this function, then you can select @@ -1987,31 +2021,44 @@ const char *avformat_license(void); * @see av_register_input_format() * @see av_register_output_format() */ +attribute_deprecated void av_register_all(void); +attribute_deprecated void av_register_input_format(AVInputFormat *format); +attribute_deprecated void av_register_output_format(AVOutputFormat *format); +#endif /** - * Do global initialization of network components. This is optional, - * but recommended, since it avoids the overhead of implicitly - * doing the setup for each session. + * Do global initialization of network libraries. This is optional, + * and not recommended anymore. * - * Calling this function will become mandatory if using network - * protocols at some major version bump. + * This functions only exists to work around thread-safety issues + * with older GnuTLS or OpenSSL libraries. If libavformat is linked + * to newer versions of those libraries, or if you do not use them, + * calling this function is unnecessary. Otherwise, you need to call + * this function before any other threads using them are started. + * + * This function will be deprecated once support for older GnuTLS and + * OpenSSL libraries is removed, and this function has no purpose + * anymore. */ int avformat_network_init(void); /** - * Undo the initialization done by avformat_network_init. + * Undo the initialization done by avformat_network_init. Call it only + * once for each time you called avformat_network_init. */ int avformat_network_deinit(void); +#if FF_API_NEXT /** * If f is NULL, returns the first registered input format, * if f is non-NULL, returns the next registered input format after f * or NULL if f is the last one. */ +attribute_deprecated AVInputFormat *av_iformat_next(const AVInputFormat *f); /** @@ -2019,7 +2066,31 @@ AVInputFormat *av_iformat_next(const AVInputFormat *f); * if f is non-NULL, returns the next registered output format after f * or NULL if f is the last one. */ +attribute_deprecated AVOutputFormat *av_oformat_next(const AVOutputFormat *f); +#endif + +/** + * Iterate over all registered muxers. + * + * @param opaque a pointer where libavformat will store the iteration state. Must + * point to NULL to start the iteration. + * + * @return the next registered muxer or NULL when the iteration is + * finished + */ +const AVOutputFormat *av_muxer_iterate(void **opaque); + +/** + * Iterate over all registered demuxers. + * + * @param opaque a pointer where libavformat will store the iteration state. Must + * point to NULL to start the iteration. + * + * @return the next registered demuxer or NULL when the iteration is + * finished + */ +const AVInputFormat *av_demuxer_iterate(void **opaque); /** * Allocate an AVFormatContext.