21 #ifndef AVFORMAT_INTERNAL_H 22 #define AVFORMAT_INTERNAL_H 26 #include "libavutil/bprint.h" 30 #define MAX_URL_SIZE 4096 33 #define PROBE_BUF_MIN 2048 34 #define PROBE_BUF_MAX (1 << 20) 36 #define MAX_PROBE_PACKETS 2500 39 # define hex_dump_debug(class, buf, size) av_hex_dump_log(class, AV_LOG_DEBUG, buf, size) 41 # define hex_dump_debug(class, buf, size) do { if (0) av_hex_dump_log(class, AV_LOG_DEBUG, buf, size); } while(0) 62 int64_t val, num, den;
100 #define RAW_PACKET_BUFFER_SIZE 2500000 101 int raw_packet_buffer_remaining_size;
115 #if FF_API_COMPUTE_PKT_FIELDS2 116 int missing_ts_warning;
119 int inject_global_side_data;
121 int avoid_negative_ts_use_pts;
146 int prefer_codec_framerate;
198 #define dynarray_add(tab, nb_ptr, elem)\ 200 __typeof__(tab) _tab = (tab);\ 201 __typeof__(elem) _elem = (elem);\ 202 (void)sizeof(**_tab == _elem); \ 203 av_dynarray_add(_tab, nb_ptr, _elem);\ 206 #define dynarray_add(tab, nb_ptr, elem)\ 208 av_dynarray_add((tab), nb_ptr, (elem));\ 212 struct tm *ff_brktimegm(time_t secs,
struct tm *tm);
214 char *ff_data_to_hex(
char *buf,
const uint8_t *src,
int size,
int lowercase);
236 #define NTP_OFFSET 2208988800ULL 237 #define NTP_OFFSET_US (NTP_OFFSET * 1000000ULL) 260 void ff_sdp_write_media(
char *buff,
int size,
AVStream *st,
int idx,
261 const char *dest_addr,
const char *dest_type,
282 int ff_get_v_length(uint64_t val);
300 int ff_get_line(
AVIOContext *s,
char *buf,
int maxlen);
310 int ff_get_chomp_line(
AVIOContext *s,
char *buf,
int maxlen);
323 int64_t ff_read_line_to_bprint(
AVIOContext *s, AVBPrint *bp);
336 int64_t ff_read_line_to_bprint_overwrite(
AVIOContext *s, AVBPrint *bp);
338 #define SPACE_CHARS " \t\r\n" 350 typedef void (*ff_parse_key_val_cb)(
void *context,
const char *key,
351 int key_len,
char **dest,
int *dest_len);
374 int64_t wanted_timestamp,
int flags);
380 int *nb_index_entries,
381 unsigned int *index_entries_allocated_size,
382 int64_t pos, int64_t timestamp,
int size,
int distance,
int flags);
384 void ff_configure_buffers_for_index(
AVFormatContext *s, int64_t time_tolerance);
398 int64_t start, int64_t end,
const char *title);
407 enum AVCodecID ff_guess_image2_codec(
const char *filename);
417 int64_t target_ts,
int flags);
429 int ff_find_last_ts(
AVFormatContext *s,
int stream_index, int64_t *ts, int64_t *pos,
430 int64_t (*read_timestamp)(
struct AVFormatContext *,
int , int64_t *, int64_t ));
439 int64_t target_ts, int64_t pos_min,
440 int64_t pos_max, int64_t pos_limit,
441 int64_t ts_min, int64_t ts_max,
442 int flags, int64_t *ts_ret,
443 int64_t (*read_timestamp)(
struct AVFormatContext *,
int , int64_t *, int64_t ));
458 unsigned int pts_num,
unsigned int pts_den);
465 uint64_t channel_layout, int32_t sample_rate,
466 int32_t width, int32_t height);
575 static inline int ff_rename(
const char *oldpath,
const char *newpath,
void *logctx)
578 if (rename(oldpath, newpath) == -1) {
579 ret = AVERROR(errno);
581 char err[AV_ERROR_MAX_STRING_SIZE] = {0};
582 av_make_error_string(err, AV_ERROR_MAX_STRING_SIZE, ret);
583 av_log(logctx,
AV_LOG_ERROR,
"failed to rename file %s to %s: %s\n", oldpath, newpath, err);
622 enum AVWriteUncodedFrameFlags {
628 AV_WRITE_UNCODED_FRAME_QUERY = 0x0001,
644 #define FFERROR_REDO FFERRTAG('R','E','D','O') 690 #define CONTAINS_PAL 2 734 int ff_lock_avformat(
void);
735 int ff_unlock_avformat(
void);
744 #define FF_PACKETLIST_FLAG_REF_PACKET (1 << 0) 758 int ff_packet_list_put(AVPacketList **head, AVPacketList **tail,
Bytestream IO Context.
Definition: avio.h:161
int bitstream_checked
Whether or not check_bitstream should still be run on each packet.
Definition: internal.h:167
int reorder
Set to 1 if the codec allows reordering, so pts can be different from dts.
Definition: internal.h:154
The bitstream filter state.
Definition: avcodec.h:5687
int ff_interleave_packet_per_dts(AVFormatContext *s, AVPacket *out, AVPacket *pkt, int flush)
Interleave a packet per dts in an output media file.
Definition: mux.c:1020
void av_log(void *avcl, int level, const char *fmt,...) av_printf_format(3
Send the specified message to the log if the level is less than or equal to the current av_log_level...
This struct describes the properties of an encoded stream.
Definition: avcodec.h:3876
int ff_write_chained(AVFormatContext *dst, int dst_stream, AVPacket *pkt, AVFormatContext *src, int interleave)
Write a packet to another muxer than the one the user originally intended.
Definition: mux.c:1311
Format I/O context.
Definition: avformat.h:1342
miscellaneous OS support macros and functions.
The exact value of the fractional number is: 'val + num / den'.
Definition: internal.h:61
Definition: internal.h:44
Definition: avformat.h:1999
Definition: internal.h:49
Callback for checking whether to abort blocking functions.
Definition: avio.h:58
int avctx_inited
1 if avctx has been initialized with the values from the codec parameters
Definition: internal.h:176
AVCodecID
Identify the syntax and semantics of the bitstream.
Definition: avcodec.h:215
Definition: internal.h:149
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:176
AVBSFContext ** bsfcs
bitstream filters to run on stream
Definition: internal.h:161
Definition: avformat.h:802
Definition: avcodec.h:5032
Stream structure.
Definition: avformat.h:873
int ff_interleaved_peek(AVFormatContext *s, int stream, AVPacket *pkt, int add_offset)
Find the next packet in the interleaving queue for the given stream.
Definition: mux.c:1139
main external API structure.
Definition: avcodec.h:1518
Rational number (pair of numerator and denominator).
Definition: rational.h:58
int need_context_update
Whether the internal avctx needs to be updated from codecpar (after a late change to codecpar) ...
Definition: internal.h:192
enum AVChromaLocation ff_choose_chroma_location(AVFormatContext *s, AVStream *st)
Chooses a timebase for muxing the specified stream.
Definition: mux.c:118
AVRational ff_choose_timebase(AVFormatContext *s, AVStream *st, int min_precision)
Chooses a timebase for muxing the specified stream.
Definition: mux.c:102
int ff_interleave_add_packet(AVFormatContext *s, AVPacket *pkt, int(*compare)(AVFormatContext *, AVPacket *, AVPacket *))
Add packet to AVFormatContext->packet_buffer list, determining its interleaved position using compare...
Definition: mux.c:919
Definition: avformat.h:1299
AVCodecContext * avctx
The codec context used by avformat_find_stream_info, the parser, etc.
Definition: internal.h:172
AVChromaLocation
Location of chroma samples.
Definition: pixfmt.h:518
This structure stores compressed data.
Definition: avcodec.h:1407