Update FFmpeg to version 4.
This commit is contained in:
61 files changed
+2100
-1634
No files matched your search
@@ -437,19 +437,6 @@ int av_get_packet(AVIOContext *s, AVPacket *pkt, int size);
|
||||
*/
|
||||
int av_append_packet(AVIOContext *s, AVPacket *pkt, int size);
|
||||
|
||||
#if FF_API_LAVF_FRAC
|
||||
/*************************************************/
|
||||
/* fractional numbers for exact pts handling */
|
||||
|
||||
/**
|
||||
* The exact value of the fractional number is: 'val + num / den'.
|
||||
* num is assumed to be 0 <= num < den.
|
||||
*/
|
||||
typedef struct AVFrac {
|
||||
int64_t val, num, den;
|
||||
} AVFrac;
|
||||
#endif
|
||||
|
||||
/*************************************************/
|
||||
/* input/output formats */
|
||||
|
||||
@@ -478,10 +465,6 @@ typedef struct AVProbeData {
|
||||
#define AVFMT_NOFILE 0x0001
|
||||
#define AVFMT_NEEDNUMBER 0x0002 /**< Needs '%d' in filename. */
|
||||
#define AVFMT_SHOW_IDS 0x0008 /**< Show format stream IDs numbers. */
|
||||
#if FF_API_LAVF_FMT_RAWPICTURE
|
||||
#define AVFMT_RAWPICTURE 0x0020 /**< Format wants AVPicture structure for
|
||||
raw picture data. @deprecated Not used anymore */
|
||||
#endif
|
||||
#define AVFMT_GLOBALHEADER 0x0040 /**< Format wants global header. */
|
||||
#define AVFMT_NOTIMESTAMPS 0x0080 /**< Format does not need / have any timestamps. */
|
||||
#define AVFMT_GENERIC_INDEX 0x0100 /**< Use generic index building code. */
|
||||
@@ -802,9 +785,9 @@ enum AVStreamParseType {
|
||||
AVSTREAM_PARSE_HEADERS, /**< Only parse headers, do not repack. */
|
||||
AVSTREAM_PARSE_TIMESTAMPS, /**< full parsing and interpolation of timestamps for frames not starting on a packet boundary */
|
||||
AVSTREAM_PARSE_FULL_ONCE, /**< full parsing and repack of the first frame only, only implemented for H.264 currently */
|
||||
AVSTREAM_PARSE_FULL_RAW=MKTAG(0,'R','A','W'), /**< full parsing and repack with timestamp and position generation by parser for raw
|
||||
this assumes that each packet in the file contains no demuxer level headers and
|
||||
just codec level data, otherwise position generation would fail */
|
||||
AVSTREAM_PARSE_FULL_RAW, /**< full parsing and repack with timestamp and position generation by parser for raw
|
||||
this assumes that each packet in the file contains no demuxer level headers and
|
||||
just codec level data, otherwise position generation would fail */
|
||||
};
|
||||
|
||||
typedef struct AVIndexEntry {
|
||||
@@ -862,6 +845,7 @@ typedef struct AVStreamInternal AVStreamInternal;
|
||||
#define AV_DISPOSITION_CAPTIONS 0x10000
|
||||
#define AV_DISPOSITION_DESCRIPTIONS 0x20000
|
||||
#define AV_DISPOSITION_METADATA 0x40000
|
||||
#define AV_DISPOSITION_DEPENDENT 0x80000 ///< dependent audio stream (mix_type=0 in mpegts)
|
||||
|
||||
/**
|
||||
* Options for behavior on timestamp wrap detection.
|
||||
@@ -894,14 +878,6 @@ typedef struct AVStream {
|
||||
#endif
|
||||
void *priv_data;
|
||||
|
||||
#if FF_API_LAVF_FRAC
|
||||
/**
|
||||
* @deprecated this field is unused
|
||||
*/
|
||||
attribute_deprecated
|
||||
struct AVFrac pts;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* This is the fundamental unit of time (in seconds) in terms
|
||||
* of which frame timestamps are represented.
|
||||
@@ -1001,6 +977,39 @@ typedef struct AVStream {
|
||||
int event_flags;
|
||||
#define AVSTREAM_EVENT_FLAG_METADATA_UPDATED 0x0001 ///< The call resulted in updated metadata.
|
||||
|
||||
/**
|
||||
* Real base framerate of the stream.
|
||||
* This is the lowest framerate with which all timestamps can be
|
||||
* represented accurately (it is the least common multiple of all
|
||||
* framerates in the stream). Note, this value is just a guess!
|
||||
* For example, if the time base is 1/90000 and all frames have either
|
||||
* approximately 3600 or 1800 timer ticks, then r_frame_rate will be 50/1.
|
||||
*/
|
||||
AVRational r_frame_rate;
|
||||
|
||||
#if FF_API_LAVF_FFSERVER
|
||||
/**
|
||||
* String containing pairs of key and values describing recommended encoder configuration.
|
||||
* Pairs are separated by ','.
|
||||
* Keys are separated from values by '='.
|
||||
*
|
||||
* @deprecated unused
|
||||
*/
|
||||
attribute_deprecated
|
||||
char *recommended_encoder_configuration;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Codec parameters associated with this stream. Allocated and freed by
|
||||
* libavformat in avformat_new_stream() and avformat_free_context()
|
||||
* respectively.
|
||||
*
|
||||
* - demuxing: filled by libavformat on stream creation or in
|
||||
* avformat_find_stream_info()
|
||||
* - muxing: filled by the caller before avformat_write_header()
|
||||
*/
|
||||
AVCodecParameters *codecpar;
|
||||
|
||||
/*****************************************************************
|
||||
* 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
|
||||
@@ -1011,10 +1020,10 @@ typedef struct AVStream {
|
||||
*****************************************************************
|
||||
*/
|
||||
|
||||
#define MAX_STD_TIMEBASES (30*12+30+3+6)
|
||||
/**
|
||||
* Stream information used internally by avformat_find_stream_info()
|
||||
*/
|
||||
#define MAX_STD_TIMEBASES (30*12+30+3+6)
|
||||
struct {
|
||||
int64_t last_dts;
|
||||
int64_t duration_gcd;
|
||||
@@ -1023,6 +1032,7 @@ typedef struct AVStream {
|
||||
double (*duration_error)[2][MAX_STD_TIMEBASES];
|
||||
int64_t codec_info_duration;
|
||||
int64_t codec_info_duration_fields;
|
||||
int frame_delay_evidence;
|
||||
|
||||
/**
|
||||
* 0 -> decoder has not been searched for yet.
|
||||
@@ -1085,19 +1095,6 @@ typedef struct AVStream {
|
||||
int nb_index_entries;
|
||||
unsigned int index_entries_allocated_size;
|
||||
|
||||
/**
|
||||
* Real base framerate of the stream.
|
||||
* This is the lowest framerate with which all timestamps can be
|
||||
* represented accurately (it is the least common multiple of all
|
||||
* framerates in the stream). Note, this value is just a guess!
|
||||
* For example, if the time base is 1/90000 and all frames have either
|
||||
* approximately 3600 or 1800 timer ticks, then r_frame_rate will be 50/1.
|
||||
*
|
||||
* Code outside avformat should access this field using:
|
||||
* av_stream_get/set_r_frame_rate(stream)
|
||||
*/
|
||||
AVRational r_frame_rate;
|
||||
|
||||
/**
|
||||
* Stream Identifier
|
||||
* This is the MPEG-TS stream identifier +1
|
||||
@@ -1203,19 +1200,6 @@ 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 ','.
|
||||
* Keys are separated from values by '='.
|
||||
*/
|
||||
char *recommended_encoder_configuration;
|
||||
|
||||
/**
|
||||
* display aspect ratio (0 if unknown)
|
||||
* - encoding: unused
|
||||
@@ -1223,31 +1207,31 @@ typedef struct AVStream {
|
||||
*/
|
||||
AVRational display_aspect_ratio;
|
||||
|
||||
struct FFFrac *priv_pts;
|
||||
|
||||
/**
|
||||
* An opaque field for libavformat internal usage.
|
||||
* Must not be accessed in any way by callers.
|
||||
*/
|
||||
AVStreamInternal *internal;
|
||||
|
||||
/*
|
||||
* Codec parameters associated with this stream. Allocated and freed by
|
||||
* libavformat in avformat_new_stream() and avformat_free_context()
|
||||
* respectively.
|
||||
*
|
||||
* - demuxing: filled by libavformat on stream creation or in
|
||||
* avformat_find_stream_info()
|
||||
* - muxing: filled by the caller before avformat_write_header()
|
||||
*/
|
||||
AVCodecParameters *codecpar;
|
||||
} AVStream;
|
||||
|
||||
#if FF_API_FORMAT_GET_SET
|
||||
/**
|
||||
* Accessors for some AVStream fields. These used to be provided for ABI
|
||||
* compatibility, and do not need to be used anymore.
|
||||
*/
|
||||
attribute_deprecated
|
||||
AVRational av_stream_get_r_frame_rate(const AVStream *s);
|
||||
attribute_deprecated
|
||||
void av_stream_set_r_frame_rate(AVStream *s, AVRational r);
|
||||
struct AVCodecParserContext *av_stream_get_parser(const AVStream *s);
|
||||
#if FF_API_LAVF_FFSERVER
|
||||
attribute_deprecated
|
||||
char* av_stream_get_recommended_encoder_configuration(const AVStream *s);
|
||||
attribute_deprecated
|
||||
void av_stream_set_recommended_encoder_configuration(AVStream *s, char *configuration);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
struct AVCodecParserContext *av_stream_get_parser(const AVStream *s);
|
||||
|
||||
/**
|
||||
* Returns the pts of the last muxed packet + its duration
|
||||
@@ -1292,6 +1276,11 @@ typedef struct AVProgram {
|
||||
|
||||
#define AVFMTCTX_NOHEADER 0x0001 /**< signal that no header is present
|
||||
(streams are added dynamically) */
|
||||
#define AVFMTCTX_UNSEEKABLE 0x0002 /**< signal that the stream is definitely
|
||||
not seekable, and attempts to call the
|
||||
seek function will fail. For some
|
||||
network protocols (e.g. HLS), this can
|
||||
change dynamically at runtime. */
|
||||
|
||||
typedef struct AVChapter {
|
||||
int id; ///< unique ID to identify the chapter
|
||||
@@ -1406,13 +1395,33 @@ typedef struct AVFormatContext {
|
||||
*/
|
||||
AVStream **streams;
|
||||
|
||||
#if FF_API_FORMAT_FILENAME
|
||||
/**
|
||||
* input or output filename
|
||||
*
|
||||
* - demuxing: set by avformat_open_input()
|
||||
* - muxing: may be set by the caller before avformat_write_header()
|
||||
*
|
||||
* @deprecated Use url instead.
|
||||
*/
|
||||
attribute_deprecated
|
||||
char filename[1024];
|
||||
#endif
|
||||
|
||||
/**
|
||||
* input or output URL. Unlike the old filename field, this field has no
|
||||
* length restriction.
|
||||
*
|
||||
* - demuxing: set by avformat_open_input(), initialized to an empty
|
||||
* string if url parameter was NULL in avformat_open_input().
|
||||
* - muxing: may be set by the caller before calling avformat_write_header()
|
||||
* (or avformat_init_output() if that is called first) to a string
|
||||
* which is freeable by av_free(). Set to an empty string if it
|
||||
* was NULL in avformat_init_output().
|
||||
*
|
||||
* Freed by libavformat in avformat_free_context().
|
||||
*/
|
||||
char *url;
|
||||
|
||||
/**
|
||||
* Position of the first frame of the component, in
|
||||
@@ -1469,11 +1478,11 @@ typedef struct AVFormatContext {
|
||||
#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)
|
||||
#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.
|
||||
#define AVFMT_FLAG_KEEP_SIDE_DATA 0x40000 ///< Deprecated, does nothing.
|
||||
#endif
|
||||
#define AVFMT_FLAG_FAST_SEEK 0x80000 ///< Enable fast, but inaccurate seeks for some formats
|
||||
#define AVFMT_FLAG_SHORTEST 0x100000 ///< Stop muxing when the shortest stream stops.
|
||||
#define AVFMT_FLAG_AUTO_BSF 0x200000 ///< Wait for packet data before writing a header, and add bitstream filters as requested by the muxer
|
||||
#define AVFMT_FLAG_AUTO_BSF 0x200000 ///< Add bitstream filters as requested by the muxer
|
||||
|
||||
/**
|
||||
* Maximum size of the data read from input for determining
|
||||
@@ -1876,7 +1885,7 @@ typedef struct AVFormatContext {
|
||||
*/
|
||||
char *protocol_whitelist;
|
||||
|
||||
/*
|
||||
/**
|
||||
* A callback for opening new IO streams.
|
||||
*
|
||||
* Whenever a muxer or a demuxer needs to open an IO stream (typically from
|
||||
@@ -1919,29 +1928,46 @@ typedef struct AVFormatContext {
|
||||
int max_streams;
|
||||
} AVFormatContext;
|
||||
|
||||
#if FF_API_FORMAT_GET_SET
|
||||
/**
|
||||
* Accessors for some AVFormatContext fields. These used to be provided for ABI
|
||||
* compatibility, and do not need to be used anymore.
|
||||
*/
|
||||
attribute_deprecated
|
||||
int av_format_get_probe_score(const AVFormatContext *s);
|
||||
attribute_deprecated
|
||||
AVCodec * av_format_get_video_codec(const AVFormatContext *s);
|
||||
attribute_deprecated
|
||||
void av_format_set_video_codec(AVFormatContext *s, AVCodec *c);
|
||||
attribute_deprecated
|
||||
AVCodec * av_format_get_audio_codec(const AVFormatContext *s);
|
||||
attribute_deprecated
|
||||
void av_format_set_audio_codec(AVFormatContext *s, AVCodec *c);
|
||||
attribute_deprecated
|
||||
AVCodec * av_format_get_subtitle_codec(const AVFormatContext *s);
|
||||
attribute_deprecated
|
||||
void av_format_set_subtitle_codec(AVFormatContext *s, AVCodec *c);
|
||||
attribute_deprecated
|
||||
AVCodec * av_format_get_data_codec(const AVFormatContext *s);
|
||||
attribute_deprecated
|
||||
void av_format_set_data_codec(AVFormatContext *s, AVCodec *c);
|
||||
attribute_deprecated
|
||||
int av_format_get_metadata_header_padding(const AVFormatContext *s);
|
||||
attribute_deprecated
|
||||
void av_format_set_metadata_header_padding(AVFormatContext *s, int c);
|
||||
attribute_deprecated
|
||||
void * av_format_get_opaque(const AVFormatContext *s);
|
||||
attribute_deprecated
|
||||
void av_format_set_opaque(AVFormatContext *s, void *opaque);
|
||||
attribute_deprecated
|
||||
av_format_control_message av_format_get_control_message_cb(const AVFormatContext *s);
|
||||
attribute_deprecated
|
||||
void av_format_set_control_message_cb(AVFormatContext *s, av_format_control_message callback);
|
||||
#if FF_API_OLD_OPEN_CALLBACKS
|
||||
attribute_deprecated AVOpenCallback av_format_get_open_cb(const AVFormatContext *s);
|
||||
attribute_deprecated void av_format_set_open_cb(AVFormatContext *s, AVOpenCallback callback);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* This function will cause global side data to be injected in the next packet
|
||||
@@ -1986,6 +2012,7 @@ const char *avformat_configuration(void);
|
||||
*/
|
||||
const char *avformat_license(void);
|
||||
|
||||
#if FF_API_NEXT
|
||||
/**
|
||||
* Initialize libavformat and register all the muxers, demuxers and
|
||||
* protocols. If you do not call this function, then you can select
|
||||
@@ -1994,31 +2021,44 @@ const char *avformat_license(void);
|
||||
* @see av_register_input_format()
|
||||
* @see av_register_output_format()
|
||||
*/
|
||||
attribute_deprecated
|
||||
void av_register_all(void);
|
||||
|
||||
attribute_deprecated
|
||||
void av_register_input_format(AVInputFormat *format);
|
||||
attribute_deprecated
|
||||
void av_register_output_format(AVOutputFormat *format);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Do global initialization of network components. This is optional,
|
||||
* but recommended, since it avoids the overhead of implicitly
|
||||
* doing the setup for each session.
|
||||
* Do global initialization of network libraries. This is optional,
|
||||
* and not recommended anymore.
|
||||
*
|
||||
* Calling this function will become mandatory if using network
|
||||
* protocols at some major version bump.
|
||||
* This functions only exists to work around thread-safety issues
|
||||
* with older GnuTLS or OpenSSL libraries. If libavformat is linked
|
||||
* to newer versions of those libraries, or if you do not use them,
|
||||
* calling this function is unnecessary. Otherwise, you need to call
|
||||
* this function before any other threads using them are started.
|
||||
*
|
||||
* This function will be deprecated once support for older GnuTLS and
|
||||
* OpenSSL libraries is removed, and this function has no purpose
|
||||
* anymore.
|
||||
*/
|
||||
int avformat_network_init(void);
|
||||
|
||||
/**
|
||||
* Undo the initialization done by avformat_network_init.
|
||||
* Undo the initialization done by avformat_network_init. Call it only
|
||||
* once for each time you called avformat_network_init.
|
||||
*/
|
||||
int avformat_network_deinit(void);
|
||||
|
||||
#if FF_API_NEXT
|
||||
/**
|
||||
* If f is NULL, returns the first registered input format,
|
||||
* if f is non-NULL, returns the next registered input format after f
|
||||
* or NULL if f is the last one.
|
||||
*/
|
||||
attribute_deprecated
|
||||
AVInputFormat *av_iformat_next(const AVInputFormat *f);
|
||||
|
||||
/**
|
||||
@@ -2026,7 +2066,31 @@ AVInputFormat *av_iformat_next(const AVInputFormat *f);
|
||||
* if f is non-NULL, returns the next registered output format after f
|
||||
* or NULL if f is the last one.
|
||||
*/
|
||||
attribute_deprecated
|
||||
AVOutputFormat *av_oformat_next(const AVOutputFormat *f);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Iterate over all registered muxers.
|
||||
*
|
||||
* @param opaque a pointer where libavformat will store the iteration state. Must
|
||||
* point to NULL to start the iteration.
|
||||
*
|
||||
* @return the next registered muxer or NULL when the iteration is
|
||||
* finished
|
||||
*/
|
||||
const AVOutputFormat *av_muxer_iterate(void **opaque);
|
||||
|
||||
/**
|
||||
* Iterate over all registered demuxers.
|
||||
*
|
||||
* @param opaque a pointer where libavformat will store the iteration state. Must
|
||||
* point to NULL to start the iteration.
|
||||
*
|
||||
* @return the next registered demuxer or NULL when the iteration is
|
||||
* finished
|
||||
*/
|
||||
const AVInputFormat *av_demuxer_iterate(void **opaque);
|
||||
|
||||
/**
|
||||
* Allocate an AVFormatContext.
|
||||
@@ -2103,13 +2167,8 @@ uint8_t *av_stream_new_side_data(AVStream *stream,
|
||||
* @param size pointer for side information size to store (optional)
|
||||
* @return pointer to data if present or NULL otherwise
|
||||
*/
|
||||
#if FF_API_NOCONST_GET_SIDE_DATA
|
||||
uint8_t *av_stream_get_side_data(AVStream *stream,
|
||||
enum AVPacketSideDataType type, int *size);
|
||||
#else
|
||||
uint8_t *av_stream_get_side_data(const AVStream *stream,
|
||||
enum AVPacketSideDataType type, int *size);
|
||||
#endif
|
||||
|
||||
AVProgram *av_new_program(AVFormatContext *s, int id);
|
||||
|
||||
@@ -2954,6 +3013,7 @@ int avformat_match_stream_specifier(AVFormatContext *s, AVStream *st,
|
||||
|
||||
int avformat_queue_attached_pictures(AVFormatContext *s);
|
||||
|
||||
#if FF_API_OLD_BSF
|
||||
/**
|
||||
* Apply a list of bitstream filters to a packet.
|
||||
*
|
||||
@@ -2965,7 +3025,6 @@ int avformat_queue_attached_pictures(AVFormatContext *s);
|
||||
* @return >=0 on success;
|
||||
* AVERROR code on failure
|
||||
*/
|
||||
#if FF_API_OLD_BSF
|
||||
attribute_deprecated
|
||||
int av_apply_bitstream_filters(AVCodecContext *codec, AVPacket *pkt,
|
||||
AVBitStreamFilterContext *bsfc);
|
||||
|
||||
Reference in new issue
Block a user