Utility functions
[I/O and Muxing/Demuxing Library]

Miscelaneous utility functions related to both muxing and demuxing (or neither). More...


Modules

 RIFF FourCCs
 Get the tables mapping RIFF FourCCs to libavcodec CodecIDs.

Functions

void av_hex_dump (FILE *f, uint8_t *buf, int size)
 Send a nice hexadecimal dump of a buffer to the specified file stream.
void av_hex_dump_log (void *avcl, int level, uint8_t *buf, int size)
 Send a nice hexadecimal dump of a buffer to the log.
void av_pkt_dump2 (FILE *f, AVPacket *pkt, int dump_payload, AVStream *st)
 Send a nice dump of a packet to the specified file stream.
void av_pkt_dump_log2 (void *avcl, int level, AVPacket *pkt, int dump_payload, AVStream *st)
 Send a nice dump of a packet to the log.
enum CodecID av_codec_get_id (const struct AVCodecTag *const *tags, unsigned int tag)
 Get the CodecID for the given codec tag tag.
unsigned int av_codec_get_tag (const struct AVCodecTag *const *tags, enum CodecID id)
 Get the codec tag for the given codec id id.
int av_find_default_stream_index (AVFormatContext *s)
int av_index_search_timestamp (AVStream *st, int64_t timestamp, int flags)
 Get the index for a specific timestamp.
int av_add_index_entry (AVStream *st, int64_t pos, int64_t timestamp, int size, int distance, int flags)
 Add an index entry into a sorted list.
void av_url_split (char *proto, int proto_size, char *authorization, int authorization_size, char *hostname, int hostname_size, int *port_ptr, char *path, int path_size, const char *url)
 Split a URL string into components.
void av_dump_format (AVFormatContext *ic, int index, const char *url, int is_output)
int64_t av_gettime (void)
 Get the current time in microseconds.
int av_get_frame_filename (char *buf, int buf_size, const char *path, int number)
 Return in 'buf' the path with 'd' replaced by a number.
int av_filename_number_test (const char *filename)
 Check whether filename actually is a numbered sequence generator.
int av_sdp_create (AVFormatContext *ac[], int n_files, char *buf, int size)
 Generate an SDP for an RTP session.
int av_match_ext (const char *filename, const char *extensions)
 Return a positive value if the given filename has one of the given extensions, 0 otherwise.
int avformat_query_codec (AVOutputFormat *ofmt, enum CodecID codec_id, int std_compliance)
 Test if the given container can store a codec.


Detailed Description

Miscelaneous utility functions related to both muxing and demuxing (or neither).

Function Documentation

int av_add_index_entry ( AVStream st,
int64_t  pos,
int64_t  timestamp,
int  size,
int  distance,
int  flags 
)

enum CodecID av_codec_get_id ( const struct AVCodecTag *const *  tags,
unsigned int  tag 
)

Get the CodecID for the given codec tag tag.

If no codec id is found returns CODEC_ID_NONE.

Parameters:
tags list of supported codec_id-codec_tag pairs, as stored in AVInputFormat.codec_tag and AVOutputFormat.codec_tag

Referenced by decode_stream_header(), and transcode_init().

unsigned int av_codec_get_tag ( const struct AVCodecTag *const *  tags,
enum CodecID  id 
)

Get the codec tag for the given codec id id.

If no codec tag is found returns 0.

Parameters:
tags list of supported codec_id-codec_tag pairs, as stored in AVInputFormat.codec_tag and AVOutputFormat.codec_tag

Referenced by avformat_query_codec(), avformat_write_header(), and transcode_init().

void av_dump_format ( AVFormatContext ic,
int  index,
const char *  url,
int  is_output 
)

Definition at line 3775 of file utils.c.

Referenced by main(), open_input_file(), opt_input_file(), read_thread(), and transcode_init().

int av_filename_number_test ( const char *  filename  ) 

Check whether filename actually is a numbered sequence generator.

Parameters:
filename possible numbered sequence string
Returns:
1 if a valid numbered sequence string, 0 otherwise

Definition at line 338 of file utils.c.

Referenced by av_guess_format(), avformat_open_input(), opt_output_file(), and read_probe().

int av_find_default_stream_index ( AVFormatContext s  ) 

Definition at line 1460 of file utils.c.

Referenced by seek_frame_internal().

int av_get_frame_filename ( char *  buf,
int  buf_size,
const char *  path,
int  number 
)

Return in 'buf' the path with 'd' replaced by a number.

Also handles the '0nd' format where 'n' is the total number of digits and '%'.

Parameters:
buf destination buffer
buf_size destination buffer size
path numbered sequence string
number frame number
Returns:
0 if OK, -1 on format error

Definition at line 3866 of file utils.c.

Referenced by av_filename_number_test(), find_image_range(), read_packet(), seg_write_header(), segment_start(), and write_packet().

int64_t av_gettime ( void   ) 

void av_hex_dump ( FILE *  f,
uint8_t buf,
int  size 
)

Send a nice hexadecimal dump of a buffer to the specified file stream.

Parameters:
f The file stream pointer where the dump should be sent to.
buf buffer
size buffer size
See also:
av_hex_dump_log, av_pkt_dump2, av_pkt_dump_log2

Definition at line 3950 of file utils.c.

Referenced by pkt_dump_internal().

void av_hex_dump_log ( void *  avcl,
int  level,
uint8_t buf,
int  size 
)

Send a nice hexadecimal dump of a buffer to the log.

Parameters:
avcl A pointer to an arbitrary struct of which the first field is a pointer to an AVClass struct.
level The importance level of the message, lower values signifying higher importance.
buf buffer
size buffer size
See also:
av_hex_dump, av_pkt_dump2, av_pkt_dump_log2

Definition at line 3955 of file utils.c.

Referenced by asf_read_header().

int av_index_search_timestamp ( AVStream st,
int64_t  timestamp,
int  flags 
)

Get the index for a specific timestamp.

Parameters:
flags if AVSEEK_FLAG_BACKWARD then the returned index will correspond to the timestamp which is <= the requested one, if backward is 0, then it will be >= if AVSEEK_FLAG_ANY seek to any frame, only keyframes otherwise
Returns:
< 0 if no such timestamp could be found

Definition at line 1627 of file utils.c.

Referenced by ape_read_seek(), asf_read_seek(), avi_read_packet(), avi_read_seek(), ff_seek_frame_binary(), gxf_seek(), matroska_read_seek(), mov_seek_stream(), mpc8_read_seek(), mpc_read_seek(), nsv_read_seek(), nut_write_packet(), read_packet(), read_seek(), rl2_read_seek(), seek_frame_generic(), tta_read_seek(), and wv_read_seek().

int av_match_ext ( const char *  filename,
const char *  extensions 
)

Return a positive value if the given filename has one of the given extensions, 0 otherwise.

Parameters:
extensions a comma-separated list of filename extensions

Definition at line 167 of file utils.c.

Referenced by av_guess_format(), av_probe_input_format3(), http_parse_request(), ipod_get_codec_tag(), mpegts_probe(), mpegts_write_header(), and nsv_probe().

void av_pkt_dump2 ( FILE *  f,
AVPacket pkt,
int  dump_payload,
AVStream st 
)

Send a nice dump of a packet to the specified file stream.

Parameters:
f The file stream pointer where the dump should be sent to.
pkt packet to dump
dump_payload True if the payload must be displayed, too.
st AVStream that the packet belongs to

Definition at line 3994 of file utils.c.

void av_pkt_dump_log2 ( void *  avcl,
int  level,
AVPacket pkt,
int  dump_payload,
AVStream st 
)

Send a nice dump of a packet to the log.

Parameters:
avcl A pointer to an arbitrary struct of which the first field is a pointer to an AVClass struct.
level The importance level of the message, lower values signifying higher importance.
pkt packet to dump
dump_payload True if the payload must be displayed, too.
st AVStream that the packet belongs to

Definition at line 4007 of file utils.c.

Referenced by transcode().

int av_sdp_create ( AVFormatContext ac[],
int  n_files,
char *  buf,
int  size 
)

Generate an SDP for an RTP session.

Parameters:
ac array of AVFormatContexts describing the RTP streams. If the array is composed by only one context, such context can contain multiple AVStreams (one AVStream per RTP stream). Otherwise, all the contexts in the array (an AVCodecContext per RTP stream) must contain only one AVStream.
n_files number of AVCodecContexts contained in ac
buf buffer where the SDP will be stored (must be allocated by the caller)
size the size of the buffer
Returns:
0 if OK, AVERROR_xxx on error

Definition at line 637 of file sdp.c.

Referenced by ff_rtsp_setup_output_streams(), prepare_sdp_description(), print_sdp(), and sap_write_header().

void av_url_split ( char *  proto,
int  proto_size,
char *  authorization,
int  authorization_size,
char *  hostname,
int  hostname_size,
int *  port_ptr,
char *  path,
int  path_size,
const char *  url 
)

Split a URL string into components.

The pointers to buffers for storing individual components may be null, in order to ignore that component. Buffers for components not found are set to empty strings. If the port is not found, it is set to a negative value.

Parameters:
proto the buffer for the protocol
proto_size the size of the proto buffer
authorization the buffer for the authorization
authorization_size the size of the authorization buffer
hostname the buffer for the host name
hostname_size the size of the hostname buffer
port_ptr a pointer to store the port number in
path the buffer for the path
path_size the size of the path buffer
url the URL to split

Definition at line 4013 of file utils.c.

Referenced by ff_rtp_set_remote_url(), ff_udp_set_remote_url(), find_rtp_session_with_url(), gopher_open(), http_open_cnx(), mms_open(), mmsh_open_internal(), resetup_tcp(), rtmp_open(), rtp_open(), rtsp_cmd_describe(), rtsp_cmd_setup(), sap_read_header(), sap_write_header(), sctp_open(), tcp_open(), tls_open(), and udp_open().

int avformat_query_codec ( AVOutputFormat ofmt,
enum CodecID  codec_id,
int  std_compliance 
)

Test if the given container can store a codec.

Parameters:
std_compliance standards compliance level, one of FF_COMPLIANCE_*
Returns:
1 if codec with ID codec_id can be stored in ofmt, 0 if it cannot. A negative number if this information is not available.

Definition at line 4344 of file utils.c.


Generated on Fri Oct 26 02:48:04 2012 for FFmpeg by  doxygen 1.5.8