[vlc-commits] MMS: use the GUID definitions from the asf demuxer
Jean-Baptiste Kempf
git at videolan.org
Sun Aug 28 02:10:11 CEST 2011
vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sun Aug 28 01:43:26 2011 +0200| [4d543634c06a4172fde4eda5dd81264455e1c0d3] | committer: Jean-Baptiste Kempf
MMS: use the GUID definitions from the asf demuxer
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4d543634c06a4172fde4eda5dd81264455e1c0d3
---
modules/access/mms/Modules.am | 1 +
modules/access/mms/asf.c | 31 ++++----------
modules/access/mms/asf.h | 90 +----------------------------------------
3 files changed, 11 insertions(+), 111 deletions(-)
diff --git a/modules/access/mms/Modules.am b/modules/access/mms/Modules.am
index aa594f7..5f03d9c 100644
--- a/modules/access/mms/Modules.am
+++ b/modules/access/mms/Modules.am
@@ -9,6 +9,7 @@ SOURCES_access_mms = \
buffer.h \
asf.h \
asf.c \
+ ../../demux/asf/libasf_guid.h \
$(NULL)
libvlc_LTLIBRARIES += libaccess_mms_plugin.la
diff --git a/modules/access/mms/asf.c b/modules/access/mms/asf.c
index 52e9729..b5e099a 100644
--- a/modules/access/mms/asf.c
+++ b/modules/access/mms/asf.c
@@ -31,21 +31,6 @@
#include "asf.h"
#include "buffer.h"
-static int CmpGuid( const guid_t *p_guid1, const guid_t *p_guid2 )
-{
- return( ( p_guid1->v1 == p_guid2->v1 &&
- p_guid1->v2 == p_guid2->v2 &&
- p_guid1->v3 == p_guid2->v3 &&
- p_guid1->v4[0] == p_guid2->v4[0] &&
- p_guid1->v4[1] == p_guid2->v4[1] &&
- p_guid1->v4[2] == p_guid2->v4[2] &&
- p_guid1->v4[3] == p_guid2->v4[3] &&
- p_guid1->v4[4] == p_guid2->v4[4] &&
- p_guid1->v4[5] == p_guid2->v4[5] &&
- p_guid1->v4[6] == p_guid2->v4[6] &&
- p_guid1->v4[7] == p_guid2->v4[7] ) ? 1 : 0 );
-}
-
void GenerateGuid ( guid_t *p_guid )
{
p_guid->v1 = 0xbabac001;
@@ -74,7 +59,7 @@ void asf_HeaderParse ( asf_header_t *hdr,
var_buffer_initread( &buffer, p_header, i_header );
var_buffer_getguid( &buffer, &guid );
- if( !CmpGuid( &guid, &asf_object_header_guid ) )
+ if( !CmpGUID( &guid, &asf_object_header_guid ) )
{
/* ERROR: */
}
@@ -85,7 +70,7 @@ void asf_HeaderParse ( asf_header_t *hdr,
var_buffer_getguid( &buffer, &guid );
i_size = var_buffer_get64( &buffer );
- if( CmpGuid( &guid, &asf_object_file_properties_guid ) )
+ if( CmpGUID( &guid, &asf_object_file_properties_guid ) )
{
var_buffer_getmemory( &buffer, NULL, 16 );
hdr->i_file_size = var_buffer_get64( &buffer );
@@ -96,12 +81,12 @@ void asf_HeaderParse ( asf_header_t *hdr,
var_buffer_getmemory( &buffer, NULL, i_size - 24 - 16 - 8 - 8 - 8 - 8-8-8-4 - 4);
}
- else if( CmpGuid( &guid, &asf_object_header_extension_guid ) )
+ else if( CmpGUID( &guid, &asf_object_header_extension_guid ) )
{
/* Enter it */
var_buffer_getmemory( &buffer, NULL, 46 - 24 );
}
- else if( CmpGuid( &guid, &asf_object_extended_stream_properties_guid ) )
+ else if( CmpGUID( &guid, &asf_object_extended_stream_properties_guid ) )
{
/* Grrrrrr */
int16_t i_count1, i_count2;
@@ -141,7 +126,7 @@ void asf_HeaderParse ( asf_header_t *hdr,
/* It's a hack we just skip the first part of the object until
* the embed stream properties if any (ugly, but whose fault ?) */
}
- else if( CmpGuid( &guid, &asf_object_stream_properties_guid ) )
+ else if( CmpGUID( &guid, &asf_object_stream_properties_guid ) )
{
int i_stream_id;
guid_t stream_type;
@@ -152,11 +137,11 @@ void asf_HeaderParse ( asf_header_t *hdr,
i_stream_id = var_buffer_get8( &buffer ) & 0x7f;
var_buffer_getmemory( &buffer, NULL, i_size - 24 - 32 - 16 - 1);
- if( CmpGuid( &stream_type, &asf_object_stream_type_video ) )
+ if( CmpGUID( &stream_type, &asf_object_stream_type_video ) )
{
hdr->stream[i_stream_id].i_cat = ASF_STREAM_VIDEO;
}
- else if( CmpGuid( &stream_type, &asf_object_stream_type_audio ) )
+ else if( CmpGUID( &stream_type, &asf_object_stream_type_audio ) )
{
hdr->stream[i_stream_id].i_cat = ASF_STREAM_AUDIO;
}
@@ -165,7 +150,7 @@ void asf_HeaderParse ( asf_header_t *hdr,
hdr->stream[i_stream_id].i_cat = ASF_STREAM_UNKNOWN;
}
}
- else if ( CmpGuid( &guid, &asf_object_bitrate_properties_guid ) )
+ else if ( CmpGUID( &guid, &asf_object_stream_bitrate_properties ) )
{
int i_count;
uint8_t i_stream_id;
diff --git a/modules/access/mms/asf.h b/modules/access/mms/asf.h
index 049328c..0c678de 100644
--- a/modules/access/mms/asf.h
+++ b/modules/access/mms/asf.h
@@ -31,6 +31,8 @@
#ifndef _ASF_H_
#define _ASF_H_ 1
+#include "../../demux/asf/libasf_guid.h"
+
#define ASF_STREAM_VIDEO 0x0001
#define ASF_STREAM_AUDIO 0x0002
#define ASF_STREAM_UNKNOWN 0xffff
@@ -52,14 +54,6 @@ typedef struct
} asf_header_t;
-typedef struct guid_s
-{
- uint32_t v1; /* le */
- uint16_t v2; /* le */
- uint16_t v3; /* le */
- uint8_t v4[8];
-} guid_t;
-
void GenerateGuid ( guid_t * );
void asf_HeaderParse ( asf_header_t *, uint8_t *, int );
@@ -67,84 +61,4 @@ void asf_StreamSelect ( asf_header_t *,
int i_bitrate_max, bool b_all, bool b_audio,
bool b_video );
-#define GUID_FMT "%8.8x-%4.4x-%4.4x-%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x"
-#define GUID_PRINT( guid ) \
- (guid).v1, \
- (guid).v2, \
- (guid).v3, \
- (guid).v4[0],(guid).v4[1],(guid).v4[2],(guid).v4[3], \
- (guid).v4[4],(guid).v4[5],(guid).v4[6],(guid).v4[7]
-
-static const guid_t asf_object_header_guid =
-{
- 0x75B22630,
- 0x668E,
- 0x11CF,
- { 0xA6,0xD9, 0x00,0xAA,0x00,0x62,0xCE,0x6C }
-};
-
-static const guid_t asf_object_file_properties_guid =
-{
- 0x8cabdca1,
- 0xa947,
- 0x11cf,
- { 0x8e,0xe4, 0x00,0xC0,0x0C,0x20,0x53,0x65 }
-};
-
-static const guid_t asf_object_stream_properties_guid =
-{
- 0xB7DC0791,
- 0xA9B7,
- 0x11CF,
- { 0x8E,0xE6, 0x00,0xC0,0x0C,0x20,0x53,0x65 }
-};
-
-static const guid_t asf_object_stream_type_audio =
-{
- 0xF8699E40,
- 0x5B4D,
- 0x11CF,
- { 0xA8,0xFD, 0x00,0x80,0x5F,0x5C,0x44,0x2B }
-};
-
-static const guid_t asf_object_stream_type_video =
-{
- 0xbc19efc0,
- 0x5B4D,
- 0x11CF,
- { 0xA8,0xFD, 0x00,0x80,0x5F,0x5C,0x44,0x2B }
-};
-
-static const guid_t asf_object_bitrate_properties_guid =
-{
- 0x7BF875CE,
- 0x468D,
- 0x11D1,
- { 0x8D,0x82,0x00,0x60,0x97,0xC9,0xA2,0xB2 }
-};
-
-static const guid_t asf_object_bitrate_mutual_exclusion_guid =
-{
- 0xD6E229DC,
- 0x35DA,
- 0x11D1,
- { 0x90,0x34,0x00,0xA0,0xC9,0x03,0x49,0xBE }
-};
-
-static const guid_t asf_object_extended_stream_properties_guid =
-{
- 0x14E6A5CB,
- 0xC672,
- 0x4332,
- { 0x83, 0x99, 0xA9, 0x69, 0x52, 0x06, 0x5B, 0x5A }
-};
-
-static const guid_t asf_object_header_extension_guid =
-{
- 0x5FBF03B5,
- 0xA92E,
- 0x11CF,
- { 0x8E, 0xE3, 0x00, 0xC0, 0x0C, 0x20, 0x53, 0x65 }
-};
-
#endif
More information about the vlc-commits
mailing list