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);
|
||||
|
||||
@@ -137,7 +137,13 @@ enum AVIODataMarkerType {
|
||||
* Trailer data, which doesn't contain actual content, but only for
|
||||
* finalizing the output file.
|
||||
*/
|
||||
AVIO_DATA_MARKER_TRAILER
|
||||
AVIO_DATA_MARKER_TRAILER,
|
||||
/**
|
||||
* A point in the output bytestream where the underlying AVIOContext might
|
||||
* flush the buffer depending on latency or buffering requirements. Typically
|
||||
* means the end of a packet.
|
||||
*/
|
||||
AVIO_DATA_MARKER_FLUSH_POINT,
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -168,8 +174,9 @@ typedef struct AVIOContext {
|
||||
const AVClass *av_class;
|
||||
|
||||
/*
|
||||
* The following shows the relationship between buffer, buf_ptr, buf_end, buf_size,
|
||||
* and pos, when reading and when writing (since AVIOContext is used for both):
|
||||
* The following shows the relationship between buffer, buf_ptr,
|
||||
* buf_ptr_max, buf_end, buf_size, and pos, when reading and when writing
|
||||
* (since AVIOContext is used for both):
|
||||
*
|
||||
**********************************************************************************
|
||||
* READING
|
||||
@@ -196,21 +203,24 @@ typedef struct AVIOContext {
|
||||
* WRITING
|
||||
**********************************************************************************
|
||||
*
|
||||
* | buffer_size |
|
||||
* |-------------------------------|
|
||||
* | |
|
||||
* | buffer_size |
|
||||
* |--------------------------------------|
|
||||
* | |
|
||||
*
|
||||
* buffer buf_ptr buf_end
|
||||
* +-------------------+-----------+
|
||||
* |/ / / / / / / / / /| |
|
||||
* write buffer: | / to be flushed / | |
|
||||
* |/ / / / / / / / / /| |
|
||||
* +-------------------+-----------+
|
||||
* buf_ptr_max
|
||||
* buffer (buf_ptr) buf_end
|
||||
* +-----------------------+--------------+
|
||||
* |/ / / / / / / / / / / /| |
|
||||
* write buffer: | / / to be flushed / / | |
|
||||
* |/ / / / / / / / / / / /| |
|
||||
* +-----------------------+--------------+
|
||||
* buf_ptr can be in this
|
||||
* due to a backward seek
|
||||
*
|
||||
* pos
|
||||
* +--------------------------+-----------------------------------+
|
||||
* output file: | | |
|
||||
* +--------------------------+-----------------------------------+
|
||||
* pos
|
||||
* +-------------+----------------------------------------------+
|
||||
* output file: | | |
|
||||
* +-------------+----------------------------------------------+
|
||||
*
|
||||
*/
|
||||
unsigned char *buffer; /**< Start of the buffer. */
|
||||
@@ -226,7 +236,6 @@ typedef struct AVIOContext {
|
||||
int (*write_packet)(void *opaque, uint8_t *buf, int buf_size);
|
||||
int64_t (*seek)(void *opaque, int64_t offset, int whence);
|
||||
int64_t pos; /**< position in the file of the current buffer */
|
||||
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 */
|
||||
int max_packet_size;
|
||||
@@ -329,6 +338,17 @@ typedef struct AVIOContext {
|
||||
int (*short_seek_get)(void *opaque);
|
||||
|
||||
int64_t written;
|
||||
|
||||
/**
|
||||
* Maximum reached position before a backward seek in the write buffer,
|
||||
* used keeping track of already written data for a later flush.
|
||||
*/
|
||||
unsigned char *buf_ptr_max;
|
||||
|
||||
/**
|
||||
* Try to buffer at least this amount of data before flushing it
|
||||
*/
|
||||
int min_packet_size;
|
||||
} AVIOContext;
|
||||
|
||||
/**
|
||||
@@ -418,7 +438,7 @@ void avio_free_directory_entry(AVIODirEntry **entry);
|
||||
|
||||
/**
|
||||
* Allocate and initialize an AVIOContext for buffered I/O. It must be later
|
||||
* freed with av_free().
|
||||
* freed with avio_context_free().
|
||||
*
|
||||
* @param buffer Memory block for input/output operations via AVIOContext.
|
||||
* The buffer must be allocated with av_malloc() and friends.
|
||||
@@ -431,6 +451,8 @@ void avio_free_directory_entry(AVIODirEntry **entry);
|
||||
* @param write_flag Set to 1 if the buffer should be writable, 0 otherwise.
|
||||
* @param opaque An opaque pointer to user-specific data.
|
||||
* @param read_packet A function for refilling the buffer, may be NULL.
|
||||
* For stream protocols, must never return 0 but rather
|
||||
* a proper AVERROR code.
|
||||
* @param write_packet A function for writing the buffer contents, may be NULL.
|
||||
* The function may not change the input buffers content.
|
||||
* @param seek A function for seeking to specified byte position, may be NULL.
|
||||
@@ -446,6 +468,14 @@ AVIOContext *avio_alloc_context(
|
||||
int (*write_packet)(void *opaque, uint8_t *buf, int buf_size),
|
||||
int64_t (*seek)(void *opaque, int64_t offset, int whence));
|
||||
|
||||
/**
|
||||
* Free the supplied IO context and everything associated with it.
|
||||
*
|
||||
* @param s Double pointer to the IO context. This function will write NULL
|
||||
* into s.
|
||||
*/
|
||||
void avio_context_free(AVIOContext **s);
|
||||
|
||||
void avio_w8(AVIOContext *s, int b);
|
||||
void avio_write(AVIOContext *s, const unsigned char *buf, int size);
|
||||
void avio_wl64(AVIOContext *s, uint64_t val);
|
||||
@@ -540,13 +570,6 @@ int64_t avio_size(AVIOContext *s);
|
||||
* @return non zero if and only if end of file
|
||||
*/
|
||||
int avio_feof(AVIOContext *s);
|
||||
#if FF_API_URL_FEOF
|
||||
/**
|
||||
* @deprecated use avio_feof()
|
||||
*/
|
||||
attribute_deprecated
|
||||
int url_feof(AVIOContext *s);
|
||||
#endif
|
||||
|
||||
/** @warning Writes up to 4 KiB per call */
|
||||
int avio_printf(AVIOContext *s, const char *fmt, ...) av_printf_format(2, 3);
|
||||
@@ -569,6 +592,15 @@ void avio_flush(AVIOContext *s);
|
||||
*/
|
||||
int avio_read(AVIOContext *s, unsigned char *buf, int size);
|
||||
|
||||
/**
|
||||
* Read size bytes from AVIOContext into buf. Unlike avio_read(), this is allowed
|
||||
* to read fewer bytes than requested. The missing bytes can be read in the next
|
||||
* call. This always tries to read at least 1 byte.
|
||||
* Useful to reduce latency in certain cases.
|
||||
* @return number of bytes read or AVERROR
|
||||
*/
|
||||
int avio_read_partial(AVIOContext *s, unsigned char *buf, int size);
|
||||
|
||||
/**
|
||||
* @name Functions for reading from AVIOContext
|
||||
* @{
|
||||
|
||||
@@ -31,9 +31,9 @@
|
||||
|
||||
// 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 72
|
||||
#define LIBAVFORMAT_VERSION_MICRO 101
|
||||
#define LIBAVFORMAT_VERSION_MAJOR 58
|
||||
#define LIBAVFORMAT_VERSION_MINOR 12
|
||||
#define LIBAVFORMAT_VERSION_MICRO 100
|
||||
|
||||
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
|
||||
LIBAVFORMAT_VERSION_MINOR, \
|
||||
@@ -55,47 +55,44 @@
|
||||
* at once through the bump. This improves the git bisect-ability of the change.
|
||||
*
|
||||
*/
|
||||
#ifndef FF_API_LAVF_BITEXACT
|
||||
#define FF_API_LAVF_BITEXACT (LIBAVFORMAT_VERSION_MAJOR < 58)
|
||||
#endif
|
||||
#ifndef FF_API_LAVF_FRAC
|
||||
#define FF_API_LAVF_FRAC (LIBAVFORMAT_VERSION_MAJOR < 58)
|
||||
#endif
|
||||
#ifndef FF_API_LAVF_CODEC_TB
|
||||
#define FF_API_LAVF_CODEC_TB (LIBAVFORMAT_VERSION_MAJOR < 58)
|
||||
#endif
|
||||
#ifndef FF_API_URL_FEOF
|
||||
#define FF_API_URL_FEOF (LIBAVFORMAT_VERSION_MAJOR < 58)
|
||||
#endif
|
||||
#ifndef FF_API_LAVF_FMT_RAWPICTURE
|
||||
#define FF_API_LAVF_FMT_RAWPICTURE (LIBAVFORMAT_VERSION_MAJOR < 58)
|
||||
#endif
|
||||
#ifndef FF_API_COMPUTE_PKT_FIELDS2
|
||||
#define FF_API_COMPUTE_PKT_FIELDS2 (LIBAVFORMAT_VERSION_MAJOR < 58)
|
||||
#define FF_API_COMPUTE_PKT_FIELDS2 (LIBAVFORMAT_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_OLD_OPEN_CALLBACKS
|
||||
#define FF_API_OLD_OPEN_CALLBACKS (LIBAVFORMAT_VERSION_MAJOR < 58)
|
||||
#define FF_API_OLD_OPEN_CALLBACKS (LIBAVFORMAT_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_LAVF_AVCTX
|
||||
#define FF_API_LAVF_AVCTX (LIBAVFORMAT_VERSION_MAJOR < 58)
|
||||
#endif
|
||||
#ifndef FF_API_NOCONST_GET_SIDE_DATA
|
||||
#define FF_API_NOCONST_GET_SIDE_DATA (LIBAVFORMAT_VERSION_MAJOR < 58)
|
||||
#define FF_API_LAVF_AVCTX (LIBAVFORMAT_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_HTTP_USER_AGENT
|
||||
#define FF_API_HTTP_USER_AGENT (LIBAVFORMAT_VERSION_MAJOR < 58)
|
||||
#define FF_API_HTTP_USER_AGENT (LIBAVFORMAT_VERSION_MAJOR < 59)
|
||||
#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)
|
||||
#define FF_API_HLS_WRAP (LIBAVFORMAT_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_LAVF_KEEPSIDE_FLAG
|
||||
#define FF_API_LAVF_KEEPSIDE_FLAG (LIBAVFORMAT_VERSION_MAJOR < 58)
|
||||
#define FF_API_LAVF_KEEPSIDE_FLAG (LIBAVFORMAT_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_OLD_ROTATE_API
|
||||
#define FF_API_OLD_ROTATE_API (LIBAVFORMAT_VERSION_MAJOR < 58)
|
||||
#define FF_API_OLD_ROTATE_API (LIBAVFORMAT_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_FORMAT_GET_SET
|
||||
#define FF_API_FORMAT_GET_SET (LIBAVFORMAT_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_OLD_AVIO_EOF_0
|
||||
#define FF_API_OLD_AVIO_EOF_0 (LIBAVFORMAT_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_LAVF_FFSERVER
|
||||
#define FF_API_LAVF_FFSERVER (LIBAVFORMAT_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_FORMAT_FILENAME
|
||||
#define FF_API_FORMAT_FILENAME (LIBAVFORMAT_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_OLD_RTSP_OPTIONS
|
||||
#define FF_API_OLD_RTSP_OPTIONS (LIBAVFORMAT_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_NEXT
|
||||
#define FF_API_NEXT (LIBAVFORMAT_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user