libavformat/internal.h File Reference

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

Go to the source code of this file.

Data Structures

struct  AVCodecTag

Defines

#define MAX_URL_SIZE   4096
#define hex_dump_debug(class, buf, size)
#define dynarray_add(tab, nb_ptr, elem)
#define NTP_OFFSET   2208988800ULL
#define NTP_OFFSET_US   (NTP_OFFSET * 1000000ULL)
#define SPACE_CHARS   " \t\r\n"

Typedefs

typedef void(* ff_parse_key_val_cb )(void *context, const char *key, int key_len, char **dest, int *dest_len)
 Callback function type for ff_parse_key_value.

Functions

struct tm * brktimegm (time_t secs, struct tm *tm)
char * ff_data_to_hex (char *buf, const uint8_t *src, int size, int lowercase)
int ff_hex_to_data (uint8_t *data, const char *p)
 Parse a string of hexadecimal strings.
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)
 Get the current time since NTP epoch in microseconds.
int ff_url_join (char *str, int size, const char *proto, const char *authorization, const char *hostname, int port, const char *fmt,...)
 Assemble a URL string from components.
void ff_sdp_write_media (char *buff, int size, AVCodecContext *c, const char *dest_addr, const char *dest_type, int port, int ttl, AVFormatContext *fmt)
 Append the media-specific SDP fragment for the media stream c to the buffer buff.
int ff_write_chained (AVFormatContext *dst, int dst_stream, AVPacket *pkt, AVFormatContext *src)
 Write a packet to another muxer than the one the user originally intended.
int ff_get_v_length (uint64_t val)
 Get the length in bytes which is needed to store val as v.
void ff_put_v (AVIOContext *bc, uint64_t val)
 Put val using a variable number of bytes.
int ff_get_line (AVIOContext *s, char *buf, int maxlen)
 Read a whole line of text from AVIOContext.
void ff_parse_key_value (const char *str, ff_parse_key_val_cb callback_get_buf, void *context)
 Parse a string with comma-separated key=value pairs.
int ff_find_stream_index (AVFormatContext *s, int id)
 Find stream index based on format-specific stream ID.
int ff_index_search_timestamp (const AVIndexEntry *entries, int nb_entries, int64_t wanted_timestamp, int flags)
 Internal version of av_index_search_timestamp.
int ff_add_index_entry (AVIndexEntry **index_entries, int *nb_index_entries, unsigned int *index_entries_allocated_size, int64_t pos, int64_t timestamp, int size, int distance, int flags)
 Internal version of av_add_index_entry.
AVChapterff_new_chapter (AVFormatContext *s, int id, AVRational time_base, int64_t start, int64_t end, const char *title)
 Add a new chapter.
void ff_reduce_index (AVFormatContext *s, int stream_index)
 Ensure the index uses less memory than the maximum specified in AVFormatContext.max_index_size by discarding entries if it grows too large.
void ff_make_absolute_url (char *buf, int size, const char *base, const char *rel)
enum CodecID ff_guess_image2_codec (const char *filename)


Define Documentation

#define dynarray_add ( tab,
nb_ptr,
elem   ) 

Value:

do {\
    av_dynarray_add((tab), nb_ptr, (elem));\
} while(0)

Definition at line 49 of file internal.h.

Referenced by av_new_program(), ff_new_chapter(), ff_rtsp_setup_output_streams(), matroska_parse_block(), mpegts_add_service(), new_variant(), and parse_playlist().

#define hex_dump_debug ( class,
buf,
size   ) 

Definition at line 32 of file internal.h.

Referenced by pat_cb(), pmt_cb(), and sdt_cb().

#define MAX_URL_SIZE   4096

Definition at line 27 of file internal.h.

Referenced by open_input(), and parse_playlist().

#define NTP_OFFSET   2208988800ULL

Definition at line 80 of file internal.h.

#define NTP_OFFSET_US   (NTP_OFFSET * 1000000ULL)

Definition at line 81 of file internal.h.

Referenced by ff_ntp_time(), and rtp_write_header().

#define SPACE_CHARS   " \t\r\n"


Typedef Documentation

typedef void(* ff_parse_key_val_cb)(void *context, const char *key, int key_len, char **dest, int *dest_len)

Callback function type for ff_parse_key_value.

Parameters:
key a pointer to the key
key_len the number of bytes that belong to the key, including the '=' char
dest return the destination pointer for the value in *dest, may be null to ignore the value
dest_len the length of the *dest buffer

Definition at line 181 of file internal.h.


Function Documentation

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

Definition at line 29 of file cutils.c.

Referenced by dv_write_pack().

int ff_add_index_entry ( AVIndexEntry **  index_entries,
int *  nb_index_entries,
unsigned int *  index_entries_allocated_size,
int64_t  pos,
int64_t  timestamp,
int  size,
int  distance,
int  flags 
)

Internal version of av_add_index_entry.

Definition at line 1428 of file utils.c.

Referenced by av_add_index_entry(), and read_header().

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

Definition at line 3761 of file utils.c.

Referenced by ff_rdt_calc_response_and_checksum(), make_digest_auth(), and open_input().

int ff_find_stream_index ( AVFormatContext s,
int  id 
)

Find stream index based on format-specific stream ID.

Returns:
stream index, or < 0 on error

Definition at line 3945 of file utils.c.

Referenced by get_sindex(), and parse_chunks().

int ff_get_line ( AVIOContext s,
char *  buf,
int  maxlen 
)

Read a whole line of text from AVIOContext.

Stop reading after reaching either a \n, a \0 or EOF. The returned string is always \0-terminated, and may be truncated if the buffer is too small.

Parameters:
s the read-only AVIOContext
buf buffer to store the read line
maxlen size of the buffer
Returns:
the length of the string written in the buffer, not including the final \0

Definition at line 762 of file aviobuf.c.

Referenced by microdvd_read_header(), microdvd_read_packet(), read_chomp_line(), read_header(), and srt_read_packet().

int ff_get_v_length ( uint64_t  val  ) 

Get the length in bytes which is needed to store val as v.

Definition at line 478 of file aviobuf.c.

Referenced by ff_put_v(), and write_packet().

enum CodecID ff_guess_image2_codec ( const char *  filename  ) 

Definition at line 199 of file img2.c.

Referenced by av_guess_codec(), and av_guess_format().

int ff_hex_to_data ( uint8_t *  data,
const char *  p 
)

Parse a string of hexadecimal strings.

Any space between the hexadecimal digits is ignored.

Parameters:
data if non-null, the parsed data is written to this pointer
p the string to parse
Returns:
the number of bytes written (or to be written, if data is null)

Definition at line 3782 of file utils.c.

Referenced by parse_fmtp_config(), and parse_playlist().

int ff_index_search_timestamp ( const AVIndexEntry entries,
int  nb_entries,
int64_t  wanted_timestamp,
int  flags 
)

Internal version of av_index_search_timestamp.

Definition at line 1482 of file utils.c.

Referenced by av_index_search_timestamp(), ff_add_index_entry(), and read_seek().

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 3151 of file utils.c.

Referenced by av_interleave_packet_per_dts(), and ff_audio_rechunk_interleave().

void ff_make_absolute_url ( char *  buf,
int  size,
const char *  base,
const char *  rel 
)

Definition at line 3955 of file utils.c.

Referenced by new_variant(), and parse_playlist().

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

Add a new chapter.

Parameters:
s media file handle
id unique ID for this chapter
start chapter start time in time_base units
end chapter end time in time_base units
title chapter title
Returns:
AVChapter or NULL on error

Definition at line 2778 of file utils.c.

Referenced by asf_read_marker(), decode_info_header(), matroska_read_header(), mov_read_chapters(), mov_read_chpl(), ogm_chapter(), and read_chapter().

uint64_t ff_ntp_time ( void   ) 

Get the current time since NTP epoch in microseconds.

Definition at line 3528 of file utils.c.

Referenced by rtp_write_header(), and rtp_write_packet().

void ff_parse_key_value ( const char *  str,
ff_parse_key_val_cb  callback_get_buf,
void *  context 
)

Parse a string with comma-separated key=value pairs.

The value strings may be quoted and may contain escaped characters within quoted strings.

Parameters:
str the string to parse
callback_get_buf function that returns where to store the unescaped value string.
context the opaque context pointer to pass to callback_get_buf

Definition at line 3891 of file utils.c.

Referenced by ff_http_auth_handle_header(), and parse_playlist().

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

Definition at line 3316 of file utils.c.

Referenced by pmt_cb().

void ff_put_v ( AVIOContext bc,
uint64_t  val 
)

Put val using a variable number of bytes.

Definition at line 487 of file aviobuf.c.

Referenced by put_packet(), put_s(), put_str(), put_tt(), write_chapter(), write_globalinfo(), write_mainheader(), write_packet(), write_streamheader(), and write_streaminfo().

void ff_read_frame_flush ( AVFormatContext s  ) 

Flush the frame reader.

Definition at line 1371 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_reduce_index ( AVFormatContext s,
int  stream_index 
)

Ensure the index uses less memory than the maximum specified in AVFormatContext.max_index_size by discarding entries if it grows too large.

Definition at line 1415 of file utils.c.

Referenced by av_read_frame_internal(), and mpegps_read_pes_header().

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

Append 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:
buff the buffer to append the SDP fragment to
size the size of the buff buffer
c the AVCodecContext of the media to describe
dest_addr the destination address of the media stream, may be NULL
dest_type the destination address type, may be NULL
port the destination port of the media stream, 0 if unknown
ttl the time to live of the stream, 0 if not multicast
fmt the AVFormatContext, which might contain options modifying the generated SDP

Definition at line 619 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,
  ... 
)

Assemble a URL string from components.

This is the reverse operation of av_url_split.

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

See also:
av_url_split
Parameters:
str the buffer to fill with the url
size the size of the str buffer
proto the protocol identifier, if null, the separator after the identifier is left out, too
authorization an optional authorization string, may be null. An empty string is treated the same as a null string.
hostname the host name string
port the port number, left out from the string if negative
fmt a 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 3828 of file utils.c.

Referenced by build_udp_url(), ff_rtsp_setup_output_streams(), gen_connect(), gopher_open(), http_open_cnx(), mms_open(), mmsh_open(), rtmp_open(), rtp_set_remote_url(), sap_read_header(), and sap_write_header().

int ff_write_chained ( AVFormatContext dst,
int  dst_stream,
AVPacket pkt,
AVFormatContext src 
)

Write a packet to another muxer than the one the user originally intended.

Useful when chaining muxers, where one muxer internally writes a received packet to another muxer.

Parameters:
dst the muxer to write the packet to
dst_stream the stream index within dst to write the packet to
pkt the packet to be written
src the muxer the packet originally was intended for
Returns:
the value av_write_frame returned

Definition at line 3873 of file utils.c.

Referenced by ff_mov_add_hinted_packet(), rtsp_write_packet(), and sap_write_packet().


Generated on Fri Oct 26 02:39:45 2012 for FFmpeg by  doxygen 1.5.8