diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-01-28 07:23:26 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-01-28 10:53:34 +0400 |
commit | e37f161e66e042d6c2c7470c4d9881df9427fc4a (patch) | |
tree | 6400fd6453f0525a65724937532d5baa33deead3 /libavformat | |
parent | f21b6159cf3110a5f018d6addf7382840d427199 (diff) | |
parent | e771e6dd63e837220aa5d959486546d2be972e83 (diff) |
Merge remote-tracking branch 'qatar/master'
* qatar/master: (71 commits)
movenc: Allow writing to a non-seekable output if using empty moov
movenc: Support adding isml (smooth streaming live) metadata
libavcodec: Don't crash in avcodec_encode_audio if time_base isn't set
sunrast: Document the different Sun Raster file format types.
sunrast: Add a check for experimental type.
libspeexenc: use AVSampleFormat instead of deprecated/removed SampleFormat
lavf: remove disabled FF_API_SET_PTS_INFO cruft
lavf: remove disabled FF_API_OLD_INTERRUPT_CB cruft
lavf: remove disabled FF_API_REORDER_PRIVATE cruft
lavf: remove disabled FF_API_SEEK_PUBLIC cruft
lavf: remove disabled FF_API_STREAM_COPY cruft
lavf: remove disabled FF_API_PRELOAD cruft
lavf: remove disabled FF_API_NEW_STREAM cruft
lavf: remove disabled FF_API_RTSP_URL_OPTIONS cruft
lavf: remove disabled FF_API_MUXRATE cruft
lavf: remove disabled FF_API_FILESIZE cruft
lavf: remove disabled FF_API_TIMESTAMP cruft
lavf: remove disabled FF_API_LOOP_OUTPUT cruft
lavf: remove disabled FF_API_LOOP_INPUT cruft
lavf: remove disabled FF_API_AVSTREAM_QUALITY cruft
...
Conflicts:
doc/APIchanges
libavcodec/8bps.c
libavcodec/avcodec.h
libavcodec/libx264.c
libavcodec/mjpegbdec.c
libavcodec/options.c
libavcodec/sunrast.c
libavcodec/utils.c
libavcodec/version.h
libavcodec/x86/h264_deblock.asm
libavdevice/libdc1394.c
libavdevice/v4l2.c
libavformat/avformat.h
libavformat/avio.c
libavformat/avio.h
libavformat/aviobuf.c
libavformat/dv.c
libavformat/mov.c
libavformat/utils.c
libavformat/version.h
libavformat/wtv.c
libavutil/Makefile
libavutil/file.c
libswscale/x86/input.asm
libswscale/x86/swscale_mmx.c
libswscale/x86/swscale_template.c
tests/ref/lavf/ffm
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
145 files changed, 328 insertions, 1735 deletions
diff --git a/libavformat/4xm.c b/libavformat/4xm.c index 3d9c5aea12..342c22c169 100644 --- a/libavformat/4xm.c +++ b/libavformat/4xm.c @@ -91,8 +91,7 @@ static int fourxm_probe(AVProbeData *p) return AVPROBE_SCORE_MAX; } -static int fourxm_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int fourxm_read_header(AVFormatContext *s) { AVIOContext *pb = s->pb; unsigned int fourcc_tag; diff --git a/libavformat/aacdec.c b/libavformat/aacdec.c index 5c5f06cd58..ff58c36675 100644 --- a/libavformat/aacdec.c +++ b/libavformat/aacdec.c @@ -62,8 +62,7 @@ static int adts_aac_probe(AVProbeData *p) else return 0; } -static int adts_aac_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int adts_aac_read_header(AVFormatContext *s) { AVStream *st; diff --git a/libavformat/act.c b/libavformat/act.c index 5c414f04e9..e47afc1d27 100644 --- a/libavformat/act.c +++ b/libavformat/act.c @@ -60,8 +60,7 @@ static int probe(AVProbeData *p) return AVPROBE_SCORE_MAX; } -static int read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int read_header(AVFormatContext *s) { ACTContext* ctx = s->priv_data; AVIOContext *pb = s->pb; diff --git a/libavformat/adxdec.c b/libavformat/adxdec.c index ab11d832d8..243160940c 100644 --- a/libavformat/adxdec.c +++ b/libavformat/adxdec.c @@ -62,7 +62,7 @@ static int adx_read_packet(AVFormatContext *s, AVPacket *pkt) return 0; } -static int adx_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int adx_read_header(AVFormatContext *s) { ADXDemuxerContext *c = s->priv_data; AVCodecContext *avctx; diff --git a/libavformat/aea.c b/libavformat/aea.c index 9fac6c8de6..4e255241d1 100644 --- a/libavformat/aea.c +++ b/libavformat/aea.c @@ -54,8 +54,7 @@ static int aea_read_probe(AVProbeData *p) return 0; } -static int aea_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int aea_read_header(AVFormatContext *s) { AVStream *st = avformat_new_stream(s, NULL); if (!st) diff --git a/libavformat/aiffdec.c b/libavformat/aiffdec.c index e33bd57b7f..0f683837a3 100644 --- a/libavformat/aiffdec.c +++ b/libavformat/aiffdec.c @@ -79,7 +79,7 @@ static void get_meta(AVFormatContext *s, const char *key, int size) } size += (size&1)-res; str[res] = 0; - av_dict_set(&s->metadata, key, str, AV_METADATA_DONT_STRDUP_VAL); + av_dict_set(&s->metadata, key, str, AV_DICT_DONT_STRDUP_VAL); }else size+= size&1; @@ -176,8 +176,7 @@ static int aiff_probe(AVProbeData *p) } /* aiff input */ -static int aiff_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int aiff_read_header(AVFormatContext *s) { int size, filesize; int64_t offset = 0; diff --git a/libavformat/amr.c b/libavformat/amr.c index 7b566a2729..84dbd5a78b 100644 --- a/libavformat/amr.c +++ b/libavformat/amr.c @@ -76,8 +76,7 @@ static int amr_probe(AVProbeData *p) } /* amr input */ -static int amr_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int amr_read_header(AVFormatContext *s) { AVIOContext *pb = s->pb; AVStream *st; diff --git a/libavformat/anm.c b/libavformat/anm.c index 812bc285c3..3c8d570c8e 100644 --- a/libavformat/anm.c +++ b/libavformat/anm.c @@ -76,8 +76,7 @@ static int find_record(const AnmDemuxContext *anm, int record) return AVERROR_INVALIDDATA; } -static int read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int read_header(AVFormatContext *s) { AnmDemuxContext *anm = s->priv_data; AVIOContext *pb = s->pb; diff --git a/libavformat/apc.c b/libavformat/apc.c index 1e942e69c9..389eba7b0a 100644 --- a/libavformat/apc.c +++ b/libavformat/apc.c @@ -30,7 +30,7 @@ static int apc_probe(AVProbeData *p) return 0; } -static int apc_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int apc_read_header(AVFormatContext *s) { AVIOContext *pb = s->pb; AVStream *st; diff --git a/libavformat/ape.c b/libavformat/ape.c index 72fca5dd46..ffb8f5a384 100644 --- a/libavformat/ape.c +++ b/libavformat/ape.c @@ -152,7 +152,7 @@ static void ape_dumpinfo(AVFormatContext * s, APEContext * ape_ctx) #endif } -static int ape_read_header(AVFormatContext * s, AVFormatParameters * ap) +static int ape_read_header(AVFormatContext * s) { AVIOContext *pb = s->pb; APEContext *ape = s->priv_data; diff --git a/libavformat/applehttp.c b/libavformat/applehttp.c index 883427ce97..7e6346a989 100644 --- a/libavformat/applehttp.c +++ b/libavformat/applehttp.c @@ -445,7 +445,7 @@ reload: goto restart; } -static int applehttp_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int applehttp_read_header(AVFormatContext *s) { AppleHTTPContext *c = s->priv_data; int ret = 0, i, j, stream_offset = 0; diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c index 2aec02c938..2c2bd47802 100644 --- a/libavformat/asfdec.c +++ b/libavformat/asfdec.c @@ -576,7 +576,7 @@ static int asf_read_marker(AVFormatContext *s, int64_t size) return 0; } -static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int asf_read_header(AVFormatContext *s) { ASFContext *asf = s->priv_data; ff_asf_guid g; diff --git a/libavformat/assdec.c b/libavformat/assdec.c index 78cb6d93e1..f76424a36c 100644 --- a/libavformat/assdec.c +++ b/libavformat/assdec.c @@ -73,7 +73,7 @@ static int event_cmp(uint8_t **a, uint8_t **b) return get_pts(*a) - get_pts(*b); } -static int read_header(AVFormatContext *s, AVFormatParameters *ap) +static int read_header(AVFormatContext *s) { int i, len, header_remaining; ASSContext *ass = s->priv_data; diff --git a/libavformat/au.c b/libavformat/au.c index 3dfb3be004..05ec1eea31 100644 --- a/libavformat/au.c +++ b/libavformat/au.c @@ -118,8 +118,7 @@ static int au_probe(AVProbeData *p) } /* au input */ -static int au_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int au_read_header(AVFormatContext *s) { int size, bps, data_size = 0; unsigned int tag; diff --git a/libavformat/avformat.h b/libavformat/avformat.h index c28d1ddb2b..55616a8010 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -220,74 +220,6 @@ struct AVFormatContext; * @} */ -#if FF_API_OLD_METADATA2 -/** - * @defgroup old_metadata Old metadata API - * The following functions are deprecated, use - * their equivalents from libavutil/dict.h instead. - * @{ - */ - -#define AV_METADATA_MATCH_CASE AV_DICT_MATCH_CASE -#define AV_METADATA_IGNORE_SUFFIX AV_DICT_IGNORE_SUFFIX -#define AV_METADATA_DONT_STRDUP_KEY AV_DICT_DONT_STRDUP_KEY -#define AV_METADATA_DONT_STRDUP_VAL AV_DICT_DONT_STRDUP_VAL -#define AV_METADATA_DONT_OVERWRITE AV_DICT_DONT_OVERWRITE - -typedef attribute_deprecated AVDictionary AVMetadata; -typedef attribute_deprecated AVDictionaryEntry AVMetadataTag; - -typedef struct AVMetadataConv AVMetadataConv; - -/** - * Get a metadata element with matching key. - * - * @param prev Set to the previous matching element to find the next. - * If set to NULL the first matching element is returned. - * @param flags Allows case as well as suffix-insensitive comparisons. - * @return Found tag or NULL, changing key or value leads to undefined behavior. - */ -attribute_deprecated AVDictionaryEntry * -av_metadata_get(AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags); - -/** - * Set the given tag in *pm, overwriting an existing tag. - * - * @param pm pointer to a pointer to a metadata struct. If *pm is NULL - * a metadata struct is allocated and put in *pm. - * @param key tag key to add to *pm (will be av_strduped depending on flags) - * @param value tag value to add to *pm (will be av_strduped depending on flags). - * Passing a NULL value will cause an existing tag to be deleted. - * @return >= 0 on success otherwise an error code <0 - */ -attribute_deprecated int av_metadata_set2(AVDictionary **pm, const char *key, const char *value, int flags); - -/** - * This function is provided for compatibility reason and currently does nothing. - */ -attribute_deprecated void av_metadata_conv(struct AVFormatContext *ctx, const AVMetadataConv *d_conv, - const AVMetadataConv *s_conv); - -/** - * Copy metadata from one AVDictionary struct into another. - * @param dst pointer to a pointer to a AVDictionary struct. If *dst is NULL, - * this function will allocate a struct for you and put it in *dst - * @param src pointer to source AVDictionary struct - * @param flags flags to use when setting metadata in *dst - * @note metadata is read using the AV_DICT_IGNORE_SUFFIX flag - */ -attribute_deprecated void av_metadata_copy(AVDictionary **dst, AVDictionary *src, int flags); - -/** - * Free all the memory allocated for an AVDictionary struct. - */ -attribute_deprecated void av_metadata_free(AVDictionary **m); -/** - * @} - */ -#endif - - /* packet functions */ @@ -345,25 +277,6 @@ typedef struct AVProbeData { #define AVPROBE_SCORE_MAX 100 ///< maximum score, half of that is used for file-extension-based detection #define AVPROBE_PADDING_SIZE 32 ///< extra allocated bytes at the end of the probe buffer -typedef struct AVFormatParameters { -#if FF_API_FORMAT_PARAMETERS - attribute_deprecated AVRational time_base; - attribute_deprecated int sample_rate; - attribute_deprecated int channels; - attribute_deprecated int width; - attribute_deprecated int height; - attribute_deprecated enum PixelFormat pix_fmt; - attribute_deprecated int channel; /**< Used to select DV channel. */ - attribute_deprecated const char *standard; /**< deprecated, use demuxer-specific options instead. */ - attribute_deprecated unsigned int mpeg2ts_raw:1; /**< deprecated, use mpegtsraw demuxer */ - /**< deprecated, use mpegtsraw demuxer-specific options instead */ - attribute_deprecated unsigned int mpeg2ts_compute_pcr:1; - attribute_deprecated unsigned int initial_pause:1; /**< Do not begin to play the stream - immediately (RTSP only). */ - attribute_deprecated unsigned int prealloced_context:1; -#endif -} AVFormatParameters; - /// Demuxer will use avio_open, no opened file should be provided by the caller. #define AVFMT_NOFILE 0x0001 #define AVFMT_NEEDNUMBER 0x0002 /**< Needs '%d' in filename. */ @@ -422,9 +335,6 @@ typedef struct AVOutputFormat { * AVFMT_NODIMENSIONS, AVFMT_NOSTREAMS, AVFMT_ALLOW_FLUSH */ int flags; - - void *dummy; - int (*interleave_packet)(struct AVFormatContext *, AVPacket *out, AVPacket *in, int flush); @@ -436,10 +346,6 @@ typedef struct AVOutputFormat { enum CodecID subtitle_codec; /**< default subtitle codec */ -#if FF_API_OLD_METADATA2 - const AVMetadataConv *metadata_conv; -#endif - const AVClass *priv_class; ///< AVClass for the private context /** @@ -496,8 +402,7 @@ typedef struct AVInputFormat { * additional parameters. Only used in raw format right * now. 'av_new_stream' should be called to create new streams. */ - int (*read_header)(struct AVFormatContext *, - AVFormatParameters *ap); + int (*read_header)(struct AVFormatContext *); /** * Read one packet and put it in 'pkt'. pts and flags are also @@ -575,10 +480,6 @@ typedef struct AVInputFormat { */ int (*read_seek2)(struct AVFormatContext *s, int stream_index, int64_t min_ts, int64_t ts, int64_t max_ts, int flags); -#if FF_API_OLD_METADATA2 - const AVMetadataConv *metadata_conv; -#endif - const AVClass *priv_class; ///< AVClass for the private context /* private fields */ @@ -649,11 +550,6 @@ typedef struct AVStream { AVRational r_frame_rate; void *priv_data; -#if FF_API_REORDER_PRIVATE - /* internal data used in av_find_stream_info() */ - int64_t first_dts; -#endif - /** * encoding: pts generation when outputting stream */ @@ -667,24 +563,8 @@ typedef struct AVStream { * encoding: set by libavformat in av_write_header */ AVRational time_base; -#if FF_API_REORDER_PRIVATE - int pts_wrap_bits; /**< number of bits in pts (used for wrapping control) */ -#endif -#if FF_API_STREAM_COPY - /* ffmpeg.c private use */ - attribute_deprecated int stream_copy; /**< If set, just copy stream. */ -#endif enum AVDiscard discard; ///< Selects which packets can be discarded at will and do not need to be demuxed. -#if FF_API_AVSTREAM_QUALITY - //FIXME move stuff to a flags field? - /** - * Quality, as it has been removed from AVCodecContext and put in AVVideoFrame. - * MN: dunno if that is the right place for it - */ - attribute_deprecated float quality; -#endif - /** * Decoding: pts of the first frame of the stream in presentation order, in stream time base. * Only set this if you are absolutely 100% sure that the value you set @@ -702,31 +582,10 @@ typedef struct AVStream { */ int64_t duration; -#if FF_API_REORDER_PRIVATE - /* av_read_frame() support */ - enum AVStreamParseType need_parsing; - struct AVCodecParserContext *parser; - - int64_t cur_dts; - int last_IP_duration; - int64_t last_IP_pts; - /* av_seek_frame() support */ - AVIndexEntry *index_entries; /**< Only used if the format does not - support seeking natively. */ - int nb_index_entries; - unsigned int index_entries_allocated_size; -#endif - int64_t nb_frames; ///< number of frames in this stream if known or 0 int disposition; /**< AV_DISPOSITION_* bit field */ -#if FF_API_REORDER_PRIVATE - AVProbeData probe_data; -#define MAX_REORDER_DELAY 16 - int64_t pts_buffer[MAX_REORDER_DELAY+1]; -#endif - /** * sample aspect ratio (0 if unknown) * - encoding: Set by user. @@ -736,38 +595,6 @@ typedef struct AVStream { AVDictionary *metadata; -#if FF_API_REORDER_PRIVATE - /* Intended mostly for av_read_frame() support. Not supposed to be used by */ - /* external applications; try to use something else if at all possible. */ - const uint8_t *cur_ptr; - int cur_len; - AVPacket cur_pkt; - - // Timestamp generation support: - /** - * Timestamp corresponding to the last dts sync point. - * - * Initialized when AVCodecParserContext.dts_sync_point >= 0 and - * a DTS is received from the underlying container. Otherwise set to - * AV_NOPTS_VALUE by default. - */ - int64_t reference_dts; - - /** - * Number of packets to buffer for codec probing - * NOT PART OF PUBLIC API - */ -#define MAX_PROBE_PACKETS 2500 - int probe_packets; - - /** - * last packet in packet_buffer for this stream when muxing. - * Used internally, NOT PART OF PUBLIC API, do not read or - * write from outside of libav* - */ - struct AVPacketList *last_in_packet_buffer; -#endif - /** * Average framerate */ @@ -808,13 +635,6 @@ typedef struct AVStream { int64_t codec_info_duration; int nb_decoded_frames; } *info; - - /** - * flag to indicate that probing is requested - * NOT PART OF PUBLIC API - */ - int request_probe; -#if !FF_API_REORDER_PRIVATE const uint8_t *cur_ptr; int cur_len; AVPacket cur_pkt; @@ -856,7 +676,12 @@ typedef struct AVStream { unsigned int index_entries_allocated_size; int pts_wrap_bits; /**< number of bits in pts (used for wrapping control) */ -#endif + + /** + * flag to indicate that probing is requested + * NOT PART OF PUBLIC API + */ + int request_probe; } AVStream; #define AV_PROGRAM_RUNNING 1 @@ -947,23 +772,7 @@ typedef struct AVFormatContext { char filename[1024]; /**< input or output filename */ /* stream info */ -#if FF_API_TIMESTAMP - /** - * @deprecated use 'creation_time' metadata tag instead - */ - attribute_deprecated int64_t timestamp; -#endif - int ctx_flags; /**< Format-specific flags, see AVFMTCTX_xx */ -#if FF_API_REORDER_PRIVATE - /* private data for pts handling (do not modify directly). */ - /** - * This buffer is only needed when packets were already buffered but - * not decoded, for example to get the codec parameters in MPEG - * streams. - */ - struct AVPacketList *packet_buffer; -#endif /** * Decoding: position of the first frame of the component, in @@ -980,13 +789,6 @@ typedef struct AVFormatContext { */ int64_t duration; -#if FF_API_FILESIZE - /** - * decoding: total file size, 0 if unknown - */ - attribute_deprecated int64_t file_size; -#endif - /** * Decoding: total stream bitrate in bit/s, 0 if not * available. Never set it directly if the file_size and the @@ -994,37 +796,9 @@ typedef struct AVFormatContext { */ int bit_rate; -#if FF_API_REORDER_PRIVATE - /* av_read_frame() support */ - AVStream *cur_st; - - /* av_seek_frame() support */ - int64_t data_offset; /**< offset of the first packet */ -#endif - -#if FF_API_MUXRATE - /** - * use mpeg muxer private options instead - */ - attribute_deprecated int mux_rate; -#endif unsigned int packet_size; -#if FF_API_PRELOAD - attribute_deprecated int preload; -#endif int max_delay; -#if FF_API_LOOP_OUTPUT -#define AVFMT_NOOUTPUTLOOP -1 -#define AVFMT_INFINITEOUTPUTLOOP 0 - /** - * number of times to loop output in formats that support it - * - * @deprecated use the 'loop' private option in the gif muxer. - */ - attribute_deprecated int loop_output; -#endif - int flags; #define AVFMT_FLAG_GENPTS 0x0001 ///< Generate missing pts even if it requires parsing future frames. #define AVFMT_FLAG_IGNIDX 0x0002 ///< Ignore index. @@ -1032,9 +806,6 @@ typedef struct AVFormatContext { #define AVFMT_FLAG_IGNDTS 0x0008 ///< Ignore DTS on frames that contain both DTS & PTS #define AVFMT_FLAG_NOFILLIN 0x0010 ///< Do not infer any values from other values, just return what is stored in the container #define AVFMT_FLAG_NOPARSE 0x0020 ///< Do not use AVParsers, you also must set AVFMT_FLAG_NOFILLIN as the fillin code works on frames and no parsing -> no frames. Also seeking to frames can not work if parsing to find frame boundaries has been disabled -#if FF_API_FLAG_RTP_HINT -#define AVFMT_FLAG_RTP_HINT 0x0040 ///< Deprecated, use the -movflags rtphint muxer specific AVOption instead -#endif #define AVFMT_FLAG_CUSTOM_IO 0x0080 ///< The caller has supplied a custom AVIOContext, don't avio_close() it. #define AVFMT_FLAG_DISCARD_CORRUPT 0x0100 ///< Discard frames marked corrupted #define AVFMT_FLAG_MP4A_LATM 0x8000 ///< Enable RTP MP4A-LATM payload @@ -1042,13 +813,6 @@ typedef struct AVFormatContext { #define AVFMT_FLAG_PRIV_OPT 0x20000 ///< Enable use of private options by delaying codec open (this could be made default once all code is converted) #define AVFMT_FLAG_KEEP_SIDE_DATA 0x40000 ///< Dont merge side data but keep it seperate. -#if FF_API_LOOP_INPUT - /** - * @deprecated, use the 'loop' img2 demuxer private option. - */ - attribute_deprecated int loop_input; -#endif - /** * decoding: size of data to probe; encoding: unused. */ @@ -1111,30 +875,8 @@ typedef struct AVFormatContext { int debug; #define FF_FDEBUG_TS 0x0001 -#if FF_API_REORDER_PRIVATE - /** - * Raw packets from the demuxer, prior to parsing and decoding. - * This buffer is used for buffering packets until the codec can - * be identified, as parsing cannot be done without knowing the - * codec. - */ - struct AVPacketList *raw_packet_buffer; - struct AVPacketList *raw_packet_buffer_end; - - struct AVPacketList *packet_buffer_end; -#endif - AVDictionary *metadata; -#if FF_API_REORDER_PRIVATE - /** - * Remaining size available for raw_packet_buffer, in bytes. - * NOT PART OF PUBLIC API - */ -#define RAW_PACKET_BUFFER_SIZE 2500000 - int raw_packet_buffer_remaining_size; -#endif - /** * Start time of the stream in real world time, in microseconds * since the unix epoch (00:00 1st January 1970). That is, pts=0 @@ -1205,7 +947,6 @@ typedef struct AVFormatContext { * New public fields should be added right above. ***************************************************************** */ -#if !FF_API_REORDER_PRIVATE /** * Raw packets from the demuxer, prior to parsing and decoding. * This buffer is used for buffering packets until the codec can @@ -1233,7 +974,6 @@ typedef struct AVFormatContext { /* av_seek_frame() support */ int64_t data_offset; /**< offset of the first packet */ -#endif } AVFormatContext; typedef struct AVPacketList { @@ -1354,17 +1094,12 @@ AVProgram *av_new_program(AVFormatContext *s, int id); */ -#if FF_API_GUESS_IMG2_CODEC -attribute_deprecated enum CodecID av_guess_image2_codec(const char *filename); -#endif - #if FF_API_PKT_DUMP attribute_deprecated void av_pkt_dump(FILE *f, AVPacket *pkt, int dump_payload); attribute_deprecated void av_pkt_dump_log(void *avcl, int level, AVPacket *pkt, int dump_payload); #endif - #if FF_API_ALLOC_OUTPUT_CONTEXT /** * @deprecated deprecated in favor of avformat_alloc_output_context2() @@ -1453,36 +1188,6 @@ int av_probe_input_buffer(AVIOContext *pb, AVInputFormat **fmt, const char *filename, void *logctx, unsigned int offset, unsigned int max_probe_size); -#if FF_API_FORMAT_PARAMETERS -/** - * Allocate all the structures needed to read an input stream. - * This does not open the needed codecs for decoding the stream[s]. - * @deprecated use avformat_open_input instead. - */ -attribute_deprecated int av_open_input_stream(AVFormatContext **ic_ptr, - AVIOContext *pb, const char *filename, - AVInputFormat *fmt, AVFormatParameters *ap); - -/** - * Open a media file as input. The codecs are not opened. Only the file - * header (if present) is read. - * - * @param ic_ptr The opened media file handle is put here. - * @param filename filename to open - * @param fmt If non-NULL, force the file format to use. - * @param buf_size optional buffer size (zero if default is OK) - * @param ap Additional parameters needed when opening the file - * (NULL if default). - * @return 0 if OK, AVERROR_xxx otherwise - * - * @deprecated use avformat_open_input instead. - */ -attribute_deprecated int av_open_input_file(AVFormatContext **ic_ptr, const char *filename, - AVInputFormat *fmt, - int buf_size, - AVFormatParameters *ap); -#endif - /** * Open an input stream and read the header. The codecs are not opened. * The stream must be closed with av_close_input_file(). @@ -1504,7 +1209,8 @@ attribute_deprecated int av_open_input_file(AVFormatContext **ic_ptr, const char */ int avformat_open_input(AVFormatContext **ps, const char *filename, AVInputFormat *fmt, AVDictionary **options); -int av_demuxer_open(AVFormatContext *ic, AVFormatParameters *ap); +attribute_deprecated +int av_demuxer_open(AVFormatContext *ic); #if FF_API_FORMAT_PARAMETERS /** @@ -1685,16 +1391,6 @@ int av_read_play(AVFormatContext *s); */ int av_read_pause(AVFormatContext *s); -#if FF_API_FORMAT_PARAMETERS -/** - * Free a AVFormatContext allocated by av_open_input_stream. - * @param s context to free - * @deprecated use av_close_input_file() - */ -attribute_deprecated -void av_close_input_stream(AVFormatContext *s); -#endif - #if FF_API_CLOSE_INPUT_FILE /** * @deprecated use avformat_close_input() @@ -1744,28 +1440,6 @@ void av_set_pts_info(AVStream *s, int pts_wrap_bits, #define AVSEEK_FLAG_ANY 4 ///< seek to any frame, even non-keyframes #define AVSEEK_FLAG_FRAME 8 ///< seeking based on frame number -#if FF_API_SEEK_PUBLIC -attribute_deprecated -int av_seek_frame_binary(AVFormatContext *s, int stream_index, - int64_t target_ts, int flags); -attribute_deprecated -void av_update_cur_dts(AVFormatContext *s, AVStream *ref_st, int64_t timestamp); -attribute_deprecated -int64_t av_gen_search(AVFormatContext *s, int stream_index, - int64_t target_ts, int64_t pos_min, - int64_t pos_max, int64_t pos_limit, - int64_t ts_min, int64_t ts_max, - int flags, int64_t *ts_ret, - int64_t (*read_timestamp)(struct AVFormatContext *, int , int64_t *, int64_t )); -#endif - -#if FF_API_FORMAT_PARAMETERS -/** - * @deprecated pass the options to avformat_write_header directly. - */ -attribute_deprecated int av_set_parameters(AVFormatContext *s, AVFormatParameters *ap); -#endif - /** * @addtogroup lavf_encoding * @{ @@ -1787,21 +1461,6 @@ attribute_deprecated int av_set_parameters(AVFormatContext *s, AVFormatParameter */ int avformat_write_header(AVFormatContext *s, AVDictionary **options); -#if FF_API_FORMAT_PARAMETERS -/** - * Allocate the stream private data and write the stream header to an - * output media file. - * @note: this sets stream time-bases, if possible to stream->codec->time_base - * but for some formats it might also be some other time base - * - * @param s media file handle - * @return 0 if OK, AVERROR_xxx on error - * - * @deprecated use avformat_write_header. - */ -attribute_deprecated int av_write_header(AVFormatContext *s); -#endif - /** * Write a packet to an output media file. * @@ -2047,45 +1706,17 @@ void av_url_split(char *proto, int proto_size, char *path, int path_size, const char *url); -#if FF_API_DUMP_FORMAT -/** - * @deprecated Deprecated in favor of av_dump_format(). - */ -attribute_deprecated void dump_format(AVFormatContext *ic, - int index, - const char *url, - int is_output); -#endif void av_dump_format(AVFormatContext *ic, int index, const char *url, int is_output); -#if FF_API_PARSE_DATE -/** - * Parse datestr and return a corresponding number of microseconds. - * - * @param datestr String representing a date or a duration. - * See av_parse_time() for the syntax of the provided string. - * @deprecated in favor of av_parse_time() - */ -attribute_deprecated -int64_t parse_date(const char *datestr, int duration); -#endif - /** * Get the current time in microseconds. */ int64_t av_gettime(void); -#if FF_API_FIND_INFO_TAG -/** - * @deprecated use av_find_info_tag in libavutil instead. - */ -attribute_deprecated int find_info_tag(char *arg, int arg_size, const char *tag1, const char *info); -#endif - /** * Return in 'buf' the path with '%d' replaced by a number. * @@ -2125,10 +1756,6 @@ int av_filename_number_test(const char *filename); */ int av_sdp_create(AVFormatContext *ac[], int n_files, char *buf, int size); -#if FF_API_SDP_CREATE -attribute_deprecated int avf_sdp_create(AVFormatContext *ac[], int n_files, char *buff, int size); -#endif - /** * Return a positive value if the given filename has one of the given * extensions, 0 otherwise. diff --git a/libavformat/avidec.c b/libavformat/avidec.c index ec2204c0a9..93b15bddf7 100644 --- a/libavformat/avidec.c +++ b/libavformat/avidec.c @@ -351,7 +351,7 @@ static void avi_read_nikon(AVFormatContext *s, uint64_t end) } } -static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int avi_read_header(AVFormatContext *s) { AVIContext *avi = s->priv_data; AVIOContext *pb = s->pb; @@ -719,7 +719,7 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap) case MKTAG('i', 'n', 'd', 'x'): i= avio_tell(pb); if(pb->seekable && !(s->flags & AVFMT_FLAG_IGNIDX) && avi->use_odml && - read_braindead_odml_indx(s, 0) < 0 && s->error_recognition >= FF_ER_EXPLODE) + read_braindead_odml_indx(s, 0) < 0 && (s->error_recognition & AV_EF_EXPLODE)) goto fail; avio_seek(pb, i+size, SEEK_SET); break; diff --git a/libavformat/avio.c b/libavformat/avio.c index 418a8a79fc..0f6ce31097 100644 --- a/libavformat/avio.c +++ b/libavformat/avio.c @@ -84,16 +84,6 @@ const AVClass ffurl_context_class = { /*@}*/ -#if FF_API_OLD_INTERRUPT_CB -static int default_interrupt_cb(void); -int (*url_interrupt_cb)(void) = default_interrupt_cb; -#endif - -URLProtocol *av_protocol_next(URLProtocol *p) -{ - return ffurl_protocol_next(p); -} - const char *avio_enum_protocols(void **opaque, int output) { URLProtocol **p = opaque; @@ -190,9 +180,7 @@ static int url_alloc_for_protocol (URLContext **puc, struct URLProtocol *up, int ffurl_connect(URLContext* uc, AVDictionary **options) { int err = -#if !FF_API_OLD_AVIO uc->prot->url_open2 ? uc->prot->url_open2(uc, uc->filename, uc->flags, options) : -#endif uc->prot->url_open(uc, uc->filename, uc->flags); if (err) return err; @@ -205,81 +193,6 @@ int ffurl_connect(URLContext* uc, AVDictionary **options) return 0; } -#if FF_API_OLD_AVIO -int url_open_protocol (URLContext **puc, struct URLProtocol *up, - const char *filename, int flags) -{ - int ret; - - ret = url_alloc_for_protocol(puc, up, filename, flags, NULL); - if (ret) - goto fail; - ret = ffurl_connect(*puc, NULL); - if (!ret) - return 0; - fail: - ffurl_close(*puc); - *puc = NULL; - return ret; -} -int url_alloc(URLContext **puc, const char *filename, int flags) -{ - return ffurl_alloc(puc, filename, flags, NULL); -} -int url_connect(URLContext* uc) -{ - return ffurl_connect(uc, NULL); -} -int url_open(URLContext **puc, const char *filename, int flags) -{ - return ffurl_open(puc, filename, flags, NULL, NULL); -} -int url_read(URLContext *h, unsigned char *buf, int size) -{ - return ffurl_read(h, buf, size); -} -int url_read_complete(URLContext *h, unsigned char *buf, int size) -{ - return ffurl_read_complete(h, buf, size); -} -int url_write(URLContext *h, const unsigned char *buf, int size) -{ - return ffurl_write(h, buf, size); -} -int64_t url_seek(URLContext *h, int64_t pos, int whence) -{ - return ffurl_seek(h, pos, whence); -} -int url_close(URLContext *h) -{ - return ffurl_close(h); -} -int64_t url_filesize(URLContext *h) -{ - return ffurl_size(h); -} -int url_get_file_handle(URLContext *h) -{ - return ffurl_get_file_handle(h); -} -int url_get_max_packet_size(URLContext *h) -{ - return h->max_packet_size; -} -void url_get_filename(URLContext *h, char *buf, int buf_size) -{ - av_strlcpy(buf, h->filename, buf_size); -} -void url_set_interrupt_cb(URLInterruptCB *interrupt_cb) -{ - avio_set_interrupt_cb(interrupt_cb); -} -int av_register_protocol2(URLProtocol *protocol, int size) -{ - return ffurl_register_protocol(protocol, size); -} -#endif - #define URL_SCHEME_CHARS \ "abcdefghijklmnopqrstuvwxyz" \ "ABCDEFGHIJKLMNOPQRSTUVWXYZ" \ @@ -422,17 +335,6 @@ int ffurl_close(URLContext *h) return ret; } -#if FF_API_OLD_AVIO -int url_exist(const char *filename) -{ - URLContext *h; - if (ffurl_open(&h, filename, AVIO_FLAG_READ, NULL, NULL) < 0) - return 0; - ffurl_close(h); - return 1; -} -#endif - int avio_check(const char *url, int flags) { URLContext *h; @@ -474,45 +376,11 @@ int ffurl_get_file_handle(URLContext *h) return h->prot->url_get_file_handle(h); } -#if FF_API_OLD_INTERRUPT_CB -static int default_interrupt_cb(void) -{ - return 0; -} - -void avio_set_interrupt_cb(int (*interrupt_cb)(void)) -{ - if (!interrupt_cb) - interrupt_cb = default_interrupt_cb; - url_interrupt_cb = interrupt_cb; -} -#endif - int ff_check_interrupt(AVIOInterruptCB *cb) { int ret; if (cb && cb->callback && (ret = cb->callback(cb->opaque))) return ret; -#if FF_API_OLD_INTERRUPT_CB - return url_interrupt_cb(); -#else return 0; -#endif -} - -#if FF_API_OLD_AVIO -int av_url_read_pause(URLContext *h, int pause) -{ - if (!h->prot->url_read_pause) - return AVERROR(ENOSYS); - return h->prot->url_read_pause(h, pause); } -int64_t av_url_read_seek(URLContext *h, - int stream_index, int64_t timestamp, int flags) -{ - if (!h->prot->url_read_seek) - return AVERROR(ENOSYS); - return h->prot->url_read_seek(h, stream_index, timestamp, flags); -} -#endif diff --git a/libavformat/avio.h b/libavformat/avio.h index a8698a8419..c29b267968 100644 --- a/libavformat/avio.h +++ b/libavformat/avio.h @@ -66,7 +66,6 @@ typedef struct { * function pointers specified in avio_alloc_context() */ typedef struct { -#if !FF_API_OLD_AVIO /** * A class for private options. * @@ -80,7 +79,6 @@ typedef struct { * to any av_opt_* functions in that case. */ AVClass *av_class; -#endif unsigned char *buffer; /**< Start of the buffer. */ int buffer_size; /**< Maximum buffer size */ unsigned char *buf_ptr; /**< Current position in the buffer */ @@ -97,9 +95,6 @@ typedef struct { int must_flush; /**< true if the next seek should flush */ int eof_reached; /**< true if eof reached */ int write_flag; /**< true if open for writing */ -#if FF_API_OLD_AVIO - attribute_deprecated int is_streamed; -#endif int max_packet_size; unsigned long checksum; unsigned char *checksum_ptr; @@ -130,259 +125,6 @@ typedef struct { /* unbuffered I/O */ -#if FF_API_OLD_AVIO -/** - * URL Context. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(URLContext) must not be used outside libav*. - * @deprecated This struct will be made private - */ -typedef struct URLContext { - const AVClass *av_class; ///< information for av_log(). Set by url_open(). - struct URLProtocol *prot; - int flags; - int is_streamed; /**< true if streamed (no seek possible), default = false */ - int max_packet_size; /**< if non zero, the stream is packetized with this max packet size */ - void *priv_data; - char *filename; /**< specified URL */ - int is_connected; - AVIOInterruptCB interrupt_callback; -} URLContext; - -#define URL_PROTOCOL_FLAG_NESTED_SCHEME 1 /*< The protocol name can be the first part of a nested protocol scheme */ -#define URL_PROTOCOL_FLAG_NETWORK 2 /*< The protocol uses network */ - -/** - * @deprecated This struct is to be made private. Use the higher-level - * AVIOContext-based API instead. - */ -typedef struct URLProtocol { - const char *name; - int (*url_open)(URLContext *h, const char *url, int flags); - int (*url_read)(URLContext *h, unsigned char *buf, int size); - int (*url_write)(URLContext *h, const unsigned char *buf, int size); - int64_t (*url_seek)(URLContext *h, int64_t pos, int whence); - int (*url_close)(URLContext *h); - struct URLProtocol *next; - int (*url_read_pause)(URLContext *h, int pause); - int64_t (*url_read_seek)(URLContext *h, int stream_index, - int64_t timestamp, int flags); - int (*url_get_file_handle)(URLContext *h); - int priv_data_size; - const AVClass *priv_data_class; - int flags; - int (*url_check)(URLContext *h, int mask); -} URLProtocol; - -typedef struct URLPollEntry { - URLContext *handle; - int events; - int revents; -} URLPollEntry; - -/* not implemented */ -attribute_deprecated int url_poll(URLPollEntry *poll_table, int n, int timeout); - -/** - * @name URL open modes - * The flags argument to url_open and cosins must be one of the following - * constants, optionally ORed with other flags. - * @{ - */ -#define URL_RDONLY 1 /**< read-only */ -#define URL_WRONLY 2 /**< write-only */ -#define URL_RDWR (URL_RDONLY|URL_WRONLY) /**< read-write */ -/** - * @} - */ - -/** - * Use non-blocking mode. - * If this flag is set, operations on the context will return - * AVERROR(EAGAIN) if they can not be performed immediately. - * If this flag is not set, operations on the context will never return - * AVERROR(EAGAIN). - * Note that this flag does not affect the opening/connecting of the - * context. Connecting a protocol will always block if necessary (e.g. on - * network protocols) but never hang (e.g. on busy devices). - * Warning: non-blocking protocols is work-in-progress; this flag may be - * silently ignored. - */ -#define URL_FLAG_NONBLOCK 8 - -typedef int URLInterruptCB(void); -extern URLInterruptCB *url_interrupt_cb; - -/** - * @defgroup old_url_funcs Old url_* functions - * The following functions are deprecated. Use the buffered API based on #AVIOContext instead. - * @{ - * @ingroup lavf_io - */ -attribute_deprecated int url_open_protocol (URLContext **puc, struct URLProtocol *up, - const char *url, int flags); -attribute_deprecated int url_alloc(URLContext **h, const char *url, int flags); -attribute_deprecated int url_connect(URLContext *h); -attribute_deprecated int url_open(URLContext **h, const char *url, int flags); -attribute_deprecated int url_read(URLContext *h, unsigned char *buf, int size); -attribute_deprecated int url_read_complete(URLContext *h, unsigned char *buf, int size); -attribute_deprecated int url_write(URLContext *h, const unsigned char *buf, int size); -attribute_deprecated int64_t url_seek(URLContext *h, int64_t pos, int whence); -attribute_deprecated int url_close(URLContext *h); -attribute_deprecated int64_t url_filesize(URLContext *h); -attribute_deprecated int url_get_file_handle(URLContext *h); -attribute_deprecated int url_get_max_packet_size(URLContext *h); -attribute_deprecated void url_get_filename(URLContext *h, char *buf, int buf_size); -attribute_deprecated int av_url_read_pause(URLContext *h, int pause); -attribute_deprecated int64_t av_url_read_seek(URLContext *h, int stream_index, - int64_t timestamp, int flags); -attribute_deprecated void url_set_interrupt_cb(int (*interrupt_cb)(void)); - -/** - * returns the next registered protocol after the given protocol (the first if - * NULL is given), or NULL if protocol is the last one. - */ -URLProtocol *av_protocol_next(URLProtocol *p); - -/** - * Register the URLProtocol protocol. - * - * @param size the size of the URLProtocol struct referenced - */ -attribute_deprecated int av_register_protocol2(URLProtocol *protocol, int size); -/** - * @} - */ - - -typedef attribute_deprecated AVIOContext ByteIOContext; - -attribute_deprecated int init_put_byte(AVIOContext *s, - unsigned char *buffer, - int buffer_size, - int write_flag, - void *opaque, - int (*read_packet)(void *opaque, uint8_t *buf, int buf_size), - int (*write_packet)(void *opaque, uint8_t *buf, int buf_size), - int64_t (*seek)(void *opaque, int64_t offset, int whence)); -attribute_deprecated AVIOContext *av_alloc_put_byte( - unsigned char *buffer, - int buffer_size, - int write_flag, - void *opaque, - int (*read_packet)(void *opaque, uint8_t *buf, int buf_size), - int (*write_packet)(void *opaque, uint8_t *buf, int buf_size), - int64_t (*seek)(void *opaque, int64_t offset, int whence)); - -/** - * @defgroup old_avio_funcs Old put_/get_*() functions - * The following functions are deprecated. Use the "avio_"-prefixed functions instead. - * @{ - * @ingroup lavf_io - */ -attribute_deprecated int get_buffer(AVIOContext *s, unsigned char *buf, int size); -attribute_deprecated int get_partial_buffer(AVIOContext *s, unsigned char *buf, int size); -attribute_deprecated int get_byte(AVIOContext *s); -attribute_deprecated unsigned int get_le16(AVIOContext *s); -attribute_deprecated unsigned int get_le24(AVIOContext *s); -attribute_deprecated unsigned int get_le32(AVIOContext *s); -attribute_deprecated uint64_t get_le64(AVIOContext *s); -attribute_deprecated unsigned int get_be16(AVIOContext *s); -attribute_deprecated unsigned int get_be24(AVIOContext *s); -attribute_deprecated unsigned int get_be32(AVIOContext *s); -attribute_deprecated uint64_t get_be64(AVIOContext *s); - -attribute_deprecated void put_byte(AVIOContext *s, int b); -attribute_deprecated void put_nbyte(AVIOContext *s, int b, int count); -attribute_deprecated void put_buffer(AVIOContext *s, const unsigned char *buf, int size); -attribute_deprecated void put_le64(AVIOContext *s, uint64_t val); -attribute_deprecated void put_be64(AVIOContext *s, uint64_t val); -attribute_deprecated void put_le32(AVIOContext *s, unsigned int val); -attribute_deprecated void put_be32(AVIOContext *s, unsigned int val); -attribute_deprecated void put_le24(AVIOContext *s, unsigned int val); -attribute_deprecated void put_be24(AVIOContext *s, unsigned int val); -attribute_deprecated void put_le16(AVIOContext *s, unsigned int val); -attribute_deprecated void put_be16(AVIOContext *s, unsigned int val); -attribute_deprecated void put_tag(AVIOContext *s, const char *tag); -/** - * @} - */ - -attribute_deprecated int av_url_read_fpause(AVIOContext *h, int pause); -attribute_deprecated int64_t av_url_read_fseek (AVIOContext *h, int stream_index, - int64_t timestamp, int flags); - -/** - * @defgroup old_url_f_funcs Old url_f* functions - * The following functions are deprecated, use the "avio_"-prefixed functions instead. - * @{ - * @ingroup lavf_io - */ -attribute_deprecated int url_fopen( AVIOContext **s, const char *url, int flags); -attribute_deprecated int url_fclose(AVIOContext *s); -attribute_deprecated int64_t url_fseek(AVIOContext *s, int64_t offset, int whence); -attribute_deprecated int url_fskip(AVIOContext *s, int64_t offset); -attribute_deprecated int64_t url_ftell(AVIOContext *s); -attribute_deprecated int64_t url_fsize(AVIOContext *s); -#define URL_EOF (-1) -attribute_deprecated int url_fgetc(AVIOContext *s); -attribute_deprecated int url_setbufsize(AVIOContext *s, int buf_size); -attribute_deprecated int url_fprintf(AVIOContext *s, const char *fmt, ...) av_printf_format(2, 3); -attribute_deprecated void put_flush_packet(AVIOContext *s); -attribute_deprecated int url_open_dyn_buf(AVIOContext **s); -attribute_deprecated int url_open_dyn_packet_buf(AVIOContext **s, int max_packet_size); -attribute_deprecated int url_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer); -attribute_deprecated int url_fdopen(AVIOContext **s, URLContext *h); -/** - * @} - */ - -attribute_deprecated int url_ferror(AVIOContext *s); - -attribute_deprecated int udp_set_remote_url(URLContext *h, const char *uri); -attribute_deprecated int udp_get_local_port(URLContext *h); - -attribute_deprecated void init_checksum(AVIOContext *s, - unsigned long (*update_checksum)(unsigned long c, const uint8_t *p, unsigned int len), - unsigned long checksum); -attribute_deprecated unsigned long get_checksum(AVIOContext *s); -attribute_deprecated void put_strz(AVIOContext *s, const char *buf); -/** @note unlike fgets, the EOL character is not returned and a whole - line is parsed. return NULL if first char read was EOF */ -attribute_deprecated char *url_fgets(AVIOContext *s, char *buf, int buf_size); -/** - * @deprecated use avio_get_str instead - */ -attribute_deprecated char *get_strz(AVIOContext *s, char *buf, int maxlen); -/** - * @deprecated Use AVIOContext.seekable field directly. - */ -attribute_deprecated static inline int url_is_streamed(AVIOContext *s) -{ - return !s->seekable; -} -attribute_deprecated URLContext *url_fileno(AVIOContext *s); - -/** - * @deprecated use AVIOContext.max_packet_size directly. - */ -attribute_deprecated int url_fget_max_packet_size(AVIOContext *s); - -attribute_deprecated int url_open_buf(AVIOContext **s, uint8_t *buf, int buf_size, int flags); - -/** return the written or read size */ -attribute_deprecated int url_close_buf(AVIOContext *s); - -/** - * Return a non-zero value if the resource indicated by url - * exists, 0 otherwise. - * @deprecated Use avio_check instead. - */ -attribute_deprecated int url_exist(const char *url); -#endif // FF_API_OLD_AVIO - /** * Return AVIO_FLAG_* access flags corresponding to the access permissions * of the resource in url, or a negative value corresponding to an @@ -397,18 +139,6 @@ attribute_deprecated int url_exist(const char *url); */ int avio_check(const char *url, int flags); -#if FF_API_OLD_INTERRUPT_CB -/** - * The callback is called in blocking functions to test regulary if - * asynchronous interruption is needed. AVERROR_EXIT is returned - * in this case by the interrupted function. 'NULL' means no interrupt - * callback is given. - * @deprecated Use interrupt_callback in AVFormatContext/avio_open2 - * instead. - */ -attribute_deprecated void avio_set_interrupt_cb(int (*interrupt_cb)(void)); -#endif - /** * Allocate and initialize an AVIOContext for buffered I/O. It must be later * freed with av_free(). diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c index d8074780df..d1520ed432 100644 --- a/libavformat/aviobuf.c +++ b/libavformat/aviobuf.c @@ -40,7 +40,6 @@ */ #define SHORT_SEEK_THRESHOLD 4096 -#if !FF_API_OLD_AVIO static void *ffio_url_child_next(void *obj, void *prev) { AVIOContext *s = obj; @@ -64,7 +63,7 @@ const AVClass ffio_url_class = { .child_next = ffio_url_child_next, .child_class_next = ffio_url_child_class_next, }; -#endif + static void fill_buffer(AVIOContext *s); static int url_resetbuf(AVIOContext *s, int flags); @@ -89,9 +88,6 @@ int ffio_init_context(AVIOContext *s, s->must_flush = 0; s->eof_reached = 0; s->error = 0; -#if FF_API_OLD_AVIO - s->is_streamed = 0; -#endif s->seekable = AVIO_SEEKABLE_NORMAL; s->max_packet_size = 0; s->update_checksum= NULL; @@ -104,33 +100,6 @@ int ffio_init_context(AVIOContext *s, return 0; } -#if FF_API_OLD_AVIO -int init_put_byte(AVIOContext *s, - unsigned char *buffer, - int buffer_size, - int write_flag, - void *opaque, - int (*read_packet)(void *opaque, uint8_t *buf, int buf_size), - int (*write_packet)(void *opaque, uint8_t *buf, int buf_size), - int64_t (*seek)(void *opaque, int64_t offset, int whence)) -{ - return ffio_init_context(s, buffer, buffer_size, write_flag, opaque, - read_packet, write_packet, seek); -} -AVIOContext *av_alloc_put_byte( - unsigned char *buffer, - int buffer_size, - int write_flag, - void *opaque, - int (*read_packet)(void *opaque, uint8_t *buf, int buf_size), - int (*write_packet)(void *opaque, uint8_t *buf, int buf_size), - int64_t (*seek)(void *opaque, int64_t offset, int whence)) -{ - return avio_alloc_context(buffer, buffer_size, write_flag, opaque, - read_packet, write_packet, seek); -} -#endif - AVIOContext *avio_alloc_context( unsigned char *buffer, int buffer_size, @@ -270,19 +239,6 @@ int64_t avio_skip(AVIOContext *s, int64_t offset) return avio_seek(s, offset, SEEK_CUR); } -#if FF_API_OLD_AVIO -int url_fskip(AVIOContext *s, int64_t offset) -{ - int64_t ret = avio_seek(s, offset, SEEK_CUR); - return ret < 0 ? ret : 0; -} - -int64_t url_ftell(AVIOContext *s) -{ - return avio_seek(s, 0, SEEK_CUR); -} -#endif - int64_t avio_size(AVIOContext *s) { int64_t size; @@ -313,15 +269,6 @@ int url_feof(AVIOContext *s) return s->eof_reached; } -#if FF_API_OLD_AVIO -int url_ferror(AVIOContext *s) -{ - if(!s) - return 0; - return s->error; -} -#endif - void avio_wl32(AVIOContext *s, unsigned int val) { avio_w8(s, val); @@ -338,143 +285,6 @@ void avio_wb32(AVIOContext *s, unsigned int val) avio_w8(s, val); } -#if FF_API_OLD_AVIO -void put_strz(AVIOContext *s, const char *str) -{ - avio_put_str(s, str); -} - -#define GET(name, type) \ - type get_be ##name(AVIOContext *s) \ -{\ - return avio_rb ##name(s);\ -}\ - type get_le ##name(AVIOContext *s) \ -{\ - return avio_rl ##name(s);\ -} - -GET(16, unsigned int) -GET(24, unsigned int) -GET(32, unsigned int) -GET(64, uint64_t) - -#undef GET - -#define PUT(name, type ) \ - void put_le ##name(AVIOContext *s, type val)\ -{\ - avio_wl ##name(s, val);\ -}\ - void put_be ##name(AVIOContext *s, type val)\ -{\ - avio_wb ##name(s, val);\ -} - -PUT(16, unsigned int) -PUT(24, unsigned int) -PUT(32, unsigned int) -PUT(64, uint64_t) -#undef PUT - -int get_byte(AVIOContext *s) -{ - return avio_r8(s); -} -int get_buffer(AVIOContext *s, unsigned char *buf, int size) -{ - return avio_read(s, buf, size); -} -int get_partial_buffer(AVIOContext *s, unsigned char *buf, int size) -{ - return ffio_read_partial(s, buf, size); -} -void put_byte(AVIOContext *s, int val) -{ - avio_w8(s, val); -} -void put_buffer(AVIOContext *s, const unsigned char *buf, int size) -{ - avio_write(s, buf, size); -} -void put_nbyte(AVIOContext *s, int b, int count) -{ - ffio_fill(s, b, count); -} - -int url_fopen(AVIOContext **s, const char *filename, int flags) -{ - return avio_open(s, filename, flags); -} -int url_fclose(AVIOContext *s) -{ - return avio_close(s); -} -int64_t url_fseek(AVIOContext *s, int64_t offset, int whence) -{ - return avio_seek(s, offset, whence); -} -int64_t url_fsize(AVIOContext *s) -{ - return avio_size(s); -} -int url_setbufsize(AVIOContext *s, int buf_size) -{ - return ffio_set_buf_size(s, buf_size); -} -int url_fprintf(AVIOContext *s, const char *fmt, ...) -{ - va_list ap; - char buf[4096]; - int ret; - - va_start(ap, fmt); - ret = vsnprintf(buf, sizeof(buf), fmt, ap); - va_end(ap); - avio_write(s, buf, strlen(buf)); - return ret; -} -void put_flush_packet(AVIOContext *s) -{ - avio_flush(s); -} -int av_url_read_fpause(AVIOContext *s, int pause) -{ - return avio_pause(s, pause); -} -int64_t av_url_read_fseek(AVIOContext *s, int stream_index, - int64_t timestamp, int flags) -{ - return avio_seek_time(s, stream_index, timestamp, flags); -} -void init_checksum(AVIOContext *s, - unsigned long (*update_checksum)(unsigned long c, const uint8_t *p, unsigned int len), - unsigned long checksum) -{ - ffio_init_checksum(s, update_checksum, checksum); -} -unsigned long get_checksum(AVIOContext *s) -{ - return ffio_get_checksum(s); -} -int url_open_dyn_buf(AVIOContext **s) -{ - return avio_open_dyn_buf(s); -} -int url_open_dyn_packet_buf(AVIOContext **s, int max_packet_size) -{ - return ffio_open_dyn_packet_buf(s, max_packet_size); -} -int url_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer) -{ - return avio_close_dyn_buf(s, pbuffer); -} -int url_fdopen(AVIOContext **s, URLContext *h) -{ - return ffio_fdopen(s, h); -} -#endif - int avio_put_str(AVIOContext *s, const char *str) { int len = 1; @@ -557,15 +367,6 @@ void avio_wb24(AVIOContext *s, unsigned int val) avio_w8(s, val); } -#if FF_API_OLD_AVIO -void put_tag(AVIOContext *s, const char *tag) -{ - while (*tag) { - avio_w8(s, *tag++); - } -} -#endif - /* Input stream */ static void fill_buffer(AVIOContext *s) @@ -647,17 +448,6 @@ int avio_r8(AVIOContext *s) return 0; } -#if FF_API_OLD_AVIO -int url_fgetc(AVIOContext *s) -{ - if (s->buf_ptr >= s->buf_end) - fill_buffer(s); - if (s->buf_ptr < s->buf_end) - return *s->buf_ptr++; - return URL_EOF; -} -#endif - int avio_read(AVIOContext *s, unsigned char *buf, int size) { int len, size1; @@ -783,14 +573,6 @@ unsigned int avio_rb32(AVIOContext *s) return val; } -#if FF_API_OLD_AVIO -char *get_strz(AVIOContext *s, char *buf, int maxlen) -{ - avio_get_str(s, INT_MAX, buf, maxlen); - return buf; -} -#endif - int ff_get_line(AVIOContext *s, char *buf, int maxlen) { int i = 0; @@ -888,19 +670,13 @@ int ffio_fdopen(AVIOContext **s, URLContext *h) av_free(buffer); return AVERROR(ENOMEM); } - -#if FF_API_OLD_AVIO - (*s)->is_streamed = h->is_streamed; -#endif (*s)->seekable = h->is_streamed ? 0 : AVIO_SEEKABLE_NORMAL; (*s)->max_packet_size = max_packet_size; if(h->prot) { (*s)->read_pause = (int (*)(void *, int))h->prot->url_read_pause; (*s)->read_seek = (int64_t (*)(void *, int, int64_t, int))h->prot->url_read_seek; } -#if !FF_API_OLD_AVIO (*s)->av_class = &ffio_url_class; -#endif return 0; } @@ -1003,13 +779,6 @@ int avio_close(AVIOContext *s) return ffurl_close(h); } -#if FF_API_OLD_AVIO -URLContext *url_fileno(AVIOContext *s) -{ - return s->opaque; -} -#endif - int avio_printf(AVIOContext *s, const char *fmt, ...) { va_list ap; @@ -1023,34 +792,6 @@ int avio_printf(AVIOContext *s, const char *fmt, ...) return ret; } -#if FF_API_OLD_AVIO -char *url_fgets(AVIOContext *s, char *buf, int buf_size) -{ - int c; - char *q; - - c = avio_r8(s); - if (url_feof(s)) - return NULL; - q = buf; - for(;;) { - if (url_feof(s) || c == '\n') - break; - if ((q - buf) < buf_size - 1) - *q++ = c; - c = avio_r8(s); - } - if (buf_size > 0) - *q = '\0'; - return buf; -} - -int url_fget_max_packet_size(AVIOContext *s) -{ - return s->max_packet_size; -} -#endif - int avio_pause(AVIOContext *s, int pause) { if (!s->read_pause) @@ -1078,29 +819,6 @@ int64_t avio_seek_time(AVIOContext *s, int stream_index, return ret; } -/* buffer handling */ -#if FF_API_OLD_AVIO -int url_open_buf(AVIOContext **s, uint8_t *buf, int buf_size, int flags) -{ - int ret; - *s = av_mallocz(sizeof(AVIOContext)); - if(!*s) - return AVERROR(ENOMEM); - ret = ffio_init_context(*s, buf, buf_size, - flags & AVIO_FLAG_WRITE, - NULL, NULL, NULL, NULL); - if(ret != 0) - av_freep(s); - return ret; -} - -int url_close_buf(AVIOContext *s) -{ - avio_flush(s); - return s->buf_ptr - s->buffer; -} -#endif - /* output in a dynamic buffer */ typedef struct DynBuffer { diff --git a/libavformat/avisynth.c b/libavformat/avisynth.c index 17ff5a88a3..13b5f4309c 100644 --- a/libavformat/avisynth.c +++ b/libavformat/avisynth.c @@ -41,7 +41,7 @@ typedef struct { int next_stream; } AVISynthContext; -static int avisynth_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int avisynth_read_header(AVFormatContext *s) { AVISynthContext *avs = s->priv_data; HRESULT res; diff --git a/libavformat/avs.c b/libavformat/avs.c index 492cb0b0c6..ed98ad7313 100644 --- a/libavformat/avs.c +++ b/libavformat/avs.c @@ -55,7 +55,7 @@ static int avs_probe(AVProbeData * p) return 0; } -static int avs_read_header(AVFormatContext * s, AVFormatParameters * ap) +static int avs_read_header(AVFormatContext * s) { AvsFormat *avs = s->priv_data; diff --git a/libavformat/bethsoftvid.c b/libavformat/bethsoftvid.c index 0a24ce51c0..e1786c9351 100644 --- a/libavformat/bethsoftvid.c +++ b/libavformat/bethsoftvid.c @@ -57,8 +57,7 @@ static int vid_probe(AVProbeData *p) return AVPROBE_SCORE_MAX; } -static int vid_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int vid_read_header(AVFormatContext *s) { BVID_DemuxContext *vid = s->priv_data; AVIOContext *pb = s->pb; diff --git a/libavformat/bfi.c b/libavformat/bfi.c index 3886d4bedd..97fa8025e7 100644 --- a/libavformat/bfi.c +++ b/libavformat/bfi.c @@ -47,7 +47,7 @@ static int bfi_probe(AVProbeData * p) return 0; } -static int bfi_read_header(AVFormatContext * s, AVFormatParameters * ap) +static int bfi_read_header(AVFormatContext * s) { BFIContext *bfi = s->priv_data; AVIOContext *pb = s->pb; diff --git a/libavformat/bink.c b/libavformat/bink.c index beceffd88d..20cf609cd0 100644 --- a/libavformat/bink.c +++ b/libavformat/bink.c @@ -68,7 +68,7 @@ static int probe(AVProbeData *p) return 0; } -static int read_header(AVFormatContext *s, AVFormatParameters *ap) +static int read_header(AVFormatContext *s) { BinkDemuxContext *bink = s->priv_data; AVIOContext *pb = s->pb; diff --git a/libavformat/bintext.c b/libavformat/bintext.c index 1c84092cbc..d9395f0798 100644 --- a/libavformat/bintext.c +++ b/libavformat/bintext.c @@ -99,8 +99,7 @@ static void predict_width(AVCodecContext *avctx, uint64_t fsize, int got_width) avctx->width = fsize > 4000 ? (160<<3) : (80<<3); } -static AVStream * init_stream(AVFormatContext *s, - AVFormatParameters *ap) +static AVStream * init_stream(AVFormatContext *s) { BinDemuxContext *bin = s->priv_data; AVStream *st = avformat_new_stream(s, NULL); @@ -109,27 +108,26 @@ static AVStream * init_stream(AVFormatContext *s, st->codec->codec_tag = 0; st->codec->codec_type = AVMEDIA_TYPE_VIDEO; - if (!ap->time_base.num) { +// if (!ap->time_base.num) { avpriv_set_pts_info(st, 60, 1, 25); - } else { - avpriv_set_pts_info(st, 60, ap->time_base.num, ap->time_base.den); - } +// } else { +// avpriv_set_pts_info(st, 60, ap->time_base.num, ap->time_base.den); +// } /* simulate tty display speed */ - bin->chars_per_frame = FFMAX(av_q2d(st->time_base) * (ap->sample_rate ? ap->sample_rate : LINE_RATE), 1); + bin->chars_per_frame = FFMAX(av_q2d(st->time_base) * (/*ap->sample_rate ? ap->sample_rate :*/ LINE_RATE), 1); - st->codec->width = ap->width ? ap->width : (80<<3); - st->codec->height = ap->height ? ap->height : (25<<4); + st->codec->width = /*ap->width ? ap->width :*/ (80<<3); + st->codec->height = /*ap->height ? ap->height :*/ (25<<4); return st; } -static int bintext_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int bintext_read_header(AVFormatContext *s) { BinDemuxContext *bin = s->priv_data; AVIOContext *pb = s->pb; - AVStream *st = init_stream(s, ap); + AVStream *st = init_stream(s); if (!st) return AVERROR(ENOMEM); st->codec->codec_id = CODEC_ID_BINTEXT; @@ -146,9 +144,9 @@ static int bintext_read_header(AVFormatContext *s, bin->fsize = avio_size(pb); if (ff_sauce_read(s, &bin->fsize, &got_width, 0) < 0) next_tag_read(s, &bin->fsize); - if (!ap->width) +// if (!ap->width) predict_width(st->codec, bin->fsize, got_width); - if (!ap->height) +// if (!ap->height) calculate_height(st->codec, bin->fsize); avio_seek(pb, 0, SEEK_SET); } @@ -168,14 +166,13 @@ static int xbin_probe(AVProbeData *p) return 0; } -static int xbin_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int xbin_read_header(AVFormatContext *s) { BinDemuxContext *bin = s->priv_data; AVIOContext *pb = s->pb; char fontheight, flags; - AVStream *st = init_stream(s, ap); + AVStream *st = init_stream(s); if (!st) return AVERROR(ENOMEM); @@ -212,8 +209,7 @@ static int xbin_read_header(AVFormatContext *s, #endif /* CONFIG_XBIN_DEMUXER */ #if CONFIG_ADF_DEMUXER -static int adf_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int adf_read_header(AVFormatContext *s) { BinDemuxContext *bin = s->priv_data; AVIOContext *pb = s->pb; @@ -222,7 +218,7 @@ static int adf_read_header(AVFormatContext *s, if (avio_r8(pb) != 1) return AVERROR_INVALIDDATA; - st = init_stream(s, ap); + st = init_stream(s); if (!st) return AVERROR(ENOMEM); st->codec->codec_id = CODEC_ID_BINTEXT; @@ -247,7 +243,7 @@ static int adf_read_header(AVFormatContext *s, bin->fsize = avio_size(pb) - 1 - 192 - 4096; st->codec->width = 80<<3; ff_sauce_read(s, &bin->fsize, &got_width, 0); - if (!ap->height) +// if (!ap->height) calculate_height(st->codec, bin->fsize); avio_seek(pb, 1 + 192 + 4096, SEEK_SET); } @@ -269,8 +265,7 @@ static int idf_probe(AVProbeData *p) return 0; } -static int idf_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int idf_read_header(AVFormatContext *s) { BinDemuxContext *bin = s->priv_data; AVIOContext *pb = s->pb; @@ -280,7 +275,7 @@ static int idf_read_header(AVFormatContext *s, if (!pb->seekable) return AVERROR(EIO); - st = init_stream(s, ap); + st = init_stream(s); if (!st) return AVERROR(ENOMEM); st->codec->codec_id = CODEC_ID_IDF; @@ -301,7 +296,7 @@ static int idf_read_header(AVFormatContext *s, bin->fsize = avio_size(pb) - 12 - 4096 - 48; ff_sauce_read(s, &bin->fsize, &got_width, 0); - if (!ap->height) +// if (!ap->height) calculate_height(st->codec, bin->fsize); avio_seek(pb, 12, SEEK_SET); return 0; diff --git a/libavformat/bit.c b/libavformat/bit.c index 1249ea1aee..b0931f429b 100644 --- a/libavformat/bit.c +++ b/libavformat/bit.c @@ -47,7 +47,7 @@ static int probe(AVProbeData *p) return AVPROBE_SCORE_MAX/2; } -static int read_header(AVFormatContext *s, AVFormatParameters *ap) +static int read_header(AVFormatContext *s) { AVStream* st; diff --git a/libavformat/bmv.c b/libavformat/bmv.c index 1077efa573..ebf59e9f23 100644 --- a/libavformat/bmv.c +++ b/libavformat/bmv.c @@ -38,7 +38,7 @@ typedef struct BMVContext { int64_t audio_pos; } BMVContext; -static int bmv_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int bmv_read_header(AVFormatContext *s) { AVStream *st, *ast; BMVContext *c = s->priv_data; diff --git a/libavformat/c93.c b/libavformat/c93.c index b9f38a7dea..a5c2b5d7d6 100644 --- a/libavformat/c93.c +++ b/libavformat/c93.c @@ -57,8 +57,7 @@ static int probe(AVProbeData *p) return AVPROBE_SCORE_MAX; } -static int read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int read_header(AVFormatContext *s) { AVStream *video; AVIOContext *pb = s->pb; diff --git a/libavformat/cafdec.c b/libavformat/cafdec.c index c31aa4f077..8545c534ec 100644 --- a/libavformat/cafdec.c +++ b/libavformat/cafdec.c @@ -204,8 +204,7 @@ static void read_info_chunk(AVFormatContext *s, int64_t size) } } -static int read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int read_header(AVFormatContext *s) { AVIOContext *pb = s->pb; CaffContext *caf = s->priv_data; diff --git a/libavformat/cdg.c b/libavformat/cdg.c index 09ba87b060..e7788f35d2 100644 --- a/libavformat/cdg.c +++ b/libavformat/cdg.c @@ -26,7 +26,7 @@ #define CDG_COMMAND 0x09 #define CDG_MASK 0x3F -static int read_header(AVFormatContext *s, AVFormatParameters *ap) +static int read_header(AVFormatContext *s) { AVStream *vst; int ret; diff --git a/libavformat/daud.c b/libavformat/daud.c index aa70800085..de85a5fb84 100644 --- a/libavformat/daud.c +++ b/libavformat/daud.c @@ -20,7 +20,7 @@ */ #include "avformat.h" -static int daud_header(AVFormatContext *s, AVFormatParameters *ap) { +static int daud_header(AVFormatContext *s) { AVStream *st = avformat_new_stream(s, NULL); if (!st) return AVERROR(ENOMEM); diff --git a/libavformat/dfa.c b/libavformat/dfa.c index 25084ef76d..a838b5bed1 100644 --- a/libavformat/dfa.c +++ b/libavformat/dfa.c @@ -31,8 +31,7 @@ static int dfa_probe(AVProbeData *p) return AVPROBE_SCORE_MAX; } -static int dfa_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int dfa_read_header(AVFormatContext *s) { AVIOContext *pb = s->pb; AVStream *st; diff --git a/libavformat/dsicin.c b/libavformat/dsicin.c index e0db8ba10e..d525da650d 100644 --- a/libavformat/dsicin.c +++ b/libavformat/dsicin.c @@ -92,7 +92,7 @@ static int cin_read_file_header(CinDemuxContext *cin, AVIOContext *pb) { return 0; } -static int cin_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int cin_read_header(AVFormatContext *s) { int rc; CinDemuxContext *cin = s->priv_data; diff --git a/libavformat/dv.c b/libavformat/dv.c index 666e3317ab..106a878f7d 100644 --- a/libavformat/dv.c +++ b/libavformat/dv.c @@ -485,8 +485,7 @@ finish: return ret; } -static int dv_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int dv_read_header(AVFormatContext *s) { unsigned state, marker_pos = 0; RawDVContext *c = s->priv_data; diff --git a/libavformat/dvenc.c b/libavformat/dvenc.c index 049bb7b3d2..205d3db027 100644 --- a/libavformat/dvenc.c +++ b/libavformat/dvenc.c @@ -333,11 +333,6 @@ static DVMuxContext* dv_init_mux(AVFormatContext* s) c->frames = 0; c->has_audio = 0; c->has_video = 0; -#if FF_API_TIMESTAMP - if (s->timestamp) - c->start_time = s->timestamp; - else -#endif if (t = av_dict_get(s->metadata, "creation_time", NULL, 0)) c->start_time = ff_iso8601_to_unix_time(t->value); diff --git a/libavformat/dxa.c b/libavformat/dxa.c index 54bea27246..f4e13835b2 100644 --- a/libavformat/dxa.c +++ b/libavformat/dxa.c @@ -51,7 +51,7 @@ static int dxa_probe(AVProbeData *p) return 0; } -static int dxa_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int dxa_read_header(AVFormatContext *s) { AVIOContext *pb = s->pb; DXAContext *c = s->priv_data; diff --git a/libavformat/eacdata.c b/libavformat/eacdata.c index 2311f0bcd1..313cbe2aec 100644 --- a/libavformat/eacdata.c +++ b/libavformat/eacdata.c @@ -45,7 +45,7 @@ static int cdata_probe(AVProbeData *p) return 0; } -static int cdata_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int cdata_read_header(AVFormatContext *s) { CdataDemuxContext *cdata = s->priv_data; AVIOContext *pb = s->pb; diff --git a/libavformat/electronicarts.c b/libavformat/electronicarts.c index a0007d2982..c901931dec 100644 --- a/libavformat/electronicarts.c +++ b/libavformat/electronicarts.c @@ -398,8 +398,7 @@ static int ea_probe(AVProbeData *p) return AVPROBE_SCORE_MAX; } -static int ea_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int ea_read_header(AVFormatContext *s) { EaDemuxContext *ea = s->priv_data; AVStream *st; diff --git a/libavformat/ffmdec.c b/libavformat/ffmdec.c index 4b8e939e66..f500511d44 100644 --- a/libavformat/ffmdec.c +++ b/libavformat/ffmdec.c @@ -24,6 +24,7 @@ #include "avformat.h" #include "internal.h" #include "ffm.h" +#include "avio_internal.h" #if CONFIG_FFSERVER #include <unistd.h> @@ -124,7 +125,7 @@ static int ffm_read_data(AVFormatContext *s, retry_read: if (pb->buffer_size != ffm->packet_size) { int64_t tell = avio_tell(pb); - url_setbufsize(pb, ffm->packet_size); + ffio_set_buf_size(pb, ffm->packet_size); avio_seek(pb, tell, SEEK_SET); } id = avio_rb16(pb); /* PACKET_ID */ @@ -264,7 +265,7 @@ static int ffm_close(AVFormatContext *s) } -static int ffm_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int ffm_read_header(AVFormatContext *s) { FFMContext *ffm = s->priv_data; AVStream *st; @@ -350,7 +351,6 @@ static int ffm_read_header(AVFormatContext *s, AVFormatParameters *ap) codec->thread_count = avio_r8(pb); codec->coder_type = avio_rb32(pb); codec->me_cmp = avio_rb32(pb); - codec->partitions = avio_rb32(pb); codec->me_subpel_quality = avio_rb32(pb); codec->me_range = avio_rb32(pb); codec->keyint_min = avio_rb32(pb); @@ -360,7 +360,6 @@ static int ffm_read_header(AVFormatContext *s, AVFormatParameters *ap) codec->qblur = av_int2double(avio_rb64(pb)); codec->max_qdiff = avio_rb32(pb); codec->refs = avio_rb32(pb); - codec->directpred = avio_rb32(pb); break; case AVMEDIA_TYPE_AUDIO: codec->sample_rate = avio_rb32(pb); diff --git a/libavformat/ffmenc.c b/libavformat/ffmenc.c index 69d924d09c..eb21fd79bb 100644 --- a/libavformat/ffmenc.c +++ b/libavformat/ffmenc.c @@ -157,7 +157,6 @@ static int ffm_write_header(AVFormatContext *s) avio_w8(pb, codec->thread_count); avio_wb32(pb, codec->coder_type); avio_wb32(pb, codec->me_cmp); - avio_wb32(pb, codec->partitions); avio_wb32(pb, codec->me_subpel_quality); avio_wb32(pb, codec->me_range); avio_wb32(pb, codec->keyint_min); @@ -167,7 +166,6 @@ static int ffm_write_header(AVFormatContext *s) avio_wb64(pb, av_double2int(codec->qblur)); avio_wb32(pb, codec->max_qdiff); avio_wb32(pb, codec->refs); - avio_wb32(pb, codec->directpred); break; case AVMEDIA_TYPE_AUDIO: avio_wb32(pb, codec->sample_rate); diff --git a/libavformat/ffmetadec.c b/libavformat/ffmetadec.c index 1d223fb9e0..98620bd321 100644 --- a/libavformat/ffmetadec.c +++ b/libavformat/ffmetadec.c @@ -123,7 +123,7 @@ static int read_tag(uint8_t *line, AVDictionary **m) return 0; } -static int read_header(AVFormatContext *s, AVFormatParameters *ap) +static int read_header(AVFormatContext *s) { AVDictionary **m = &s->metadata; uint8_t line[1024]; diff --git a/libavformat/filmstripdec.c b/libavformat/filmstripdec.c index 24033388d8..0038dd3749 100644 --- a/libavformat/filmstripdec.c +++ b/libavformat/filmstripdec.c @@ -34,8 +34,7 @@ typedef struct { int leading; } FilmstripDemuxContext; -static int read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int read_header(AVFormatContext *s) { FilmstripDemuxContext *film = s->priv_data; AVIOContext *pb = s->pb; diff --git a/libavformat/flacdec.c b/libavformat/flacdec.c index 070f9af3f6..65a75b2c48 100644 --- a/libavformat/flacdec.c +++ b/libavformat/flacdec.c @@ -27,8 +27,7 @@ #include "vorbiscomment.h" #include "libavcodec/bytestream.h" -static int flac_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int flac_read_header(AVFormatContext *s) { int ret, metadata_last=0, metadata_type, metadata_size, found_streaminfo=0; uint8_t header[4]; diff --git a/libavformat/flic.c b/libavformat/flic.c index 89652a20f6..3ad7c86cdc 100644 --- a/libavformat/flic.c +++ b/libavformat/flic.c @@ -83,8 +83,7 @@ static int flic_probe(AVProbeData *p) return AVPROBE_SCORE_MAX; } -static int flic_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int flic_read_header(AVFormatContext *s) { FlicDemuxContext *flic = s->priv_data; AVIOContext *pb = s->pb; diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c index 7705c480a9..1f1424e949 100644 --- a/libavformat/flvdec.c +++ b/libavformat/flvdec.c @@ -378,8 +378,7 @@ static AVStream *create_stream(AVFormatContext *s, int stream_type){ return st; } -static int flv_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int flv_read_header(AVFormatContext *s) { int offset, flags; diff --git a/libavformat/g723_1.c b/libavformat/g723_1.c index 00cfe16266..a12a47a1ae 100644 --- a/libavformat/g723_1.c +++ b/libavformat/g723_1.c @@ -29,7 +29,7 @@ static const uint8_t frame_size[4] = {24, 20, 4, 1}; -static int g723_1_init(AVFormatContext *s, AVFormatParameters *ap) +static int g723_1_init(AVFormatContext *s) { AVStream *st; diff --git a/libavformat/g729dec.c b/libavformat/g729dec.c index 82b1198c55..d56da5cd7b 100644 --- a/libavformat/g729dec.c +++ b/libavformat/g729dec.c @@ -29,7 +29,7 @@ typedef struct G729DemuxerContext { int bit_rate; } G729DemuxerContext; -static int g729_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int g729_read_header(AVFormatContext *s) { AVStream* st; G729DemuxerContext *s1 = s->priv_data; diff --git a/libavformat/gif.c b/libavformat/gif.c index 200bc70573..dc63af9778 100644 --- a/libavformat/gif.c +++ b/libavformat/gif.c @@ -288,11 +288,6 @@ static int gif_write_header(AVFormatContext *s) return AVERROR(EIO); } -#if FF_API_LOOP_OUTPUT - if (s->loop_output) - gif->loop = s->loop_output; -#endif - gif_image_write_header(pb, width, height, gif->loop, NULL); avio_flush(s->pb); diff --git a/libavformat/gsmdec.c b/libavformat/gsmdec.c index 443f820ad8..5d6495860a 100644 --- a/libavformat/gsmdec.c +++ b/libavformat/gsmdec.c @@ -54,7 +54,7 @@ static int gsm_read_packet(AVFormatContext *s, AVPacket *pkt) return 0; } -static int gsm_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int gsm_read_header(AVFormatContext *s) { GSMDemuxerContext *c = s->priv_data; AVStream *st = avformat_new_stream(s, NULL); diff --git a/libavformat/gxf.c b/libavformat/gxf.c index e773ba7775..e557370f87 100644 --- a/libavformat/gxf.c +++ b/libavformat/gxf.c @@ -284,7 +284,7 @@ static void gxf_read_index(AVFormatContext *s, int pkt_len) { avio_skip(pb, pkt_len); } -static int gxf_header(AVFormatContext *s, AVFormatParameters *ap) { +static int gxf_header(AVFormatContext *s) { AVIOContext *pb = s->pb; GXFPktType pkt_type; int map_len; diff --git a/libavformat/gxfenc.c b/libavformat/gxfenc.c index 47b64efc9f..752e042cdd 100644 --- a/libavformat/gxfenc.c +++ b/libavformat/gxfenc.c @@ -421,11 +421,6 @@ static int gxf_write_umf_material_description(AVFormatContext *s) uint32_t timecode_in; // timecode at mark in uint32_t timecode_out; // timecode at mark out -#if FF_API_TIMESTAMP - if (s->timestamp) - timestamp = s->timestamp; - else -#endif if (t = av_dict_get(s->metadata, "creation_time", NULL, 0)) timestamp = ff_iso8601_to_unix_time(t->value); diff --git a/libavformat/icodec.c b/libavformat/icodec.c index eab0478211..81ad0b0824 100644 --- a/libavformat/icodec.c +++ b/libavformat/icodec.c @@ -49,7 +49,7 @@ static int probe(AVProbeData *p) return 0; } -static int read_header(AVFormatContext *s, AVFormatParameters *ap) +static int read_header(AVFormatContext *s) { IcoDemuxContext *ico = s->priv_data; AVIOContext *pb = s->pb; diff --git a/libavformat/idcin.c b/libavformat/idcin.c index 57f81c813d..fd4504a566 100644 --- a/libavformat/idcin.c +++ b/libavformat/idcin.c @@ -138,8 +138,7 @@ static int idcin_probe(AVProbeData *p) return AVPROBE_SCORE_MAX / 2; } -static int idcin_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int idcin_read_header(AVFormatContext *s) { AVIOContext *pb = s->pb; IdcinDemuxContext *idcin = s->priv_data; diff --git a/libavformat/idroqdec.c b/libavformat/idroqdec.c index fffee9d76e..096ada2ba9 100644 --- a/libavformat/idroqdec.c +++ b/libavformat/idroqdec.c @@ -67,8 +67,7 @@ static int roq_probe(AVProbeData *p) return AVPROBE_SCORE_MAX; } -static int roq_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int roq_read_header(AVFormatContext *s) { RoqDemuxContext *roq = s->priv_data; AVIOContext *pb = s->pb; diff --git a/libavformat/iff.c b/libavformat/iff.c index ebc1c35ba5..6566a15ddb 100644 --- a/libavformat/iff.c +++ b/libavformat/iff.c @@ -126,8 +126,7 @@ static int iff_probe(AVProbeData *p) return 0; } -static int iff_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int iff_read_header(AVFormatContext *s) { IffDemuxContext *iff = s->priv_data; AVIOContext *pb = s->pb; diff --git a/libavformat/img2.c b/libavformat/img2.c index 8adba0ac5f..18b9cde230 100644 --- a/libavformat/img2.c +++ b/libavformat/img2.c @@ -205,13 +205,7 @@ enum CodecID ff_guess_image2_codec(const char *filename) return av_str2id(img_tags, filename); } -#if FF_API_GUESS_IMG2_CODEC -enum CodecID av_guess_image2_codec(const char *filename){ - return av_str2id(img_tags, filename); -} -#endif - -static int read_header(AVFormatContext *s1, AVFormatParameters *ap) +static int read_header(AVFormatContext *s1) { VideoData *s = s1->priv_data; int first_index, last_index, ret = 0; @@ -240,11 +234,6 @@ static int read_header(AVFormatContext *s1, AVFormatParameters *ap) return ret; } -#if FF_API_LOOP_INPUT - if (s1->loop_input) - s->loop = s1->loop_input; -#endif - av_strlcpy(s->path, s1->filename, sizeof(s->path)); s->img_number = 0; s->img_count = 0; diff --git a/libavformat/ipmovie.c b/libavformat/ipmovie.c index 12d5a39671..a60b961573 100644 --- a/libavformat/ipmovie.c +++ b/libavformat/ipmovie.c @@ -536,8 +536,7 @@ static int ipmovie_probe(AVProbeData *p) return 0; } -static int ipmovie_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int ipmovie_read_header(AVFormatContext *s) { IPMVEContext *ipmovie = s->priv_data; AVIOContext *pb = s->pb; diff --git a/libavformat/iss.c b/libavformat/iss.c index bbc8465b35..a60dc1f4a0 100644 --- a/libavformat/iss.c +++ b/libavformat/iss.c @@ -65,7 +65,7 @@ static int iss_probe(AVProbeData *p) return AVPROBE_SCORE_MAX; } -static av_cold int iss_read_header(AVFormatContext *s, AVFormatParameters *ap) +static av_cold int iss_read_header(AVFormatContext *s) { IssDemuxContext *iss = s->priv_data; AVIOContext *pb = s->pb; diff --git a/libavformat/iv8.c b/libavformat/iv8.c index fa77f82471..e431c342db 100644 --- a/libavformat/iv8.c +++ b/libavformat/iv8.c @@ -37,7 +37,7 @@ static int probe(AVProbeData *p) return 0; } -static int read_header(AVFormatContext *s, AVFormatParameters *ap) +static int read_header(AVFormatContext *s) { AVStream *st; diff --git a/libavformat/ivfdec.c b/libavformat/ivfdec.c index bc837a2b90..1a6e671be5 100644 --- a/libavformat/ivfdec.c +++ b/libavformat/ivfdec.c @@ -32,7 +32,7 @@ static int probe(AVProbeData *p) return 0; } -static int read_header(AVFormatContext *s, AVFormatParameters *ap) +static int read_header(AVFormatContext *s) { AVStream *st; AVRational time_base; diff --git a/libavformat/jvdec.c b/libavformat/jvdec.c index 212cd8aae7..31cba6f468 100644 --- a/libavformat/jvdec.c +++ b/libavformat/jvdec.c @@ -58,8 +58,7 @@ static int read_probe(AVProbeData *pd) return 0; } -static int read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int read_header(AVFormatContext *s) { JVDemuxContext *jv = s->priv_data; AVIOContext *pb = s->pb; diff --git a/libavformat/libmodplug.c b/libavformat/libmodplug.c index dfbf67c2d2..a662dbafbc 100644 --- a/libavformat/libmodplug.c +++ b/libavformat/libmodplug.c @@ -160,7 +160,7 @@ static int modplug_load_metadata(AVFormatContext *s) #define AUDIO_PKT_SIZE 512 -static int modplug_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int modplug_read_header(AVFormatContext *s) { AVStream *st; AVIOContext *pb = s->pb; diff --git a/libavformat/libnut.c b/libavformat/libnut.c index 757f9d252a..c6d552db59 100644 --- a/libavformat/libnut.c +++ b/libavformat/libnut.c @@ -188,7 +188,7 @@ static off_t av_seek(void * h, long long pos, int whence) { return avio_seek(bc, pos, whence); } -static int nut_read_header(AVFormatContext * avf, AVFormatParameters * ap) { +static int nut_read_header(AVFormatContext * avf) { NUTContext * priv = avf->priv_data; AVIOContext * bc = avf->pb; nut_demuxer_opts_tt dopts = { diff --git a/libavformat/lmlm4.c b/libavformat/lmlm4.c index 865cb2da90..24ae289cbe 100644 --- a/libavformat/lmlm4.c +++ b/libavformat/lmlm4.c @@ -58,7 +58,7 @@ static int lmlm4_probe(AVProbeData * pd) { return 0; } -static int lmlm4_read_header(AVFormatContext *s, AVFormatParameters *ap) { +static int lmlm4_read_header(AVFormatContext *s) { AVStream *st; if (!(st = avformat_new_stream(s, NULL))) diff --git a/libavformat/loasdec.c b/libavformat/loasdec.c index e48c21905a..5c8a8be573 100644 --- a/libavformat/loasdec.c +++ b/libavformat/loasdec.c @@ -59,8 +59,7 @@ static int loas_probe(AVProbeData *p) else return 0; } -static int loas_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int loas_read_header(AVFormatContext *s) { AVStream *st; diff --git a/libavformat/lxfdec.c b/libavformat/lxfdec.c index 7952dadfbb..6969b144ab 100644 --- a/libavformat/lxfdec.c +++ b/libavformat/lxfdec.c @@ -196,7 +196,7 @@ static int get_packet_header(AVFormatContext *s, uint8_t *header, uint32_t *form return ret; } -static int lxf_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int lxf_read_header(AVFormatContext *s) { LXFDemuxContext *lxf = s->priv_data; AVIOContext *pb = s->pb; diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index b7f7740647..df54762c5e 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -1309,7 +1309,7 @@ static int matroska_aac_sri(int samplerate) return sri; } -static int matroska_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int matroska_read_header(AVFormatContext *s) { MatroskaDemuxContext *matroska = s->priv_data; EbmlList *attachements_list = &matroska->attachments; diff --git a/libavformat/metadata.c b/libavformat/metadata.c index 30774287b0..1660a604f1 100644 --- a/libavformat/metadata.c +++ b/libavformat/metadata.c @@ -23,35 +23,6 @@ #include "libavutil/dict.h" #include "libavutil/avstring.h" -#if FF_API_OLD_METADATA2 -AVDictionaryEntry * -av_metadata_get(AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags) -{ - return av_dict_get(m, key, prev, flags); -} - -int av_metadata_set2(AVDictionary **pm, const char *key, const char *value, int flags) -{ - return av_dict_set(pm, key, value, flags); -} - -void av_metadata_conv(AVFormatContext *ctx, const AVMetadataConv *d_conv, - const AVMetadataConv *s_conv) -{ - return; -} - -void av_metadata_free(AVDictionary **pm) -{ - av_dict_free(pm); -} - -void av_metadata_copy(AVDictionary **dst, AVDictionary *src, int flags) -{ - av_dict_copy(dst, src, flags); -} -#endif - void ff_metadata_conv(AVDictionary **pm, const AVMetadataConv *d_conv, const AVMetadataConv *s_conv) { diff --git a/libavformat/metadata.h b/libavformat/metadata.h index d826c6f144..6586094e82 100644 --- a/libavformat/metadata.h +++ b/libavformat/metadata.h @@ -31,13 +31,10 @@ #include "avformat.h" #include "libavutil/dict.h" -struct AVMetadataConv{ +typedef struct AVMetadataConv { const char *native; const char *generic; -}; -#if !FF_API_OLD_METADATA2 -typedef struct AVMetadataConv AVMetadataConv; -#endif +} AVMetadataConv; void ff_metadata_conv(AVDictionary **pm, const AVMetadataConv *d_conv, const AVMetadataConv *s_conv); diff --git a/libavformat/microdvddec.c b/libavformat/microdvddec.c index 748ebdfc48..b1b784c883 100644 --- a/libavformat/microdvddec.c +++ b/libavformat/microdvddec.c @@ -50,7 +50,7 @@ static int microdvd_probe(AVProbeData *p) return AVPROBE_SCORE_MAX; } -static int microdvd_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int microdvd_read_header(AVFormatContext *s) { AVRational pts_info = (AVRational){ 2997, 125 }; /* default: 23.976 fps */ MicroDVDContext *microdvd = s->priv_data; diff --git a/libavformat/mkvtimestamp_v2.c b/libavformat/mkvtimestamp_v2.c index 469b75db41..b04c655f7f 100644 --- a/libavformat/mkvtimestamp_v2.c +++ b/libavformat/mkvtimestamp_v2.c @@ -25,7 +25,7 @@ static int write_header(AVFormatContext *s) { static const char *header = "# timecode format v2\n"; - put_buffer(s->pb, header, strlen(header)); + avio_write(s->pb, header, strlen(header)); avpriv_set_pts_info(s->streams[0], 64, 1, 1000); return 0; } @@ -36,8 +36,8 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt) if (pkt->stream_index) av_log(s, AV_LOG_WARNING, "More than one stream unsupported\n"); snprintf(buf, sizeof(buf), "%" PRId64 "\n", pkt->dts); - put_buffer(s->pb, buf, strlen(buf)); - put_flush_packet(s->pb); + avio_write(s->pb, buf, strlen(buf)); + avio_flush(s->pb); return 0; } diff --git a/libavformat/mm.c b/libavformat/mm.c index 8bb933babe..91d22d09d8 100644 --- a/libavformat/mm.c +++ b/libavformat/mm.c @@ -81,8 +81,7 @@ static int probe(AVProbeData *p) return AVPROBE_SCORE_MAX / 2; } -static int read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int read_header(AVFormatContext *s) { MmDemuxContext *mm = s->priv_data; AVIOContext *pb = s->pb; diff --git a/libavformat/mmf.c b/libavformat/mmf.c index facf8f1278..cbbb7dfed7 100644 --- a/libavformat/mmf.c +++ b/libavformat/mmf.c @@ -180,8 +180,7 @@ static int mmf_probe(AVProbeData *p) } /* mmf input */ -static int mmf_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int mmf_read_header(AVFormatContext *s) { MMFContext *mmf = s->priv_data; unsigned int tag; diff --git a/libavformat/mov.c b/libavformat/mov.c index b584c0da42..c46a2e4f02 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -2694,7 +2694,7 @@ static int mov_read_timecode_track(AVFormatContext *s, AVStream *st) return 0; } -static int mov_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int mov_read_header(AVFormatContext *s) { MOVContext *mov = s->priv_data; AVIOContext *pb = s->pb; diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 6ed1005d33..4574df3de9 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -50,6 +50,7 @@ static const AVOption options[] = { { "frag_keyframe", "Fragment at video keyframes", 0, AV_OPT_TYPE_CONST, {.dbl = FF_MOV_FLAG_FRAG_KEYFRAME}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "movflags" }, { "separate_moof", "Write separate moof/mdat atoms for each track", 0, AV_OPT_TYPE_CONST, {.dbl = FF_MOV_FLAG_SEPARATE_MOOF}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "movflags" }, { "frag_custom", "Flush fragments on caller requests", 0, AV_OPT_TYPE_CONST, {.dbl = FF_MOV_FLAG_FRAG_CUSTOM}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "movflags" }, + { "isml", "Create a live smooth streaming feed (for pushing to a publishing point)", 0, AV_OPT_TYPE_CONST, {.dbl = FF_MOV_FLAG_ISML}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "movflags" }, FF_RTP_FLAG_OPTS(MOVMuxContext, rtp_flags), { "skip_iods", "Skip writing iods atom.", offsetof(MOVMuxContext, iods_skip), AV_OPT_TYPE_INT, {.dbl = 1}, 0, 1, AV_OPT_FLAG_ENCODING_PARAM}, { "iods_audio_profile", "iods audio profile atom.", offsetof(MOVMuxContext, iods_audio_profile), AV_OPT_TYPE_INT, {.dbl = -1}, -1, 255, AV_OPT_FLAG_ENCODING_PARAM}, @@ -1975,6 +1976,128 @@ static int mov_write_moov_tag(AVIOContext *pb, MOVMuxContext *mov, return updateSize(pb, pos); } +static void param_write_int(AVIOContext *pb, const char *name, int value) +{ + avio_printf(pb, "<param name=\"%s\" value=\"%d\" valuetype=\"data\"/>\n", name, value); +} + +static void param_write_string(AVIOContext *pb, const char *name, const char *value) +{ + avio_printf(pb, "<param name=\"%s\" value=\"%s\" valuetype=\"data\"/>\n", name, value); +} + +static void param_write_hex(AVIOContext *pb, const char *name, const uint8_t *value, int len) +{ + char buf[150]; + len = FFMIN(sizeof(buf)/2 - 1, len); + ff_data_to_hex(buf, value, len, 0); + buf[2*len] = '\0'; + avio_printf(pb, "<param name=\"%s\" value=\"%s\" valuetype=\"data\"/>\n", name, buf); +} + +static void write_h264_extradata(AVIOContext *pb, AVCodecContext *enc) +{ + uint16_t sps_size, pps_size, len; + char buf[150]; + sps_size = AV_RB16(&enc->extradata[6]); + if (11 + sps_size > enc->extradata_size) + return; + pps_size = AV_RB16(&enc->extradata[9 + sps_size]); + if (11 + sps_size + pps_size > enc->extradata_size) + return; + len = FFMIN(sizeof(buf)/2 - 1, sps_size); + ff_data_to_hex(buf, &enc->extradata[8], len, 0); + buf[2*len] = '\0'; + avio_printf(pb, "<param name=\"CodecPrivateData\" value=\"00000001%s", buf); + len = FFMIN(sizeof(buf)/2 - 1, pps_size); + ff_data_to_hex(buf, &enc->extradata[11 + sps_size], len, 0); + buf[2*len] = '\0'; + avio_printf(pb, "00000001%s\" valuetype=\"data\"/>\n", buf); +} + +static int mov_write_isml_manifest(AVIOContext *pb, MOVMuxContext *mov) +{ + int64_t pos = avio_tell(pb); + int i; + const uint8_t uuid[] = { + 0xa5, 0xd4, 0x0b, 0x30, 0xe8, 0x14, 0x11, 0xdd, + 0xba, 0x2f, 0x08, 0x00, 0x20, 0x0c, 0x9a, 0x66 + }; + + avio_wb32(pb, 0); + ffio_wfourcc(pb, "uuid"); + avio_write(pb, uuid, sizeof(uuid)); + avio_wb32(pb, 0); + + avio_printf(pb, "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"); + avio_printf(pb, "<smil xmlns=\"http://www.w3.org/2001/SMIL20/Language\">\n"); + avio_printf(pb, "<head>\n"); + avio_printf(pb, "<meta name=\"creator\" content=\"%s\" />\n", + LIBAVFORMAT_IDENT); + avio_printf(pb, "</head>\n"); + avio_printf(pb, "<body>\n"); + avio_printf(pb, "<switch>\n"); + for (i = 0; i < mov->nb_streams; i++) { + MOVTrack *track = &mov->tracks[i]; + const char *type; + /* track->trackID is initialized in write_moov, and thus isn't known + * here yet */ + int track_id = i + 1; + + if (track->enc->codec_type == AVMEDIA_TYPE_VIDEO) { + type = "video"; + } else if (track->enc->codec_type == AVMEDIA_TYPE_AUDIO) { + type = "audio"; + } else { + continue; + } + avio_printf(pb, "<%s systemBitrate=\"%d\">\n", type, + track->enc->bit_rate); + param_write_int(pb, "systemBitrate", track->enc->bit_rate); + param_write_int(pb, "trackID", track_id); + if (track->enc->codec_type == AVMEDIA_TYPE_VIDEO) { + if (track->enc->codec_id == CODEC_ID_H264 && + track->enc->extradata_size >= 11 && + track->enc->extradata[0] == 1) { + write_h264_extradata(pb, track->enc); + } else { + param_write_hex(pb, "CodecPrivateData", track->enc->extradata, + track->enc->extradata_size); + } + if (track->enc->codec_id == CODEC_ID_H264) { + param_write_string(pb, "FourCC", "H264"); + } else if (track->enc->codec_id == CODEC_ID_VC1) { + param_write_string(pb, "FourCC", "WVC1"); + } + param_write_int(pb, "MaxWidth", track->enc->width); + param_write_int(pb, "MaxHeight", track->enc->height); + param_write_int(pb, "DisplayWidth", track->enc->width); + param_write_int(pb, "DisplayHeight", track->enc->height); + } else { + if (track->enc->codec_id == CODEC_ID_AAC) { + param_write_string(pb, "FourCC", "AACL"); + } else if (track->enc->codec_id == CODEC_ID_WMAPRO) { + param_write_string(pb, "FourCC", "WMAP"); + } + param_write_hex(pb, "CodecPrivateData", track->enc->extradata, + track->enc->extradata_size); + param_write_int(pb, "AudioTag", ff_codec_get_tag(ff_codec_wav_tags, + track->enc->codec_id)); + param_write_int(pb, "Channels", track->enc->channels); + param_write_int(pb, "SamplingRate", track->enc->sample_rate); + param_write_int(pb, "BitsPerSample", 16); + param_write_int(pb, "PacketSize", track->enc->block_align ? + track->enc->block_align : 4); + } + avio_printf(pb, "</%s>\n", type); + } + avio_printf(pb, "</switch>\n"); + avio_printf(pb, "</body>\n"); + avio_printf(pb, "</smil>\n"); + + return updateSize(pb, pos); +} + static int mov_write_mfhd_tag(AVIOContext *pb, MOVMuxContext *mov) { avio_wb32(pb, 16); @@ -2245,6 +2368,10 @@ static int mov_write_mfra_tag(AVIOContext *pb, MOVMuxContext *mov) avio_wb32(pb, 0); /* size placeholder */ ffio_wfourcc(pb, "mfra"); + /* An empty mfra atom is enough to indicate to the publishing point that + * the stream has ended. */ + if (mov->flags & FF_MOV_FLAG_ISML) + return updateSize(pb, pos); for (i = 0; i < mov->nb_streams; i++) { MOVTrack *track = &mov->tracks[i]; @@ -2446,6 +2573,7 @@ static int mov_flush_fragment(AVFormatContext *s) mov->tracks[i].cluster[0].dts; mov->tracks[i].entry = 0; } + avio_flush(s->pb); return 0; } @@ -2485,6 +2613,7 @@ static int mov_flush_fragment(AVFormatContext *s) if (write_moof) { MOVFragmentInfo *info; + avio_flush(s->pb); track->nb_frag_info++; track->frag_info = av_realloc(track->frag_info, sizeof(*track->frag_info) * @@ -2517,6 +2646,7 @@ static int mov_flush_fragment(AVFormatContext *s) mov->mdat_size = 0; + avio_flush(s->pb); return 0; } @@ -2530,7 +2660,9 @@ static int mov_write_packet_internal(AVFormatContext *s, AVPacket *pkt) int size= pkt->size; uint8_t *reformatted_data = NULL; - if (!s->pb->seekable) return 0; /* Can't handle that */ + if (!s->pb->seekable && !(mov->flags & FF_MOV_FLAG_EMPTY_MOOV)) + return 0; /* Can't handle that */ + if (!size) return 0; /* Discard 0 sized packets */ if ((mov->max_fragment_duration && trk->entry && @@ -2718,7 +2850,13 @@ static int mov_write_header(AVFormatContext *s) AVDictionaryEntry *t; int i, hint_track = 0; - if (!s->pb->seekable) { + /* Non-seekable output is ok if EMPTY_MOOV is set, or if using the ismv + * format (which sets EMPTY_MOOV later in this function). If ism_lookahead + * is enabled, we don't support non-seekable output at all. */ + if (!s->pb->seekable && + ((!(mov->flags & FF_MOV_FLAG_EMPTY_MOOV) && + !(s->oformat && !strcmp(s->oformat->name, "ismv"))) + || mov->ism_lookahead)) { av_log(s, AV_LOG_ERROR, "muxer does not support non seekable output\n"); return -1; } @@ -2748,14 +2886,6 @@ static int mov_write_header(AVFormatContext *s) if (mov->mode & (MODE_MOV|MODE_IPOD) && s->nb_chapters) mov->chapter_track = mov->nb_streams++; -#if FF_API_FLAG_RTP_HINT - if (s->flags & AVFMT_FLAG_RTP_HINT) { - av_log(s, AV_LOG_WARNING, "The RTP_HINT flag is deprecated, enable it " - "via the -movflags rtphint muxer option " - "instead.\n"); - mov->flags |= FF_MOV_FLAG_RTP_HINT; - } -#endif if (mov->flags & FF_MOV_FLAG_RTP_HINT) { /* Add hint tracks for each audio and video stream */ hint_track = mov->nb_streams; @@ -2883,11 +3013,6 @@ static int mov_write_header(AVFormatContext *s) if (!(mov->flags & FF_MOV_FLAG_EMPTY_MOOV)) mov_write_mdat_tag(pb, mov); -#if FF_API_TIMESTAMP - if (s->timestamp) - mov->time = s->timestamp; - else -#endif if (t = av_dict_get(s->metadata, "creation_time", NULL, 0)) mov->time = ff_iso8601_to_unix_time(t->value); if (mov->time) @@ -2910,6 +3035,9 @@ static int mov_write_header(AVFormatContext *s) avio_flush(pb); + if (mov->flags & FF_MOV_FLAG_ISML) + mov_write_isml_manifest(pb, mov); + if (mov->flags & FF_MOV_FLAG_EMPTY_MOOV) { mov_write_moov_tag(pb, mov, s); mov->fragments++; diff --git a/libavformat/movenc.h b/libavformat/movenc.h index c430df1bcf..10181177c8 100644 --- a/libavformat/movenc.h +++ b/libavformat/movenc.h @@ -155,6 +155,7 @@ typedef struct MOVMuxContext { #define FF_MOV_FLAG_FRAG_KEYFRAME 8 #define FF_MOV_FLAG_SEPARATE_MOOF 16 #define FF_MOV_FLAG_FRAG_CUSTOM 32 +#define FF_MOV_FLAG_ISML 64 int ff_mov_write_packet(AVFormatContext *s, AVPacket *pkt); diff --git a/libavformat/mp3dec.c b/libavformat/mp3dec.c index aa48787835..8dfcea23bc 100644 --- a/libavformat/mp3dec.c +++ b/libavformat/mp3dec.c @@ -132,8 +132,7 @@ static int mp3_parse_vbr_tags(AVFormatContext *s, AVStream *st, int64_t base) return 0; } -static int mp3_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int mp3_read_header(AVFormatContext *s) { AVStream *st; int64_t off; diff --git a/libavformat/mpc.c b/libavformat/mpc.c index c05b88a7cf..d929286ddd 100644 --- a/libavformat/mpc.c +++ b/libavformat/mpc.c @@ -52,7 +52,7 @@ static int mpc_probe(AVProbeData *p) return 0; } -static int mpc_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int mpc_read_header(AVFormatContext *s) { MPCContext *c = s->priv_data; AVStream *st; diff --git a/libavformat/mpc8.c b/libavformat/mpc8.c index 01c1cc725b..a711369414 100644 --- a/libavformat/mpc8.c +++ b/libavformat/mpc8.c @@ -188,7 +188,7 @@ static void mpc8_handle_chunk(AVFormatContext *s, int tag, int64_t chunk_pos, in } } -static int mpc8_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int mpc8_read_header(AVFormatContext *s) { MPCContext *c = s->priv_data; AVIOContext *pb = s->pb; diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c index de2dd9dfbe..be1c85d127 100644 --- a/libavformat/mpeg.c +++ b/libavformat/mpeg.c @@ -105,8 +105,7 @@ typedef struct MpegDemuxContext { int sofdec; } MpegDemuxContext; -static int mpegps_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int mpegps_read_header(AVFormatContext *s) { MpegDemuxContext *m = s->priv_data; const char *sofdec = "Sofdec"; diff --git a/libavformat/mpegenc.c b/libavformat/mpegenc.c index b42c9afbd8..098e076016 100644 --- a/libavformat/mpegenc.c +++ b/libavformat/mpegenc.c @@ -421,11 +421,6 @@ static int mpeg_mux_init(AVFormatContext *ctx) video_bitrate += codec_rate; } -#if FF_API_MUXRATE - if(ctx->mux_rate){ - s->mux_rate= (ctx->mux_rate + (8 * 50) - 1) / (8 * 50); - } else -#endif if (!s->mux_rate) { /* we increase slightly the bitrate to take into account the headers. XXX: compute it exactly */ @@ -1163,10 +1158,6 @@ static int mpeg_mux_write_packet(AVFormatContext *ctx, AVPacket *pkt) int preload; const int is_iframe = st->codec->codec_type == AVMEDIA_TYPE_VIDEO && (pkt->flags & AV_PKT_FLAG_KEY); -#if FF_API_PRELOAD - if (ctx->preload) - s->preload = ctx->preload; -#endif preload = av_rescale(s->preload, 90000, AV_TIME_BASE); pts= pkt->pts; diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c index 8c1c557050..81649c7cb6 100644 --- a/libavformat/mpegts.c +++ b/libavformat/mpegts.c @@ -1915,8 +1915,7 @@ static int parse_pcr(int64_t *ppcr_high, int *ppcr_low, return 0; } -static int mpegts_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int mpegts_read_header(AVFormatContext *s) { MpegTSContext *ts = s->priv_data; AVIOContext *pb = s->pb; diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c index 043e578130..526545f697 100644 --- a/libavformat/mpegtsenc.c +++ b/libavformat/mpegtsenc.c @@ -579,11 +579,6 @@ static int mpegts_write_header(AVFormatContext *s) service->pcr_pid = ts_st->pid; } -#if FF_API_MUXRATE - if (s->mux_rate) - ts->mux_rate = s->mux_rate; -#endif - if (ts->mux_rate > 1) { service->pcr_packet_period = (ts->mux_rate * PCR_RETRANS_TIME) / (TS_PACKET_SIZE * 8 * 1000); diff --git a/libavformat/msnwc_tcp.c b/libavformat/msnwc_tcp.c index 1e6fd0b6f5..f8a631e311 100644 --- a/libavformat/msnwc_tcp.c +++ b/libavformat/msnwc_tcp.c @@ -70,7 +70,7 @@ static int msnwc_tcp_probe(AVProbeData *p) return -1; } -static int msnwc_tcp_read_header(AVFormatContext *ctx, AVFormatParameters *ap) +static int msnwc_tcp_read_header(AVFormatContext *ctx) { AVIOContext *pb = ctx->pb; AVCodecContext *codec; diff --git a/libavformat/mtv.c b/libavformat/mtv.c index 7237963ef3..19b7793bae 100644 --- a/libavformat/mtv.c +++ b/libavformat/mtv.c @@ -75,7 +75,7 @@ static int mtv_probe(AVProbeData *p) return AVPROBE_SCORE_MAX; } -static int mtv_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int mtv_read_header(AVFormatContext *s) { MTVDemuxContext *mtv = s->priv_data; AVIOContext *pb = s->pb; diff --git a/libavformat/mvi.c b/libavformat/mvi.c index 70a9b66919..a5a69ac19a 100644 --- a/libavformat/mvi.c +++ b/libavformat/mvi.c @@ -36,7 +36,7 @@ typedef struct MviDemuxContext { int video_frame_size; } MviDemuxContext; -static int read_header(AVFormatContext *s, AVFormatParameters *ap) +static int read_header(AVFormatContext *s) { MviDemuxContext *mvi = s->priv_data; AVIOContext *pb = s->pb; diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c index c8baf189f8..c9278692a3 100644 --- a/libavformat/mxfdec.c +++ b/libavformat/mxfdec.c @@ -1653,7 +1653,7 @@ static void mxf_handle_small_eubc(AVFormatContext *s) mxf->edit_units_per_packet = 1920; } -static int mxf_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int mxf_read_header(AVFormatContext *s) { MXFContext *mxf = s->priv_data; KLVPacket klv; diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c index 881902b2f8..6e0061304d 100644 --- a/libavformat/mxfenc.c +++ b/libavformat/mxfenc.c @@ -1511,11 +1511,6 @@ static int mxf_write_header(AVFormatContext *s) sc->order = AV_RB32(sc->track_essence_element_key+12); } -#if FF_API_TIMESTAMP - if (s->timestamp) - timestamp = s->timestamp; - else -#endif if (t = av_dict_get(s->metadata, "creation_time", NULL, 0)) timestamp = ff_iso8601_to_unix_time(t->value); if (timestamp) diff --git a/libavformat/mxg.c b/libavformat/mxg.c index 3e0c4219e4..32ca2750cb 100644 --- a/libavformat/mxg.c +++ b/libavformat/mxg.c @@ -37,7 +37,7 @@ typedef struct MXGContext { unsigned int cache_size; } MXGContext; -static int mxg_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int mxg_read_header(AVFormatContext *s) { AVStream *video_st, *audio_st; MXGContext *mxg = s->priv_data; diff --git a/libavformat/ncdec.c b/libavformat/ncdec.c index cf95c631bd..9a46b808e7 100644 --- a/libavformat/ncdec.c +++ b/libavformat/ncdec.c @@ -44,7 +44,7 @@ static int nc_probe(AVProbeData *probe_packet) return 0; } -static int nc_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int nc_read_header(AVFormatContext *s) { AVStream *st = avformat_new_stream(s, NULL); diff --git a/libavformat/nsvdec.c b/libavformat/nsvdec.c index 6a6830ee9f..50fbca98c2 100644 --- a/libavformat/nsvdec.c +++ b/libavformat/nsvdec.c @@ -268,7 +268,7 @@ static int nsv_resync(AVFormatContext *s) return -1; } -static int nsv_parse_NSVf_header(AVFormatContext *s, AVFormatParameters *ap) +static int nsv_parse_NSVf_header(AVFormatContext *s) { NSVContext *nsv = s->priv_data; AVIOContext *pb = s->pb; @@ -392,7 +392,7 @@ static int nsv_parse_NSVf_header(AVFormatContext *s, AVFormatParameters *ap) return 0; } -static int nsv_parse_NSVs_header(AVFormatContext *s, AVFormatParameters *ap) +static int nsv_parse_NSVs_header(AVFormatContext *s) { NSVContext *nsv = s->priv_data; AVIOContext *pb = s->pb; @@ -513,7 +513,7 @@ fail: return -1; } -static int nsv_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int nsv_read_header(AVFormatContext *s) { NSVContext *nsv = s->priv_data; int i, err; @@ -528,10 +528,10 @@ static int nsv_read_header(AVFormatContext *s, AVFormatParameters *ap) if (nsv_resync(s) < 0) return -1; if (nsv->state == NSV_FOUND_NSVF) - err = nsv_parse_NSVf_header(s, ap); + err = nsv_parse_NSVf_header(s); /* we need the first NSVs also... */ if (nsv->state == NSV_FOUND_NSVS) { - err = nsv_parse_NSVs_header(s, ap); + err = nsv_parse_NSVs_header(s); break; /* we just want the first one */ } } @@ -572,7 +572,7 @@ null_chunk_retry: if (err < 0) return err; if (nsv->state == NSV_FOUND_NSVS) - err = nsv_parse_NSVs_header(s, NULL); + err = nsv_parse_NSVs_header(s); if (err < 0) return err; if (nsv->state != NSV_HAS_READ_NSVS && nsv->state != NSV_FOUND_BEEF) diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c index 5dd687c55d..810632de50 100644 --- a/libavformat/nutdec.c +++ b/libavformat/nutdec.c @@ -596,7 +596,7 @@ fail: return ret; } -static int nut_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int nut_read_header(AVFormatContext *s) { NUTContext *nut = s->priv_data; AVIOContext *bc = s->pb; diff --git a/libavformat/nuv.c b/libavformat/nuv.c index 93cbc264c3..7c96f05217 100644 --- a/libavformat/nuv.c +++ b/libavformat/nuv.c @@ -122,7 +122,7 @@ static int get_codec_data(AVIOContext *pb, AVStream *vst, return 0; } -static int nuv_header(AVFormatContext *s, AVFormatParameters *ap) { +static int nuv_header(AVFormatContext *s) { NUVContext *ctx = s->priv_data; AVIOContext *pb = s->pb; char id_string[12]; diff --git a/libavformat/oggdec.c b/libavformat/oggdec.c index ceb4091c6e..3a1abc085f 100644 --- a/libavformat/oggdec.c +++ b/libavformat/oggdec.c @@ -518,7 +518,7 @@ static int ogg_get_length(AVFormatContext *s) return 0; } -static int ogg_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int ogg_read_header(AVFormatContext *s) { struct ogg *ogg = s->priv_data; int ret, i; diff --git a/libavformat/omadec.c b/libavformat/omadec.c index 2980f6fee5..5a1660b89f 100644 --- a/libavformat/omadec.c +++ b/libavformat/omadec.c @@ -259,8 +259,7 @@ static int decrypt_init(AVFormatContext *s, ID3v2ExtraMeta *em, uint8_t *header) return 0; } -static int oma_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int oma_read_header(AVFormatContext *s) { int ret, framesize, jsflag, samplerate; uint32_t codec_params; diff --git a/libavformat/options.c b/libavformat/options.c index 31acbd37c1..490c765666 100644 --- a/libavformat/options.c +++ b/libavformat/options.c @@ -41,10 +41,8 @@ static void *format_child_next(void *obj, void *prev) ((s->iformat && s->iformat->priv_class) || s->oformat && s->oformat->priv_class)) return s->priv_data; -#if !FF_API_OLD_AVIO if (s->pb && s->pb->av_class && prev != s->pb) return s->pb; -#endif return NULL; } @@ -54,11 +52,7 @@ static const AVClass *format_child_class_next(const AVClass *prev) AVOutputFormat *ofmt = NULL; if (!prev) -#if !FF_API_OLD_AVIO return &ffio_url_class; -#else - prev = (void *)&ifmt; // Dummy pointer; -#endif while ((ifmt = av_iformat_next(ifmt))) if (ifmt->priv_class == prev) @@ -88,9 +82,6 @@ static const AVClass *format_child_class_next(const AVClass *prev) static const AVOption options[]={ {"probesize", "set probing size", OFFSET(probesize), AV_OPT_TYPE_INT, {.dbl = 5000000 }, 32, INT_MAX, D}, -#if FF_API_MUXRATE -{"muxrate", "set mux rate", OFFSET(mux_rate), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, 0, INT_MAX, E}, -#endif {"packetsize", "set packet size", OFFSET(packet_size), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, 0, INT_MAX, E}, {"fflags", NULL, OFFSET(flags), AV_OPT_TYPE_FLAGS, {.dbl = DEFAULT }, INT_MIN, INT_MAX, D|E, "fflags"}, {"ignidx", "ignore index", 0, AV_OPT_TYPE_CONST, {.dbl = AVFMT_FLAG_IGNIDX }, INT_MIN, INT_MAX, D, "fflags"}, @@ -98,9 +89,6 @@ static const AVOption options[]={ {"nofillin", "do not fill in missing values that can be exactly calculated", 0, AV_OPT_TYPE_CONST, {.dbl = AVFMT_FLAG_NOFILLIN }, INT_MIN, INT_MAX, D, "fflags"}, {"noparse", "disable AVParsers, this needs nofillin too", 0, AV_OPT_TYPE_CONST, {.dbl = AVFMT_FLAG_NOPARSE }, INT_MIN, INT_MAX, D, "fflags"}, {"igndts", "ignore dts", 0, AV_OPT_TYPE_CONST, {.dbl = AVFMT_FLAG_IGNDTS }, INT_MIN, INT_MAX, D, "fflags"}, -#if FF_API_FLAG_RTP_HINT -{"rtphint", "add rtp hinting (deprecated, use the -movflags rtphint option instead)", 0, AV_OPT_TYPE_CONST, {.dbl = AVFMT_FLAG_RTP_HINT }, INT_MIN, INT_MAX, E, "fflags"}, -#endif {"discardcorrupt", "discard corrupted frames", 0, AV_OPT_TYPE_CONST, {.dbl = AVFMT_FLAG_DISCARD_CORRUPT }, INT_MIN, INT_MAX, D, "fflags"}, {"sortdts", "try to interleave outputted packets by dts", 0, AV_OPT_TYPE_CONST, {.dbl = AVFMT_FLAG_SORT_DTS }, INT_MIN, INT_MAX, D, "fflags"}, {"keepside", "dont merge side data", 0, AV_OPT_TYPE_CONST, {.dbl = AVFMT_FLAG_KEEP_SIDE_DATA }, INT_MIN, INT_MAX, D, "fflags"}, diff --git a/libavformat/pmpdec.c b/libavformat/pmpdec.c index a57b66072e..4ef8ca3437 100644 --- a/libavformat/pmpdec.c +++ b/libavformat/pmpdec.c @@ -39,7 +39,7 @@ static int pmp_probe(AVProbeData *p) { return 0; } -static int pmp_header(AVFormatContext *s, AVFormatParameters *ap) +static int pmp_header(AVFormatContext *s) { PMPContext *pmp = s->priv_data; AVIOContext *pb = s->pb; diff --git a/libavformat/psxstr.c b/libavformat/psxstr.c index 2013a73b0f..d657197d6f 100644 --- a/libavformat/psxstr.c +++ b/libavformat/psxstr.c @@ -130,8 +130,7 @@ static int str_probe(AVProbeData *p) else return 0; } -static int str_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int str_read_header(AVFormatContext *s) { AVIOContext *pb = s->pb; StrDemuxContext *str = s->priv_data; diff --git a/libavformat/pva.c b/libavformat/pva.c index 9ba690d73e..199f7bc651 100644 --- a/libavformat/pva.c +++ b/libavformat/pva.c @@ -54,7 +54,7 @@ static int pva_probe(AVProbeData * pd) { return AVPROBE_SCORE_MAX / 4; } -static int pva_read_header(AVFormatContext *s, AVFormatParameters *ap) { +static int pva_read_header(AVFormatContext *s) { AVStream *st; if (!(st = avformat_new_stream(s, NULL))) diff --git a/libavformat/qcp.c b/libavformat/qcp.c index c88c39b25d..929fce48e9 100644 --- a/libavformat/qcp.c +++ b/libavformat/qcp.c @@ -80,7 +80,7 @@ static int qcp_probe(AVProbeData *pd) return 0; } -static int qcp_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int qcp_read_header(AVFormatContext *s) { AVIOContext *pb = s->pb; QCPContext *c = s->priv_data; diff --git a/libavformat/r3d.c b/libavformat/r3d.c index 874c361406..1e0e73ea6b 100644 --- a/libavformat/r3d.c +++ b/libavformat/r3d.c @@ -159,7 +159,7 @@ static void r3d_read_reos(AVFormatContext *s) avio_skip(s->pb, 6*4); } -static int r3d_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int r3d_read_header(AVFormatContext *s) { R3DContext *r3d = s->priv_data; Atom atom; diff --git a/libavformat/rawdec.c b/libavformat/rawdec.c index ad1921d8d1..f7c0de8c25 100644 --- a/libavformat/rawdec.c +++ b/libavformat/rawdec.c @@ -29,7 +29,7 @@ #include "libavutil/pixdesc.h" /* raw input */ -int ff_raw_read_header(AVFormatContext *s, AVFormatParameters *ap) +int ff_raw_read_header(AVFormatContext *s) { AVStream *st; enum CodecID id; @@ -126,8 +126,7 @@ int ff_raw_read_partial_packet(AVFormatContext *s, AVPacket *pkt) return ret; } -int ff_raw_audio_read_header(AVFormatContext *s, - AVFormatParameters *ap) +int ff_raw_audio_read_header(AVFormatContext *s) { AVStream *st = avformat_new_stream(s, NULL); if (!st) @@ -142,8 +141,7 @@ int ff_raw_audio_read_header(AVFormatContext *s, } /* MPEG-1/H.263 input */ -int ff_raw_video_read_header(AVFormatContext *s, - AVFormatParameters *ap) +int ff_raw_video_read_header(AVFormatContext *s) { AVStream *st; FFRawVideoDemuxerContext *s1 = s->priv_data; diff --git a/libavformat/rawdec.h b/libavformat/rawdec.h index a2011ebcba..844a28824d 100644 --- a/libavformat/rawdec.h +++ b/libavformat/rawdec.h @@ -41,13 +41,13 @@ typedef struct FFRawVideoDemuxerContext { extern const AVOption ff_rawvideo_options[]; -int ff_raw_read_header(AVFormatContext *s, AVFormatParameters *ap); +int ff_raw_read_header(AVFormatContext *s); int ff_raw_read_partial_packet(AVFormatContext *s, AVPacket *pkt); -int ff_raw_audio_read_header(AVFormatContext *s, AVFormatParameters *ap); +int ff_raw_audio_read_header(AVFormatContext *s); -int ff_raw_video_read_header(AVFormatContext *s, AVFormatParameters *ap); +int ff_raw_video_read_header(AVFormatContext *s); #define FF_RAWVIDEO_DEMUXER_CLASS(name)\ static const AVClass name ## _demuxer_class = {\ diff --git a/libavformat/rl2.c b/libavformat/rl2.c index 78edec5b18..b160098150 100644 --- a/libavformat/rl2.c +++ b/libavformat/rl2.c @@ -72,8 +72,7 @@ static int rl2_probe(AVProbeData *p) * @param ap format parameters * @return 0 on success, AVERROR otherwise */ -static av_cold int rl2_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static av_cold int rl2_read_header(AVFormatContext *s) { AVIOContext *pb = s->pb; AVStream *st; diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c index ae6cda3866..68383b2d21 100644 --- a/libavformat/rmdec.c +++ b/libavformat/rmdec.c @@ -404,7 +404,7 @@ static int rm_read_header_old(AVFormatContext *s) return rm_read_audio_stream_info(s, s->pb, st, st->priv_data, 1); } -static int rm_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int rm_read_header(AVFormatContext *s) { RMDemuxContext *rm = s->priv_data; AVStream *st; diff --git a/libavformat/rpl.c b/libavformat/rpl.c index 7100331d5a..c1c66b77b4 100644 --- a/libavformat/rpl.c +++ b/libavformat/rpl.c @@ -110,7 +110,7 @@ static AVRational read_fps(const char* line, int* error) return result; } -static int rpl_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int rpl_read_header(AVFormatContext *s) { AVIOContext *pb = s->pb; RPLContext *rpl = s->priv_data; diff --git a/libavformat/rsodec.c b/libavformat/rsodec.c index dade0239da..9c9f815e66 100644 --- a/libavformat/rsodec.c +++ b/libavformat/rsodec.c @@ -27,7 +27,7 @@ #include "riff.h" #include "rso.h" -static int rso_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int rso_read_header(AVFormatContext *s) { AVIOContext *pb = s->pb; int id, rate, bps; diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c index c2a0d26e5e..4a0e8bffee 100644 --- a/libavformat/rtsp.c +++ b/libavformat/rtsp.c @@ -1389,51 +1389,6 @@ redirect: if (port < 0) port = RTSP_DEFAULT_PORT; -#if FF_API_RTSP_URL_OPTIONS - /* search for options */ - option_list = strrchr(path, '?'); - if (option_list) { - /* Strip out the RTSP specific options, write out the rest of - * the options back into the same string. */ - filename = option_list; - while (option_list) { - int handled = 1; - /* move the option pointer */ - option = ++option_list; - option_list = strchr(option_list, '&'); - if (option_list) - *option_list = 0; - - /* handle the options */ - if (!strcmp(option, "udp")) { - lower_transport_mask |= (1<< RTSP_LOWER_TRANSPORT_UDP); - } else if (!strcmp(option, "multicast")) { - lower_transport_mask |= (1<< RTSP_LOWER_TRANSPORT_UDP_MULTICAST); - } else if (!strcmp(option, "tcp")) { - lower_transport_mask |= (1<< RTSP_LOWER_TRANSPORT_TCP); - } else if(!strcmp(option, "http")) { - lower_transport_mask |= (1<< RTSP_LOWER_TRANSPORT_TCP); - rt->control_transport = RTSP_MODE_TUNNEL; - } else if (!strcmp(option, "filter_src")) { - rt->rtsp_flags |= RTSP_FLAG_FILTER_SRC; - } else { - /* Write options back into the buffer, using memmove instead - * of strcpy since the strings may overlap. */ - int len = strlen(option); - memmove(++filename, option, len); - filename += len; - if (option_list) *filename = '&'; - handled = 0; - } - if (handled) - av_log(s, AV_LOG_WARNING, "Options passed via URL are " - "deprecated, use -rtsp_transport " - "and -rtsp_flags instead.\n"); - } - *filename = 0; - } -#endif - if (!lower_transport_mask) lower_transport_mask = (1 << RTSP_LOWER_TRANSPORT_NB) - 1; @@ -1844,7 +1799,7 @@ static int sdp_probe(AVProbeData *p1) return 0; } -static int sdp_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int sdp_read_header(AVFormatContext *s) { RTSPState *rt = s->priv_data; RTSPStream *rtsp_st; @@ -1930,8 +1885,7 @@ static int rtp_probe(AVProbeData *p) return 0; } -static int rtp_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int rtp_read_header(AVFormatContext *s) { uint8_t recvbuf[1500]; char host[500], sdp[500]; @@ -2008,7 +1962,7 @@ static int rtp_read_header(AVFormatContext *s, rt->media_type_mask = (1 << (AVMEDIA_TYPE_DATA+1)) - 1; - ret = sdp_read_header(s, ap); + ret = sdp_read_header(s); s->pb = NULL; return ret; diff --git a/libavformat/rtspdec.c b/libavformat/rtspdec.c index 8699f77918..18a76ab626 100644 --- a/libavformat/rtspdec.c +++ b/libavformat/rtspdec.c @@ -150,8 +150,7 @@ static int rtsp_probe(AVProbeData *p) return 0; } -static int rtsp_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int rtsp_read_header(AVFormatContext *s) { RTSPState *rt = s->priv_data; int ret; diff --git a/libavformat/sapdec.c b/libavformat/sapdec.c index 9ce069e199..0f96a1ecc0 100644 --- a/libavformat/sapdec.c +++ b/libavformat/sapdec.c @@ -60,8 +60,7 @@ static int sap_read_close(AVFormatContext *s) return 0; } -static int sap_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int sap_read_header(AVFormatContext *s) { struct SAPState *sap = s->priv_data; char host[1024], path[1024], url[1024]; diff --git a/libavformat/sbgdec.c b/libavformat/sbgdec.c index fb0882c31c..8b569c88b2 100644 --- a/libavformat/sbgdec.c +++ b/libavformat/sbgdec.c @@ -1378,8 +1378,7 @@ static av_cold int sbg_read_probe(AVProbeData *p) return score; } -static av_cold int sbg_read_header(AVFormatContext *avf, - AVFormatParameters *ap) +static av_cold int sbg_read_header(AVFormatContext *avf) { struct sbg_demuxer *sbg = avf->priv_data; int r; diff --git a/libavformat/sdp.c b/libavformat/sdp.c index 11b50a0d07..2417663885 100644 --- a/libavformat/sdp.c +++ b/libavformat/sdp.c @@ -643,9 +643,3 @@ void ff_sdp_write_media(char *buff, int size, AVCodecContext *c, const char *des } #endif -#if FF_API_SDP_CREATE -int avf_sdp_create(AVFormatContext *ac[], int n_files, char *buff, int size) -{ - return av_sdp_create(ac, n_files, buff, size); -} -#endif diff --git a/libavformat/segafilm.c b/libavformat/segafilm.c index c2a163d9fc..210dedad48 100644 --- a/libavformat/segafilm.c +++ b/libavformat/segafilm.c @@ -76,8 +76,7 @@ static int film_probe(AVProbeData *p) return AVPROBE_SCORE_MAX; } -static int film_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int film_read_header(AVFormatContext *s) { FilmDemuxContext *film = s->priv_data; AVIOContext *pb = s->pb; diff --git a/libavformat/sierravmd.c b/libavformat/sierravmd.c index 6fb7d8a700..18bcb38bbf 100644 --- a/libavformat/sierravmd.c +++ b/libavformat/sierravmd.c @@ -79,8 +79,7 @@ static int vmd_probe(AVProbeData *p) return AVPROBE_SCORE_MAX / 2; } -static int vmd_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int vmd_read_header(AVFormatContext *s) { VmdDemuxContext *vmd = s->priv_data; AVIOContext *pb = s->pb; diff --git a/libavformat/siff.c b/libavformat/siff.c index 1a3f0a4e47..e0f21f3f4b 100644 --- a/libavformat/siff.c +++ b/libavformat/siff.c @@ -154,7 +154,7 @@ static int siff_parse_soun(AVFormatContext *s, SIFFContext *c, AVIOContext *pb) return create_audio_stream(s, c); } -static int siff_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int siff_read_header(AVFormatContext *s) { AVIOContext *pb = s->pb; SIFFContext *c = s->priv_data; diff --git a/libavformat/smacker.c b/libavformat/smacker.c index 26319d4d59..c023b0ea27 100644 --- a/libavformat/smacker.c +++ b/libavformat/smacker.c @@ -98,7 +98,7 @@ static int smacker_probe(AVProbeData *p) return 0; } -static int smacker_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int smacker_read_header(AVFormatContext *s) { AVIOContext *pb = s->pb; SmackerContext *smk = s->priv_data; diff --git a/libavformat/smjpegdec.c b/libavformat/smjpegdec.c index d7ff9799ef..05a92839da 100644 --- a/libavformat/smjpegdec.c +++ b/libavformat/smjpegdec.c @@ -41,7 +41,7 @@ static int smjpeg_probe(AVProbeData *p) return 0; } -static int smjpeg_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int smjpeg_read_header(AVFormatContext *s) { SMJPEGContext *sc = s->priv_data; AVStream *ast = NULL, *vst = NULL; diff --git a/libavformat/sol.c b/libavformat/sol.c index f9adeaddc7..700078c9cc 100644 --- a/libavformat/sol.c +++ b/libavformat/sol.c @@ -82,8 +82,7 @@ static int sol_channels(int magic, int type) return 2; } -static int sol_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int sol_read_header(AVFormatContext *s) { unsigned int magic,tag; AVIOContext *pb = s->pb; diff --git a/libavformat/soxdec.c b/libavformat/soxdec.c index 23fea38fd4..282e16ec43 100644 --- a/libavformat/soxdec.c +++ b/libavformat/soxdec.c @@ -44,8 +44,7 @@ static int sox_probe(AVProbeData *p) return 0; } -static int sox_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int sox_read_header(AVFormatContext *s) { AVIOContext *pb = s->pb; unsigned header_size, comment_size; diff --git a/libavformat/spdifdec.c b/libavformat/spdifdec.c index b0e9afb7b3..89e9b7c3d8 100644 --- a/libavformat/spdifdec.c +++ b/libavformat/spdifdec.c @@ -155,7 +155,7 @@ static int spdif_probe(AVProbeData *p) return AVPROBE_SCORE_MAX / 8; } -static int spdif_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int spdif_read_header(AVFormatContext *s) { s->ctx_flags |= AVFMTCTX_NOHEADER; return 0; diff --git a/libavformat/srtdec.c b/libavformat/srtdec.c index 84e885d21e..481f4a6bb0 100644 --- a/libavformat/srtdec.c +++ b/libavformat/srtdec.c @@ -40,7 +40,7 @@ static int srt_probe(AVProbeData *p) return 0; } -static int srt_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int srt_read_header(AVFormatContext *s) { AVStream *st = avformat_new_stream(s, NULL); if (!st) diff --git a/libavformat/swfdec.c b/libavformat/swfdec.c index c0b2e1759b..f24d0a898c 100644 --- a/libavformat/swfdec.c +++ b/libavformat/swfdec.c @@ -52,7 +52,7 @@ static int swf_probe(AVProbeData *p) return 0; } -static int swf_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int swf_read_header(AVFormatContext *s) { SWFContext *swf = s->priv_data; AVIOContext *pb = s->pb; diff --git a/libavformat/thp.c b/libavformat/thp.c index 75f7941ff8..dc30fbaf70 100644 --- a/libavformat/thp.c +++ b/libavformat/thp.c @@ -54,8 +54,7 @@ static int thp_probe(AVProbeData *p) return 0; } -static int thp_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int thp_read_header(AVFormatContext *s) { ThpDemuxContext *thp = s->priv_data; AVStream *st; diff --git a/libavformat/tiertexseq.c b/libavformat/tiertexseq.c index 4e845d777c..d2d4e880c2 100644 --- a/libavformat/tiertexseq.c +++ b/libavformat/tiertexseq.c @@ -181,7 +181,7 @@ static int seq_parse_frame_data(SeqDemuxContext *seq, AVIOContext *pb) return 0; } -static int seq_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int seq_read_header(AVFormatContext *s) { int i, rc; SeqDemuxContext *seq = s->priv_data; diff --git a/libavformat/tmv.c b/libavformat/tmv.c index 7f7a136a53..bfc5326068 100644 --- a/libavformat/tmv.c +++ b/libavformat/tmv.c @@ -63,7 +63,7 @@ static int tmv_probe(AVProbeData *p) return 0; } -static int tmv_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int tmv_read_header(AVFormatContext *s) { TMVContext *tmv = s->priv_data; AVIOContext *pb = s->pb; diff --git a/libavformat/tta.c b/libavformat/tta.c index 6e513563be..c2f0902535 100644 --- a/libavformat/tta.c +++ b/libavformat/tta.c @@ -38,7 +38,7 @@ static int tta_probe(AVProbeData *p) return 0; } -static int tta_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int tta_read_header(AVFormatContext *s) { TTAContext *c = s->priv_data; AVStream *st; diff --git a/libavformat/tty.c b/libavformat/tty.c index 6780c50216..6d8a6eb541 100644 --- a/libavformat/tty.c +++ b/libavformat/tty.c @@ -72,8 +72,7 @@ static int efi_read(AVFormatContext *avctx, uint64_t start_pos) return 0; } -static int read_header(AVFormatContext *avctx, - AVFormatParameters *ap) +static int read_header(AVFormatContext *avctx) { TtyDemuxContext *s = avctx->priv_data; int width = 0, height = 0, ret = 0; diff --git a/libavformat/txd.c b/libavformat/txd.c index 06aca8c3f4..f6060330ba 100644 --- a/libavformat/txd.c +++ b/libavformat/txd.c @@ -37,7 +37,7 @@ static int txd_probe(AVProbeData * pd) { return 0; } -static int txd_read_header(AVFormatContext *s, AVFormatParameters *ap) { +static int txd_read_header(AVFormatContext *s) { AVStream *st; st = avformat_new_stream(s, NULL); diff --git a/libavformat/url.h b/libavformat/url.h index 3a80f216c7..b459a59e03 100644 --- a/libavformat/url.h +++ b/libavformat/url.h @@ -31,7 +31,6 @@ #include "libavutil/dict.h" #include "libavutil/log.h" -#if !FF_API_OLD_AVIO #define URL_PROTOCOL_FLAG_NESTED_SCHEME 1 /*< The protocol name can be the first part of a nested protocol scheme */ #define URL_PROTOCOL_FLAG_NETWORK 2 /*< The protocol uses network */ @@ -74,7 +73,6 @@ typedef struct URLProtocol { int flags; int (*url_check)(URLContext *h, int mask); } URLProtocol; -#endif /** * Create a URLContext for accessing to the resource indicated by diff --git a/libavformat/utils.c b/libavformat/utils.c index c1de71d29e..912c2baaa8 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -424,102 +424,11 @@ static int set_codec_from_probe_data(AVFormatContext *s, AVStream *st, AVProbeDa /************************************************************/ /* input media file */ -#if FF_API_FORMAT_PARAMETERS -static AVDictionary *convert_format_parameters(AVFormatParameters *ap) -{ - char buf[1024]; - AVDictionary *opts = NULL; - - if (!ap) - return NULL; - - AV_NOWARN_DEPRECATED( - if (ap->time_base.num) { - snprintf(buf, sizeof(buf), "%d/%d", ap->time_base.den, ap->time_base.num); - av_dict_set(&opts, "framerate", buf, 0); - } - if (ap->sample_rate) { - snprintf(buf, sizeof(buf), "%d", ap->sample_rate); - av_dict_set(&opts, "sample_rate", buf, 0); - } - if (ap->channels) { - snprintf(buf, sizeof(buf), "%d", ap->channels); - av_dict_set(&opts, "channels", buf, 0); - } - if (ap->width || ap->height) { - snprintf(buf, sizeof(buf), "%dx%d", ap->width, ap->height); - av_dict_set(&opts, "video_size", buf, 0); - } - if (ap->pix_fmt != PIX_FMT_NONE) { - av_dict_set(&opts, "pixel_format", av_get_pix_fmt_name(ap->pix_fmt), 0); - } - if (ap->channel) { - snprintf(buf, sizeof(buf), "%d", ap->channel); - av_dict_set(&opts, "channel", buf, 0); - } - if (ap->standard) { - av_dict_set(&opts, "standard", ap->standard, 0); - } - if (ap->mpeg2ts_compute_pcr) { - av_dict_set(&opts, "mpeg2ts_compute_pcr", "1", 0); - } - if (ap->initial_pause) { - av_dict_set(&opts, "initial_pause", "1", 0); - } - ) - return opts; -} - -/** - * Open a media file from an IO stream. 'fmt' must be specified. - */ -int av_open_input_stream(AVFormatContext **ic_ptr, - AVIOContext *pb, const char *filename, - AVInputFormat *fmt, AVFormatParameters *ap) -{ - int err; - AVDictionary *opts; - AVFormatContext *ic; - AVFormatParameters default_ap; - - if(!ap){ - ap=&default_ap; - memset(ap, 0, sizeof(default_ap)); - } - opts = convert_format_parameters(ap); - - AV_NOWARN_DEPRECATED( - if(!ap->prealloced_context) - *ic_ptr = ic = avformat_alloc_context(); - else - ic = *ic_ptr; - ) - if (!ic) { - err = AVERROR(ENOMEM); - goto fail; - } - if (pb && fmt && fmt->flags & AVFMT_NOFILE) - av_log(ic, AV_LOG_WARNING, "Custom AVIOContext makes no sense and " - "will be ignored with AVFMT_NOFILE format.\n"); - else - ic->pb = pb; - - if ((err = avformat_open_input(&ic, filename, fmt, &opts)) < 0) - goto fail; - ic->pb = ic->pb ? ic->pb : pb; // don't leak custom pb if it wasn't set above - -fail: - *ic_ptr = ic; - av_dict_free(&opts); - return err; -} -#endif - -int av_demuxer_open(AVFormatContext *ic, AVFormatParameters *ap){ +int av_demuxer_open(AVFormatContext *ic){ int err; if (ic->iformat->read_header) { - err = ic->iformat->read_header(ic, ap); + err = ic->iformat->read_header(ic); if (err < 0) return err; } @@ -608,27 +517,6 @@ int av_probe_input_buffer(AVIOContext *pb, AVInputFormat **fmt, return ret; } -#if FF_API_FORMAT_PARAMETERS -int av_open_input_file(AVFormatContext **ic_ptr, const char *filename, - AVInputFormat *fmt, - int buf_size, - AVFormatParameters *ap) -{ - int err; - AVDictionary *opts = convert_format_parameters(ap); - - AV_NOWARN_DEPRECATED( - if (!ap || !ap->prealloced_context) - *ic_ptr = NULL; - ) - - err = avformat_open_input(ic_ptr, filename, fmt, &opts); - - av_dict_free(&opts); - return err; -} -#endif - /* open input file and probe the format if necessary */ static int init_input(AVFormatContext *s, const char *filename, AVDictionary **options) { @@ -661,7 +549,6 @@ int avformat_open_input(AVFormatContext **ps, const char *filename, AVInputForma { AVFormatContext *s = *ps; int ret = 0; - AVFormatParameters ap = { { 0 } }; AVDictionary *tmp = NULL; if (!s && !(s = avformat_alloc_context())) @@ -708,7 +595,7 @@ int avformat_open_input(AVFormatContext **ps, const char *filename, AVInputForma ff_id3v2_read(s, ID3v2_DEFAULT_MAGIC); if (!(s->flags&AVFMT_FLAG_PRIV_OPT) && s->iformat->read_header) - if ((ret = s->iformat->read_header(s, &ap)) < 0) + if ((ret = s->iformat->read_header(s)) < 0) goto fail; if (!(s->flags&AVFMT_FLAG_PRIV_OPT) && s->pb && !s->data_offset) @@ -1461,13 +1348,6 @@ void ff_read_frame_flush(AVFormatContext *s) } } -#if FF_API_SEEK_PUBLIC -void av_update_cur_dts(AVFormatContext *s, AVStream *ref_st, int64_t timestamp) -{ - ff_update_cur_dts(s, ref_st, timestamp); -} -#endif - void ff_update_cur_dts(AVFormatContext *s, AVStream *ref_st, int64_t timestamp) { int i; @@ -1589,12 +1469,6 @@ int av_index_search_timestamp(AVStream *st, int64_t wanted_timestamp, wanted_timestamp, flags); } -#if FF_API_SEEK_PUBLIC -int av_seek_frame_binary(AVFormatContext *s, int stream_index, int64_t target_ts, int flags){ - return ff_seek_frame_binary(s, stream_index, target_ts, flags); -} -#endif - int ff_seek_frame_binary(AVFormatContext *s, int stream_index, int64_t target_ts, int flags) { AVInputFormat *avif= s->iformat; @@ -1657,18 +1531,6 @@ int ff_seek_frame_binary(AVFormatContext *s, int stream_index, int64_t target_ts return 0; } -#if FF_API_SEEK_PUBLIC -int64_t av_gen_search(AVFormatContext *s, int stream_index, int64_t target_ts, - int64_t pos_min, int64_t pos_max, int64_t pos_limit, - int64_t ts_min, int64_t ts_max, int flags, int64_t *ts_ret, - int64_t (*read_timestamp)(struct AVFormatContext *, int , int64_t *, int64_t )) -{ - return ff_gen_search(s, stream_index, target_ts, pos_min, pos_max, - pos_limit, ts_min, ts_max, flags, ts_ret, - read_timestamp); -} -#endif - int64_t ff_gen_search(AVFormatContext *s, int stream_index, int64_t target_ts, int64_t pos_min, int64_t pos_max, int64_t pos_limit, int64_t ts_min, int64_t ts_max, int flags, int64_t *ts_ret, @@ -2382,13 +2244,6 @@ static int tb_unreliable(AVCodecContext *c){ return 0; } -#if FF_API_FORMAT_PARAMETERS -int av_find_stream_info(AVFormatContext *ic) -{ - return avformat_find_stream_info(ic, NULL); -} -#endif - int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options) { int i, count, ret, read_size, j; @@ -2825,16 +2680,6 @@ int av_read_pause(AVFormatContext *s) return AVERROR(ENOSYS); } -#if FF_API_FORMAT_PARAMETERS -void av_close_input_stream(AVFormatContext *s) -{ - flush_packet_queue(s); - if (s->iformat->read_close) - s->iformat->read_close(s); - avformat_free_context(s); -} -#endif - void avformat_free_context(AVFormatContext *s) { int i; @@ -2898,16 +2743,6 @@ void avformat_close_input(AVFormatContext **ps) avio_close(pb); } -#if FF_API_NEW_STREAM -AVStream *av_new_stream(AVFormatContext *s, int id) -{ - AVStream *st = avformat_new_stream(s, NULL); - if (st) - st->id = id; - return st; -} -#endif - AVStream *avformat_new_stream(AVFormatContext *s, AVCodec *c) { AVStream *st; @@ -3008,24 +2843,6 @@ AVChapter *avpriv_new_chapter(AVFormatContext *s, int id, AVRational time_base, /************************************************************/ /* output media file */ -#if FF_API_FORMAT_PARAMETERS -int av_set_parameters(AVFormatContext *s, AVFormatParameters *ap) -{ - if (s->oformat->priv_data_size > 0) { - s->priv_data = av_mallocz(s->oformat->priv_data_size); - if (!s->priv_data) - return AVERROR(ENOMEM); - if (s->oformat->priv_class) { - *(const AVClass**)s->priv_data= s->oformat->priv_class; - av_opt_set_defaults(s->priv_data); - } - } else - s->priv_data = NULL; - - return 0; -} -#endif - int avformat_alloc_output_context2(AVFormatContext **avctx, AVOutputFormat *oformat, const char *format, const char *filename) { @@ -3122,13 +2939,6 @@ static int validate_codec_tag(AVFormatContext *s, AVStream *st) return 1; } -#if FF_API_FORMAT_PARAMETERS -int av_write_header(AVFormatContext *s) -{ - return avformat_write_header(s, NULL); -} -#endif - int avformat_write_header(AVFormatContext *s, AVDictionary **options) { int ret = 0, i; @@ -3724,16 +3534,6 @@ static void dump_stream_format(AVFormatContext *ic, int i, int index, int is_out dump_metadata(NULL, st->metadata, " "); } -#if FF_API_DUMP_FORMAT -void dump_format(AVFormatContext *ic, - int index, - const char *url, - int is_output) -{ - av_dump_format(ic, index, url, is_output); -} -#endif - void av_dump_format(AVFormatContext *ic, int index, const char *url, @@ -3825,26 +3625,6 @@ uint64_t ff_ntp_time(void) return (av_gettime() / 1000) * 1000 + NTP_OFFSET_US; } -#if FF_API_PARSE_DATE -#include "libavutil/parseutils.h" - -int64_t parse_date(const char *timestr, int duration) -{ - int64_t timeval; - av_parse_time(&timeval, timestr, duration); - return timeval; -} -#endif - -#if FF_API_FIND_INFO_TAG -#include "libavutil/parseutils.h" - -int find_info_tag(char *arg, int arg_size, const char *tag1, const char *info) -{ - return av_find_info_tag(arg, arg_size, tag1, info); -} -#endif - int av_get_frame_filename(char *buf, int buf_size, const char *path, int number) { diff --git a/libavformat/vc1test.c b/libavformat/vc1test.c index b6d9fb9e30..d26e78be87 100644 --- a/libavformat/vc1test.c +++ b/libavformat/vc1test.c @@ -42,8 +42,7 @@ static int vc1t_probe(AVProbeData *p) return AVPROBE_SCORE_MAX/2; } -static int vc1t_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int vc1t_read_header(AVFormatContext *s) { AVIOContext *pb = s->pb; AVStream *st; diff --git a/libavformat/version.h b/libavformat/version.h index f3848da6bb..8a86c10d26 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -29,8 +29,8 @@ #include "libavutil/avutil.h" -#define LIBAVFORMAT_VERSION_MAJOR 53 -#define LIBAVFORMAT_VERSION_MINOR 31 +#define LIBAVFORMAT_VERSION_MAJOR 54 +#define LIBAVFORMAT_VERSION_MINOR 0 #define LIBAVFORMAT_VERSION_MICRO 100 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ @@ -47,80 +47,23 @@ * Those FF_API_* defines are not part of public API. * They may change, break or disappear at any time. */ -#ifndef FF_API_OLD_METADATA2 -#define FF_API_OLD_METADATA2 (LIBAVFORMAT_VERSION_MAJOR < 54) -#endif #ifndef FF_API_OLD_AVIO -#define FF_API_OLD_AVIO (LIBAVFORMAT_VERSION_MAJOR < 54) -#endif -#ifndef FF_API_DUMP_FORMAT -#define FF_API_DUMP_FORMAT (LIBAVFORMAT_VERSION_MAJOR < 54) -#endif -#ifndef FF_API_PARSE_DATE -#define FF_API_PARSE_DATE (LIBAVFORMAT_VERSION_MAJOR < 54) -#endif -#ifndef FF_API_FIND_INFO_TAG -#define FF_API_FIND_INFO_TAG (LIBAVFORMAT_VERSION_MAJOR < 54) +#define FF_API_OLD_AVIO (LIBAVFORMAT_VERSION_MAJOR < 55) #endif #ifndef FF_API_PKT_DUMP #define FF_API_PKT_DUMP (LIBAVFORMAT_VERSION_MAJOR < 54) #endif -#ifndef FF_API_GUESS_IMG2_CODEC -#define FF_API_GUESS_IMG2_CODEC (LIBAVFORMAT_VERSION_MAJOR < 54) -#endif -#ifndef FF_API_SDP_CREATE -#define FF_API_SDP_CREATE (LIBAVFORMAT_VERSION_MAJOR < 54) -#endif #ifndef FF_API_ALLOC_OUTPUT_CONTEXT -#define FF_API_ALLOC_OUTPUT_CONTEXT (LIBAVFORMAT_VERSION_MAJOR < 54) +#define FF_API_ALLOC_OUTPUT_CONTEXT (LIBAVFORMAT_VERSION_MAJOR < 55) #endif #ifndef FF_API_FORMAT_PARAMETERS -#define FF_API_FORMAT_PARAMETERS (LIBAVFORMAT_VERSION_MAJOR < 54) -#endif -#ifndef FF_API_FLAG_RTP_HINT -#define FF_API_FLAG_RTP_HINT (LIBAVFORMAT_VERSION_MAJOR < 54) -#endif -#ifndef FF_API_AVSTREAM_QUALITY -#define FF_API_AVSTREAM_QUALITY (LIBAVFORMAT_VERSION_MAJOR < 54) -#endif -#ifndef FF_API_LOOP_INPUT -#define FF_API_LOOP_INPUT (LIBAVFORMAT_VERSION_MAJOR < 54) -#endif -#ifndef FF_API_LOOP_OUTPUT -#define FF_API_LOOP_OUTPUT (LIBAVFORMAT_VERSION_MAJOR < 54) -#endif -#ifndef FF_API_TIMESTAMP -#define FF_API_TIMESTAMP (LIBAVFORMAT_VERSION_MAJOR < 54) -#endif -#ifndef FF_API_FILESIZE -#define FF_API_FILESIZE (LIBAVFORMAT_VERSION_MAJOR < 54) -#endif -#ifndef FF_API_MUXRATE -#define FF_API_MUXRATE (LIBAVFORMAT_VERSION_MAJOR < 54) -#endif -#ifndef FF_API_RTSP_URL_OPTIONS -#define FF_API_RTSP_URL_OPTIONS (LIBAVFORMAT_VERSION_MAJOR < 54) +#define FF_API_FORMAT_PARAMETERS (LIBAVFORMAT_VERSION_MAJOR < 55) #endif #ifndef FF_API_NEW_STREAM -#define FF_API_NEW_STREAM (LIBAVFORMAT_VERSION_MAJOR < 54) -#endif -#ifndef FF_API_PRELOAD -#define FF_API_PRELOAD (LIBAVFORMAT_VERSION_MAJOR < 54) -#endif -#ifndef FF_API_STREAM_COPY -#define FF_API_STREAM_COPY (LIBAVFORMAT_VERSION_MAJOR < 54) -#endif -#ifndef FF_API_SEEK_PUBLIC -#define FF_API_SEEK_PUBLIC (LIBAVFORMAT_VERSION_MAJOR < 54) -#endif -#ifndef FF_API_REORDER_PRIVATE -#define FF_API_REORDER_PRIVATE (LIBAVFORMAT_VERSION_MAJOR < 54) -#endif -#ifndef FF_API_OLD_INTERRUPT_CB -#define FF_API_OLD_INTERRUPT_CB (LIBAVFORMAT_VERSION_MAJOR < 54) +#define FF_API_NEW_STREAM (LIBAVFORMAT_VERSION_MAJOR < 55) #endif #ifndef FF_API_SET_PTS_INFO -#define FF_API_SET_PTS_INFO (LIBAVFORMAT_VERSION_MAJOR < 54) +#define FF_API_SET_PTS_INFO (LIBAVFORMAT_VERSION_MAJOR < 55) #endif #ifndef FF_API_CLOSE_INPUT_FILE #define FF_API_CLOSE_INPUT_FILE (LIBAVFORMAT_VERSION_MAJOR < 55) diff --git a/libavformat/vocdec.c b/libavformat/vocdec.c index 6ee8d33964..37fd524b7f 100644 --- a/libavformat/vocdec.c +++ b/libavformat/vocdec.c @@ -38,7 +38,7 @@ static int voc_probe(AVProbeData *p) return AVPROBE_SCORE_MAX; } -static int voc_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int voc_read_header(AVFormatContext *s) { VocDecContext *voc = s->priv_data; AVIOContext *pb = s->pb; diff --git a/libavformat/vqf.c b/libavformat/vqf.c index 1014b41e68..8cd69232ce 100644 --- a/libavformat/vqf.c +++ b/libavformat/vqf.c @@ -86,7 +86,7 @@ static const AVMetadataConv vqf_metadata_conv[] = { { 0 }, }; -static int vqf_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int vqf_read_header(AVFormatContext *s) { VqfContext *c = s->priv_data; AVStream *st = avformat_new_stream(s, NULL); diff --git a/libavformat/wav.c b/libavformat/wav.c index ab4b3b42e7..610c792e85 100644 --- a/libavformat/wav.c +++ b/libavformat/wav.c @@ -387,8 +387,7 @@ static const AVMetadataConv wav_metadata_conv[] = { }; /* wav input */ -static int wav_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int wav_read_header(AVFormatContext *s) { int64_t size, av_uninit(data_size); int64_t sample_count=0; @@ -729,7 +728,7 @@ static int w64_probe(AVProbeData *p) return 0; } -static int w64_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int w64_read_header(AVFormatContext *s) { int64_t size; AVIOContext *pb = s->pb; diff --git a/libavformat/wc3movie.c b/libavformat/wc3movie.c index 4d800cd322..d79d7687f4 100644 --- a/libavformat/wc3movie.c +++ b/libavformat/wc3movie.c @@ -83,8 +83,7 @@ static int wc3_probe(AVProbeData *p) return AVPROBE_SCORE_MAX; } -static int wc3_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int wc3_read_header(AVFormatContext *s) { Wc3DemuxContext *wc3 = s->priv_data; AVIOContext *pb = s->pb; diff --git a/libavformat/westwood_aud.c b/libavformat/westwood_aud.c index f083a86baf..a7148eb08b 100644 --- a/libavformat/westwood_aud.c +++ b/libavformat/westwood_aud.c @@ -81,8 +81,7 @@ static int wsaud_probe(AVProbeData *p) return AVPROBE_SCORE_MAX / 2; } -static int wsaud_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int wsaud_read_header(AVFormatContext *s) { AVIOContext *pb = s->pb; AVStream *st; diff --git a/libavformat/westwood_vqa.c b/libavformat/westwood_vqa.c index 41dad8e8ab..47493382c4 100644 --- a/libavformat/westwood_vqa.c +++ b/libavformat/westwood_vqa.c @@ -73,8 +73,7 @@ static int wsvqa_probe(AVProbeData *p) return AVPROBE_SCORE_MAX; } -static int wsvqa_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int wsvqa_read_header(AVFormatContext *s) { WsVqaDemuxContext *wsvqa = s->priv_data; AVIOContext *pb = s->pb; diff --git a/libavformat/wtvdec.c b/libavformat/wtvdec.c index db9bb10068..537dc8ee0d 100644 --- a/libavformat/wtvdec.c +++ b/libavformat/wtvdec.c @@ -870,7 +870,7 @@ static int parse_chunks(AVFormatContext *s, int mode, int64_t seekts, int *len_p return AVERROR_EOF; } -static int read_header(AVFormatContext *s, AVFormatParameters *ap) +static int read_header(AVFormatContext *s) { WtvContext *wtv = s->priv_data; int root_sector, root_size; diff --git a/libavformat/wv.c b/libavformat/wv.c index 33f69d8a1f..537fdec583 100644 --- a/libavformat/wv.c +++ b/libavformat/wv.c @@ -203,8 +203,7 @@ static int wv_read_block_header(AVFormatContext *ctx, AVIOContext *pb, int appen return 0; } -static int wv_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int wv_read_header(AVFormatContext *s) { AVIOContext *pb = s->pb; WVContext *wc = s->priv_data; diff --git a/libavformat/xa.c b/libavformat/xa.c index 8432ea6b99..1e51eec934 100644 --- a/libavformat/xa.c +++ b/libavformat/xa.c @@ -63,8 +63,7 @@ static int xa_probe(AVProbeData *p) return AVPROBE_SCORE_MAX/2; } -static int xa_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int xa_read_header(AVFormatContext *s) { MaxisXADemuxContext *xa = s->priv_data; AVIOContext *pb = s->pb; diff --git a/libavformat/xmv.c b/libavformat/xmv.c index f01e0aa77b..110103ea69 100644 --- a/libavformat/xmv.c +++ b/libavformat/xmv.c @@ -123,8 +123,7 @@ static int xmv_probe(AVProbeData *p) return 0; } -static int xmv_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int xmv_read_header(AVFormatContext *s) { XMVDemuxContext *xmv = s->priv_data; AVIOContext *pb = s->pb; diff --git a/libavformat/xwma.c b/libavformat/xwma.c index a4e53fa2d2..ea7cc4f36e 100644 --- a/libavformat/xwma.c +++ b/libavformat/xwma.c @@ -40,7 +40,7 @@ static int xwma_probe(AVProbeData *p) return 0; } -static int xwma_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int xwma_read_header(AVFormatContext *s) { int64_t size, av_uninit(data_size); int ret; diff --git a/libavformat/yop.c b/libavformat/yop.c index eac3fb6707..d1c24fb2fa 100644 --- a/libavformat/yop.c +++ b/libavformat/yop.c @@ -47,7 +47,7 @@ static int yop_probe(AVProbeData *probe_packet) return 0; } -static int yop_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int yop_read_header(AVFormatContext *s) { YopDecContext *yop = s->priv_data; AVIOContext *pb = s->pb; diff --git a/libavformat/yuv4mpeg.c b/libavformat/yuv4mpeg.c index 61c72f5d82..9d34f7d8f3 100644 --- a/libavformat/yuv4mpeg.c +++ b/libavformat/yuv4mpeg.c @@ -195,7 +195,7 @@ AVOutputFormat ff_yuv4mpegpipe_muxer = { #define MAX_YUV4_HEADER 80 #define MAX_FRAME_HEADER 80 -static int yuv4_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int yuv4_read_header(AVFormatContext *s) { char header[MAX_YUV4_HEADER + 10]; // Include headroom for // the longest option |