summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>2006-07-28 18:18:12 +0000
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>2006-07-28 18:18:12 +0000
commit4bfff76814cd296de4d51a97209f4afb4a9f5171 (patch)
treec4835d1a5b327bf6c9187c010792eb484935773a /libavformat
parent7c87a2f0c058472c39ba3670f8164acdd6baf2d2 (diff)
declare and use UID type
Originally committed as revision 5836 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/mxf.c32
1 files changed, 18 insertions, 14 deletions
diff --git a/libavformat/mxf.c b/libavformat/mxf.c
index c0b2099781..3d9eb3b199 100644
--- a/libavformat/mxf.c
+++ b/libavformat/mxf.c
@@ -43,17 +43,19 @@
#include "dsputil.h"
#include "riff.h"
+typedef DECLARE_ALIGNED_16(uint8_t, UID[16]);
+
typedef struct {
AVStream *stream;
- uint8_t track_uid[16];
- uint8_t sequence_uid[16];
+ UID track_uid;
+ UID sequence_uid;
int track_id;
int track_number;
} MXFTrack;
typedef struct {
- DECLARE_ALIGNED_16(uint8_t, essence_container[16]);
- DECLARE_ALIGNED_16(uint8_t, essence_compression[16]);
+ UID essence_container;
+ UID essence_compression;
enum CodecType codec_type;
AVRational sample_rate;
AVRational aspect_ratio;
@@ -75,20 +77,22 @@ typedef struct {
} MXFContext;
typedef struct {
- DECLARE_ALIGNED_16(uint8_t, key[16]);
+ UID key;
offset_t offset;
uint64_t length;
} KLVPacket;
-static const uint8_t mxf_metadata_source_package_key[] = { 0x06, 0x0e, 0x2b, 0x34, 0x02, 0x53, 0x01, 0x01, 0x0d, 0x01, 0x01, 0x01, 0x01, 0x01, 0x37, 0x00 };
-static const uint8_t mxf_metadata_sequence_key[] = { 0x06, 0x0e, 0x2b, 0x34, 0x02, 0x53, 0x01, 0x01, 0x0d, 0x01, 0x01, 0x01, 0x01, 0x01, 0x0F, 0x00 };
-static const uint8_t mxf_metadata_generic_sound_descriptor_key[] = { 0x06, 0x0e, 0x2b, 0x34, 0x02, 0x53, 0x01, 0x01, 0x0d, 0x01, 0x01, 0x01, 0x01, 0x01, 0x42, 0x00 };
-static const uint8_t mxf_metadata_cdci_descriptor_key[] = { 0x06, 0x0e, 0x2b, 0x34, 0x02, 0x53, 0x01, 0x01, 0x0d, 0x01, 0x01, 0x01, 0x01, 0x01, 0x28, 0x00 };
-static const uint8_t mxf_metadata_mpegvideo_descriptor_key[] = { 0x06, 0x0e, 0x2b, 0x34, 0x02, 0x53, 0x01, 0x01, 0x0d, 0x01, 0x01, 0x01, 0x01, 0x01, 0x51, 0x00 };
-static const uint8_t mxf_metadata_wave_descriptor_key[] = { 0x06, 0x0e, 0x2b, 0x34, 0x02, 0x53, 0x01, 0x01, 0x0d, 0x01, 0x01, 0x01, 0x01, 0x01, 0x48, 0x00 };
-static const uint8_t mxf_metadata_track_key[] = { 0x06, 0x0e, 0x2b, 0x34, 0x02, 0x53, 0x01, 0x01, 0x0d, 0x01, 0x01, 0x01, 0x01, 0x01, 0x3b, 0x00 };
-static const uint8_t mxf_header_partition_pack_key[] = { 0x06, 0x0e, 0x2b, 0x34, 0x02, 0x05, 0x01, 0x01, 0x0d, 0x01, 0x02, 0x01, 0x01, 0x02 };
-static const uint8_t mxf_essence_element_key[] = { 0x06, 0x0e, 0x2b, 0x34, 0x01, 0x02, 0x01 };
+static const UID mxf_metadata_source_package_key = { 0x06, 0x0e, 0x2b, 0x34, 0x02, 0x53, 0x01, 0x01, 0x0d, 0x01, 0x01, 0x01, 0x01, 0x01, 0x37, 0x00 };
+static const UID mxf_metadata_sequence_key = { 0x06, 0x0e, 0x2b, 0x34, 0x02, 0x53, 0x01, 0x01, 0x0d, 0x01, 0x01, 0x01, 0x01, 0x01, 0x0F, 0x00 };
+static const UID mxf_metadata_generic_sound_descriptor_key = { 0x06, 0x0e, 0x2b, 0x34, 0x02, 0x53, 0x01, 0x01, 0x0d, 0x01, 0x01, 0x01, 0x01, 0x01, 0x42, 0x00 };
+static const UID mxf_metadata_cdci_descriptor_key = { 0x06, 0x0e, 0x2b, 0x34, 0x02, 0x53, 0x01, 0x01, 0x0d, 0x01, 0x01, 0x01, 0x01, 0x01, 0x28, 0x00 };
+static const UID mxf_metadata_mpegvideo_descriptor_key = { 0x06, 0x0e, 0x2b, 0x34, 0x02, 0x53, 0x01, 0x01, 0x0d, 0x01, 0x01, 0x01, 0x01, 0x01, 0x51, 0x00 };
+static const UID mxf_metadata_wave_descriptor_key = { 0x06, 0x0e, 0x2b, 0x34, 0x02, 0x53, 0x01, 0x01, 0x0d, 0x01, 0x01, 0x01, 0x01, 0x01, 0x48, 0x00 };
+static const UID mxf_metadata_track_key = { 0x06, 0x0e, 0x2b, 0x34, 0x02, 0x53, 0x01, 0x01, 0x0d, 0x01, 0x01, 0x01, 0x01, 0x01, 0x3b, 0x00 };
+
+/* partial keys to match */
+static const uint8_t mxf_header_partition_pack_key[] = { 0x06, 0x0e, 0x2b, 0x34, 0x02, 0x05, 0x01, 0x01, 0x0d, 0x01, 0x02, 0x01, 0x01, 0x02 };
+static const uint8_t mxf_essence_element_key[] = { 0x06, 0x0e, 0x2b, 0x34, 0x01, 0x02, 0x01 };
#define IS_KLV_KEY(x, y) (!memcmp(x, y, sizeof(y)))