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 #ifdef DEBUG
00030 # define hex_dump_debug(class, buf, size) av_hex_dump_log(class, AV_LOG_DEBUG, buf, size)
00031 #else
00032 # define hex_dump_debug(class, buf, size)
00033 #endif
00034
00035 typedef struct AVCodecTag {
00036 enum CodecID id;
00037 unsigned int tag;
00038 } AVCodecTag;
00039
00040 #ifdef __GNUC__
00041 #define dynarray_add(tab, nb_ptr, elem)\
00042 do {\
00043 __typeof__(tab) _tab = (tab);\
00044 __typeof__(elem) _elem = (elem);\
00045 (void)sizeof(**_tab == _elem); \
00046 av_dynarray_add(_tab, nb_ptr, _elem);\
00047 } while(0)
00048 #else
00049 #define dynarray_add(tab, nb_ptr, elem)\
00050 do {\
00051 av_dynarray_add((tab), nb_ptr, (elem));\
00052 } while(0)
00053 #endif
00054
00055 struct tm *brktimegm(time_t secs, struct tm *tm);
00056
00057 char *ff_data_to_hex(char *buf, const uint8_t *src, int size, int lowercase);
00058
00067 int ff_hex_to_data(uint8_t *data, const char *p);
00068
00069 void ff_program_add_stream_index(AVFormatContext *ac, int progid, unsigned int idx);
00070
00075 void ff_interleave_add_packet(AVFormatContext *s, AVPacket *pkt,
00076 int (*compare)(AVFormatContext *, AVPacket *, AVPacket *));
00077
00078 void ff_read_frame_flush(AVFormatContext *s);
00079
00080 #define NTP_OFFSET 2208988800ULL
00081 #define NTP_OFFSET_US (NTP_OFFSET * 1000000ULL)
00082
00084 uint64_t ff_ntp_time(void);
00085
00107 int ff_url_join(char *str, int size, const char *proto,
00108 const char *authorization, const char *hostname,
00109 int port, const char *fmt, ...);
00110
00128 void ff_sdp_write_media(char *buff, int size, AVCodecContext *c,
00129 const char *dest_addr, const char *dest_type,
00130 int port, int ttl, AVFormatContext *fmt);
00131
00143 int ff_write_chained(AVFormatContext *dst, int dst_stream, AVPacket *pkt,
00144 AVFormatContext *src);
00145
00149 int ff_get_v_length(uint64_t val);
00150
00154 void ff_put_v(AVIOContext *bc, uint64_t val);
00155
00167 int ff_get_line(AVIOContext *s, char *buf, int maxlen);
00168
00169 #define SPACE_CHARS " \t\r\n"
00170
00181 typedef void (*ff_parse_key_val_cb)(void *context, const char *key,
00182 int key_len, char **dest, int *dest_len);
00192 void ff_parse_key_value(const char *str, ff_parse_key_val_cb callback_get_buf,
00193 void *context);
00194
00199 int ff_find_stream_index(AVFormatContext *s, int id);
00200
00204 int ff_index_search_timestamp(const AVIndexEntry *entries, int nb_entries,
00205 int64_t wanted_timestamp, int flags);
00206
00210 int ff_add_index_entry(AVIndexEntry **index_entries,
00211 int *nb_index_entries,
00212 unsigned int *index_entries_allocated_size,
00213 int64_t pos, int64_t timestamp, int size, int distance, int flags);
00214
00226 AVChapter *ff_new_chapter(AVFormatContext *s, int id, AVRational time_base,
00227 int64_t start, int64_t end, const char *title);
00228
00234 void ff_reduce_index(AVFormatContext *s, int stream_index);
00235
00236
00237
00238
00239
00240
00241
00242
00243
00244 void ff_make_absolute_url(char *buf, int size, const char *base,
00245 const char *rel);
00246
00247 enum CodecID ff_guess_image2_codec(const char *filename);
00248
00249 #endif