00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef AVFORMAT_INTERNAL_H
00022 #define AVFORMAT_INTERNAL_H
00023
00024 #include <stdint.h>
00025 #include "avformat.h"
00026
00027 #define MAX_URL_SIZE 4096
00028
00029 typedef struct AVCodecTag {
00030 enum CodecID id;
00031 unsigned int tag;
00032 } AVCodecTag;
00033
00034 void ff_dynarray_add(intptr_t **tab_ptr, int *nb_ptr, intptr_t elem);
00035
00036 #ifdef __GNUC__
00037 #define dynarray_add(tab, nb_ptr, elem)\
00038 do {\
00039 __typeof__(tab) _tab = (tab);\
00040 __typeof__(elem) _elem = (elem);\
00041 (void)sizeof(**_tab == _elem); \
00042 ff_dynarray_add((intptr_t **)_tab, nb_ptr, (intptr_t)_elem);\
00043 } while(0)
00044 #else
00045 #define dynarray_add(tab, nb_ptr, elem)\
00046 do {\
00047 ff_dynarray_add((intptr_t **)(tab), nb_ptr, (intptr_t)(elem));\
00048 } while(0)
00049 #endif
00050
00051 time_t mktimegm(struct tm *tm);
00052 struct tm *brktimegm(time_t secs, struct tm *tm);
00053 const char *small_strptime(const char *p, const char *fmt,
00054 struct tm *dt);
00055
00056 char *ff_data_to_hex(char *buf, const uint8_t *src, int size, int lowercase);
00057
00066 int ff_hex_to_data(uint8_t *data, const char *p);
00067
00068 void ff_program_add_stream_index(AVFormatContext *ac, int progid, unsigned int idx);
00069
00074 void ff_interleave_add_packet(AVFormatContext *s, AVPacket *pkt,
00075 int (*compare)(AVFormatContext *, AVPacket *, AVPacket *));
00076
00077 void ff_read_frame_flush(AVFormatContext *s);
00078
00079 #define NTP_OFFSET 2208988800ULL
00080 #define NTP_OFFSET_US (NTP_OFFSET * 1000000ULL)
00081
00083 uint64_t ff_ntp_time(void);
00084
00100 int ff_probe_input_buffer(ByteIOContext **pb, AVInputFormat **fmt,
00101 const char *filename, void *logctx,
00102 unsigned int offset, unsigned int max_probe_size);
00103
00104 #if FF_API_URL_SPLIT
00105
00108 void ff_url_split(char *proto, int proto_size,
00109 char *authorization, int authorization_size,
00110 char *hostname, int hostname_size,
00111 int *port_ptr,
00112 char *path, int path_size,
00113 const char *url);
00114 #endif
00115
00137 int ff_url_join(char *str, int size, const char *proto,
00138 const char *authorization, const char *hostname,
00139 int port, const char *fmt, ...);
00140
00156 void ff_sdp_write_media(char *buff, int size, AVCodecContext *c,
00157 const char *dest_addr, const char *dest_type,
00158 int port, int ttl);
00159
00171 int ff_write_chained(AVFormatContext *dst, int dst_stream, AVPacket *pkt,
00172 AVFormatContext *src);
00173
00177 int ff_get_v_length(uint64_t val);
00178
00182 void ff_put_v(ByteIOContext *bc, uint64_t val);
00183
00195 int ff_get_line(ByteIOContext *s, char *buf, int maxlen);
00196
00197 #define SPACE_CHARS " \t\r\n"
00198
00209 typedef void (*ff_parse_key_val_cb)(void *context, const char *key,
00210 int key_len, char **dest, int *dest_len);
00220 void ff_parse_key_value(const char *str, ff_parse_key_val_cb callback_get_buf,
00221 void *context);
00222
00227 int ff_find_stream_index(AVFormatContext *s, int id);
00228
00229 #endif