Commit 372cb91d authored by Gildas Bazin's avatar Gildas Bazin

* modules/mux/asf.c: small cleanup

parent c219dac6
......@@ -31,6 +31,7 @@
#include <vlc/sout.h>
#include "codecs.h"
typedef GUID guid_t;
/*****************************************************************************
* Module descriptor
......@@ -87,15 +88,6 @@ static int AddStream( sout_mux_t *, sout_input_t * );
static int DelStream( sout_mux_t *, sout_input_t * );
static int Mux ( sout_mux_t * );
typedef struct
{
uint32_t v1; /* le */
uint16_t v2; /* le */
uint16_t v3; /* le */
uint8_t v4[8];
} guid_t;
typedef struct
{
int i_id;
......@@ -155,6 +147,7 @@ typedef struct
int i_buffer_size;
int i_buffer;
uint8_t *p_buffer;
} bo_t;
static void bo_init ( bo_t *, uint8_t *, int );
......@@ -206,12 +199,12 @@ static int Open( vlc_object_t *p_this )
/* Generate a random fid */
srand( mdate() & 0xffffffff );
p_sys->fid.v1 = 0xbabac001;
p_sys->fid.v2 = ( (uint64_t)rand() << 16 ) / RAND_MAX;
p_sys->fid.v3 = ( (uint64_t)rand() << 16 ) / RAND_MAX;
p_sys->fid.Data1 = 0xbabac001;
p_sys->fid.Data2 = ( (uint64_t)rand() << 16 ) / RAND_MAX;
p_sys->fid.Data3 = ( (uint64_t)rand() << 16 ) / RAND_MAX;
for( i = 0; i < 8; i++ )
{
p_sys->fid.v4[i] = ( (uint64_t)rand() << 8 ) / RAND_MAX;
p_sys->fid.Data4[i] = ( (uint64_t)rand() << 8 ) / RAND_MAX;
}
/* Meta data */
......@@ -706,116 +699,52 @@ static void bo_addle_str16_nosize( bo_t *bo, char *str )
}
/****************************************************************************
* guid
* GUID definitions
****************************************************************************/
static void bo_add_guid( bo_t *p_bo, const guid_t *id )
{
int i;
bo_addle_u32( p_bo, id->v1 );
bo_addle_u16( p_bo, id->v2 );
bo_addle_u16( p_bo, id->v3 );
bo_addle_u32( p_bo, id->Data1 );
bo_addle_u16( p_bo, id->Data2 );
bo_addle_u16( p_bo, id->Data3 );
for( i = 0; i < 8; i++ )
{
bo_add_u8( p_bo, id->v4[i] );
bo_add_u8( p_bo, id->Data4[i] );
}
}
static const guid_t asf_object_header_guid =
{
0x75B22630,
0x668E,
0x11CF,
{ 0xA6,0xD9, 0x00,0xAA,0x00,0x62,0xCE,0x6C }
};
{0x75B22630, 0x668E, 0x11CF, {0xA6, 0xD9, 0x00, 0xAA, 0x00, 0x62, 0xCE, 0x6C}};
static const guid_t asf_object_data_guid =
{
0x75B22636,
0x668E,
0x11CF,
{ 0xA6,0xD9, 0x00,0xAA,0x00,0x62,0xCE,0x6C }
};
{0x75B22636, 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 }
};
{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 }
};
{0xB7DC0791, 0xA9B7, 0x11CF, {0x8E, 0xE6, 0x00, 0xC0, 0x0C, 0x20, 0x53, 0x65}};
static const guid_t asf_object_header_extention_guid =
{
0x5FBF03B5,
0xA92E,
0x11CF,
{ 0x8E,0xE3, 0x00,0xC0,0x0C,0x20,0x53,0x65 }
};
{0x5FBF03B5, 0xA92E, 0x11CF, {0x8E, 0xE3, 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 }
};
{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 }
};
{0xbc19efc0, 0x5B4D, 0x11CF, {0xA8, 0xFD, 0x00, 0x80, 0x5F, 0x5C, 0x44, 0x2B}};
static const guid_t asf_guid_audio_conceal_none =
{
0x20FB5700,
0x5B55,
0x11CF,
{ 0xA8, 0xFD, 0x00, 0x80, 0x5F, 0x5C, 0x44, 0x2B }
};
{0x20FB5700, 0x5B55, 0x11CF, {0xA8, 0xFD, 0x00, 0x80, 0x5F, 0x5C, 0x44, 0x2B}};
static const guid_t asf_guid_video_conceal_none =
{
0x20FB5700,
0x5B55,
0x11CF,
{ 0xA8, 0xFD, 0x00, 0x80, 0x5F, 0x5C, 0x44, 0x2B }
};
{0x20FB5700, 0x5B55, 0x11CF, {0xA8, 0xFD, 0x00, 0x80, 0x5F, 0x5C, 0x44, 0x2B}};
static const guid_t asf_guid_reserved_1 =
{
0xABD3D211,
0xA9BA,
0x11cf,
{ 0x8E, 0xE6,0x00, 0xC0, 0x0C ,0x20, 0x53, 0x65 }
};
{0xABD3D211, 0xA9BA, 0x11cf, {0x8E, 0xE6, 0x00, 0xC0, 0x0C ,0x20, 0x53, 0x65}};
static const guid_t asf_object_codec_comment_guid =
{
0x86D15240,
0x311D,
0x11D0,
{ 0xA3, 0xA4, 0x00, 0xA0, 0xC9, 0x03, 0x48, 0xF6 }
};
{0x86D15240, 0x311D, 0x11D0, {0xA3, 0xA4, 0x00, 0xA0, 0xC9, 0x03, 0x48, 0xF6}};
static const guid_t asf_object_codec_comment_reserved_guid =
{
0x86D15241,
0x311D,
0x11D0,
{ 0xA3, 0xA4, 0x00, 0xA0, 0xC9, 0x03, 0x48, 0xF6 }
};
{0x86D15241, 0x311D, 0x11D0, {0xA3, 0xA4, 0x00, 0xA0, 0xC9, 0x03, 0x48, 0xF6}};
static const guid_t asf_object_content_description_guid =
{
0x75B22633,
0x668E,
0x11CF,
{ 0xa6, 0xd9, 0x00, 0xaa, 0x00, 0x62, 0xce, 0x6c }
};
{0x75B22633, 0x668E, 0x11CF, {0xa6, 0xd9, 0x00, 0xaa, 0x00, 0x62, 0xce, 0x6c}};
static const guid_t asf_object_index =
{0xb35b7d8c, 0x7af1, 0x4f66, {0x94, 0x9a, 0x89, 0x03, 0x8e, 0x82, 0xc7, 0x48}};
/****************************************************************************
* Misc
****************************************************************************/
static void asf_chunk_add( bo_t *bo,
int i_type, int i_len, int i_flags, int i_seq )
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment