2
* copyright (c) 2001 Fabrice Bellard
4
* This file is part of FFmpeg.
6
* FFmpeg is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU Lesser General Public
8
* License as published by the Free Software Foundation; either
9
* version 2.1 of the License, or (at your option) any later version.
11
* FFmpeg is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
* Lesser General Public License for more details.
16
* You should have received a copy of the GNU Lesser General Public
17
* License along with FFmpeg; if not, write to the Free Software
18
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
8
#define LIBAVFORMAT_VERSION_INT ((50<<16)+(4<<8)+0)
9
#define LIBAVFORMAT_VERSION 50.4.0
28
#define LIBAVFORMAT_VERSION_INT ((50<<16)+(6<<8)+0)
29
#define LIBAVFORMAT_VERSION 50.6.0
10
30
#define LIBAVFORMAT_BUILD LIBAVFORMAT_VERSION_INT
12
32
#define LIBAVFORMAT_IDENT "Lavf" AV_STRINGIFY(LIBAVFORMAT_VERSION)
79
99
is assumed to be such as 0 <= num < den */
80
100
typedef struct AVFrac {
81
101
int64_t val, num, den;
84
void av_frac_init(AVFrac *f, int64_t val, int64_t num, int64_t den);
85
void av_frac_add(AVFrac *f, int64_t incr);
86
void av_frac_set(AVFrac *f, int64_t val);
102
} AVFrac attribute_deprecated;
88
104
/*************************************************/
89
105
/* input/output formats */
265
283
AVIndexEntry *index_entries; /* only used if the format does not
266
284
support seeking natively */
267
285
int nb_index_entries;
268
int index_entries_allocated_size;
286
unsigned int index_entries_allocated_size;
270
288
int64_t nb_frames; ///< number of frames in this stream if known or 0
290
#define MAX_REORDER_DELAY 4
291
int64_t pts_buffer[MAX_REORDER_DELAY+1];
273
294
#define AVFMTCTX_NOHEADER 0x0001 /* signal that no header is present
352
378
extern AVOutputFormat *first_oformat;
354
380
/* still image support */
355
struct AVInputImageContext;
356
typedef struct AVInputImageContext AVInputImageContext;
381
struct AVInputImageContext attribute_deprecated;
382
typedef struct AVInputImageContext AVInputImageContext attribute_deprecated;
358
384
typedef struct AVImageInfo {
359
385
enum PixelFormat pix_fmt; /* requested pixel format */
361
387
int height; /* requested height */
362
388
int interleaved; /* image is interleaved (e.g. interleaved GIF) */
363
389
AVPicture pict; /* returned allocated image */
390
} AVImageInfo attribute_deprecated;
366
392
/* AVImageFormat.flags field constants */
367
393
#define AVIMAGE_INTERLEAVED 0x0001 /* image format support interleaved output */
382
408
int (*img_write)(ByteIOContext *, AVImageInfo *);
384
410
struct AVImageFormat *next;
411
} AVImageFormat attribute_deprecated;
387
void av_register_image_format(AVImageFormat *img_fmt);
388
AVImageFormat *av_probe_image_format(AVProbeData *pd);
389
AVImageFormat *guess_image_format(const char *filename);
413
void av_register_image_format(AVImageFormat *img_fmt) attribute_deprecated;
414
AVImageFormat *av_probe_image_format(AVProbeData *pd) attribute_deprecated;
415
AVImageFormat *guess_image_format(const char *filename) attribute_deprecated;
390
416
enum CodecID av_guess_image2_codec(const char *filename);
391
417
int av_read_image(ByteIOContext *pb, const char *filename,
392
418
AVImageFormat *fmt,
393
int (*alloc_cb)(void *, AVImageInfo *info), void *opaque);
394
int av_write_image(ByteIOContext *pb, AVImageFormat *fmt, AVImageInfo *img);
396
extern AVImageFormat *first_image_format;
398
extern AVImageFormat pnm_image_format;
399
extern AVImageFormat pbm_image_format;
400
extern AVImageFormat pgm_image_format;
401
extern AVImageFormat ppm_image_format;
402
extern AVImageFormat pam_image_format;
403
extern AVImageFormat pgmyuv_image_format;
404
extern AVImageFormat yuv_image_format;
406
extern AVImageFormat png_image_format;
408
extern AVImageFormat jpeg_image_format;
409
extern AVImageFormat gif_image_format;
410
extern AVImageFormat sgi_image_format;
419
int (*alloc_cb)(void *, AVImageInfo *info), void *opaque) attribute_deprecated;
420
int av_write_image(ByteIOContext *pb, AVImageFormat *fmt, AVImageInfo *img) attribute_deprecated;
422
extern AVImageFormat *first_image_format attribute_deprecated;
412
424
/* XXX: use automatic init with either ELF sections or C file parser */
416
extern AVInputFormat mpegps_demux;
417
int mpegps_init(void);
420
extern AVInputFormat mpegts_demux;
421
int mpegts_init(void);
439
int avienc_init(void);
442
int avidec_init(void);
451
int movenc_init(void);
454
int flvenc_init(void);
457
int flvdec_init(void);
472
int ff_wav_init(void);
475
int ff_mmf_init(void);
478
int pcm_read_seek(AVFormatContext *s,
479
int stream_index, int64_t timestamp, int flags);
486
int yuv4mpeg_init(void);
492
int libogg_init(void);
495
int ff_dv_init(void);
501
extern AVInputFormat redir_demux;
502
int redir_open(AVFormatContext **ic_ptr, ByteIOContext *f);
505
int fourxm_init(void);
514
int ipmovie_init(void);
523
int westwood_init(void);
529
int idcin_init(void);
538
int matroska_init(void);
543
/* electronicarts.c */
547
int nsvdec_init(void);
556
int ff_aiff_init(void);
565
int ff_adts_init(void);
574
int smacker_init(void);
578
429
#include "rtsp.h"
581
extern AVOutputFormat yuv4mpegpipe_oformat;
584
432
void av_register_input_format(AVInputFormat *format);
585
433
void av_register_output_format(AVOutputFormat *format);
596
444
void av_register_all(void);
598
typedef struct FifoBuffer {
600
uint8_t *rptr, *wptr, *end;
603
int fifo_init(FifoBuffer *f, int size);
604
void fifo_free(FifoBuffer *f);
605
int fifo_size(FifoBuffer *f, uint8_t *rptr);
606
int fifo_read(FifoBuffer *f, uint8_t *buf, int buf_size, uint8_t **rptr_ptr);
607
void fifo_write(FifoBuffer *f, uint8_t *buf, int size, uint8_t **wptr_ptr);
608
int put_fifo(ByteIOContext *pb, FifoBuffer *f, int buf_size, uint8_t **rptr_ptr);
609
void fifo_realloc(FifoBuffer *f, unsigned int size);
611
446
/* media file input */
612
447
AVInputFormat *av_find_input_format(const char *short_name);
613
448
AVInputFormat *av_probe_input_format(AVProbeData *pd, int is_opened);
649
484
int av_add_index_entry(AVStream *st,
650
485
int64_t pos, int64_t timestamp, int size, int distance, int flags);
651
486
int av_seek_frame_binary(AVFormatContext *s, int stream_index, int64_t target_ts, int flags);
487
void av_update_cur_dts(AVFormatContext *s, AVStream *ref_st, int64_t timestamp);
653
489
/* media file output */
654
490
int av_set_parameters(AVFormatContext *s, AVFormatParameters *ap);
655
491
int av_write_header(AVFormatContext *s);
656
492
int av_write_frame(AVFormatContext *s, AVPacket *pkt);
657
493
int av_interleaved_write_frame(AVFormatContext *s, AVPacket *pkt);
494
int av_interleave_packet_per_dts(AVFormatContext *s, AVPacket *out, AVPacket *pkt, int flush);
659
496
int av_write_trailer(AVFormatContext *s);
677
514
int find_info_tag(char *arg, int arg_size, const char *tag1, const char *info);
679
int get_frame_filename(char *buf, int buf_size,
680
const char *path, int number);
681
int filename_number_test(const char *filename);
516
int av_get_frame_filename(char *buf, int buf_size,
517
const char *path, int number);
518
int av_filename_number_test(const char *filename);
683
520
/* grab specific */
684
521
int video_grab_init(void);