]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/avformat.h
cosmetics, add demuxer word
[ffmpeg] / libavformat / avformat.h
index 17f317e2d0f429648de111bcbe34d63a50ea92f2..f8f35ac37db18eec98f708fa661dff06e9208747 100644 (file)
 /* packet functions */
 
 typedef struct AVPacket {
-    int64_t pts;                            ///< presentation time stamp in time_base units
-    int64_t dts;                            ///< decompression time stamp in time_base units
+    /**
+     * Presentation time stamp in time_base units.
+     * This is 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 can not happen before
+     * decompression, unless one wants to view hex dumps. Some formats misuse
+     * the terms dts and pts/cts to mean something different, these timestamps
+     * must be converted to true pts/dts before they are stored in AVPacket.
+     */
+    int64_t pts;
+    /**
+     * Decompression time stamp in time_base units.
+     * This is 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;
@@ -390,8 +405,10 @@ typedef struct AVProgram {
                                          (streams are added dynamically) */
 
 typedef struct AVChapter {
-    int64_t start, end; /**< chapter start/end time in AV_TIME_BASE units */
-    char *title; /**< chapter title */
+    int id;                 ///< Unique id to identify the chapter
+    AVRational time_base;   ///< Timebase in which the start/end timestamps are specified
+    int64_t start, end;     ///< chapter start/end time in time_base units
+    char *title;            ///< chapter title
 } AVChapter;
 
 #define MAX_STREAMS 20
@@ -520,7 +537,7 @@ typedef struct AVFormatContext {
      */
     unsigned int max_picture_buffer;
 
-    int num_chapters;
+    unsigned int nb_chapters;
     AVChapter **chapters;
 } AVFormatContext;
 
@@ -758,11 +775,14 @@ AVProgram *av_new_program(AVFormatContext *s, int id);
  * and should be ONLY used by demuxers.
  *
  * @param s media file handle
- * @param start chapter start time in AV_TIME_BASE units
- * @param end chapter end time in AV_TIME_BASE units
+ * @param id unique id for this chapter
+ * @param start chapter start time in time_base units
+ * @param end chapter end time in time_base units
  * @param title chapter title
+ *
+ * @return AVChapter or NULL if error.
  */
-int ff_new_chapter(AVFormatContext *s, int64_t start, int64_t end, const char *title);
+AVChapter *ff_new_chapter(AVFormatContext *s, int id, AVRational time_base, int64_t start, int64_t end, const char *title);
 
 /**
  * Set the pts for a given stream.