]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/avformat.h
fixing CODEC_FLAG_GLOBAL_HEADER
[ffmpeg] / libavformat / avformat.h
index 9e40145265cb6e4f26e64f5edd7f53392c3f3353..ef70029217e7c2bec9442386ffcf5f87a125277b 100644 (file)
@@ -7,7 +7,7 @@ extern "C" {
 
 #define LIBAVFORMAT_VERSION_INT 0x000406  
 #define LIBAVFORMAT_VERSION     "0.4.6"
-#define LIBAVFORMAT_BUILD       4604
+#define LIBAVFORMAT_BUILD       4606
 
 #include "avcodec.h"
 
@@ -15,7 +15,16 @@ extern "C" {
 
 /* packet functions */
 
-#define AV_NOPTS_VALUE 0
+#ifndef MAXINT64
+#define MAXINT64 int64_t_C(0x7fffffffffffffff)
+#endif
+
+#ifndef MININT64
+#define MININT64 int64_t_C(0x8000000000000000)
+#endif
+
+#define AV_NOPTS_VALUE MININT64
+#define AV_TIME_BASE 1000000
 
 typedef struct AVPacket {
     int64_t pts; /* presentation time stamp in stream units (set av_set_pts_info) */
@@ -45,7 +54,9 @@ int av_new_packet(AVPacket *pkt, int size);
  */
 static inline void av_free_packet(AVPacket *pkt)
 {
-    pkt->destruct(pkt);
+    if (pkt && pkt->destruct) {
+       pkt->destruct(pkt);
+    }
 }
 
 /*************************************************/
@@ -86,6 +97,7 @@ typedef struct AVFormatParameters {
     struct AVImageFormat *image_format;
     int channel; /* used to select dv channel */
     const char *device; /* video4linux, audio or DV device */
+    const char *standard; /* tv standard, NTSC, PAL, SECAM */
 } AVFormatParameters;
 
 #define AVFMT_NOFILE        0x0001 /* no file should be opened */
@@ -161,7 +173,6 @@ typedef struct AVStream {
     AVCodecContext codec; /* codec context */
     int r_frame_rate;     /* real frame rate of the stream */
     int r_frame_rate_base;/* real frame rate base of the stream */
-    uint64_t time_length; /* real length of the stream in miliseconds */
     void *priv_data;
     /* internal data used in av_find_stream_info() */
     int codec_info_state;     
@@ -174,6 +185,12 @@ typedef struct AVStream {
     /* quality, as it has been removed from AVCodecContext and put in AVVideoFrame
      * MN:dunno if thats the right place, for it */
     float quality; 
+    /* decoding: position of the first frame of the component, in
+       AV_TIME_BASE fractional seconds. */
+    int64_t start_time; 
+    /* decoding: duration of the stream, in AV_TIME_BASE fractional
+       seconds. */
+    int64_t duration;
 } AVStream;
 
 #define MAX_STREAMS 20
@@ -200,7 +217,22 @@ typedef struct AVFormatContext {
     /* This buffer is only needed when packets were already buffered but
        not decoded, for example to get the codec parameters in mpeg
        streams */
-   struct AVPacketList *packet_buffer;
+    struct AVPacketList *packet_buffer;
+
+    /* decoding: position of the first frame of the component, in
+       AV_TIME_BASE fractional seconds. NEVER set this value directly:
+       it is deduced from the AVStream values.  */
+    int64_t start_time; 
+    /* decoding: duration of the stream, in AV_TIME_BASE fractional
+       seconds. NEVER set this value directly: it is deduced from the
+       AVStream values.  */
+    int64_t duration;
+    /* decoding: total file size. 0 if unknown */
+    int64_t file_size;
+    /* decoding: total stream bitrate in bit/s, 0 if not
+       available. Never set it directly if the file_size and the
+       duration are known as ffmpeg can compute it automatically. */
+    int bit_rate;
 } AVFormatContext;
 
 typedef struct AVPacketList {
@@ -219,12 +251,12 @@ typedef struct AVImageInfo {
     enum PixelFormat pix_fmt; /* requested pixel format */
     int width; /* requested width */
     int height; /* requested height */
-    int progressive; /* image is progressive (e.g. interleaved GIF) */
+    int interleaved; /* image is interleaved (e.g. interleaved GIF) */
     AVPicture pict; /* returned allocated image */
 } AVImageInfo;
 
 /* AVImageFormat.flags field constants */
-#define AVIMAGE_PROGRESSIVE 0x0001 /* image format support progressive output */
+#define AVIMAGE_INTERLEAVED 0x0001 /* image format support interleaved output */
 
 typedef struct AVImageFormat {
     const char *name;
@@ -271,6 +303,7 @@ extern AVImageFormat gif_image_format;
 /* modules */
 
 /* mpeg.c */
+extern AVInputFormat mpegps_demux;
 int mpegps_init(void);
 
 /* mpegts.c */
@@ -301,6 +334,12 @@ int swf_init(void);
 /* mov.c */
 int mov_init(void);
 
+/* flvenc.c */
+int flvenc_init(void);
+
+/* flvdec.c */
+int flvdec_init(void);
+
 /* jpeg.c */
 int jpeg_init(void);
 
@@ -310,12 +349,18 @@ int gif_init(void);
 /* au.c */
 int au_init(void);
 
+/* amr.c */
+int amr_init(void);
+
 /* wav.c */
 int wav_init(void);
 
 /* raw.c */
 int raw_init(void);
 
+/* yuv4mpeg.c */
+int yuv4mpeg_init(void);
+
 /* ogg.c */
 int ogg_init(void);
 
@@ -329,6 +374,9 @@ int ffm_init(void);
 extern AVInputFormat redir_demux;
 int redir_open(AVFormatContext **ic_ptr, ByteIOContext *f);
 
+/* 4xm.c */
+int fourxm_init(void);
+
 #include "rtp.h"
 
 #include "rtsp.h"
@@ -393,6 +441,7 @@ void dump_format(AVFormatContext *ic,
                  const char *url,
                  int is_output);
 int parse_image_size(int *width_ptr, int *height_ptr, const char *str);
+int parse_frame_rate(int *frame_rate, int *frame_rate_base, const char *arg);
 int64_t parse_date(const char *datestr, int duration);
 
 int64_t av_gettime(void);
@@ -422,6 +471,16 @@ int stristart(const char *str, const char *val, const char **ptr);
 void pstrcpy(char *buf, int buf_size, const char *str);
 char *pstrcat(char *buf, int buf_size, const char *s);
 
+void __dynarray_add(unsigned long **tab_ptr, int *nb_ptr, unsigned long elem);
+
+#define dynarray_add(tab, nb_ptr, elem)\
+do {\
+    typeof(tab) _tab = (tab);\
+    typeof(elem) _elem = (elem);\
+    (void)sizeof(**_tab == _elem); /* check that types are compatible */\
+    __dynarray_add((unsigned long **)_tab, nb_ptr, (unsigned long)_elem);\
+} while(0)
+
 struct in_addr;
 int resolve_host(struct in_addr *sin_addr, const char *hostname);