]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/avformat.h
Reformat rdt_demuxer AVCodec struct sanely.
[ffmpeg] / libavformat / avformat.h
index d002a99117a2d2c16a35700148233f4bc4c9be83..d7c457b9053aae3d7fbabe42fbafe25d86253a4f 100644 (file)
@@ -22,8 +22,8 @@
 #define AVFORMAT_AVFORMAT_H
 
 #define LIBAVFORMAT_VERSION_MAJOR 52
-#define LIBAVFORMAT_VERSION_MINOR 23
-#define LIBAVFORMAT_VERSION_MICRO  1
+#define LIBAVFORMAT_VERSION_MINOR 25
+#define LIBAVFORMAT_VERSION_MICRO  0
 
 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
                                                LIBAVFORMAT_VERSION_MINOR, \
@@ -49,6 +49,7 @@ unsigned avformat_version(void);
 
 /*
  * 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:
@@ -67,7 +68,7 @@ unsigned avformat_version(void);
  *    A demuxer should set a default if it sets any translated tag.
  */
 
-#define AV_METADATA_IGNORE_CASE     1
+#define AV_METADATA_MATCH_CASE      1
 #define AV_METADATA_IGNORE_SUFFIX   2
 
 typedef struct {
@@ -75,23 +76,29 @@ typedef struct {
     char *value;
 }AVMetadataTag;
 
-struct AVMetadata;
+typedef struct AVMetadata AVMetadata;
 
 /**
  * gets a metadata element with matching key.
  * @param prev set to the previous matching element to find the next.
- * @param flags allows case as well as suffix insensitive comparissions.
+ * @param flags allows case as well as suffix insensitive comparisons.
  * @return found tag or NULL, changing key or value leads to undefined behavior.
  */
 AVMetadataTag *
-av_metadata_get(struct AVMetadata *m, const char *key, const AVMetadataTag *prev, int flags);
+av_metadata_get(AVMetadata *m, const char *key, const AVMetadataTag *prev, int flags);
 
 /**
  * sets the given tag in m, overwriting an existing tag.
- * @param tag tag to add to m, key and value will be av_strduped.
+ * @param key tag key to add to m (will be av_strduped).
+ * @param value tag value to add to m (will be av_strduped).
  * @return >= 0 if success otherwise error code that is <0.
  */
-int av_metadata_set(struct AVMetadata **m, AVMetadataTag tag);
+int av_metadata_set(AVMetadata **pm, const char *key, const char *value);
+
+/**
+ * Free all the memory allocated for an AVMetadata struct.
+ */
+void av_metadata_free(AVMetadata **m);
 
 
 /* packet functions */
@@ -481,7 +488,12 @@ typedef struct AVStream {
      */
     AVRational sample_aspect_ratio;
 
-    struct AVMetadata *metadata;
+    AVMetadata *metadata;
+
+    /* av_read_frame() support */
+    const uint8_t *cur_ptr;
+    int cur_len;
+    AVPacket cur_pkt;
 } AVStream;
 
 #define AV_PROGRAM_RUNNING 1
@@ -500,7 +512,7 @@ typedef struct AVProgram {
     enum AVDiscard discard;        ///< selects which program to discard and which to feed to the caller
     unsigned int   *stream_index;
     unsigned int   nb_stream_indexes;
-    struct AVMetadata *metadata;
+    AVMetadata *metadata;
 } AVProgram;
 
 #define AVFMTCTX_NOHEADER      0x0001 /**< signal that no header is present
@@ -511,7 +523,7 @@ typedef struct AVChapter {
     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
     char *title;            ///< chapter title
-    struct AVMetadata *metadata;
+    AVMetadata *metadata;
 } AVChapter;
 
 #define MAX_STREAMS 20
@@ -568,9 +580,11 @@ typedef struct AVFormatContext {
 
     /* av_read_frame() support */
     AVStream *cur_st;
-    const uint8_t *cur_ptr;
-    int cur_len;
-    AVPacket cur_pkt;
+#if LIBAVFORMAT_VERSION_INT < (53<<16)
+    const uint8_t *cur_ptr_deprecated;
+    int cur_len_deprecated;
+    AVPacket cur_pkt_deprecated;
+#endif
 
     /* av_seek_frame() support */
     int64_t data_offset; /** offset of the first packet */
@@ -661,7 +675,7 @@ typedef struct AVFormatContext {
 
     struct AVPacketList *packet_buffer_end;
 
-    struct AVMetadata *metadata;
+    AVMetadata *metadata;
 } AVFormatContext;
 
 typedef struct AVPacketList {
@@ -745,6 +759,15 @@ void av_pkt_dump(FILE *f, AVPacket *pkt, int dump_payload);
  */
 void av_pkt_dump_log(void *avcl, int level, AVPacket *pkt, int dump_payload);
 
+/**
+ * Initialize libavformat and register all the muxers, demuxers and
+ * protocols. If you do not call this function, then you can select
+ * exactly which formats you want to support.
+ *
+ * @see av_register_input_format()
+ * @see av_register_output_format()
+ * @see register_protocol()
+ */
 void av_register_all(void);
 
 /** codec tag <-> codec id */