} GUID, *REFGUID, *LPGUID;
#endif /* GUID_DEFINED */
+typedef GUID guid_t;
+
#ifdef HAVE_ATTRIBUTE_PACKED
# define ATTR_PACKED __attribute__((__packed__))
#elif defined(__SUNPRO_C)
#include <vlc_common.h>
#include <vlc_rand.h>
+#include <vlc_codecs.h>
#include "asf.h"
#include "buffer.h"
var_buffer_initread( &buffer, p_header, i_header );
var_buffer_getguid( &buffer, &guid );
- if( !CmpGUID( &guid, &asf_object_header_guid ) )
+ if( !guidcmp( &guid, &asf_object_header_guid ) )
{
/* ERROR: */
}
var_buffer_getguid( &buffer, &guid );
i_size = var_buffer_get64( &buffer );
- if( CmpGUID( &guid, &asf_object_file_properties_guid ) )
+ if( guidcmp( &guid, &asf_object_file_properties_guid ) )
{
var_buffer_getmemory( &buffer, NULL, 16 );
hdr->i_file_size = var_buffer_get64( &buffer );
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( guidcmp( &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( guidcmp( &guid, &asf_object_extended_stream_properties_guid ) )
{
/* Grrrrrr */
int16_t i_count1, i_count2;
/* 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( guidcmp( &guid, &asf_object_stream_properties_guid ) )
{
int i_stream_id;
guid_t stream_type;
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( guidcmp( &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( guidcmp( &stream_type, &asf_object_stream_type_audio ) )
{
hdr->stream[i_stream_id].i_cat = ASF_STREAM_AUDIO;
}
hdr->stream[i_stream_id].i_cat = ASF_STREAM_UNKNOWN;
}
}
- else if ( CmpGUID( &guid, &asf_object_stream_bitrate_properties ) )
+ else if ( guidcmp( &guid, &asf_object_stream_bitrate_properties ) )
{
int i_count;
uint8_t i_stream_id;
if( stream_Peek( p_demux->s, &p_peek, 16 ) < 16 ) return VLC_EGENERIC;
ASF_GetGUID( &guid, p_peek );
- if( !CmpGUID( &guid, &asf_object_header_guid ) ) return VLC_EGENERIC;
+ if( !guidcmp( &guid, &asf_object_header_guid ) ) return VLC_EGENERIC;
/* Set p_demux fields */
p_demux->pf_demux = Demux;
guid_t guid;
ASF_GetGUID( &guid, p_peek );
- if( CmpGUID( &guid, &asf_object_header_guid ) )
+ if( guidcmp( &guid, &asf_object_header_guid ) )
{
msg_Warn( p_demux, "found a new ASF header" );
/* We end this stream */
es_format_t fmt;
- if( CmpGUID( &p_sp->i_stream_type, &asf_object_stream_type_audio ) &&
+ if( guidcmp( &p_sp->i_stream_type, &asf_object_stream_type_audio ) &&
p_sp->i_type_specific_data_length >= sizeof( WAVEFORMATEX ) - 2 )
{
uint8_t *p_data = p_sp->p_type_specific_data;
msg_Dbg( p_demux, "added new audio stream(codec:0x%x,ID:%d)",
GetWLE( p_data ), p_sp->i_stream_number );
}
- else if( CmpGUID( &p_sp->i_stream_type,
+ else if( guidcmp( &p_sp->i_stream_type,
&asf_object_stream_type_video ) &&
p_sp->i_type_specific_data_length >= 11 +
sizeof( BITMAPINFOHEADER ) )
msg_Dbg( p_demux, "added new video stream(ID:%d)",
p_sp->i_stream_number );
}
- else if( CmpGUID( &p_sp->i_stream_type, &asf_object_extended_stream_header ) &&
+ else if( guidcmp( &p_sp->i_stream_type, &asf_object_extended_stream_header ) &&
p_sp->i_type_specific_data_length >= 64 )
{
/* Now follows a 64 byte header of which we don't know much */
unsigned int i_data = p_sp->i_type_specific_data_length - 64;
msg_Dbg( p_demux, "Ext stream header detected. datasize = %d", p_sp->i_type_specific_data_length );
- if( CmpGUID( p_ref, &asf_object_extended_stream_type_audio ) &&
+ if( guidcmp( p_ref, &asf_object_extended_stream_type_audio ) &&
i_data >= sizeof( WAVEFORMATEX ) - 2)
{
int i_format;
/* find this object */
for( i_index = 0; ; i_index++ )
{
- if( CmpGUID( ASF_Object_Function[i_index].p_id,
+ if( guidcmp( ASF_Object_Function[i_index].p_id,
&p_obj->common.i_object_id ) ||
- CmpGUID( ASF_Object_Function[i_index].p_id,
+ guidcmp( ASF_Object_Function[i_index].p_id,
&asf_object_null_guid ) )
{
break;
/* find this object */
for( i_index = 0; ; i_index++ )
{
- if( CmpGUID( ASF_Object_Function[i_index].p_id,
+ if( guidcmp( ASF_Object_Function[i_index].p_id,
&p_obj->common.i_object_id )||
- CmpGUID( ASF_Object_Function[i_index].p_id,
+ guidcmp( ASF_Object_Function[i_index].p_id,
&asf_object_null_guid ) )
{
break;
/* Find the name */
for( i = 0; ASF_ObjectDumpDebugInfo[i].p_id != NULL; i++ )
{
- if( CmpGUID( ASF_ObjectDumpDebugInfo[i].p_id,
+ if( guidcmp( ASF_ObjectDumpDebugInfo[i].p_id,
&p_node->i_object_id ) )
break;
}
p_child = p_obj->common.p_first;
while( p_child )
{
- if( CmpGUID( &p_child->common.i_object_id, p_guid ) )
+ if( guidcmp( &p_child->common.i_object_id, p_guid ) )
i_count++;
p_child = p_child->common.p_next;
while( p_child )
{
- if( CmpGUID( &p_child->common.i_object_id, p_guid ) )
+ if( guidcmp( &p_child->common.i_object_id, p_guid ) )
{
if( i_number == 0 )
return p_child;
#ifndef LIBASG_GUID_H
#define LIBASG_GUID_H
+#include <vlc_codecs.h>
+
/*****************************************************************************
* Structure needed for decoder
*****************************************************************************/
-typedef struct guid_s
-{
- uint32_t Data1; /* le */
- uint16_t Data2; /* le */
- uint16_t Data3; /* le */
- uint8_t Data4[8];
-} guid_t;
-
#define GUID_FMT "0x%x-0x%x-0x%x-0x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x"
#define GUID_PRINT( guid ) \
(guid).Data1, \
memcpy( p_guid->Data4, p_data + 8, 8 );
}
-static inline bool CmpGUID( const guid_t *p_guid1, const guid_t *p_guid2 )
-{
- if( (p_guid1->Data1 != p_guid2->Data1 )||
- (p_guid1->Data2 != p_guid2->Data2 )||
- (p_guid1->Data3 != p_guid2->Data3 )||
- ( memcmp( p_guid1->Data4, p_guid2->Data4, 8 )) )
- {
- return false;
- }
- return true;
-}
-
#endif