]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/blobdiff - libavformat/avformat.h
frsh: Export information about the last RTP contract and VRES
[frescor/ffmpeg.git] / libavformat / avformat.h
index c454824458949438ab1d35db47878753d000290b..8732b564469b3e572365eebfcd9c4e9a880ca4c5 100644 (file)
@@ -22,7 +22,7 @@
 #define AVFORMAT_AVFORMAT_H
 
 #define LIBAVFORMAT_VERSION_MAJOR 52
-#define LIBAVFORMAT_VERSION_MINOR 30
+#define LIBAVFORMAT_VERSION_MINOR 32
 #define LIBAVFORMAT_VERSION_MICRO  0
 
 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
@@ -46,10 +46,11 @@ unsigned avformat_version(void);
 
 #include "avio.h"
 
+struct AVFormatContext;
+
 
 /*
  * Public Metadata API.
- * !!WARNING!! This is a work in progress. Don't use outside FFmpeg for now.
  * The metadata API allows libavformat to export metadata tags to a client
  * application using a sequence of key/value pairs.
  * Important concepts to keep in mind:
@@ -62,7 +63,7 @@ unsigned avformat_version(void);
  *    want to store, e.g., the email address of the child of producer Alice
  *    and actor Bob, that could have key=alice_and_bobs_childs_email_address.
  * 3. A tag whose value is localized for a particular language is appended
- *    with a dash character ('-') and the ISO 639 3-letter language code.
+ *    with a dash character ('-') and the ISO 639-2/B 3-letter language code.
  *    For example: Author-ger=Michael, Author-eng=Mike
  *    The original/default language is in the unqualified "Author" tag.
  *    A demuxer should set a default if it sets any translated tag.
@@ -77,6 +78,7 @@ typedef struct {
 }AVMetadataTag;
 
 typedef struct AVMetadata AVMetadata;
+typedef struct AVMetadataConv AVMetadataConv;
 
 /**
  * Gets a metadata element with matching key.
@@ -95,6 +97,15 @@ av_metadata_get(AVMetadata *m, const char *key, const AVMetadataTag *prev, int f
  */
 int av_metadata_set(AVMetadata **pm, const char *key, const char *value);
 
+/**
+ * Convert all the metadata sets from ctx according to the source and
+ * destination conversion tables.
+ * @param d_conv destination tags format conversion table
+ * @param s_conv source tags format conversion table
+ */
+void av_metadata_conv(struct AVFormatContext *ctx,const AVMetadataConv *d_conv,
+                                                  const AVMetadataConv *s_conv);
+
 /**
  * Frees all the memory allocated for an AVMetadata struct.
  */
@@ -103,78 +114,6 @@ void av_metadata_free(AVMetadata **m);
 
 /* packet functions */
 
-typedef struct AVPacket {
-    /**
-     * Presentation timestamp in time_base units; the time at which the
-     * decompressed packet will be presented to the user.
-     * Can be AV_NOPTS_VALUE if it is not stored in the file.
-     * pts MUST be larger or equal to dts as presentation cannot happen before
-     * decompression, unless one wants to view hex dumps. Some formats misuse
-     * the terms dts and pts/cts to mean something different. Such timestamps
-     * must be converted to true pts/dts before they are stored in AVPacket.
-     */
-    int64_t pts;
-    /**
-     * Decompression timestamp in time_base units; the time at which the
-     * packet is decompressed.
-     * Can be AV_NOPTS_VALUE if it is not stored in the file.
-     */
-    int64_t dts;
-    uint8_t *data;
-    int   size;
-    int   stream_index;
-    int   flags;
-    /**
-     * Duration of this packet in time_base units, 0 if unknown.
-     * Equals next_pts - this_pts in presentation order.
-     */
-    int   duration;
-    void  (*destruct)(struct AVPacket *);
-    void  *priv;
-    int64_t pos;                            ///< byte position in stream, -1 if unknown
-
-    /**
-     * Time difference in stream time base units from the pts of this
-     * packet to the point at which the output from the decoder has converged
-     * independent from the availability of previous frames. That is, the
-     * frames are virtually identical no matter if decoding started from
-     * the very first frame or from this keyframe.
-     * Is AV_NOPTS_VALUE if unknown.
-     * This field is not the display duration of the current packet.
-     *
-     * The purpose of this field is to allow seeking in streams that have no
-     * keyframes in the conventional sense. It corresponds to the
-     * recovery point SEI in H.264 and match_time_delta in NUT. It is also
-     * essential for some types of subtitle streams to ensure that all
-     * subtitles are correctly displayed after seeking.
-     */
-    int64_t convergence_duration;
-} AVPacket;
-#define PKT_FLAG_KEY   0x0001
-
-void av_destruct_packet_nofree(AVPacket *pkt);
-
-/**
- * Default packet destructor.
- */
-void av_destruct_packet(AVPacket *pkt);
-
-/**
- * Initialize optional fields of a packet with default values.
- *
- * @param pkt packet
- */
-void av_init_packet(AVPacket *pkt);
-
-/**
- * Allocate the payload of a packet and initialize its fields with
- * default values.
- *
- * @param pkt packet
- * @param size wanted payload size
- * @return 0 if OK, AVERROR_xxx otherwise
- */
-int av_new_packet(AVPacket *pkt, int size);
 
 /**
  * Allocate and read the payload of a packet and initialize its fields with
@@ -186,23 +125,6 @@ int av_new_packet(AVPacket *pkt, int size);
  */
 int av_get_packet(ByteIOContext *s, AVPacket *pkt, int size);
 
-/**
- * @warning This is a hack - the packet memory allocation stuff is broken. The
- * packet is allocated if it was not really allocated.
- */
-int av_dup_packet(AVPacket *pkt);
-
-/**
- * Free a packet.
- *
- * @param pkt packet to free
- */
-static inline void av_free_packet(AVPacket *pkt)
-{
-    if (pkt && pkt->destruct) {
-        pkt->destruct(pkt);
-    }
-}
 
 /*************************************************/
 /* fractional numbers for exact pts handling */
@@ -220,8 +142,6 @@ typedef struct AVFrac {
 
 struct AVCodecTag;
 
-struct AVFormatContext;
-
 /** This structure contains the data a format has to probe a file. */
 typedef struct AVProbeData {
     const char *filename;
@@ -299,6 +219,8 @@ typedef struct AVOutputFormat {
 
     enum CodecID subtitle_codec; /**< default subtitle codec */
 
+    const AVMetadataConv *metadata_conv;
+
     /* private fields */
     struct AVOutputFormat *next;
 } AVOutputFormat;
@@ -327,7 +249,10 @@ typedef struct AVInputFormat {
                        AVFormatParameters *ap);
     /** Read one packet and put it in 'pkt'. pts and flags are also
        set. 'av_new_stream' can be called only if the flag
-       AVFMTCTX_NOHEADER is used. */
+       AVFMTCTX_NOHEADER is used.
+       @return 0 on success, < 0 on error.
+               When returning an error, pkt must not have been allocated
+               or must be freed before returning */
     int (*read_packet)(struct AVFormatContext *, AVPacket *pkt);
     /** Close the stream. The AVFormatContext and AVStreams are not
        freed by this function */
@@ -378,6 +303,8 @@ typedef struct AVInputFormat {
      */
     int (*read_seek2)(struct AVFormatContext *s, int stream_index, int64_t min_ts, int64_t ts, int64_t max_ts, int flags);
 
+    const AVMetadataConv *metadata_conv;
+
     /* private fields */
     struct AVInputFormat *next;
 } AVInputFormat;
@@ -462,7 +389,9 @@ typedef struct AVStream {
      */
     int64_t duration;
 
-    char language[4]; /** ISO 639 3-letter language code (empty string if undefined) */
+#if LIBAVFORMAT_VERSION_INT < (53<<16)
+    char language[4]; /** ISO 639-2/B 3-letter language code (empty string if undefined) */
+#endif
 
     /* av_read_frame() support */
     enum AVStreamParseType need_parsing;
@@ -481,9 +410,9 @@ typedef struct AVStream {
 
 #if LIBAVFORMAT_VERSION_INT < (53<<16)
     int64_t unused[4+1];
-#endif
 
     char *filename; /**< source filename of the stream */
+#endif
 
     int disposition; /**< AV_DISPOSITION_* bit field */
 
@@ -526,8 +455,10 @@ typedef struct AVStream {
  */
 typedef struct AVProgram {
     int            id;
+#if LIBAVFORMAT_VERSION_INT < (53<<16)
     char           *provider_name; ///< network name for DVB streams
     char           *name;          ///< service name for DVB streams
+#endif
     int            flags;
     enum AVDiscard discard;        ///< selects which program to discard and which to feed to the caller
     unsigned int   *stream_index;
@@ -542,7 +473,9 @@ typedef struct AVChapter {
     int id;                 ///< unique ID to identify the chapter
     AVRational time_base;   ///< time base in which the start/end timestamps are specified
     int64_t start, end;     ///< chapter start/end time in time_base units
+#if LIBAVFORMAT_VERSION_INT < (53<<16)
     char *title;            ///< chapter title
+#endif
     AVMetadata *metadata;
 } AVChapter;
 
@@ -567,6 +500,7 @@ typedef struct AVFormatContext {
     char filename[1024]; /**< input or output filename */
     /* stream info */
     int64_t timestamp;
+#if LIBAVFORMAT_VERSION_INT < (53<<16)
     char title[512];
     char author[512];
     char copyright[512];
@@ -575,6 +509,7 @@ typedef struct AVFormatContext {
     int year;  /**< ID3 year, 0 if none */
     int track; /**< track number, 0 if none */
     char genre[32]; /**< ID3 genre */
+#endif
 
     int ctx_flags; /**< Format-specific flags, see AVFMTCTX_xx */
     /* private data for pts handling (do not modify directly). */