Libav
Defines | Functions

libavformat/internal.h File Reference

#include <stdint.h>
#include "avformat.h"

Go to the source code of this file.

Defines

#define dynarray_add(tab, nb_ptr, elem)
#define NTP_OFFSET   2208988800ULL
#define NTP_OFFSET_US   (NTP_OFFSET * 1000000ULL)

Functions

void ff_dynarray_add (intptr_t **tab_ptr, int *nb_ptr, intptr_t elem)
time_t mktimegm (struct tm *tm)
struct tm * brktimegm (time_t secs, struct tm *tm)
const char * small_strptime (const char *p, const char *fmt, struct tm *dt)
char * ff_data_to_hex (char *buf, const uint8_t *src, int size, int lowercase)
void ff_program_add_stream_index (AVFormatContext *ac, int progid, unsigned int idx)
void 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() function argument.
void ff_read_frame_flush (AVFormatContext *s)
 Flush the frame reader.
uint64_t ff_ntp_time (void)
 Gets the current time since NTP epoch in microseconds.
int ff_probe_input_buffer (ByteIOContext **pb, AVInputFormat **fmt, const char *filename, void *logctx, unsigned int offset, unsigned int max_probe_size)
 Probes a bytestream to determine the input format.
void ff_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)
 Splits a URL string into components.
int ff_url_join (char *str, int size, const char *proto, const char *authorization, const char *hostname, int port, const char *fmt,...)
 Assembles a URL string from components.
void ff_sdp_write_media (char *buff, int size, AVCodecContext *c, const char *dest_addr, int port, int ttl)
 Appends the media-specific SDP fragment for the media stream c to the buffer buff.

Define Documentation

#define dynarray_add (   tab,
  nb_ptr,
  elem 
)
Value:
do {\
    ff_dynarray_add((intptr_t **)(tab), nb_ptr, (intptr_t)(elem));\
} while(0)

Definition at line 38 of file internal.h.

Referenced by av_new_program(), ff_new_chapter(), matroska_parse_block(), mpegts_add_service(), and sdp_parse_line().

#define NTP_OFFSET   2208988800ULL

Definition at line 62 of file internal.h.

#define NTP_OFFSET_US   (NTP_OFFSET * 1000000ULL)

Definition at line 63 of file internal.h.

Referenced by ff_ntp_time(), and rtp_write_header().


Function Documentation

struct tm* brktimegm ( time_t  secs,
struct tm *  tm 
) [read]

Definition at line 68 of file cutils.c.

Referenced by dv_write_pack().

char* ff_data_to_hex ( char *  buf,
const uint8_t *  src,
int  size,
int  lowercase 
)

Definition at line 3520 of file utils.c.

Referenced by ff_rdt_calc_response_and_checksum(), and make_digest_auth().

void ff_dynarray_add ( intptr_t **  tab_ptr,
int *  nb_ptr,
intptr_t  elem 
)

Definition at line 25 of file cutils.c.

void ff_interleave_add_packet ( AVFormatContext s,
AVPacket pkt,
int(*)(AVFormatContext *, AVPacket *, AVPacket *)  compare 
)

Add packet to AVFormatContext->packet_buffer list, determining its interleaved position using compare() function argument.

Definition at line 2814 of file utils.c.

Referenced by av_interleave_packet_per_dts(), and ff_audio_rechunk_interleave().

uint64_t ff_ntp_time ( void  )

Gets the current time since NTP epoch in microseconds.

Definition at line 3165 of file utils.c.

Referenced by rtp_write_header(), and rtp_write_packet().

int ff_probe_input_buffer ( ByteIOContext **  pb,
AVInputFormat **  fmt,
const char *  filename,
void *  logctx,
unsigned int  offset,
unsigned int  max_probe_size 
)

Probes a bytestream to determine the input format.

Each time a probe returns with a score that is too low, the probe buffer size is increased and another attempt is made. When the maximum probe size is reached, the input format with the highest score is returned.

Parameters:
pbthe bytestream to probe, it may be closed and opened again
fmtthe input format is put here
filenamethe filename of the stream
logctxthe log context
offsetthe offset within the bytestream to probe from
max_probe_sizethe maximum probe buffer size (zero for default)
Returns:
0 in case of success, a negative value corresponding to an AVERROR code otherwise

Definition at line 494 of file utils.c.

Referenced by av_open_input_file().

void ff_program_add_stream_index ( AVFormatContext ac,
int  progid,
unsigned int  idx 
)

Definition at line 2972 of file utils.c.

Referenced by pmt_cb().

void ff_read_frame_flush ( AVFormatContext s)

Flush the frame reader.

Definition at line 1277 of file utils.c.

Referenced by av_seek_frame(), av_seek_frame_generic(), avformat_seek_file(), ff_restore_parser_state(), and search_hi_lo_keyframes().

void ff_sdp_write_media ( char *  buff,
int  size,
AVCodecContext c,
const char *  dest_addr,
int  port,
int  ttl 
)

Appends the media-specific SDP fragment for the media stream c to the buffer buff.

Note, the buffer needs to be initialized, since it is appended to existing content.

Parameters:
buffthe buffer to append the SDP fragment to
sizethe size of the buff buffer
cthe AVCodecContext of the media to describe
dest_addrthe destination address of the media stream, may be NULL
portthe destination port of the media stream, 0 if unknown
ttlthe time to live of the stream, 0 if not multicast

Definition at line 373 of file sdp.c.

Referenced by mov_write_udta_sdp().

int ff_url_join ( char *  str,
int  size,
const char *  proto,
const char *  authorization,
const char *  hostname,
int  port,
const char *  fmt,
  ... 
)

Assembles a URL string from components.

This is the reverse operation of ff_url_split.

Note, this requires networking to be initialized, so the caller must ensure ff_network_init has been called.

See also:
ff_url_split
Parameters:
strthe buffer to fill with the url
sizethe size of the str buffer
protothe protocol identifier, if null, the separator after the identifier is left out, too
authorizationan optional authorization string, may be null
hostnamethe host name string
portthe port number, left out from the string if negative
fmta generic format string for everything to add after the host/port, may be null
Returns:
the number of characters written to the destination buffer

Definition at line 3556 of file utils.c.

Referenced by build_udp_url(), gen_connect(), gopher_open(), http_open_cnx(), rtmp_open(), rtp_set_remote_url(), and sdp_read_header().

void ff_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 
)

Splits a URL string into components.

To reassemble components back into a URL, use ff_url_join instead of using snprintf directly.

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 isn't found, it is set to a negative value.

See also:
ff_url_join
Parameters:
protothe buffer for the protocol
proto_sizethe size of the proto buffer
authorizationthe buffer for the authorization
authorization_sizethe size of the authorization buffer
hostnamethe buffer for the host name
hostname_sizethe size of the hostname buffer
port_ptra pointer to store the port number in
paththe buffer for the path
path_sizethe size of the path buffer
urlthe URL to split

Definition at line 3459 of file utils.c.

Referenced by find_rtp_session_with_url(), gopher_open(), http_open_cnx(), rtmp_open(), rtp_open(), rtp_set_remote_url(), rtsp_cmd_describe(), rtsp_cmd_setup(), sdp_parse_line(), tcp_open(), udp_open(), and udp_set_remote_url().

time_t mktimegm ( struct tm *  tm)

Definition at line 44 of file cutils.c.

Referenced by parse_date().

const char* small_strptime ( const char *  p,
const char *  fmt,
struct tm *  dt 
)

Definition at line 125 of file cutils.c.

Referenced by parse_date().