Go to the documentation of this file.
21 #ifndef AVFORMAT_INTERNAL_H
22 #define AVFORMAT_INTERNAL_H
33 #define MAX_URL_SIZE 4096
36 #define PROBE_BUF_MIN 2048
37 #define PROBE_BUF_MAX (1 << 20)
40 # define hex_dump_debug(class, buf, size) av_hex_dump_log(class, AV_LOG_DEBUG, buf, size)
42 # define hex_dump_debug(class, buf, size) do { if (0) av_hex_dump_log(class, AV_LOG_DEBUG, buf, size); } while(0)
49 #define FF_FMT_INIT_CLEANUP (1 << 0)
89 int flush,
int has_packet);
150 #if FF_API_COMPUTE_PKT_FIELDS2
151 int missing_ts_warning;
244 #define MAX_STD_TIMEBASES (30*12+30+3+6)
360 #define MAX_REORDER_DELAY 16
445 #define dynarray_add(tab, nb_ptr, elem)\
447 __typeof__(tab) _tab = (tab);\
448 __typeof__(elem) _elem = (elem);\
449 (void)sizeof(**_tab == _elem); \
450 av_dynarray_add(_tab, nb_ptr, _elem);\
453 #define dynarray_add(tab, nb_ptr, elem)\
455 av_dynarray_add((tab), nb_ptr, (elem));\
459 #define RELATIVE_TS_BASE (INT64_MAX - (1LL << 48))
518 #define NTP_OFFSET 2208988800ULL
519 #define NTP_OFFSET_US (NTP_OFFSET * 1000000ULL)
560 const char *dest_addr,
const char *dest_type,
602 #define SPACE_CHARS " \t\r\n"
615 int key_len,
char **dest,
int *dest_len);
638 int64_t wanted_timestamp,
int flags);
644 int *nb_index_entries,
645 unsigned int *index_entries_allocated_size,
662 int64_t start, int64_t end,
const char *title);
683 int64_t target_ts,
int flags);
705 int64_t target_ts, int64_t pos_min,
706 int64_t pos_max, int64_t pos_limit,
707 int64_t ts_min, int64_t ts_max,
708 int flags, int64_t *ts_ret,
724 unsigned int pts_num,
unsigned int pts_den);
770 int flush,
int has_packet);
777 int flush,
int has_packet);
858 int ff_rename(
const char *url_src,
const char *url_dst,
void *logctx);
912 #define FFERROR_REDO FFERRTAG('R','E','D','O')
966 #define CONTAINS_PAL 2
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it be(in the first position) for now. Options ------- Then comes the options array. This is what will define the user accessible options. For example
int skip_samples
Number of samples to skip at the start of the frame decoded from the next packet.
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default minimum maximum flags name is the option name
int inject_global_side_data
Internal data to inject global side data.
int(* interleave_packet)(struct AVFormatContext *s, AVPacket *pkt, int flush, int has_packet)
The interleavement function in use.
int prefer_codec_framerate
int64_t first_dts
Timestamp corresponding to the last dts sync point.
int64_t rfps_duration_sum
This struct describes the properties of an encoded stream.
int64_t codec_info_duration_fields
int64_t codec_info_duration
int64_t first_discard_sample
If not 0, the first audio sample that should be discarded from the stream.
int64_t interleaver_chunk_size
int initialized
Whether or not avformat_init_output has already been called.
AVBSFContext * bsfc
bitstream filter to run on stream
struct FFStream::@259 extract_extradata
int64_t last_dts_for_order_check
Internal data to analyze DTS and detect faulty mpeg streams.
The bitstream filter state.
int64_t shortest_end
Timestamp of the end of the shortest stream.
unsigned int index_entries_allocated_size
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
struct FFStream::@260 * info
Stream information used internally by avformat_find_stream_info()
PacketList parse_queue
Packets split by the parser get queued here.
double(* duration_error)[2][MAX_STD_TIMEBASES]
PacketList packet_buffer
This buffer is only needed when packets were already buffered but not decoded, for example to get the...
int nb_decoded_frames
Number of internally decoded frames, used internally in libavformat, do not access its lifetime diffe...
int64_t data_offset
offset of the first packet
int codec_info_nb_frames
Number of frames that have been demuxed during avformat_find_stream_info()
uint8_t pts_reorder_error_count[MAX_REORDER_DELAY+1]
AVRational display_aspect_ratio
display aspect ratio (0 if unknown)
int64_t pts_reorder_error[MAX_REORDER_DELAY+1]
Internal data to generate dts from pts.
enum AVStreamParseType need_parsing
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default minimum maximum flags name is the option keep it simple and lowercase description are in without and describe what they for example set the foo of the bar offset is the offset of the field in your context
AVStream pub
The public context.
int bitstream_checked
Whether or not check_bitstream should still be run on each packet.
static void flush(AVCodecContext *avctx)
int avctx_inited
1 if avctx has been initialized with the values from the codec parameters
Rational number (pair of numerator and denominator).
This structure contains the data a format has to probe a file.
int64_t interleaver_chunk_duration
int inject_global_side_data
AVCodecID
Identify the syntax and semantics of the bitstream.
int64_t fps_first_dts
Those are used for average framerate estimation.
AVDictionary * id3v2_meta
ID3v2 tag useful for MP3 demuxing.
static void interleave(uint8_t *dst, uint8_t *src, int w, int h, int dst_linesize, int src_linesize, enum FilterMode mode, int swap)
const OptionDef options[]
int found_decoder
0 -> decoder has not been searched for yet.
AVPacket * parse_pkt
The generic code uses this as a temporary packet to parse packets or for muxing, especially flushing.
int64_t last_discard_sample
The sample after last sample that is intended to be discarded after first_discard_sample.
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf offset
int pts_wrap_behavior
Options for behavior, when a wrap is detected.
int raw_packet_buffer_size
Sum of the size of packets in raw_packet_buffer, in bytes.
int update_initial_durations_done
Internal data to prevent doing update_initial_durations() twice.
int64_t start_skip_samples
If not 0, the number of samples that should be skipped from the start of the stream (the samples are ...
int probe_packets
Number of packets to buffer for codec probing.
AVChromaLocation
Location of chroma samples.
int skip_to_keyframe
Indicates that everything up to the next keyframe should be discarded.
PacketList raw_packet_buffer
Raw packets from the demuxer, prior to parsing and decoding.
int64_t mux_ts_offset
Timestamp offset added to timestamps before muxing.
#define i(width, name, range_min, range_max)
int reorder
Set to 1 if the codec allows reordering, so pts can be different from dts.
int64_t pts_buffer[MAX_REORDER_DELAY+1]
PacketListEntry * last_in_packet_buffer
last packet in packet_buffer for this stream when muxing.
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default minimum maximum flags name is the option keep it simple and lowercase description are in lowercase
int chapter_ids_monotonic
Set if chapter ids are strictly monotonic.
AVRational offset_timebase
Timebase for the timestamp offset.
main external API structure.
static float compare(const AVFrame *haystack, const AVFrame *obj, int offx, int offy)
AVCodecContext * avctx
The codec context used by avformat_find_stream_info, the parser, etc.
int64_t offset
Offset to remap timestamps to be non-negative.
AVIndexEntry * index_entries
Only used if the format does not support seeking natively.
int streams_initialized
Whether or not avformat_init_output fully initialized streams.
A reference to a data buffer.
AVPacket * pkt
Used to hold temporary packets for the generic demuxing code.
int request_probe
stream probing state -1 -> probing finished 0 -> no probing requested rest -> perform probing with re...
This structure stores compressed data.
int stream_identifier
Stream Identifier This is the MPEG-TS stream identifier +1 0 means unknown.
static float distance(float x, float y, int band)
int need_context_update
Whether the internal avctx needs to be updated from codecpar (after a late change to codecpar)
#define flags(name, subs,...)
struct AVCodecParserContext * parser
static int64_t read_timestamp(AVFormatContext *s, int stream_index, int64_t *ppos, int64_t pos_limit, int64_t(*read_timestamp)(struct AVFormatContext *, int, int64_t *, int64_t))
The exact value of the fractional number is: 'val + num / den'.
AVFormatContext pub
The public context.
int64_t pts_wrap_reference
Internal data to check for wrapping of the time stamp.
int nb_interleaved_streams
Number of streams relevant for interleaving.
int avoid_negative_ts_use_pts