Commit 22fca623 authored by Laurent Aimar's avatar Laurent Aimar

* all: A little clean up.

parent b75c3a7a
This diff is collapsed.
......@@ -2,7 +2,7 @@
* asf.h : ASFv01 file input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: asf.h,v 1.3 2003/02/01 01:21:04 fenrir Exp $
* $Id: asf.h,v 1.4 2003/08/17 23:42:37 fenrir Exp $
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
......@@ -34,7 +34,6 @@ typedef struct asf_stream_s
struct demux_sys_t
{
mtime_t i_pcr; // 1/90000 s
mtime_t i_time; // µs
asf_object_root_t root;
......
......@@ -2,7 +2,7 @@
* libasf.c :
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: libasf.c,v 1.13 2003/08/17 23:02:52 fenrir Exp $
* $Id: libasf.c,v 1.14 2003/08/17 23:42:37 fenrir Exp $
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
......@@ -21,13 +21,11 @@
*****************************************************************************/
#include <stdlib.h> /* malloc(), free() */
#include <string.h> /* strdup() */
#include <errno.h>
#include <sys/types.h>
#include <vlc/vlc.h>
#include <vlc/input.h>
#include "codecs.h" /* BITMAPINFOHEADER, WAVEFORMATEX */
#include "libasf.h"
#define ASF_DEBUG 1
......@@ -43,7 +41,7 @@
(guid).v4[0],(guid).v4[1],(guid).v4[2],(guid).v4[3], \
(guid).v4[4],(guid).v4[5],(guid).v4[6],(guid).v4[7]
void GetGUID( guid_t *p_guid, uint8_t *p_data )
void ASF_GetGUID( guid_t *p_guid, uint8_t *p_data )
{
p_guid->v1 = GetDWLE( p_data );
p_guid->v2 = GetWLE( p_data + 4);
......@@ -51,7 +49,7 @@ void GetGUID( guid_t *p_guid, uint8_t *p_data )
memcpy( p_guid->v4, p_data + 8, 8 );
}
int CmpGUID( const guid_t *p_guid1, const guid_t *p_guid2 )
int ASF_CmpGUID( const guid_t *p_guid1, const guid_t *p_guid2 )
{
if( (p_guid1->v1 != p_guid2->v1 )||(p_guid1->v2 != p_guid2->v2 )||
(p_guid1->v3 != p_guid2->v3 )||
......@@ -184,7 +182,7 @@ int ASF_ReadObjectCommon( input_thread_t *p_input,
{
return( 0 );
}
GetGUID( &p_common->i_object_id, p_peek );
ASF_GetGUID( &p_common->i_object_id, p_peek );
p_common->i_object_size = GetQWLE( p_peek + 16 );
p_common->i_object_pos = ASF_TellAbsolute( p_input );
p_common->p_next = NULL;
......@@ -300,7 +298,7 @@ int ASF_ReadObject_Data( input_thread_t *p_input,
{
return( 0 );
}
GetGUID( &p_data->i_file_id, p_peek + 24 );
ASF_GetGUID( &p_data->i_file_id, p_peek + 24 );
p_data->i_total_data_packets = GetQWLE( p_peek + 40 );
p_data->i_reserved = GetWLE( p_peek + 48 );
#ifdef ASF_DEBUG
......@@ -325,7 +323,7 @@ int ASF_ReadObject_Index( input_thread_t *p_input,
{
return( 0 );
}
GetGUID( &p_index->i_file_id, p_peek + 24 );
ASF_GetGUID( &p_index->i_file_id, p_peek + 24 );
p_index->i_index_entry_time_interval = GetQWLE( p_peek + 40 );
p_index->i_max_packet_count = GetDWLE( p_peek + 48 );
p_index->i_index_entry_count = GetDWLE( p_peek + 52 );
......@@ -362,7 +360,7 @@ int ASF_ReadObject_file_properties( input_thread_t *p_input,
{
return( 0 );
}
GetGUID( &p_fp->i_file_id, p_peek + 24 );
ASF_GetGUID( &p_fp->i_file_id, p_peek + 24 );
p_fp->i_file_size = GetQWLE( p_peek + 40 );
p_fp->i_creation_date = GetQWLE( p_peek + 48 );
p_fp->i_data_packets_count = GetQWLE( p_peek + 56 );
......@@ -407,7 +405,7 @@ int ASF_ReadObject_header_extention( input_thread_t *p_input,
{
return( 0 );
}
GetGUID( &p_he->i_reserved1, p_peek + 24 );
ASF_GetGUID( &p_he->i_reserved1, p_peek + 24 );
p_he->i_reserved2 = GetWLE( p_peek + 40 );
p_he->i_header_extention_size = GetDWLE( p_peek + 42 );
if( p_he->i_header_extention_size )
......@@ -450,8 +448,8 @@ int ASF_ReadObject_stream_properties( input_thread_t *p_input,
{
return( 0 );
}
GetGUID( &p_sp->i_stream_type, p_peek + 24 );
GetGUID( &p_sp->i_error_correction_type, p_peek + 40 );
ASF_GetGUID( &p_sp->i_stream_type, p_peek + 24 );
ASF_GetGUID( &p_sp->i_error_correction_type, p_peek + 40 );
p_sp->i_time_offset = GetQWLE( p_peek + 56 );
p_sp->i_type_specific_data_length = GetDWLE( p_peek + 64 );
p_sp->i_error_correction_data_length = GetDWLE( p_peek + 68 );
......@@ -524,7 +522,7 @@ int ASF_ReadObject_codec_list( input_thread_t *p_input,
return( 0 );
}
GetGUID( &p_cl->i_reserved, p_peek + 24 );
ASF_GetGUID( &p_cl->i_reserved, p_peek + 24 );
p_cl->i_codec_entries_count = GetWLE( p_peek + 40 );
if( p_cl->i_codec_entries_count > 0 )
{
......@@ -757,9 +755,9 @@ int ASF_ReadObject( input_thread_t *p_input,
/* find this object */
for( i_index = 0; ; i_index++ )
{
if( CmpGUID( ASF_Object_Function[i_index].p_id,
if( ASF_CmpGUID( ASF_Object_Function[i_index].p_id,
&p_obj->common.i_object_id )||
CmpGUID( ASF_Object_Function[i_index].p_id,
ASF_CmpGUID( ASF_Object_Function[i_index].p_id,
&asf_object_null_guid ) )
{
break;
......@@ -822,9 +820,9 @@ void ASF_FreeObject( input_thread_t *p_input,
/* find this object */
for( i_index = 0; ; i_index++ )
{
if( CmpGUID( ASF_Object_Function[i_index].p_id,
if( ASF_CmpGUID( ASF_Object_Function[i_index].p_id,
&p_obj->common.i_object_id )||
CmpGUID( ASF_Object_Function[i_index].p_id,
ASF_CmpGUID( ASF_Object_Function[i_index].p_id,
&asf_object_null_guid ) )
{
break;
......@@ -945,7 +943,7 @@ int __ASF_CountObject( asf_object_t *p_obj, const guid_t *p_guid )
p_child = p_obj->common.p_first;
while( p_child )
{
if( CmpGUID( &p_child->common.i_object_id, p_guid ) )
if( ASF_CmpGUID( &p_child->common.i_object_id, p_guid ) )
{
i_count++;
}
......@@ -962,7 +960,7 @@ void *__ASF_FindObject( asf_object_t *p_obj, const guid_t *p_guid, int i_number
while( p_child )
{
if( CmpGUID( &p_child->common.i_object_id, p_guid ) )
if( ASF_CmpGUID( &p_child->common.i_object_id, p_guid ) )
{
if( i_number == 0 )
{
......
......@@ -2,7 +2,7 @@
* libasf.h :
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: libasf.h,v 1.5 2002/12/06 16:34:06 sam Exp $
* $Id: libasf.h,v 1.6 2003/08/17 23:42:37 fenrir Exp $
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
......@@ -20,7 +20,6 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#include "codecs.h" /* BITMAPINFOHEADER, WAVEFORMATEX */
/*****************************************************************************
* Structure needed for decoder
......@@ -153,24 +152,6 @@ static const guid_t asf_object_stream_type_command =
{ 0xA3,0xAC, 0x00,0xA0,0xC9,0x03,0x48,0xF6 }
};
#if 0
static const guid_t asf_object_
{
};
#endif
#if 0
typedef struct asf_packet_s
{
int i_stream_number;
int i_payload_size;
u8 *p_payload_data;
} asf_packet_t;
#endif
#define ASF_OBJECT_COMMON \
int i_type; \
guid_t i_object_id; \
......@@ -334,14 +315,6 @@ typedef struct asf_object_codec_list_s
} asf_object_codec_list_t;
#if 0
typedef struct asf_object_script_command_s
{
ASF_OBJECT_COMMON
} asf_object_script_command_t;
#endif
typedef struct asf_marker_s
{
uint64_t i_offset;
......@@ -351,7 +324,6 @@ typedef struct asf_marker_s
uint32_t i_flags;
uint32_t i_marker_description_length;
uint8_t *i_marker_description;
/* u8 padding */
} asf_marker_t;
......@@ -366,14 +338,6 @@ typedef struct asf_object_marker_s
} asf_object_marker_t;
#if 0
typedef struct asf_object__s
{
ASF_OBJECT_COMMON
} asf_object__t;
#endif
typedef union asf_object_u
{
asf_object_common_t common;
......@@ -395,8 +359,8 @@ int ASF_SeekAbsolute( input_thread_t *p_input, off_t i_pos);
int ASF_ReadData( input_thread_t *p_input, uint8_t *p_buff, int i_size );
int ASF_SkipBytes( input_thread_t *p_input, int i_count );
void GetGUID( guid_t *p_guid, uint8_t *p_data );
int CmpGUID( const guid_t *p_guid1, const guid_t *p_guid2 );
void ASF_GetGUID( guid_t *p_guid, uint8_t *p_data );
int ASF_CmpGUID( const guid_t *p_guid1, const guid_t *p_guid2 );
int ASF_ReadObjectCommon( input_thread_t *p_input,
asf_object_t *p_obj );
......
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