/*****************************************************************************
* asf.h: MMS access plug-in
*****************************************************************************
- * Copyright (C) 2001, 2002 VideoLAN
- * $Id: asf.h,v 1.2 2002/11/13 20:28:13 fenrir Exp $
+ * Copyright (C) 2001-2004 the VideoLAN team
+ * $Id$
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
* 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
*
* 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.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
/****************************************************************************
* XXX:
* Definitions and data duplicated from asf demuxers but I want access
- * and demux plugins to be independant
+ * and demux plugins to be independent
*
****************************************************************************/
-typedef struct guid_s
-{
- u32 v1; /* le */
- u16 v2; /* le */
- u16 v3; /* le */
- u8 v4[8];
-} guid_t;
+#ifndef _ASF_H_
+#define _ASF_H_ 1
-static inline int CmpGuid( const guid_t *p_guid1, const guid_t *p_guid2 )
+#define ASF_STREAM_VIDEO 0x0001
+#define ASF_STREAM_AUDIO 0x0002
+#define ASF_STREAM_UNKNOWN 0xffff
+
+typedef struct
{
- 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 );
-}
-
-static inline void GenerateGuid( guid_t *p_guid )
+ int i_cat; /* ASF_STREAM_VIDEO, ASF_STREAM_AUDIO */
+ int i_bitrate; /* -1 if unknown */
+ int i_selected;
+} asf_stream_t;
+
+typedef struct
{
- int i;
-
- srand( mdate() & 0xffffffff );
-
- /* FIXME should be generated using random data */
- p_guid->v1 = 0xbabac001;
- p_guid->v2 = ( (u64)rand() << 16 ) / RAND_MAX;
- p_guid->v3 = ( (u64)rand() << 16 ) / RAND_MAX;
- for( i = 0; i < 8; i++ )
- {
- p_guid->v4[i] = ( (u64)rand() * 256 ) / RAND_MAX;
- }
-}
+ int64_t i_file_size;
+ int64_t i_data_packets_count;
+ int32_t i_min_data_packet_size;
+
+ asf_stream_t stream[128];
+
+} 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 );
+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 ) \
{ 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,
{ 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