]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/asf.h
matroskadec: allows inserting chapters with unspecified end
[ffmpeg] / libavformat / asf.h
index d04f99d5dcd6ab465c1f9da88bcb34572f278175..2486d8a6faeb0a273459a45750e5c93c7ea99860 100644 (file)
  * License along with FFmpeg; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
+
+#ifndef FFMPEG_ASF_H
+#define FFMPEG_ASF_H
+
+#include <stdint.h>
+#include "avformat.h"
+
 #define PACKET_SIZE 3200
 
 typedef struct {
@@ -31,8 +38,6 @@ typedef struct {
     int ds_span;                /* descrambling  */
     int ds_packet_size;
     int ds_chunk_size;
-    int ds_data_size;
-    int ds_silence_data;
 
     int64_t packet_pos;
 
@@ -41,30 +46,28 @@ typedef struct {
 typedef uint8_t GUID[16];
 
 typedef struct {
-    GUID guid;                  // generated by client computer
-    uint64_t file_size;         // in bytes
-                                // invalid if broadcasting
-    uint64_t create_time;       // time of creation, in 100-nanosecond units since 1.1.1601
-                                // invalid if broadcasting
-    uint64_t packets_count;     // how many packets are there in the file
-                                // invalid if broadcasting
-    uint64_t play_time;         // play time, in 100-nanosecond units
-                                // invalid if broadcasting
-    uint64_t send_time;         // time to send file, in 100-nanosecond units
-                                // invalid if broadcasting (could be ignored)
-    uint32_t preroll;           // timestamp of the first packet, in milliseconds
-                                // if nonzero - substract from time
-    uint32_t ignore;            // preroll is 64bit - but let's just ignore it
-    uint32_t flags;             // 0x01 - broadcast
-                                // 0x02 - seekable
-                                // rest is reserved should be 0
-    uint32_t min_pktsize;       // size of a data packet
-                                // invalid if broadcasting
-    uint32_t max_pktsize;       // shall be the same as for min_pktsize
-                                // invalid if broadcasting
-    uint32_t max_bitrate;       // bandwith of stream in bps
-                                // should be the sum of bitrates of the
-                                // individual media streams
+    GUID guid;                  ///< generated by client computer
+    uint64_t file_size;         /**< in bytes
+                                 *   invalid if broadcasting */
+    uint64_t create_time;       /**< time of creation, in 100-nanosecond units since 1.1.1601
+                                 *   invalid if broadcasting */
+    uint64_t play_time;         /**< play time, in 100-nanosecond units
+                                 * invalid if broadcasting */
+    uint64_t send_time;         /**< time to send file, in 100-nanosecond units
+                                 *   invalid if broadcasting (could be ignored) */
+    uint32_t preroll;           /**< timestamp of the first packet, in milliseconds
+                                 *   if nonzero - subtract from time */
+    uint32_t ignore;            ///< preroll is 64bit - but let's just ignore it
+    uint32_t flags;             /**< 0x01 - broadcast
+                                 *   0x02 - seekable
+                                 *   rest is reserved should be 0 */
+    uint32_t min_pktsize;       /**< size of a data packet
+                                 *   invalid if broadcasting */
+    uint32_t max_pktsize;       /**< shall be the same as for min_pktsize
+                                 *   invalid if broadcasting */
+    uint32_t max_bitrate;       /**< bandwith of stream in bps
+                                 *   should be the sum of bitrates of the
+                                 *   individual media streams */
 } ASFMainHeader;
 
 
@@ -78,15 +81,15 @@ typedef struct {
     uint32_t seqno;
     unsigned int packet_size;
     int is_streamed;
-    int asfid2avid[128];        /* conversion table from asf ID 2 AVStream ID */
-    ASFStream streams[128];     /* it's max number and it's not that big */
+    int asfid2avid[128];                 ///< conversion table from asf ID 2 AVStream ID
+    ASFStream streams[128];              ///< it's max number and it's not that big
+    uint32_t stream_bitrates[128];       ///< max number of streams, bitrate for each (for streaming)
     /* non streamed additonnal info */
-    uint64_t nb_packets;
-    int64_t duration; /* in 100ns units */
+    uint64_t nb_packets;                 ///< how many packets are there in the file, invalid if broadcasting
+    int64_t duration;                    ///< in 100ns units
     /* packet filling */
     unsigned char multi_payloads_present;
     int packet_size_left;
-    int prev_packet_sent_time;
     int packet_timestamp_start;
     int packet_timestamp_end;
     unsigned int packet_nb_payloads;
@@ -94,9 +97,9 @@ typedef struct {
     uint8_t packet_buf[PACKET_SIZE];
     ByteIOContext pb;
     /* only for reading */
-    uint64_t data_offset; /* begining of the first data packet */
-    uint64_t data_object_offset; /* data object offset (excl. GUID & size)*/
-    uint64_t data_object_size;   /* size of the data object */
+    uint64_t data_offset;                ///< beginning of the first data packet
+    uint64_t data_object_offset;         ///< data object offset (excl. GUID & size)
+    uint64_t data_object_size;           ///< size of the data object
     int index_read;
 
     ASFMainHeader hdr;
@@ -110,9 +113,9 @@ typedef struct {
     int packet_replic_size;
     int packet_key_frame;
     int packet_padsize;
-    int packet_frag_offset;
-    int packet_frag_size;
-    int packet_frag_timestamp;
+    unsigned int packet_frag_offset;
+    unsigned int packet_frag_size;
+    int64_t packet_frag_timestamp;
     int packet_multi_size;
     int packet_obj_size;
     int packet_time_delta;
@@ -128,7 +131,7 @@ typedef struct {
     uint32_t nb_index_memory_alloc;
     uint16_t maximum_packet;
 
-    ASFStream* asf_st; /* currently decoded stream */
+    ASFStream* asf_st;                   ///< currently decoded stream
 } ASFContext;
 
 static const GUID asf_header = {
@@ -212,6 +215,10 @@ static const GUID ext_stream_audio_stream = {
         0x9d, 0x8c, 0x17, 0x31, 0xE1, 0x03, 0x28, 0x45, 0xb5, 0x82, 0x3d, 0xf9, 0xdb, 0x22, 0xf5, 0x03
 };
 
+static const GUID metadata_header = {
+        0xea, 0xcb, 0xf8, 0xc5, 0xaf, 0x5b, 0x77, 0x48, 0x84, 0x67, 0xaa, 0x8c, 0x44, 0xfa, 0x4c, 0xca
+};
+
 /* I am not a number !!! This GUID is the one found on the PC used to
    generate the stream */
 static const GUID my_guid = {
@@ -278,3 +285,5 @@ static const GUID my_guid = {
 #define ASF_PL_MASK_PAYLOAD_LENGTH_FIELD_SIZE     0xc0 //1100 0000
 
 #define ASF_PL_FLAG_KEY_FRAME 0x80 //1000 0000
+
+#endif /* FFMPEG_ASF_H */