]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/avformat.h
lavc: use avpriv_ prefix for some mpegaudio symbols used in lavf.
[ffmpeg] / libavformat / avformat.h
index 38bb86592e5498363ab60a53b65e178b07c7466d..65f66d84d332cd4190b731b30e34b11a9b2a587b 100644 (file)
@@ -274,6 +274,7 @@ typedef struct AVFormatParameters {
 #define AVFMT_NOSTREAMS     0x1000 /**< Format does not require any streams */
 #define AVFMT_NOBINSEARCH   0x2000 /**< Format does not allow to fallback to binary search via read_timestamp */
 #define AVFMT_NOGENSEARCH   0x4000 /**< Format does not allow to fallback to generic search */
+#define AVFMT_NO_BYTE_SEEK  0x8000 /**< Format does not allow seeking by bytes */
 
 typedef struct AVOutputFormat {
     const char *name;
@@ -322,6 +323,14 @@ typedef struct AVOutputFormat {
 
     const AVClass *priv_class; ///< AVClass for the private context
 
+    /**
+     * Test if the given codec can be stored in this container.
+     *
+     * @return 1 if the codec is supported, 0 if it is not.
+     *         A negative number if unknown.
+     */
+    int (*query_codec)(enum CodecID id, int std_compliance);
+
     /* private fields */
     struct AVOutputFormat *next;
 } AVOutputFormat;
@@ -398,7 +407,9 @@ typedef struct AVInputFormat {
                               int64_t *pos, int64_t pos_limit);
 
     /**
-     * Can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER.
+     * Can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_SHOW_IDS,
+     * AVFMT_GENERIC_INDEX, AVFMT_TS_DISCONT, AVFMT_NOBINSEARCH,
+     * AVFMT_NOGENSEARCH, AVFMT_NO_BYTE_SEEK.
      */
     int flags;
 
@@ -705,10 +716,12 @@ typedef struct AVFormatContext {
      */
     int64_t duration;
 
+#if FF_API_FILESIZE
     /**
      * decoding: total file size, 0 if unknown
      */
-    int64_t file_size;
+    attribute_deprecated int64_t file_size;
+#endif
 
     /**
      * Decoding: total stream bitrate in bit/s, 0 if not
@@ -723,7 +736,12 @@ typedef struct AVFormatContext {
     /* av_seek_frame() support */
     int64_t data_offset; /**< offset of the first packet */
 
-    int mux_rate;
+#if FF_API_MUXRATE
+    /**
+     * use mpeg muxer private options instead
+     */
+    attribute_deprecated int mux_rate;
+#endif
     unsigned int packet_size;
     int preload;
     int max_delay;
@@ -750,6 +768,7 @@ typedef struct AVFormatContext {
 #define AVFMT_FLAG_RTP_HINT     0x0040 ///< Deprecated, use the -movflags rtphint muxer specific AVOption instead
 #endif
 #define AVFMT_FLAG_CUSTOM_IO    0x0080 ///< The caller has supplied a custom AVIOContext, don't avio_close() it.
+#define AVFMT_FLAG_DISCARD_CORRUPT  0x0100 ///< Discard frames marked corrupted
 
 #if FF_API_LOOP_INPUT
     /**
@@ -853,6 +872,14 @@ typedef struct AVFormatContext {
      * decoding: number of frames used to probe fps
      */
     int fps_probe_size;
+
+    /**
+     * Error recognition; higher values will detect more errors but may
+     * misdetect some more or less valid parts as errors.
+     * - encoding: unused
+     * - decoding: Set by user.
+     */
+    int error_recognition;
 } AVFormatContext;
 
 typedef struct AVPacketList {
@@ -1114,6 +1141,7 @@ AVFormatContext *avformat_alloc_context(void);
  *
  * @deprecated use avformat_find_stream_info.
  */
+attribute_deprecated
 int av_find_stream_info(AVFormatContext *ic);
 #endif
 
@@ -1283,6 +1311,7 @@ void av_close_input_file(AVFormatContext *s);
  */
 void avformat_free_context(AVFormatContext *s);
 
+#if FF_API_NEW_STREAM
 /**
  * Add a new stream to a media file.
  *
@@ -1293,7 +1322,27 @@ void avformat_free_context(AVFormatContext *s);
  * @param s media file handle
  * @param id file-format-dependent stream ID
  */
+attribute_deprecated
 AVStream *av_new_stream(AVFormatContext *s, int id);
+#endif
+
+/**
+ * Add a new stream to a media file.
+ *
+ * When demuxing, it is called by the demuxer in read_header(). If the
+ * flag AVFMTCTX_NOHEADER is set in s.ctx_flags, then it may also
+ * be called in read_packet().
+ *
+ * When muxing, should be called by the user before avformat_write_header().
+ *
+ * @param c If non-NULL, the AVCodecContext corresponding to the new stream
+ * will be initialized to use this codec. This is needed for e.g. codec-specific
+ * defaults to be set, so codec should be provided if it is known.
+ *
+ * @return newly created stream or NULL on error.
+ */
+AVStream *avformat_new_stream(AVFormatContext *s, AVCodec *c);
+
 AVProgram *av_new_program(AVFormatContext *s, int id);
 
 /**
@@ -1585,4 +1634,22 @@ attribute_deprecated int avf_sdp_create(AVFormatContext *ac[], int n_files, char
  */
 int av_match_ext(const char *filename, const char *extensions);
 
+/**
+ * Test if the given container can store a codec.
+ *
+ * @param std_compliance standards compliance level, one of FF_COMPLIANCE_*
+ *
+ * @return 1 if codec with ID codec_id can be stored in ofmt, 0 if it cannot.
+ *         A negative number if this information is not available.
+ */
+int avformat_query_codec(AVOutputFormat *ofmt, enum CodecID codec_id, int std_compliance);
+
+/**
+ * Get the AVClass for AVFormatContext. It can be used in combination with
+ * AV_OPT_SEARCH_FAKE_OBJ for examining options.
+ *
+ * @see av_opt_find().
+ */
+const AVClass *avformat_get_class(void);
+
 #endif /* AVFORMAT_AVFORMAT_H */