]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/avformat.h
Add missing #includes to fix 'make checkheaders'.
[ffmpeg] / libavformat / avformat.h
index cfd4effbb7020e0693859b70b7acd7e014d0b80a..900122c6f1ff27fbbc6723dd7701fb5355ec37d2 100644 (file)
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#ifndef AVFORMAT_H
-#define AVFORMAT_H
+#ifndef FFMPEG_AVFORMAT_H
+#define FFMPEG_AVFORMAT_H
 
-#define LIBAVFORMAT_VERSION_INT ((51<<16)+(12<<8)+1)
-#define LIBAVFORMAT_VERSION     51.12.1
+#define LIBAVFORMAT_VERSION_INT ((52<<16)+(0<<8)+0)
+#define LIBAVFORMAT_VERSION     52.0.0
 #define LIBAVFORMAT_BUILD       LIBAVFORMAT_VERSION_INT
 
 #define LIBAVFORMAT_IDENT       "Lavf" AV_STRINGIFY(LIBAVFORMAT_VERSION)
@@ -197,7 +197,11 @@ typedef struct AVInputFormat {
     const char *long_name;
     /** size of private data so that it can be allocated in the wrapper */
     int priv_data_size;
-    /** tell if a given file has a chance of being parsed by this format */
+    /**
+     * tell if a given file has a chance of being parsed by this format.
+     * The buffer provided is guranteed to be AVPROBE_PADDING_SIZE bytes big
+     * so you dont have to check for that unless you need more.
+     */
     int (*read_probe)(AVProbeData *);
     /** read the format header and initialize the AVFormatContext
        structure. Return 0 if OK. 'ap' if non NULL contains
@@ -280,9 +284,10 @@ typedef struct AVStream {
      */
     AVRational r_frame_rate;
     void *priv_data;
-#if LIBAVFORMAT_VERSION_INT < (52<<16)
+
     /* internal data used in av_find_stream_info() */
-    int64_t codec_info_duration;
+    int64_t first_dts;
+#if LIBAVFORMAT_VERSION_INT < (52<<16)
     int codec_info_nb_frames;
 #endif
     /** encoding: PTS generation when outputing stream */
@@ -303,9 +308,20 @@ typedef struct AVStream {
     /** quality, as it has been removed from AVCodecContext and put in AVVideoFrame
      * MN: dunno if that is the right place for it */
     float quality;
-    /** decoding: pts of the first frame of the stream, in stream time base. */
+    /**
+     * decoding: pts of the first frame of the stream, in stream time base.
+     * only set this if you are absolutely 100% sure that the value you set
+     * it to really is the pts of the first frame
+     * This may be undefined (AV_NOPTS_VALUE).
+     * @note the ASF header does NOT contain a correct start_time the ASF
+     * demuxer must NOT set this
+     */
     int64_t start_time;
-    /** decoding: duration of the stream, in stream time base. */
+    /**
+     * decoding: duration of the stream, in stream time base.
+     * If a source file does not specify a duration, but does specify
+     * a bitrate, this value will be estimates from bit rate and file size.
+     */
     int64_t duration;
 
     char language[4]; /** ISO 639 3-letter language code (empty string if undefined) */
@@ -329,6 +345,18 @@ typedef struct AVStream {
     int64_t pts_buffer[MAX_REORDER_DELAY+1];
 } AVStream;
 
+#define AV_PROGRAM_RUNNING 1
+
+typedef struct AVProgram {
+    int            id;
+    char           *provider_name; ///< Network name for DVB streams
+    char           *name;          ///< Service name for DVB streams
+    int            flags;
+    enum AVDiscard discard;        ///< selects which program to discard and which to feed to the caller
+    unsigned int   *stream_index;
+    unsigned int   nb_stream_indexes;
+} AVProgram;
+
 #define AVFMTCTX_NOHEADER      0x0001 /**< signal that no header is present
                                          (streams are added dynamically) */
 
@@ -341,7 +369,7 @@ typedef struct AVFormatContext {
     struct AVInputFormat *iformat;
     struct AVOutputFormat *oformat;
     void *priv_data;
-    ByteIOContext pb;
+    ByteIOContext *pb;
     unsigned int nb_streams;
     AVStream *streams[MAX_STREAMS];
     char filename[1024]; /**< input or output filename */
@@ -414,6 +442,9 @@ typedef struct AVFormatContext {
 
     const uint8_t *key;
     int keylen;
+
+    unsigned int nb_programs;
+    AVProgram **programs;
 } AVFormatContext;
 
 typedef struct AVPacketList {
@@ -429,10 +460,6 @@ enum CodecID av_guess_image2_codec(const char *filename);
 /* XXX: use automatic init with either ELF sections or C file parser */
 /* modules */
 
-#include "rtp.h"
-
-#include "rtsp.h"
-
 /* utils.c */
 void av_register_input_format(AVInputFormat *format);
 void av_register_output_format(AVOutputFormat *format);
@@ -550,7 +577,7 @@ AVFormatContext *av_alloc_format_context(void);
  *
  * @param ic media file handle
  * @return >=0 if OK. AVERROR_xxx if error.
- * @todo Let user decide somehow what information is needed so we do not waste time geting stuff the user does not need.
+ * @todo Let user decide somehow what information is needed so we do not waste time getting stuff the user does not need.
  */
 int av_find_stream_info(AVFormatContext *ic);
 
@@ -631,6 +658,7 @@ void av_close_input_file(AVFormatContext *s);
  * @param id file format dependent stream id
  */
 AVStream *av_new_stream(AVFormatContext *s, int id);
+AVProgram *av_new_program(AVFormatContext *s, int id);
 
 /**
  * Set the pts for a given stream.
@@ -778,19 +806,30 @@ attribute_deprecated int parse_image_size(int *width_ptr, int *height_ptr, const
 attribute_deprecated int parse_frame_rate(int *frame_rate, int *frame_rate_base, const char *arg);
 
 /**
- * Converts date string to number of seconds since Jan 1st, 1970.
- *
+ * Parses \p datestr and returns a corresponding number of microseconds.
+ * @param datestr String representing a date or a duration.
+ * - If a date the syntax is:
  * @code
- * Syntax:
- * - If not a duration:
  *  [{YYYY-MM-DD|YYYYMMDD}]{T| }{HH[:MM[:SS[.m...]]][Z]|HH[MM[SS[.m...]]][Z]}
- * Time is localtime unless Z is suffixed to the end. In this case GMT
- * Return the date in micro seconds since 1970
- *
- * - If a duration:
- *  HH[:MM[:SS[.m...]]]
- *  S+[.m...]
  * @endcode
+ * Time is localtime unless Z is appended, in which case it is
+ * interpreted as UTC.
+ * If the year-month-day part isn't specified it takes the current
+ * year-month-day.
+ * Returns the number of microseconds since 1st of January, 1970 up to
+ * the time of the parsed date or INT64_MIN if \p datestr cannot be
+ * successfully parsed.
+ * - If a duration the syntax is:
+ * @code
+ *  [-]HH[:MM[:SS[.m...]]]
+ *  [-]S+[.m...]
+ * @endcode
+ * Returns the number of microseconds contained in a time interval
+ * with the specified duration or INT64_MIN if \p datestr cannot be
+ * succesfully parsed.
+ * @param duration Flag which tells how to interpret \p datestr, if
+ * not zero \p datestr is interpreted as a duration, otherwise as a
+ * date.
  */
 int64_t parse_date(const char *datestr, int duration);
 
@@ -819,7 +858,7 @@ int find_info_tag(char *arg, int arg_size, const char *tag1, const char *info);
  * @param buf destination buffer
  * @param buf_size destination buffer size
  * @param path numbered sequence string
- * @number frame number
+ * @param number frame number
  * @return 0 if OK, -1 if format error.
  */
 int av_get_frame_filename(char *buf, int buf_size,
@@ -841,17 +880,16 @@ int av_filename_number_test(const char *filename);
  *           multiple AVStreams (one AVStream per RTP stream). Otherwise,
  *           all the contexts in the array (an AVCodecContext per RTP stream)
  *           must contain only one AVStream
- * @param n_streams number of AVCodecContexts contained in ac
- * @return a pointer to the SDP (an array of chars which is allocated by
- *         avf_sdp_create(), and must be freed by the caller), or NULL in
- *         case of failure.
+ * @param n_files number of AVCodecContexts contained in ac
+ * @param buff buffer where the SDP will be stored (must be allocated by
+ *             the caller
+ * @param size the size of the buffer
+ * @return 0 if OK. AVERROR_xxx if error.
  */
-char *avf_sdp_create(AVFormatContext *ac[], int n_streams);
+int avf_sdp_create(AVFormatContext *ac[], int n_files, char *buff, int size);
 
 #ifdef HAVE_AV_CONFIG_H
 
-#include "os_support.h"
-
 void __dynarray_add(unsigned long **tab_ptr, int *nb_ptr, unsigned long elem);
 
 #ifdef __GNUC__
@@ -888,5 +926,4 @@ int match_ext(const char *filename, const char *extensions);
 
 #endif /* HAVE_AV_CONFIG_H */
 
-#endif /* AVFORMAT_H */
-
+#endif /* FFMPEG_AVFORMAT_H */