You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

600 lines
22KB

  1. /*
  2. * copyright (c) 2001 Fabrice Bellard
  3. *
  4. * This library is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Lesser General Public
  6. * License as published by the Free Software Foundation; either
  7. * version 2 of the License, or (at your option) any later version.
  8. *
  9. * This library is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * Lesser General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Lesser General Public
  15. * License along with this library; if not, write to the Free Software
  16. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  17. */
  18. #ifndef AVFORMAT_H
  19. #define AVFORMAT_H
  20. #ifdef __cplusplus
  21. extern "C" {
  22. #endif
  23. #define LIBAVFORMAT_VERSION_INT ((50<<16)+(5<<8)+0)
  24. #define LIBAVFORMAT_VERSION 50.5.0
  25. #define LIBAVFORMAT_BUILD LIBAVFORMAT_VERSION_INT
  26. #define LIBAVFORMAT_IDENT "Lavf" AV_STRINGIFY(LIBAVFORMAT_VERSION)
  27. #include <time.h>
  28. #include <stdio.h> /* FILE */
  29. #include "avcodec.h"
  30. #include "avio.h"
  31. /* packet functions */
  32. #ifndef MAXINT64
  33. #define MAXINT64 int64_t_C(0x7fffffffffffffff)
  34. #endif
  35. #ifndef MININT64
  36. #define MININT64 int64_t_C(0x8000000000000000)
  37. #endif
  38. typedef struct AVPacket {
  39. int64_t pts; ///< presentation time stamp in time_base units
  40. int64_t dts; ///< decompression time stamp in time_base units
  41. uint8_t *data;
  42. int size;
  43. int stream_index;
  44. int flags;
  45. int duration; ///< presentation duration in time_base units (0 if not available)
  46. void (*destruct)(struct AVPacket *);
  47. void *priv;
  48. int64_t pos; ///< byte position in stream, -1 if unknown
  49. } AVPacket;
  50. #define PKT_FLAG_KEY 0x0001
  51. void av_destruct_packet_nofree(AVPacket *pkt);
  52. void av_destruct_packet(AVPacket *pkt);
  53. /* initialize optional fields of a packet */
  54. static inline void av_init_packet(AVPacket *pkt)
  55. {
  56. pkt->pts = AV_NOPTS_VALUE;
  57. pkt->dts = AV_NOPTS_VALUE;
  58. pkt->pos = -1;
  59. pkt->duration = 0;
  60. pkt->flags = 0;
  61. pkt->stream_index = 0;
  62. pkt->destruct= av_destruct_packet_nofree;
  63. }
  64. int av_new_packet(AVPacket *pkt, int size);
  65. int av_get_packet(ByteIOContext *s, AVPacket *pkt, int size);
  66. int av_dup_packet(AVPacket *pkt);
  67. /**
  68. * Free a packet
  69. *
  70. * @param pkt packet to free
  71. */
  72. static inline void av_free_packet(AVPacket *pkt)
  73. {
  74. if (pkt && pkt->destruct) {
  75. pkt->destruct(pkt);
  76. }
  77. }
  78. /*************************************************/
  79. /* fractional numbers for exact pts handling */
  80. /* the exact value of the fractional number is: 'val + num / den'. num
  81. is assumed to be such as 0 <= num < den */
  82. typedef struct AVFrac {
  83. int64_t val, num, den;
  84. } AVFrac attribute_deprecated;
  85. /*************************************************/
  86. /* input/output formats */
  87. struct AVFormatContext;
  88. /* this structure contains the data a format has to probe a file */
  89. typedef struct AVProbeData {
  90. const char *filename;
  91. unsigned char *buf;
  92. int buf_size;
  93. } AVProbeData;
  94. #define AVPROBE_SCORE_MAX 100 ///< max score, half of that is used for file extension based detection
  95. typedef struct AVFormatParameters {
  96. AVRational time_base;
  97. int sample_rate;
  98. int channels;
  99. int width;
  100. int height;
  101. enum PixelFormat pix_fmt;
  102. struct AVImageFormat *image_format;
  103. int channel; /* used to select dv channel */
  104. const char *device; /* video, audio or DV device */
  105. const char *standard; /* tv standard, NTSC, PAL, SECAM */
  106. int mpeg2ts_raw:1; /* force raw MPEG2 transport stream output, if possible */
  107. int mpeg2ts_compute_pcr:1; /* compute exact PCR for each transport
  108. stream packet (only meaningful if
  109. mpeg2ts_raw is TRUE */
  110. int initial_pause:1; /* do not begin to play the stream
  111. immediately (RTSP only) */
  112. int prealloced_context:1;
  113. enum CodecID video_codec_id;
  114. enum CodecID audio_codec_id;
  115. } AVFormatParameters;
  116. #define AVFMT_NOFILE 0x0001 /* no file should be opened */
  117. #define AVFMT_NEEDNUMBER 0x0002 /* needs '%d' in filename */
  118. #define AVFMT_SHOW_IDS 0x0008 /* show format stream IDs numbers */
  119. #define AVFMT_RAWPICTURE 0x0020 /* format wants AVPicture structure for
  120. raw picture data */
  121. #define AVFMT_GLOBALHEADER 0x0040 /* format wants global header */
  122. #define AVFMT_NOTIMESTAMPS 0x0080 /* format doesnt need / has any timestamps */
  123. typedef struct AVOutputFormat {
  124. const char *name;
  125. const char *long_name;
  126. const char *mime_type;
  127. const char *extensions; /* comma separated extensions */
  128. /* size of private data so that it can be allocated in the wrapper */
  129. int priv_data_size;
  130. /* output support */
  131. enum CodecID audio_codec; /* default audio codec */
  132. enum CodecID video_codec; /* default video codec */
  133. int (*write_header)(struct AVFormatContext *);
  134. int (*write_packet)(struct AVFormatContext *, AVPacket *pkt);
  135. int (*write_trailer)(struct AVFormatContext *);
  136. /* can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_GLOBALHEADER */
  137. int flags;
  138. /* currently only used to set pixel format if not YUV420P */
  139. int (*set_parameters)(struct AVFormatContext *, AVFormatParameters *);
  140. int (*interleave_packet)(struct AVFormatContext *, AVPacket *out, AVPacket *in, int flush);
  141. /* private fields */
  142. struct AVOutputFormat *next;
  143. } AVOutputFormat;
  144. typedef struct AVInputFormat {
  145. const char *name;
  146. const char *long_name;
  147. /* size of private data so that it can be allocated in the wrapper */
  148. int priv_data_size;
  149. /* tell if a given file has a chance of being parsing by this format */
  150. int (*read_probe)(AVProbeData *);
  151. /* read the format header and initialize the AVFormatContext
  152. structure. Return 0 if OK. 'ap' if non NULL contains
  153. additionnal paramters. Only used in raw format right
  154. now. 'av_new_stream' should be called to create new streams. */
  155. int (*read_header)(struct AVFormatContext *,
  156. AVFormatParameters *ap);
  157. /* read one packet and put it in 'pkt'. pts and flags are also
  158. set. 'av_new_stream' can be called only if the flag
  159. AVFMTCTX_NOHEADER is used. */
  160. int (*read_packet)(struct AVFormatContext *, AVPacket *pkt);
  161. /* close the stream. The AVFormatContext and AVStreams are not
  162. freed by this function */
  163. int (*read_close)(struct AVFormatContext *);
  164. /**
  165. * seek to a given timestamp relative to the frames in
  166. * stream component stream_index
  167. * @param stream_index must not be -1
  168. * @param flags selects which direction should be preferred if no exact
  169. * match is available
  170. */
  171. int (*read_seek)(struct AVFormatContext *,
  172. int stream_index, int64_t timestamp, int flags);
  173. /**
  174. * gets the next timestamp in AV_TIME_BASE units.
  175. */
  176. int64_t (*read_timestamp)(struct AVFormatContext *s, int stream_index,
  177. int64_t *pos, int64_t pos_limit);
  178. /* can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER */
  179. int flags;
  180. /* if extensions are defined, then no probe is done. You should
  181. usually not use extension format guessing because it is not
  182. reliable enough */
  183. const char *extensions;
  184. /* general purpose read only value that the format can use */
  185. int value;
  186. /* start/resume playing - only meaningful if using a network based format
  187. (RTSP) */
  188. int (*read_play)(struct AVFormatContext *);
  189. /* pause playing - only meaningful if using a network based format
  190. (RTSP) */
  191. int (*read_pause)(struct AVFormatContext *);
  192. /* private fields */
  193. struct AVInputFormat *next;
  194. } AVInputFormat;
  195. typedef struct AVIndexEntry {
  196. int64_t pos;
  197. int64_t timestamp;
  198. #define AVINDEX_KEYFRAME 0x0001
  199. int flags:2;
  200. int size:30; //yeah trying to keep the size of this small to reduce memory requirements (its 24 vs 32 byte due to possible 8byte align)
  201. int min_distance; /* min distance between this and the previous keyframe, used to avoid unneeded searching */
  202. } AVIndexEntry;
  203. typedef struct AVStream {
  204. int index; /* stream index in AVFormatContext */
  205. int id; /* format specific stream id */
  206. AVCodecContext *codec; /* codec context */
  207. /**
  208. * real base frame rate of the stream.
  209. * for example if the timebase is 1/90000 and all frames have either
  210. * approximately 3600 or 1800 timer ticks then r_frame_rate will be 50/1
  211. */
  212. AVRational r_frame_rate;
  213. void *priv_data;
  214. /* internal data used in av_find_stream_info() */
  215. int64_t codec_info_duration;
  216. int codec_info_nb_frames;
  217. /* encoding: PTS generation when outputing stream */
  218. AVFrac pts;
  219. /**
  220. * this is the fundamental unit of time (in seconds) in terms
  221. * of which frame timestamps are represented. for fixed-fps content,
  222. * timebase should be 1/framerate and timestamp increments should be
  223. * identically 1.
  224. */
  225. AVRational time_base;
  226. int pts_wrap_bits; /* number of bits in pts (used for wrapping control) */
  227. /* ffmpeg.c private use */
  228. int stream_copy; /* if TRUE, just copy stream */
  229. enum AVDiscard discard; ///< selects which packets can be discarded at will and dont need to be demuxed
  230. //FIXME move stuff to a flags field?
  231. /* quality, as it has been removed from AVCodecContext and put in AVVideoFrame
  232. * MN:dunno if thats the right place, for it */
  233. float quality;
  234. /* decoding: position of the first frame of the component, in
  235. AV_TIME_BASE fractional seconds. */
  236. int64_t start_time;
  237. /* decoding: duration of the stream, in AV_TIME_BASE fractional
  238. seconds. */
  239. int64_t duration;
  240. char language[4]; /* ISO 639 3-letter language code (empty string if undefined) */
  241. /* av_read_frame() support */
  242. int need_parsing; ///< 1->full parsing needed, 2->only parse headers dont repack
  243. struct AVCodecParserContext *parser;
  244. int64_t cur_dts;
  245. int last_IP_duration;
  246. int64_t last_IP_pts;
  247. /* av_seek_frame() support */
  248. AVIndexEntry *index_entries; /* only used if the format does not
  249. support seeking natively */
  250. int nb_index_entries;
  251. int index_entries_allocated_size;
  252. int64_t nb_frames; ///< number of frames in this stream if known or 0
  253. #define MAX_REORDER_DELAY 4
  254. int64_t pts_buffer[MAX_REORDER_DELAY+1];
  255. } AVStream;
  256. #define AVFMTCTX_NOHEADER 0x0001 /* signal that no header is present
  257. (streams are added dynamically) */
  258. #define MAX_STREAMS 20
  259. /* format I/O context */
  260. typedef struct AVFormatContext {
  261. const AVClass *av_class; /* set by av_alloc_format_context */
  262. /* can only be iformat or oformat, not both at the same time */
  263. struct AVInputFormat *iformat;
  264. struct AVOutputFormat *oformat;
  265. void *priv_data;
  266. ByteIOContext pb;
  267. int nb_streams;
  268. AVStream *streams[MAX_STREAMS];
  269. char filename[1024]; /* input or output filename */
  270. /* stream info */
  271. int64_t timestamp;
  272. char title[512];
  273. char author[512];
  274. char copyright[512];
  275. char comment[512];
  276. char album[512];
  277. int year; /* ID3 year, 0 if none */
  278. int track; /* track number, 0 if none */
  279. char genre[32]; /* ID3 genre */
  280. int ctx_flags; /* format specific flags, see AVFMTCTX_xx */
  281. /* private data for pts handling (do not modify directly) */
  282. /* This buffer is only needed when packets were already buffered but
  283. not decoded, for example to get the codec parameters in mpeg
  284. streams */
  285. struct AVPacketList *packet_buffer;
  286. /* decoding: position of the first frame of the component, in
  287. AV_TIME_BASE fractional seconds. NEVER set this value directly:
  288. it is deduced from the AVStream values. */
  289. int64_t start_time;
  290. /* decoding: duration of the stream, in AV_TIME_BASE fractional
  291. seconds. NEVER set this value directly: it is deduced from the
  292. AVStream values. */
  293. int64_t duration;
  294. /* decoding: total file size. 0 if unknown */
  295. int64_t file_size;
  296. /* decoding: total stream bitrate in bit/s, 0 if not
  297. available. Never set it directly if the file_size and the
  298. duration are known as ffmpeg can compute it automatically. */
  299. int bit_rate;
  300. /* av_read_frame() support */
  301. AVStream *cur_st;
  302. const uint8_t *cur_ptr;
  303. int cur_len;
  304. AVPacket cur_pkt;
  305. /* av_seek_frame() support */
  306. int64_t data_offset; /* offset of the first packet */
  307. int index_built;
  308. int mux_rate;
  309. int packet_size;
  310. int preload;
  311. int max_delay;
  312. #define AVFMT_NOOUTPUTLOOP -1
  313. #define AVFMT_INFINITEOUTPUTLOOP 0
  314. /* number of times to loop output in formats that support it */
  315. int loop_output;
  316. int flags;
  317. #define AVFMT_FLAG_GENPTS 0x0001 ///< generate pts if missing even if it requires parsing future frames
  318. #define AVFMT_FLAG_IGNIDX 0x0002 ///< ignore index
  319. int loop_input;
  320. /* decoding: size of data to probe; encoding unused */
  321. unsigned int probesize;
  322. } AVFormatContext;
  323. typedef struct AVPacketList {
  324. AVPacket pkt;
  325. struct AVPacketList *next;
  326. } AVPacketList;
  327. extern AVInputFormat *first_iformat;
  328. extern AVOutputFormat *first_oformat;
  329. /* still image support */
  330. struct AVInputImageContext attribute_deprecated;
  331. typedef struct AVInputImageContext AVInputImageContext attribute_deprecated;
  332. typedef struct AVImageInfo {
  333. enum PixelFormat pix_fmt; /* requested pixel format */
  334. int width; /* requested width */
  335. int height; /* requested height */
  336. int interleaved; /* image is interleaved (e.g. interleaved GIF) */
  337. AVPicture pict; /* returned allocated image */
  338. } AVImageInfo attribute_deprecated;
  339. /* AVImageFormat.flags field constants */
  340. #define AVIMAGE_INTERLEAVED 0x0001 /* image format support interleaved output */
  341. typedef struct AVImageFormat {
  342. const char *name;
  343. const char *extensions;
  344. /* tell if a given file has a chance of being parsing by this format */
  345. int (*img_probe)(AVProbeData *);
  346. /* read a whole image. 'alloc_cb' is called when the image size is
  347. known so that the caller can allocate the image. If 'allo_cb'
  348. returns non zero, then the parsing is aborted. Return '0' if
  349. OK. */
  350. int (*img_read)(ByteIOContext *,
  351. int (*alloc_cb)(void *, AVImageInfo *info), void *);
  352. /* write the image */
  353. int supported_pixel_formats; /* mask of supported formats for output */
  354. int (*img_write)(ByteIOContext *, AVImageInfo *);
  355. int flags;
  356. struct AVImageFormat *next;
  357. } AVImageFormat attribute_deprecated;
  358. void av_register_image_format(AVImageFormat *img_fmt) attribute_deprecated;
  359. AVImageFormat *av_probe_image_format(AVProbeData *pd) attribute_deprecated;
  360. AVImageFormat *guess_image_format(const char *filename) attribute_deprecated;
  361. enum CodecID av_guess_image2_codec(const char *filename);
  362. int av_read_image(ByteIOContext *pb, const char *filename,
  363. AVImageFormat *fmt,
  364. int (*alloc_cb)(void *, AVImageInfo *info), void *opaque) attribute_deprecated;
  365. int av_write_image(ByteIOContext *pb, AVImageFormat *fmt, AVImageInfo *img) attribute_deprecated;
  366. extern AVImageFormat *first_image_format attribute_deprecated;
  367. /* XXX: use automatic init with either ELF sections or C file parser */
  368. /* modules */
  369. #include "rtp.h"
  370. #include "rtsp.h"
  371. /* utils.c */
  372. void av_register_input_format(AVInputFormat *format);
  373. void av_register_output_format(AVOutputFormat *format);
  374. AVOutputFormat *guess_stream_format(const char *short_name,
  375. const char *filename, const char *mime_type);
  376. AVOutputFormat *guess_format(const char *short_name,
  377. const char *filename, const char *mime_type);
  378. enum CodecID av_guess_codec(AVOutputFormat *fmt, const char *short_name,
  379. const char *filename, const char *mime_type, enum CodecType type);
  380. void av_hex_dump(FILE *f, uint8_t *buf, int size);
  381. void av_pkt_dump(FILE *f, AVPacket *pkt, int dump_payload);
  382. void av_register_all(void);
  383. typedef struct FifoBuffer {
  384. uint8_t *buffer;
  385. uint8_t *rptr, *wptr, *end;
  386. } FifoBuffer;
  387. int fifo_init(FifoBuffer *f, int size);
  388. void fifo_free(FifoBuffer *f);
  389. int fifo_size(FifoBuffer *f, uint8_t *rptr);
  390. int fifo_read(FifoBuffer *f, uint8_t *buf, int buf_size, uint8_t **rptr_ptr);
  391. void fifo_write(FifoBuffer *f, const uint8_t *buf, int size, uint8_t **wptr_ptr);
  392. int put_fifo(ByteIOContext *pb, FifoBuffer *f, int buf_size, uint8_t **rptr_ptr);
  393. void fifo_realloc(FifoBuffer *f, unsigned int size);
  394. static inline uint8_t fifo_peek(FifoBuffer *f, int offs)
  395. {
  396. return f->buffer[(f->rptr - f->buffer + offs) % (f->end - f->buffer)];
  397. }
  398. static inline void fifo_drain(FifoBuffer *f, int size)
  399. {
  400. f->rptr += size;
  401. if (f->rptr >= f->end)
  402. f->rptr = f->buffer + (f->rptr - f->end);
  403. }
  404. /* media file input */
  405. AVInputFormat *av_find_input_format(const char *short_name);
  406. AVInputFormat *av_probe_input_format(AVProbeData *pd, int is_opened);
  407. int av_open_input_stream(AVFormatContext **ic_ptr,
  408. ByteIOContext *pb, const char *filename,
  409. AVInputFormat *fmt, AVFormatParameters *ap);
  410. int av_open_input_file(AVFormatContext **ic_ptr, const char *filename,
  411. AVInputFormat *fmt,
  412. int buf_size,
  413. AVFormatParameters *ap);
  414. /* no av_open for output, so applications will need this: */
  415. AVFormatContext *av_alloc_format_context(void);
  416. #define AVERROR_UNKNOWN (-1) /* unknown error */
  417. #define AVERROR_IO (-2) /* i/o error */
  418. #define AVERROR_NUMEXPECTED (-3) /* number syntax expected in filename */
  419. #define AVERROR_INVALIDDATA (-4) /* invalid data found */
  420. #define AVERROR_NOMEM (-5) /* not enough memory */
  421. #define AVERROR_NOFMT (-6) /* unknown format */
  422. #define AVERROR_NOTSUPP (-7) /* operation not supported */
  423. int av_find_stream_info(AVFormatContext *ic);
  424. int av_read_packet(AVFormatContext *s, AVPacket *pkt);
  425. int av_read_frame(AVFormatContext *s, AVPacket *pkt);
  426. int av_seek_frame(AVFormatContext *s, int stream_index, int64_t timestamp, int flags);
  427. int av_read_play(AVFormatContext *s);
  428. int av_read_pause(AVFormatContext *s);
  429. void av_close_input_file(AVFormatContext *s);
  430. AVStream *av_new_stream(AVFormatContext *s, int id);
  431. void av_set_pts_info(AVStream *s, int pts_wrap_bits,
  432. int pts_num, int pts_den);
  433. #define AVSEEK_FLAG_BACKWARD 1 ///< seek backward
  434. #define AVSEEK_FLAG_BYTE 2 ///< seeking based on position in bytes
  435. #define AVSEEK_FLAG_ANY 4 ///< seek to any frame, even non keyframes
  436. int av_find_default_stream_index(AVFormatContext *s);
  437. int av_index_search_timestamp(AVStream *st, int64_t timestamp, int flags);
  438. int av_add_index_entry(AVStream *st,
  439. int64_t pos, int64_t timestamp, int size, int distance, int flags);
  440. int av_seek_frame_binary(AVFormatContext *s, int stream_index, int64_t target_ts, int flags);
  441. void av_update_cur_dts(AVFormatContext *s, AVStream *ref_st, int64_t timestamp);
  442. /* media file output */
  443. int av_set_parameters(AVFormatContext *s, AVFormatParameters *ap);
  444. int av_write_header(AVFormatContext *s);
  445. int av_write_frame(AVFormatContext *s, AVPacket *pkt);
  446. int av_interleaved_write_frame(AVFormatContext *s, AVPacket *pkt);
  447. int av_interleave_packet_per_dts(AVFormatContext *s, AVPacket *out, AVPacket *pkt, int flush);
  448. int av_write_trailer(AVFormatContext *s);
  449. void dump_format(AVFormatContext *ic,
  450. int index,
  451. const char *url,
  452. int is_output);
  453. int parse_image_size(int *width_ptr, int *height_ptr, const char *str);
  454. int parse_frame_rate(int *frame_rate, int *frame_rate_base, const char *arg);
  455. int64_t parse_date(const char *datestr, int duration);
  456. int64_t av_gettime(void);
  457. /* ffm specific for ffserver */
  458. #define FFM_PACKET_SIZE 4096
  459. offset_t ffm_read_write_index(int fd);
  460. void ffm_write_write_index(int fd, offset_t pos);
  461. void ffm_set_write_index(AVFormatContext *s, offset_t pos, offset_t file_size);
  462. int find_info_tag(char *arg, int arg_size, const char *tag1, const char *info);
  463. int av_get_frame_filename(char *buf, int buf_size,
  464. const char *path, int number);
  465. int av_filename_number_test(const char *filename);
  466. /* grab specific */
  467. int video_grab_init(void);
  468. int audio_init(void);
  469. /* DV1394 */
  470. int dv1394_init(void);
  471. int dc1394_init(void);
  472. #ifdef HAVE_AV_CONFIG_H
  473. #include "os_support.h"
  474. int strstart(const char *str, const char *val, const char **ptr);
  475. int stristart(const char *str, const char *val, const char **ptr);
  476. void pstrcpy(char *buf, int buf_size, const char *str);
  477. char *pstrcat(char *buf, int buf_size, const char *s);
  478. void __dynarray_add(unsigned long **tab_ptr, int *nb_ptr, unsigned long elem);
  479. #ifdef __GNUC__
  480. #define dynarray_add(tab, nb_ptr, elem)\
  481. do {\
  482. typeof(tab) _tab = (tab);\
  483. typeof(elem) _elem = (elem);\
  484. (void)sizeof(**_tab == _elem); /* check that types are compatible */\
  485. __dynarray_add((unsigned long **)_tab, nb_ptr, (unsigned long)_elem);\
  486. } while(0)
  487. #else
  488. #define dynarray_add(tab, nb_ptr, elem)\
  489. do {\
  490. __dynarray_add((unsigned long **)(tab), nb_ptr, (unsigned long)(elem));\
  491. } while(0)
  492. #endif
  493. time_t mktimegm(struct tm *tm);
  494. struct tm *brktimegm(time_t secs, struct tm *tm);
  495. const char *small_strptime(const char *p, const char *fmt,
  496. struct tm *dt);
  497. struct in_addr;
  498. int resolve_host(struct in_addr *sin_addr, const char *hostname);
  499. void url_split(char *proto, int proto_size,
  500. char *authorization, int authorization_size,
  501. char *hostname, int hostname_size,
  502. int *port_ptr,
  503. char *path, int path_size,
  504. const char *url);
  505. int match_ext(const char *filename, const char *extensions);
  506. #endif /* HAVE_AV_CONFIG_H */
  507. #ifdef __cplusplus
  508. }
  509. #endif
  510. #endif /* AVFORMAT_H */