[libav-devel] [PATCH] avformat: Move asf flags definitions from asfdec.c to asf.h

Alexandra Hájková alexandra.khirnova at gmail.com
Mon Jun 9 13:42:44 CEST 2014


---
 libavformat/asf.h    |  154 +++++++++++++++++++++++++++++++++++++++++++++++++
 libavformat/asfenc.c |  155 --------------------------------------------------
 2 files changed, 154 insertions(+), 155 deletions(-)

diff --git a/libavformat/asf.h b/libavformat/asf.h
index 2f6722a..1f3a463 100644
--- a/libavformat/asf.h
+++ b/libavformat/asf.h
@@ -115,6 +115,160 @@ extern const ff_asf_guid ff_asf_digital_signature;
 
 extern const AVMetadataConv ff_asf_metadata_conv[];
 
+#define ASF_INDEXED_INTERVAL    10000000
+#define ASF_INDEX_BLOCK         600
+
+#define ASF_PACKET_ERROR_CORRECTION_DATA_SIZE 0x2
+#define ASF_PACKET_ERROR_CORRECTION_FLAGS          \
+    (ASF_PACKET_FLAG_ERROR_CORRECTION_PRESENT |    \
+     ASF_PACKET_ERROR_CORRECTION_DATA_SIZE)
+
+#if (ASF_PACKET_ERROR_CORRECTION_FLAGS != 0)
+#   define ASF_PACKET_ERROR_CORRECTION_FLAGS_FIELD_SIZE 1
+#else
+#   define ASF_PACKET_ERROR_CORRECTION_FLAGS_FIELD_SIZE 0
+#endif
+
+#define ASF_PPI_PROPERTY_FLAGS                                       \
+    (ASF_PL_FLAG_REPLICATED_DATA_LENGTH_FIELD_IS_BYTE           |    \
+     ASF_PL_FLAG_OFFSET_INTO_MEDIA_OBJECT_LENGTH_FIELD_IS_DWORD |    \
+     ASF_PL_FLAG_MEDIA_OBJECT_NUMBER_LENGTH_FIELD_IS_BYTE       |    \
+     ASF_PL_FLAG_STREAM_NUMBER_LENGTH_FIELD_IS_BYTE)
+
+#define ASF_PPI_LENGTH_TYPE_FLAGS 0
+
+#define ASF_PAYLOAD_FLAGS ASF_PL_FLAG_PAYLOAD_LENGTH_FIELD_IS_WORD
+
+#if (ASF_PPI_FLAG_SEQUENCE_FIELD_IS_BYTE == (ASF_PPI_LENGTH_TYPE_FLAGS & ASF_PPI_MASK_SEQUENCE_FIELD_SIZE))
+#   define ASF_PPI_SEQUENCE_FIELD_SIZE 1
+#endif
+#if (ASF_PPI_FLAG_SEQUENCE_FIELD_IS_WORD == (ASF_PPI_LENGTH_TYPE_FLAGS & ASF_PPI_MASK_SEQUENCE_FIELD_SIZE))
+#   define ASF_PPI_SEQUENCE_FIELD_SIZE 2
+#endif
+#if (ASF_PPI_FLAG_SEQUENCE_FIELD_IS_DWORD == (ASF_PPI_LENGTH_TYPE_FLAGS & ASF_PPI_MASK_SEQUENCE_FIELD_SIZE))
+#   define ASF_PPI_SEQUENCE_FIELD_SIZE 4
+#endif
+#ifndef ASF_PPI_SEQUENCE_FIELD_SIZE
+#   define ASF_PPI_SEQUENCE_FIELD_SIZE 0
+#endif
+
+#if (ASF_PPI_FLAG_PACKET_LENGTH_FIELD_IS_BYTE == (ASF_PPI_LENGTH_TYPE_FLAGS & ASF_PPI_MASK_PACKET_LENGTH_FIELD_SIZE))
+#   define ASF_PPI_PACKET_LENGTH_FIELD_SIZE 1
+#endif
+#if (ASF_PPI_FLAG_PACKET_LENGTH_FIELD_IS_WORD == (ASF_PPI_LENGTH_TYPE_FLAGS & ASF_PPI_MASK_PACKET_LENGTH_FIELD_SIZE))
+#   define ASF_PPI_PACKET_LENGTH_FIELD_SIZE 2
+#endif
+#if (ASF_PPI_FLAG_PACKET_LENGTH_FIELD_IS_DWORD == (ASF_PPI_LENGTH_TYPE_FLAGS & ASF_PPI_MASK_PACKET_LENGTH_FIELD_SIZE))
+#   define ASF_PPI_PACKET_LENGTH_FIELD_SIZE 4
+#endif
+#ifndef ASF_PPI_PACKET_LENGTH_FIELD_SIZE
+#   define ASF_PPI_PACKET_LENGTH_FIELD_SIZE 0
+#endif
+
+#if (ASF_PPI_FLAG_PADDING_LENGTH_FIELD_IS_BYTE == (ASF_PPI_LENGTH_TYPE_FLAGS & ASF_PPI_MASK_PADDING_LENGTH_FIELD_SIZE))
+#   define ASF_PPI_PADDING_LENGTH_FIELD_SIZE 1
+#endif
+#if (ASF_PPI_FLAG_PADDING_LENGTH_FIELD_IS_WORD == (ASF_PPI_LENGTH_TYPE_FLAGS & ASF_PPI_MASK_PADDING_LENGTH_FIELD_SIZE))
+#   define ASF_PPI_PADDING_LENGTH_FIELD_SIZE 2
+#endif
+#if (ASF_PPI_FLAG_PADDING_LENGTH_FIELD_IS_DWORD == (ASF_PPI_LENGTH_TYPE_FLAGS & ASF_PPI_MASK_PADDING_LENGTH_FIELD_SIZE))
+#   define ASF_PPI_PADDING_LENGTH_FIELD_SIZE 4
+#endif
+#ifndef ASF_PPI_PADDING_LENGTH_FIELD_SIZE
+#   define ASF_PPI_PADDING_LENGTH_FIELD_SIZE 0
+#endif
+
+#if (ASF_PL_FLAG_REPLICATED_DATA_LENGTH_FIELD_IS_BYTE == (ASF_PPI_PROPERTY_FLAGS & ASF_PL_MASK_REPLICATED_DATA_LENGTH_FIELD_SIZE))
+#   define ASF_PAYLOAD_REPLICATED_DATA_LENGTH_FIELD_SIZE 1
+#endif
+#if (ASF_PL_FLAG_REPLICATED_DATA_LENGTH_FIELD_IS_WORD == (ASF_PPI_PROPERTY_FLAGS & ASF_PL_MASK_REPLICATED_DATA_LENGTH_FIELD_SIZE))
+#   define ASF_PAYLOAD_REPLICATED_DATA_LENGTH_FIELD_SIZE 2
+#endif
+#if (ASF_PL_FLAG_REPLICATED_DATA_LENGTH_FIELD_IS_DWORD == (ASF_PPI_PROPERTY_FLAGS & ASF_PL_MASK_REPLICATED_DATA_LENGTH_FIELD_SIZE))
+#   define ASF_PAYLOAD_REPLICATED_DATA_LENGTH_FIELD_SIZE 4
+#endif
+#ifndef ASF_PAYLOAD_REPLICATED_DATA_LENGTH_FIELD_SIZE
+#   define ASF_PAYLOAD_REPLICATED_DATA_LENGTH_FIELD_SIZE 0
+#endif
+
+#if (ASF_PL_FLAG_OFFSET_INTO_MEDIA_OBJECT_LENGTH_FIELD_IS_BYTE == (ASF_PPI_PROPERTY_FLAGS & ASF_PL_MASK_OFFSET_INTO_MEDIA_OBJECT_LENGTH_FIELD_SIZE))
+#   define ASF_PAYLOAD_OFFSET_INTO_MEDIA_OBJECT_FIELD_SIZE 1
+#endif
+#if (ASF_PL_FLAG_OFFSET_INTO_MEDIA_OBJECT_LENGTH_FIELD_IS_WORD == (ASF_PPI_PROPERTY_FLAGS & ASF_PL_MASK_OFFSET_INTO_MEDIA_OBJECT_LENGTH_FIELD_SIZE))
+#   define ASF_PAYLOAD_OFFSET_INTO_MEDIA_OBJECT_FIELD_SIZE 2
+#endif
+#if (ASF_PL_FLAG_OFFSET_INTO_MEDIA_OBJECT_LENGTH_FIELD_IS_DWORD == (ASF_PPI_PROPERTY_FLAGS & ASF_PL_MASK_OFFSET_INTO_MEDIA_OBJECT_LENGTH_FIELD_SIZE))
+#   define ASF_PAYLOAD_OFFSET_INTO_MEDIA_OBJECT_FIELD_SIZE 4
+#endif
+#ifndef ASF_PAYLOAD_OFFSET_INTO_MEDIA_OBJECT_FIELD_SIZE
+#   define ASF_PAYLOAD_OFFSET_INTO_MEDIA_OBJECT_FIELD_SIZE 0
+#endif
+
+#if (ASF_PL_FLAG_MEDIA_OBJECT_NUMBER_LENGTH_FIELD_IS_BYTE == (ASF_PPI_PROPERTY_FLAGS & ASF_PL_MASK_MEDIA_OBJECT_NUMBER_LENGTH_FIELD_SIZE))
+#   define ASF_PAYLOAD_MEDIA_OBJECT_NUMBER_FIELD_SIZE 1
+#endif
+#if (ASF_PL_FLAG_MEDIA_OBJECT_NUMBER_LENGTH_FIELD_IS_WORD == (ASF_PPI_PROPERTY_FLAGS & ASF_PL_MASK_MEDIA_OBJECT_NUMBER_LENGTH_FIELD_SIZE))
+#   define ASF_PAYLOAD_MEDIA_OBJECT_NUMBER_FIELD_SIZE 2
+#endif
+#if (ASF_PL_FLAG_MEDIA_OBJECT_NUMBER_LENGTH_FIELD_IS_DWORD == (ASF_PPI_PROPERTY_FLAGS & ASF_PL_MASK_MEDIA_OBJECT_NUMBER_LENGTH_FIELD_SIZE))
+#   define ASF_PAYLOAD_MEDIA_OBJECT_NUMBER_FIELD_SIZE 4
+#endif
+#ifndef ASF_PAYLOAD_MEDIA_OBJECT_NUMBER_FIELD_SIZE
+#   define ASF_PAYLOAD_MEDIA_OBJECT_NUMBER_FIELD_SIZE 0
+#endif
+
+#if (ASF_PL_FLAG_PAYLOAD_LENGTH_FIELD_IS_BYTE == (ASF_PAYLOAD_FLAGS & ASF_PL_MASK_PAYLOAD_LENGTH_FIELD_SIZE))
+#   define ASF_PAYLOAD_LENGTH_FIELD_SIZE 1
+#endif
+#if (ASF_PL_FLAG_PAYLOAD_LENGTH_FIELD_IS_WORD == (ASF_PAYLOAD_FLAGS & ASF_PL_MASK_PAYLOAD_LENGTH_FIELD_SIZE))
+#   define ASF_PAYLOAD_LENGTH_FIELD_SIZE 2
+#endif
+#ifndef ASF_PAYLOAD_LENGTH_FIELD_SIZE
+#   define ASF_PAYLOAD_LENGTH_FIELD_SIZE 0
+#endif
+
+#define PACKET_HEADER_MIN_SIZE \
+    (ASF_PACKET_ERROR_CORRECTION_FLAGS_FIELD_SIZE +       \
+     ASF_PACKET_ERROR_CORRECTION_DATA_SIZE +              \
+     1 +        /* Length Type Flags */                   \
+     1 +        /* Property Flags */                      \
+     ASF_PPI_PACKET_LENGTH_FIELD_SIZE +                   \
+     ASF_PPI_SEQUENCE_FIELD_SIZE +                        \
+     ASF_PPI_PADDING_LENGTH_FIELD_SIZE +                  \
+     4 +        /* Send Time Field */                     \
+     2)         /* Duration Field */
+
+// Replicated Data shall be at least 8 bytes long.
+#define ASF_PAYLOAD_REPLICATED_DATA_LENGTH 0x08
+
+#define PAYLOAD_HEADER_SIZE_SINGLE_PAYLOAD                \
+    (1 +     /* Stream Number */                          \
+     ASF_PAYLOAD_MEDIA_OBJECT_NUMBER_FIELD_SIZE +         \
+     ASF_PAYLOAD_OFFSET_INTO_MEDIA_OBJECT_FIELD_SIZE +    \
+     ASF_PAYLOAD_REPLICATED_DATA_LENGTH_FIELD_SIZE +      \
+     ASF_PAYLOAD_REPLICATED_DATA_LENGTH)
+
+#define PAYLOAD_HEADER_SIZE_MULTIPLE_PAYLOADS             \
+    (1 +        /* Stream Number */                       \
+     ASF_PAYLOAD_MEDIA_OBJECT_NUMBER_FIELD_SIZE +         \
+     ASF_PAYLOAD_OFFSET_INTO_MEDIA_OBJECT_FIELD_SIZE +    \
+     ASF_PAYLOAD_REPLICATED_DATA_LENGTH_FIELD_SIZE +      \
+     ASF_PAYLOAD_REPLICATED_DATA_LENGTH +                 \
+     ASF_PAYLOAD_LENGTH_FIELD_SIZE)
+
+#define SINGLE_PAYLOAD_DATA_LENGTH                        \
+    (PACKET_SIZE -                                        \
+     PACKET_HEADER_MIN_SIZE -                             \
+     PAYLOAD_HEADER_SIZE_SINGLE_PAYLOAD)
+
+#define MULTI_PAYLOAD_CONSTANT                            \
+    (PACKET_SIZE -                                        \
+     PACKET_HEADER_MIN_SIZE -                             \
+     1 -         /* Payload Flags */                      \
+     2 * PAYLOAD_HEADER_SIZE_MULTIPLE_PAYLOADS)
+
+#define DATA_HEADER_SIZE 50
+
 #define ASF_PACKET_FLAG_ERROR_CORRECTION_PRESENT 0x80 //1000 0000
 
 
diff --git a/libavformat/asfenc.c b/libavformat/asfenc.c
index e1a7189..b7942ad 100644
--- a/libavformat/asfenc.c
+++ b/libavformat/asfenc.c
@@ -30,161 +30,6 @@
 #undef NDEBUG
 #include <assert.h>
 
-
-#define ASF_INDEXED_INTERVAL    10000000
-#define ASF_INDEX_BLOCK         600
-
-#define ASF_PACKET_ERROR_CORRECTION_DATA_SIZE 0x2
-#define ASF_PACKET_ERROR_CORRECTION_FLAGS          \
-    (ASF_PACKET_FLAG_ERROR_CORRECTION_PRESENT |    \
-     ASF_PACKET_ERROR_CORRECTION_DATA_SIZE)
-
-#if (ASF_PACKET_ERROR_CORRECTION_FLAGS != 0)
-#   define ASF_PACKET_ERROR_CORRECTION_FLAGS_FIELD_SIZE 1
-#else
-#   define ASF_PACKET_ERROR_CORRECTION_FLAGS_FIELD_SIZE 0
-#endif
-
-#define ASF_PPI_PROPERTY_FLAGS                                       \
-    (ASF_PL_FLAG_REPLICATED_DATA_LENGTH_FIELD_IS_BYTE           |    \
-     ASF_PL_FLAG_OFFSET_INTO_MEDIA_OBJECT_LENGTH_FIELD_IS_DWORD |    \
-     ASF_PL_FLAG_MEDIA_OBJECT_NUMBER_LENGTH_FIELD_IS_BYTE       |    \
-     ASF_PL_FLAG_STREAM_NUMBER_LENGTH_FIELD_IS_BYTE)
-
-#define ASF_PPI_LENGTH_TYPE_FLAGS 0
-
-#define ASF_PAYLOAD_FLAGS ASF_PL_FLAG_PAYLOAD_LENGTH_FIELD_IS_WORD
-
-#if (ASF_PPI_FLAG_SEQUENCE_FIELD_IS_BYTE == (ASF_PPI_LENGTH_TYPE_FLAGS & ASF_PPI_MASK_SEQUENCE_FIELD_SIZE))
-#   define ASF_PPI_SEQUENCE_FIELD_SIZE 1
-#endif
-#if (ASF_PPI_FLAG_SEQUENCE_FIELD_IS_WORD == (ASF_PPI_LENGTH_TYPE_FLAGS & ASF_PPI_MASK_SEQUENCE_FIELD_SIZE))
-#   define ASF_PPI_SEQUENCE_FIELD_SIZE 2
-#endif
-#if (ASF_PPI_FLAG_SEQUENCE_FIELD_IS_DWORD == (ASF_PPI_LENGTH_TYPE_FLAGS & ASF_PPI_MASK_SEQUENCE_FIELD_SIZE))
-#   define ASF_PPI_SEQUENCE_FIELD_SIZE 4
-#endif
-#ifndef ASF_PPI_SEQUENCE_FIELD_SIZE
-#   define ASF_PPI_SEQUENCE_FIELD_SIZE 0
-#endif
-
-#if (ASF_PPI_FLAG_PACKET_LENGTH_FIELD_IS_BYTE == (ASF_PPI_LENGTH_TYPE_FLAGS & ASF_PPI_MASK_PACKET_LENGTH_FIELD_SIZE))
-#   define ASF_PPI_PACKET_LENGTH_FIELD_SIZE 1
-#endif
-#if (ASF_PPI_FLAG_PACKET_LENGTH_FIELD_IS_WORD == (ASF_PPI_LENGTH_TYPE_FLAGS & ASF_PPI_MASK_PACKET_LENGTH_FIELD_SIZE))
-#   define ASF_PPI_PACKET_LENGTH_FIELD_SIZE 2
-#endif
-#if (ASF_PPI_FLAG_PACKET_LENGTH_FIELD_IS_DWORD == (ASF_PPI_LENGTH_TYPE_FLAGS & ASF_PPI_MASK_PACKET_LENGTH_FIELD_SIZE))
-#   define ASF_PPI_PACKET_LENGTH_FIELD_SIZE 4
-#endif
-#ifndef ASF_PPI_PACKET_LENGTH_FIELD_SIZE
-#   define ASF_PPI_PACKET_LENGTH_FIELD_SIZE 0
-#endif
-
-#if (ASF_PPI_FLAG_PADDING_LENGTH_FIELD_IS_BYTE == (ASF_PPI_LENGTH_TYPE_FLAGS & ASF_PPI_MASK_PADDING_LENGTH_FIELD_SIZE))
-#   define ASF_PPI_PADDING_LENGTH_FIELD_SIZE 1
-#endif
-#if (ASF_PPI_FLAG_PADDING_LENGTH_FIELD_IS_WORD == (ASF_PPI_LENGTH_TYPE_FLAGS & ASF_PPI_MASK_PADDING_LENGTH_FIELD_SIZE))
-#   define ASF_PPI_PADDING_LENGTH_FIELD_SIZE 2
-#endif
-#if (ASF_PPI_FLAG_PADDING_LENGTH_FIELD_IS_DWORD == (ASF_PPI_LENGTH_TYPE_FLAGS & ASF_PPI_MASK_PADDING_LENGTH_FIELD_SIZE))
-#   define ASF_PPI_PADDING_LENGTH_FIELD_SIZE 4
-#endif
-#ifndef ASF_PPI_PADDING_LENGTH_FIELD_SIZE
-#   define ASF_PPI_PADDING_LENGTH_FIELD_SIZE 0
-#endif
-
-#if (ASF_PL_FLAG_REPLICATED_DATA_LENGTH_FIELD_IS_BYTE == (ASF_PPI_PROPERTY_FLAGS & ASF_PL_MASK_REPLICATED_DATA_LENGTH_FIELD_SIZE))
-#   define ASF_PAYLOAD_REPLICATED_DATA_LENGTH_FIELD_SIZE 1
-#endif
-#if (ASF_PL_FLAG_REPLICATED_DATA_LENGTH_FIELD_IS_WORD == (ASF_PPI_PROPERTY_FLAGS & ASF_PL_MASK_REPLICATED_DATA_LENGTH_FIELD_SIZE))
-#   define ASF_PAYLOAD_REPLICATED_DATA_LENGTH_FIELD_SIZE 2
-#endif
-#if (ASF_PL_FLAG_REPLICATED_DATA_LENGTH_FIELD_IS_DWORD == (ASF_PPI_PROPERTY_FLAGS & ASF_PL_MASK_REPLICATED_DATA_LENGTH_FIELD_SIZE))
-#   define ASF_PAYLOAD_REPLICATED_DATA_LENGTH_FIELD_SIZE 4
-#endif
-#ifndef ASF_PAYLOAD_REPLICATED_DATA_LENGTH_FIELD_SIZE
-#   define ASF_PAYLOAD_REPLICATED_DATA_LENGTH_FIELD_SIZE 0
-#endif
-
-#if (ASF_PL_FLAG_OFFSET_INTO_MEDIA_OBJECT_LENGTH_FIELD_IS_BYTE == (ASF_PPI_PROPERTY_FLAGS & ASF_PL_MASK_OFFSET_INTO_MEDIA_OBJECT_LENGTH_FIELD_SIZE))
-#   define ASF_PAYLOAD_OFFSET_INTO_MEDIA_OBJECT_FIELD_SIZE 1
-#endif
-#if (ASF_PL_FLAG_OFFSET_INTO_MEDIA_OBJECT_LENGTH_FIELD_IS_WORD == (ASF_PPI_PROPERTY_FLAGS & ASF_PL_MASK_OFFSET_INTO_MEDIA_OBJECT_LENGTH_FIELD_SIZE))
-#   define ASF_PAYLOAD_OFFSET_INTO_MEDIA_OBJECT_FIELD_SIZE 2
-#endif
-#if (ASF_PL_FLAG_OFFSET_INTO_MEDIA_OBJECT_LENGTH_FIELD_IS_DWORD == (ASF_PPI_PROPERTY_FLAGS & ASF_PL_MASK_OFFSET_INTO_MEDIA_OBJECT_LENGTH_FIELD_SIZE))
-#   define ASF_PAYLOAD_OFFSET_INTO_MEDIA_OBJECT_FIELD_SIZE 4
-#endif
-#ifndef ASF_PAYLOAD_OFFSET_INTO_MEDIA_OBJECT_FIELD_SIZE
-#   define ASF_PAYLOAD_OFFSET_INTO_MEDIA_OBJECT_FIELD_SIZE 0
-#endif
-
-#if (ASF_PL_FLAG_MEDIA_OBJECT_NUMBER_LENGTH_FIELD_IS_BYTE == (ASF_PPI_PROPERTY_FLAGS & ASF_PL_MASK_MEDIA_OBJECT_NUMBER_LENGTH_FIELD_SIZE))
-#   define ASF_PAYLOAD_MEDIA_OBJECT_NUMBER_FIELD_SIZE 1
-#endif
-#if (ASF_PL_FLAG_MEDIA_OBJECT_NUMBER_LENGTH_FIELD_IS_WORD == (ASF_PPI_PROPERTY_FLAGS & ASF_PL_MASK_MEDIA_OBJECT_NUMBER_LENGTH_FIELD_SIZE))
-#   define ASF_PAYLOAD_MEDIA_OBJECT_NUMBER_FIELD_SIZE 2
-#endif
-#if (ASF_PL_FLAG_MEDIA_OBJECT_NUMBER_LENGTH_FIELD_IS_DWORD == (ASF_PPI_PROPERTY_FLAGS & ASF_PL_MASK_MEDIA_OBJECT_NUMBER_LENGTH_FIELD_SIZE))
-#   define ASF_PAYLOAD_MEDIA_OBJECT_NUMBER_FIELD_SIZE 4
-#endif
-#ifndef ASF_PAYLOAD_MEDIA_OBJECT_NUMBER_FIELD_SIZE
-#   define ASF_PAYLOAD_MEDIA_OBJECT_NUMBER_FIELD_SIZE 0
-#endif
-
-#if (ASF_PL_FLAG_PAYLOAD_LENGTH_FIELD_IS_BYTE == (ASF_PAYLOAD_FLAGS & ASF_PL_MASK_PAYLOAD_LENGTH_FIELD_SIZE))
-#   define ASF_PAYLOAD_LENGTH_FIELD_SIZE 1
-#endif
-#if (ASF_PL_FLAG_PAYLOAD_LENGTH_FIELD_IS_WORD == (ASF_PAYLOAD_FLAGS & ASF_PL_MASK_PAYLOAD_LENGTH_FIELD_SIZE))
-#   define ASF_PAYLOAD_LENGTH_FIELD_SIZE 2
-#endif
-#ifndef ASF_PAYLOAD_LENGTH_FIELD_SIZE
-#   define ASF_PAYLOAD_LENGTH_FIELD_SIZE 0
-#endif
-
-#define PACKET_HEADER_MIN_SIZE \
-    (ASF_PACKET_ERROR_CORRECTION_FLAGS_FIELD_SIZE +       \
-     ASF_PACKET_ERROR_CORRECTION_DATA_SIZE +              \
-     1 +        /* Length Type Flags */                   \
-     1 +        /* Property Flags */                      \
-     ASF_PPI_PACKET_LENGTH_FIELD_SIZE +                   \
-     ASF_PPI_SEQUENCE_FIELD_SIZE +                        \
-     ASF_PPI_PADDING_LENGTH_FIELD_SIZE +                  \
-     4 +        /* Send Time Field */                     \
-     2)         /* Duration Field */
-
-// Replicated Data shall be at least 8 bytes long.
-#define ASF_PAYLOAD_REPLICATED_DATA_LENGTH 0x08
-
-#define PAYLOAD_HEADER_SIZE_SINGLE_PAYLOAD                \
-    (1 +     /* Stream Number */                          \
-     ASF_PAYLOAD_MEDIA_OBJECT_NUMBER_FIELD_SIZE +         \
-     ASF_PAYLOAD_OFFSET_INTO_MEDIA_OBJECT_FIELD_SIZE +    \
-     ASF_PAYLOAD_REPLICATED_DATA_LENGTH_FIELD_SIZE +      \
-     ASF_PAYLOAD_REPLICATED_DATA_LENGTH)
-
-#define PAYLOAD_HEADER_SIZE_MULTIPLE_PAYLOADS             \
-    (1 +        /* Stream Number */                       \
-     ASF_PAYLOAD_MEDIA_OBJECT_NUMBER_FIELD_SIZE +         \
-     ASF_PAYLOAD_OFFSET_INTO_MEDIA_OBJECT_FIELD_SIZE +    \
-     ASF_PAYLOAD_REPLICATED_DATA_LENGTH_FIELD_SIZE +      \
-     ASF_PAYLOAD_REPLICATED_DATA_LENGTH +                 \
-     ASF_PAYLOAD_LENGTH_FIELD_SIZE)
-
-#define SINGLE_PAYLOAD_DATA_LENGTH                        \
-    (PACKET_SIZE -                                        \
-     PACKET_HEADER_MIN_SIZE -                             \
-     PAYLOAD_HEADER_SIZE_SINGLE_PAYLOAD)
-
-#define MULTI_PAYLOAD_CONSTANT                            \
-    (PACKET_SIZE -                                        \
-     PACKET_HEADER_MIN_SIZE -                             \
-     1 -         /* Payload Flags */                      \
-     2 * PAYLOAD_HEADER_SIZE_MULTIPLE_PAYLOADS)
-
-#define DATA_HEADER_SIZE 50
-
 typedef struct {
     uint32_t seqno;
     int is_streamed;
-- 
1.7.10.4



More information about the libav-devel mailing list