Commit d10ad52f authored by Laurent Aimar's avatar Laurent Aimar

* asf: clean up + use stream_* (It's not yet well tested)

parent c95c5508
SOURCES_asf = \ SOURCES_asf = \
asf.c \ asf.c \
asf.h \
libasf.c \ libasf.c \
libasf.h \ libasf.h \
$(NULL) $(NULL)
This diff is collapsed.
/*****************************************************************************
* asf.h : ASFv01 file input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $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
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
typedef struct asf_stream_s
{
int i_cat;
es_descriptor_t *p_es;
asf_object_stream_properties_t *p_sp;
mtime_t i_time;
pes_packet_t *p_pes; // used to keep uncomplete frames
} asf_stream_t;
struct demux_sys_t
{
mtime_t i_time; // µs
asf_object_root_t root;
asf_object_file_properties_t *p_fp;
int i_streams;
asf_stream_t *stream[128];
off_t i_data_begin;
off_t i_data_end;
};
This diff is collapsed.
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* libasf.h : * libasf.h :
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: libasf.h,v 1.6 2003/08/17 23:42:37 fenrir Exp $ * $Id: libasf.h,v 1.7 2003/08/18 19:18:47 fenrir Exp $
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
...@@ -211,16 +211,6 @@ typedef struct asf_object_index_s ...@@ -211,16 +211,6 @@ typedef struct asf_object_index_s
} asf_object_index_t; } asf_object_index_t;
typedef struct asf_object_root_s
{
ASF_OBJECT_COMMON
asf_object_header_t *p_hdr;
asf_object_data_t *p_data;
asf_object_index_t *p_index;
} asf_object_root_t;
/**************************************************************************** /****************************************************************************
* Sub level asf object * Sub level asf object
****************************************************************************/ ****************************************************************************/
...@@ -338,6 +328,26 @@ typedef struct asf_object_marker_s ...@@ -338,6 +328,26 @@ typedef struct asf_object_marker_s
} asf_object_marker_t; } asf_object_marker_t;
/****************************************************************************
* Special Root Object
****************************************************************************/
typedef struct asf_object_root_s
{
ASF_OBJECT_COMMON
asf_object_header_t *p_hdr;
asf_object_data_t *p_data;
/* could be NULL if !b_seekable or not-present */
asf_object_index_t *p_index;
/* from asf_object_header_t */
asf_object_file_properties_t *p_fp;
} asf_object_root_t;
/****************************************************************************
* asf_object_t: union of all objects.
****************************************************************************/
typedef union asf_object_u typedef union asf_object_u
{ {
asf_object_common_t common; asf_object_common_t common;
...@@ -354,35 +364,16 @@ typedef union asf_object_u ...@@ -354,35 +364,16 @@ typedef union asf_object_u
} asf_object_t; } asf_object_t;
off_t ASF_TellAbsolute( input_thread_t *p_input );
int ASF_SeekAbsolute( input_thread_t *p_input, off_t i_pos); void ASF_GetGUID ( guid_t *p_guid, uint8_t *p_data );
int ASF_ReadData( input_thread_t *p_input, uint8_t *p_buff, int i_size ); int ASF_CmpGUID ( const guid_t *p_guid1, const guid_t *p_guid2 );
int ASF_SkipBytes( input_thread_t *p_input, int i_count );
asf_object_root_t *ASF_ReadObjectRoot( stream_t *, int b_seekable );
void ASF_GetGUID( guid_t *p_guid, uint8_t *p_data ); void ASF_FreeObjectRoot ( stream_t *, asf_object_root_t *p_root );
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 );
int ASF_NextObject( input_thread_t *p_input,
asf_object_t *p_obj );
int ASF_GotoObject( input_thread_t *p_input,
asf_object_t *p_obj );
int ASF_ReadObject( input_thread_t *p_input,
asf_object_t *p_obj,
asf_object_t *p_father );
void ASF_FreeObject( input_thread_t *p_input,
asf_object_t *p_obj );
int ASF_ReadObjectRoot( input_thread_t *p_input,
asf_object_root_t *p_root,
int b_seekable );
void ASF_FreeObjectRoot( input_thread_t *p_input,
asf_object_root_t *p_root );
#define ASF_CountObject( a, b ) __ASF_CountObject( (asf_object_t*)(a), b ) #define ASF_CountObject( a, b ) __ASF_CountObject( (asf_object_t*)(a), b )
int __ASF_CountObject( asf_object_t *p_obj, const guid_t *p_guid ); int __ASF_CountObject ( asf_object_t *p_obj, const guid_t *p_guid );
#define ASF_FindObject( a, b, c ) __ASF_FindObject( (asf_object_t*)(a), b, c ) #define ASF_FindObject( a, b, c ) __ASF_FindObject( (asf_object_t*)(a), b, c )
void *__ASF_FindObject( asf_object_t *p_obj, const guid_t *p_guid, int i_number ); void *__ASF_FindObject ( asf_object_t *p_obj, const guid_t *p_guid, int i_number );
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