Update ffmpeg to include the ac-3 encoder.
This commit is contained in:
1 parent
e9270b2f75
commit
b6bb6e02ca
61 files changed
+1417
-347
No files matched your search
@@ -618,6 +618,8 @@ typedef struct AVOutputFormat {
|
||||
* AVStream parameters that need to be set before packets are sent.
|
||||
* This method must not write output.
|
||||
*
|
||||
* Return 0 if streams were fully configured, 1 if not, negative AVERROR on failure
|
||||
*
|
||||
* Any allocations made here must be freed in deinit().
|
||||
*/
|
||||
int (*init)(struct AVFormatContext *);
|
||||
@@ -814,6 +816,9 @@ typedef struct AVIndexEntry {
|
||||
* is known
|
||||
*/
|
||||
#define AVINDEX_KEYFRAME 0x0001
|
||||
#define AVINDEX_DISCARD_FRAME 0x0002 /**
|
||||
* Flag is used to indicate which frame should be discarded after decoding.
|
||||
*/
|
||||
int flags:2;
|
||||
int size:30; //Yeah, trying to keep the size of this small to reduce memory requirements (it is 24 vs. 32 bytes due to possible 8-byte alignment).
|
||||
int min_distance; /**< Minimum distance between this and the previous keyframe, used to avoid unneeded searching. */
|
||||
@@ -837,11 +842,17 @@ typedef struct AVIndexEntry {
|
||||
#define AV_DISPOSITION_CLEAN_EFFECTS 0x0200 /**< stream without voice */
|
||||
/**
|
||||
* The stream is stored in the file as an attached picture/"cover art" (e.g.
|
||||
* APIC frame in ID3v2). The single packet associated with it will be returned
|
||||
* among the first few packets read from the file unless seeking takes place.
|
||||
* It can also be accessed at any time in AVStream.attached_pic.
|
||||
* APIC frame in ID3v2). The first (usually only) packet associated with it
|
||||
* will be returned among the first few packets read from the file unless
|
||||
* seeking takes place. It can also be accessed at any time in
|
||||
* AVStream.attached_pic.
|
||||
*/
|
||||
#define AV_DISPOSITION_ATTACHED_PIC 0x0400
|
||||
/**
|
||||
* The stream is sparse, and contains thumbnail images, often corresponding
|
||||
* to chapter markers. Only ever used with AV_DISPOSITION_ATTACHED_PIC.
|
||||
*/
|
||||
#define AV_DISPOSITION_TIMED_THUMBNAILS 0x0800
|
||||
|
||||
typedef struct AVStreamInternal AVStreamInternal;
|
||||
|
||||
@@ -919,6 +930,9 @@ typedef struct AVStream {
|
||||
* Decoding: duration of the stream, in stream time base.
|
||||
* If a source file does not specify a duration, but does specify
|
||||
* a bitrate, this value will be estimated from bitrate and file size.
|
||||
*
|
||||
* Encoding: May be set by the caller before avformat_write_header() to
|
||||
* provide a hint to the muxer about the estimated duration.
|
||||
*/
|
||||
int64_t duration;
|
||||
|
||||
@@ -991,12 +1005,14 @@ typedef struct AVStream {
|
||||
* All fields below this line are not part of the public API. They
|
||||
* may not be used outside of libavformat and can be changed and
|
||||
* removed at will.
|
||||
* New public fields should be added right above.
|
||||
* Internal note: be aware that physically removing these fields
|
||||
* will break ABI. Replace removed fields with dummy fields, and
|
||||
* add new fields to AVStreamInternal.
|
||||
*****************************************************************
|
||||
*/
|
||||
|
||||
/**
|
||||
* Stream information used internally by av_find_stream_info()
|
||||
* Stream information used internally by avformat_find_stream_info()
|
||||
*/
|
||||
#define MAX_STD_TIMEBASES (30*12+30+3+6)
|
||||
struct {
|
||||
@@ -1048,7 +1064,7 @@ typedef struct AVStream {
|
||||
int probe_packets;
|
||||
|
||||
/**
|
||||
* Number of frames that have been demuxed during av_find_stream_info()
|
||||
* Number of frames that have been demuxed during avformat_find_stream_info()
|
||||
*/
|
||||
int codec_info_nb_frames;
|
||||
|
||||
@@ -1187,6 +1203,12 @@ typedef struct AVStream {
|
||||
*/
|
||||
int inject_global_side_data;
|
||||
|
||||
/*****************************************************************
|
||||
* All fields above this line are not part of the public API.
|
||||
* Fields below are part of the public API and ABI again.
|
||||
*****************************************************************
|
||||
*/
|
||||
|
||||
/**
|
||||
* String containing paris of key and values describing recommended encoder configuration.
|
||||
* Paris are separated by ','.
|
||||
@@ -1446,8 +1468,12 @@ typedef struct AVFormatContext {
|
||||
#define AVFMT_FLAG_MP4A_LATM 0x8000 ///< Enable RTP MP4A-LATM payload
|
||||
#define AVFMT_FLAG_SORT_DTS 0x10000 ///< try to interleave outputted packets by dts (using this flag can slow demuxing down)
|
||||
#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 ///< Don't merge side data but keep it separate.
|
||||
#if FF_API_LAVF_KEEPSIDE_FLAG
|
||||
#define AVFMT_FLAG_KEEP_SIDE_DATA 0x40000 ///< Don't merge side data but keep it separate. Deprecated, will be the default.
|
||||
#endif
|
||||
#define AVFMT_FLAG_FAST_SEEK 0x80000 ///< Enable fast, but inaccurate seeks for some formats
|
||||
#define AVFMT_FLAG_SHORTEST 0x100000 ///< Stop muxing when the shortest stream stops.
|
||||
#define AVFMT_FLAG_AUTO_BSF 0x200000 ///< Wait for packet data before writing a header, and add bitstream filters as requested by the muxer
|
||||
|
||||
/**
|
||||
* Maximum size of the data read from input for determining
|
||||
@@ -1633,7 +1659,7 @@ typedef struct AVFormatContext {
|
||||
/**
|
||||
* Audio preload in microseconds.
|
||||
* Note, not all formats support this and unpredictable things may happen if it is used when not supported.
|
||||
* - encoding: Set by user via AVOptions (NO direct access)
|
||||
* - encoding: Set by user
|
||||
* - decoding: unused
|
||||
*/
|
||||
int audio_preload;
|
||||
@@ -1641,7 +1667,7 @@ typedef struct AVFormatContext {
|
||||
/**
|
||||
* Max chunk time in microseconds.
|
||||
* Note, not all formats support this and unpredictable things may happen if it is used when not supported.
|
||||
* - encoding: Set by user via AVOptions (NO direct access)
|
||||
* - encoding: Set by user
|
||||
* - decoding: unused
|
||||
*/
|
||||
int max_chunk_duration;
|
||||
@@ -1649,7 +1675,7 @@ typedef struct AVFormatContext {
|
||||
/**
|
||||
* Max chunk size in bytes
|
||||
* Note, not all formats support this and unpredictable things may happen if it is used when not supported.
|
||||
* - encoding: Set by user via AVOptions (NO direct access)
|
||||
* - encoding: Set by user
|
||||
* - decoding: unused
|
||||
*/
|
||||
int max_chunk_size;
|
||||
@@ -1658,14 +1684,14 @@ typedef struct AVFormatContext {
|
||||
* forces the use of wallclock timestamps as pts/dts of packets
|
||||
* This has undefined results in the presence of B frames.
|
||||
* - encoding: unused
|
||||
* - decoding: Set by user via AVOptions (NO direct access)
|
||||
* - decoding: Set by user
|
||||
*/
|
||||
int use_wallclock_as_timestamps;
|
||||
|
||||
/**
|
||||
* avio flags, used to force AVIO_FLAG_DIRECT.
|
||||
* - encoding: unused
|
||||
* - decoding: Set by user via AVOptions (NO direct access)
|
||||
* - decoding: Set by user
|
||||
*/
|
||||
int avio_flags;
|
||||
|
||||
@@ -1673,34 +1699,34 @@ typedef struct AVFormatContext {
|
||||
* The duration field can be estimated through various ways, and this field can be used
|
||||
* to know how the duration was estimated.
|
||||
* - encoding: unused
|
||||
* - decoding: Read by user via AVOptions (NO direct access)
|
||||
* - decoding: Read by user
|
||||
*/
|
||||
enum AVDurationEstimationMethod duration_estimation_method;
|
||||
|
||||
/**
|
||||
* Skip initial bytes when opening stream
|
||||
* - encoding: unused
|
||||
* - decoding: Set by user via AVOptions (NO direct access)
|
||||
* - decoding: Set by user
|
||||
*/
|
||||
int64_t skip_initial_bytes;
|
||||
|
||||
/**
|
||||
* Correct single timestamp overflows
|
||||
* - encoding: unused
|
||||
* - decoding: Set by user via AVOptions (NO direct access)
|
||||
* - decoding: Set by user
|
||||
*/
|
||||
unsigned int correct_ts_overflow;
|
||||
|
||||
/**
|
||||
* Force seeking to any (also non key) frames.
|
||||
* - encoding: unused
|
||||
* - decoding: Set by user via AVOptions (NO direct access)
|
||||
* - decoding: Set by user
|
||||
*/
|
||||
int seek2any;
|
||||
|
||||
/**
|
||||
* Flush the I/O context after each packet.
|
||||
* - encoding: Set by user via AVOptions (NO direct access)
|
||||
* - encoding: Set by user
|
||||
* - decoding: unused
|
||||
*/
|
||||
int flush_packets;
|
||||
@@ -1710,14 +1736,14 @@ typedef struct AVFormatContext {
|
||||
* The maximal score is AVPROBE_SCORE_MAX, its set when the demuxer probes
|
||||
* the format.
|
||||
* - encoding: unused
|
||||
* - decoding: set by avformat, read by user via av_format_get_probe_score() (NO direct access)
|
||||
* - decoding: set by avformat, read by user
|
||||
*/
|
||||
int probe_score;
|
||||
|
||||
/**
|
||||
* number of bytes to read maximally to identify format.
|
||||
* - encoding: unused
|
||||
* - decoding: set by user through AVOPtions (NO direct access)
|
||||
* - decoding: set by user
|
||||
*/
|
||||
int format_probesize;
|
||||
|
||||
@@ -1725,7 +1751,7 @@ typedef struct AVFormatContext {
|
||||
* ',' separated list of allowed decoders.
|
||||
* If NULL then all are allowed
|
||||
* - encoding: unused
|
||||
* - decoding: set by user through AVOptions (NO direct access)
|
||||
* - decoding: set by user
|
||||
*/
|
||||
char *codec_whitelist;
|
||||
|
||||
@@ -1733,7 +1759,7 @@ typedef struct AVFormatContext {
|
||||
* ',' separated list of allowed demuxers.
|
||||
* If NULL then all are allowed
|
||||
* - encoding: unused
|
||||
* - decoding: set by user through AVOptions (NO direct access)
|
||||
* - decoding: set by user
|
||||
*/
|
||||
char *format_whitelist;
|
||||
|
||||
@@ -1755,7 +1781,7 @@ typedef struct AVFormatContext {
|
||||
* Forced video codec.
|
||||
* This allows forcing a specific decoder, even when there are multiple with
|
||||
* the same codec_id.
|
||||
* Demuxing: Set by user via av_format_set_video_codec (NO direct access).
|
||||
* Demuxing: Set by user
|
||||
*/
|
||||
AVCodec *video_codec;
|
||||
|
||||
@@ -1763,7 +1789,7 @@ typedef struct AVFormatContext {
|
||||
* Forced audio codec.
|
||||
* This allows forcing a specific decoder, even when there are multiple with
|
||||
* the same codec_id.
|
||||
* Demuxing: Set by user via av_format_set_audio_codec (NO direct access).
|
||||
* Demuxing: Set by user
|
||||
*/
|
||||
AVCodec *audio_codec;
|
||||
|
||||
@@ -1771,7 +1797,7 @@ typedef struct AVFormatContext {
|
||||
* Forced subtitle codec.
|
||||
* This allows forcing a specific decoder, even when there are multiple with
|
||||
* the same codec_id.
|
||||
* Demuxing: Set by user via av_format_set_subtitle_codec (NO direct access).
|
||||
* Demuxing: Set by user
|
||||
*/
|
||||
AVCodec *subtitle_codec;
|
||||
|
||||
@@ -1779,7 +1805,7 @@ typedef struct AVFormatContext {
|
||||
* Forced data codec.
|
||||
* This allows forcing a specific decoder, even when there are multiple with
|
||||
* the same codec_id.
|
||||
* Demuxing: Set by user via av_format_set_data_codec (NO direct access).
|
||||
* Demuxing: Set by user
|
||||
*/
|
||||
AVCodec *data_codec;
|
||||
|
||||
@@ -1803,15 +1829,13 @@ typedef struct AVFormatContext {
|
||||
|
||||
/**
|
||||
* Output timestamp offset, in microseconds.
|
||||
* Muxing: set by user via AVOptions (NO direct access)
|
||||
* Muxing: set by user
|
||||
*/
|
||||
int64_t output_ts_offset;
|
||||
|
||||
/**
|
||||
* dump format separator.
|
||||
* can be ", " or "\n " or anything else
|
||||
* Code outside libavformat should access this field using AVOptions
|
||||
* (NO direct access).
|
||||
* - muxing: Set by user.
|
||||
* - demuxing: Set by user.
|
||||
*/
|
||||
@@ -1848,7 +1872,7 @@ typedef struct AVFormatContext {
|
||||
/**
|
||||
* ',' separated list of allowed protocols.
|
||||
* - encoding: unused
|
||||
* - decoding: set by user through AVOptions (NO direct access)
|
||||
* - decoding: set by user
|
||||
*/
|
||||
char *protocol_whitelist;
|
||||
|
||||
@@ -1883,11 +1907,22 @@ typedef struct AVFormatContext {
|
||||
/**
|
||||
* ',' separated list of disallowed protocols.
|
||||
* - encoding: unused
|
||||
* - decoding: set by user through AVOptions (NO direct access)
|
||||
* - decoding: set by user
|
||||
*/
|
||||
char *protocol_blacklist;
|
||||
|
||||
/**
|
||||
* The maximum number of streams.
|
||||
* - encoding: unused
|
||||
* - decoding: set by user
|
||||
*/
|
||||
int max_streams;
|
||||
} AVFormatContext;
|
||||
|
||||
/**
|
||||
* Accessors for some AVFormatContext fields. These used to be provided for ABI
|
||||
* compatibility, and do not need to be used anymore.
|
||||
*/
|
||||
int av_format_get_probe_score(const AVFormatContext *s);
|
||||
AVCodec * av_format_get_video_codec(const AVFormatContext *s);
|
||||
void av_format_set_video_codec(AVFormatContext *s, AVCodec *c);
|
||||
@@ -2035,6 +2070,21 @@ const AVClass *avformat_get_class(void);
|
||||
*/
|
||||
AVStream *avformat_new_stream(AVFormatContext *s, const AVCodec *c);
|
||||
|
||||
/**
|
||||
* Wrap an existing array as stream side data.
|
||||
*
|
||||
* @param st stream
|
||||
* @param type side information type
|
||||
* @param data the side data array. It must be allocated with the av_malloc()
|
||||
* family of functions. The ownership of the data is transferred to
|
||||
* st.
|
||||
* @param size side information size
|
||||
* @return zero on success, a negative AVERROR code on failure. On failure,
|
||||
* the stream is unchanged and the data remains owned by the caller.
|
||||
*/
|
||||
int av_stream_add_side_data(AVStream *st, enum AVPacketSideDataType type,
|
||||
uint8_t *data, size_t size);
|
||||
|
||||
/**
|
||||
* Allocate new information from stream.
|
||||
*
|
||||
@@ -2369,6 +2419,10 @@ void avformat_close_input(AVFormatContext **s);
|
||||
* @addtogroup lavf_encoding
|
||||
* @{
|
||||
*/
|
||||
|
||||
#define AVSTREAM_INIT_IN_WRITE_HEADER 0 ///< stream parameters initialized in avformat_write_header
|
||||
#define AVSTREAM_INIT_IN_INIT_OUTPUT 1 ///< stream parameters initialized in avformat_init_output
|
||||
|
||||
/**
|
||||
* Allocate the stream private data and write the stream header to
|
||||
* an output media file.
|
||||
@@ -2380,13 +2434,37 @@ void avformat_close_input(AVFormatContext **s);
|
||||
* On return this parameter will be destroyed and replaced with a dict containing
|
||||
* options that were not found. May be NULL.
|
||||
*
|
||||
* @return 0 on success, negative AVERROR on failure.
|
||||
* @return AVSTREAM_INIT_IN_WRITE_HEADER on success if the codec had not already been fully initialized in avformat_init,
|
||||
* AVSTREAM_INIT_IN_INIT_OUTPUT on success if the codec had already been fully initialized in avformat_init,
|
||||
* negative AVERROR on failure.
|
||||
*
|
||||
* @see av_opt_find, av_dict_set, avio_open, av_oformat_next.
|
||||
* @see av_opt_find, av_dict_set, avio_open, av_oformat_next, avformat_init_output.
|
||||
*/
|
||||
av_warn_unused_result
|
||||
int avformat_write_header(AVFormatContext *s, AVDictionary **options);
|
||||
|
||||
/**
|
||||
* Allocate the stream private data and initialize the codec, but do not write the header.
|
||||
* May optionally be used before avformat_write_header to initialize stream parameters
|
||||
* before actually writing the header.
|
||||
* If using this function, do not pass the same options to avformat_write_header.
|
||||
*
|
||||
* @param s Media file handle, must be allocated with avformat_alloc_context().
|
||||
* Its oformat field must be set to the desired output format;
|
||||
* Its pb field must be set to an already opened AVIOContext.
|
||||
* @param options An AVDictionary filled with AVFormatContext and muxer-private options.
|
||||
* On return this parameter will be destroyed and replaced with a dict containing
|
||||
* options that were not found. May be NULL.
|
||||
*
|
||||
* @return AVSTREAM_INIT_IN_WRITE_HEADER on success if the codec requires avformat_write_header to fully initialize,
|
||||
* AVSTREAM_INIT_IN_INIT_OUTPUT on success if the codec has been fully initialized,
|
||||
* negative AVERROR on failure.
|
||||
*
|
||||
* @see av_opt_find, av_dict_set, avio_open, av_oformat_next, avformat_write_header.
|
||||
*/
|
||||
av_warn_unused_result
|
||||
int avformat_init_output(AVFormatContext *s, AVDictionary **options);
|
||||
|
||||
/**
|
||||
* Write a packet to an output media file.
|
||||
*
|
||||
@@ -2893,6 +2971,36 @@ int av_apply_bitstream_filters(AVCodecContext *codec, AVPacket *pkt,
|
||||
AVBitStreamFilterContext *bsfc);
|
||||
#endif
|
||||
|
||||
enum AVTimebaseSource {
|
||||
AVFMT_TBCF_AUTO = -1,
|
||||
AVFMT_TBCF_DECODER,
|
||||
AVFMT_TBCF_DEMUXER,
|
||||
#if FF_API_R_FRAME_RATE
|
||||
AVFMT_TBCF_R_FRAMERATE,
|
||||
#endif
|
||||
};
|
||||
|
||||
/**
|
||||
* Transfer internal timing information from one stream to another.
|
||||
*
|
||||
* This function is useful when doing stream copy.
|
||||
*
|
||||
* @param ofmt target output format for ost
|
||||
* @param ost output stream which needs timings copy and adjustments
|
||||
* @param ist reference input stream to copy timings from
|
||||
* @param copy_tb define from where the stream codec timebase needs to be imported
|
||||
*/
|
||||
int avformat_transfer_internal_stream_timing_info(const AVOutputFormat *ofmt,
|
||||
AVStream *ost, const AVStream *ist,
|
||||
enum AVTimebaseSource copy_tb);
|
||||
|
||||
/**
|
||||
* Get the internal codec timebase from a stream.
|
||||
*
|
||||
* @param st input stream to extract the timebase from
|
||||
*/
|
||||
AVRational av_stream_get_codec_timebase(const AVStream *st);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
@@ -34,7 +34,15 @@
|
||||
|
||||
#include "libavformat/version.h"
|
||||
|
||||
#define AVIO_SEEKABLE_NORMAL 0x0001 /**< Seeking works like for a local file */
|
||||
/**
|
||||
* Seeking works like for a local file.
|
||||
*/
|
||||
#define AVIO_SEEKABLE_NORMAL (1 << 0)
|
||||
|
||||
/**
|
||||
* Seeking by timestamp with avio_seek_time() is possible.
|
||||
*/
|
||||
#define AVIO_SEEKABLE_TIME (1 << 1)
|
||||
|
||||
/**
|
||||
* Callback for checking whether to abort blocking functions.
|
||||
@@ -313,6 +321,14 @@ typedef struct AVIOContext {
|
||||
*/
|
||||
enum AVIODataMarkerType current_type;
|
||||
int64_t last_time;
|
||||
|
||||
/**
|
||||
* A callback that is used instead of short_seek_threshold.
|
||||
* This is current internal only, do not use from outside.
|
||||
*/
|
||||
int (*short_seek_get)(void *opaque);
|
||||
|
||||
int64_t written;
|
||||
} AVIOContext;
|
||||
|
||||
/**
|
||||
@@ -703,6 +719,18 @@ int avio_closep(AVIOContext **s);
|
||||
*/
|
||||
int avio_open_dyn_buf(AVIOContext **s);
|
||||
|
||||
/**
|
||||
* Return the written size and a pointer to the buffer.
|
||||
* The AVIOContext stream is left intact.
|
||||
* The buffer must NOT be freed.
|
||||
* No padding is added to the buffer.
|
||||
*
|
||||
* @param s IO context
|
||||
* @param pbuffer pointer to a byte buffer
|
||||
* @return the length of the byte buffer
|
||||
*/
|
||||
int avio_get_dyn_buf(AVIOContext *s, uint8_t **pbuffer);
|
||||
|
||||
/**
|
||||
* Return the written size and a pointer to the buffer. The buffer
|
||||
* must be freed with av_free().
|
||||
|
||||
@@ -32,8 +32,8 @@
|
||||
// Major bumping may affect Ticket5467, 5421, 5451(compatibility with Chromium)
|
||||
// Also please add any ticket numbers that you believe might be affected here
|
||||
#define LIBAVFORMAT_VERSION_MAJOR 57
|
||||
#define LIBAVFORMAT_VERSION_MINOR 48
|
||||
#define LIBAVFORMAT_VERSION_MICRO 103
|
||||
#define LIBAVFORMAT_VERSION_MINOR 72
|
||||
#define LIBAVFORMAT_VERSION_MICRO 101
|
||||
|
||||
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
|
||||
LIBAVFORMAT_VERSION_MINOR, \
|
||||
@@ -82,6 +82,22 @@
|
||||
#ifndef FF_API_NOCONST_GET_SIDE_DATA
|
||||
#define FF_API_NOCONST_GET_SIDE_DATA (LIBAVFORMAT_VERSION_MAJOR < 58)
|
||||
#endif
|
||||
#ifndef FF_API_HTTP_USER_AGENT
|
||||
#define FF_API_HTTP_USER_AGENT (LIBAVFORMAT_VERSION_MAJOR < 58)
|
||||
#endif
|
||||
#ifndef FF_API_HLS_WRAP
|
||||
#define FF_API_HLS_WRAP (LIBAVFORMAT_VERSION_MAJOR < 58)
|
||||
#endif
|
||||
#ifndef FF_API_LAVF_MERGE_SD
|
||||
#define FF_API_LAVF_MERGE_SD (LIBAVFORMAT_VERSION_MAJOR < 58)
|
||||
#endif
|
||||
#ifndef FF_API_LAVF_KEEPSIDE_FLAG
|
||||
#define FF_API_LAVF_KEEPSIDE_FLAG (LIBAVFORMAT_VERSION_MAJOR < 58)
|
||||
#endif
|
||||
#ifndef FF_API_OLD_ROTATE_API
|
||||
#define FF_API_OLD_ROTATE_API (LIBAVFORMAT_VERSION_MAJOR < 58)
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef FF_API_R_FRAME_RATE
|
||||
#define FF_API_R_FRAME_RATE 1
|
||||
|
||||
Reference in new issue
Block a user