FFmpeg
Functions
demux_utils.c File Reference
#include "libavutil/version.h"
#include "libavutil/avassert.h"
#include "libavcodec/bytestream.h"
#include "libavcodec/packet_internal.h"
#include "avformat.h"
#include "avio_internal.h"
#include "demux.h"
#include "internal.h"

Go to the source code of this file.

Functions

struct AVCodecParserContextav_stream_get_parser (const AVStream *st)
 
void avpriv_stream_set_need_parsing (AVStream *st, enum AVStreamParseType type)
 
AVChapteravpriv_new_chapter (AVFormatContext *s, int64_t id, AVRational time_base, int64_t start, int64_t end, const char *title)
 Add a new chapter. More...
 
void av_format_inject_global_side_data (AVFormatContext *s)
 This function will cause global side data to be injected in the next packet of each stream as well as after any subsequent seek. More...
 
int avformat_queue_attached_pictures (AVFormatContext *s)
 
int ff_add_attached_pic (AVFormatContext *s, AVStream *st0, AVIOContext *pb, AVBufferRef **buf, int size)
 Add an attached pic to an AVStream. More...
 
int ff_add_param_change (AVPacket *pkt, int32_t channels, uint64_t channel_layout, int32_t sample_rate, int32_t width, int32_t height)
 Add side data to a packet for changing parameters to the given values. More...
 
int av_read_play (AVFormatContext *s)
 Start playing a network-based stream (e.g. More...
 
int av_read_pause (AVFormatContext *s)
 Pause a network-based stream (e.g. More...
 
int ff_generate_avci_extradata (AVStream *st)
 Generate standard extradata for AVC-Intra based on width/height and field order. More...
 
int ff_get_extradata (void *logctx, AVCodecParameters *par, AVIOContext *pb, int size)
 Allocate extradata with additional AV_INPUT_BUFFER_PADDING_SIZE at end which is always set to 0 and fill it from pb. More...
 
int ff_find_stream_index (const AVFormatContext *s, int id)
 Find stream index based on format-specific stream ID. More...
 

Function Documentation

◆ av_stream_get_parser()

struct AVCodecParserContext* av_stream_get_parser ( const AVStream st)

Definition at line 32 of file demux_utils.c.

Referenced by ist_dts_update().

◆ avpriv_stream_set_need_parsing()

void avpriv_stream_set_need_parsing ( AVStream st,
enum AVStreamParseType  type 
)

Definition at line 37 of file demux_utils.c.

Referenced by v4l2_read_header().

◆ avpriv_new_chapter()

AVChapter* avpriv_new_chapter ( AVFormatContext s,
int64_t  id,
AVRational  time_base,
int64_t  start,
int64_t  end,
const char *  title 
)

Add a new chapter.

Parameters
smedia file handle
idunique ID for this chapter
startchapter start time in time_base units
endchapter end time in time_base units
titlechapter title
Returns
AVChapter or NULL on error

Definition at line 42 of file demux_utils.c.

Referenced by aa_read_header(), asf_read_marker(), concat_parse_script(), decode_info_header(), dvdvideo_chapters_setup_preindex(), dvdvideo_chapters_setup_simple(), ff_id3v2_parse_chapters(), flac_read_header(), mov_metadata_hmmt(), mov_read_chapters(), mov_read_chpl(), ogm_chapter(), read_chapter(), and read_header().

◆ av_format_inject_global_side_data()

void av_format_inject_global_side_data ( AVFormatContext s)

This function will cause global side data to be injected in the next packet of each stream as well as after any subsequent seek.

Note
global side data is always available in every AVStream's codecpar side data array, and in a decoder's side data array if initialized with said stream's codecpar.
See also
av_packet_side_data_get()

Definition at line 83 of file demux_utils.c.

◆ ff_add_attached_pic()

int ff_add_attached_pic ( AVFormatContext s,
AVStream st,
AVIOContext pb,
AVBufferRef **  buf,
int  size 
)

Add an attached pic to an AVStream.

Parameters
stif set, the stream to add the attached pic to; if unset, a new stream will be added to s.
pbAVIOContext to read data from if buf is unset.
bufif set, it contains the data and size information to be used for the attached pic; if unset, data is read from pb.
sizethe size of the data to read if buf is unset.
Returns
0 on success, < 0 on error. On error, this function removes the stream it has added (if any).

Definition at line 116 of file demux_utils.c.

Referenced by ape_tag_read_field(), asf_read_picture(), ff_flac_parse_picture(), ff_id3v2_parse_apic(), get_attachment(), mov_read_chapters(), and mov_read_covr().

◆ ff_add_param_change()

int ff_add_param_change ( AVPacket pkt,
int32_t  channels,
uint64_t  channel_layout,
int32_t  sample_rate,
int32_t  width,
int32_t  height 
)

Add side data to a packet for changing parameters to the given values.

Parameters set to 0 aren't included in the change.

Definition at line 151 of file demux_utils.c.

Referenced by flv_read_packet(), load_ipmovie_packet(), and swf_read_packet().

◆ ff_generate_avci_extradata()

int ff_generate_avci_extradata ( AVStream st)

Generate standard extradata for AVC-Intra based on width/height and field order.

Definition at line 200 of file demux_utils.c.

Referenced by mov_read_trak(), and mxf_parse_structural_metadata().

◆ ff_get_extradata()

int ff_get_extradata ( void *  logctx,
AVCodecParameters par,
AVIOContext pb,
int  size 
)

◆ ff_find_stream_index()

int ff_find_stream_index ( const AVFormatContext s,
int  id 
)

Find stream index based on format-specific stream ID.

Returns
stream index, or < 0 on error

Definition at line 351 of file demux_utils.c.

Referenced by get_sindex(), parse_chunks(), pmt_cb(), and scte_data_cb().