]> git.sesse.net Git - vlc/blobdiff - modules/access/mms/asf.h
Added RGBA and YUVA support (it will enhance subtitle scaling).
[vlc] / modules / access / mms / asf.h
index a90788b8675578c02cbcc3f5b7c325d96cc83a81..049328c9244b34f783f7d986ad69b63180a7f526 100644 (file)
@@ -1,8 +1,8 @@
 /*****************************************************************************
  * asf.h: MMS access plug-in
  *****************************************************************************
- * Copyright (C) 2001, 2002 VideoLAN
- * $Id: asf.h,v 1.4 2003/03/02 18:17:58 fenrir Exp $
+ * Copyright (C) 2001-2004 the VideoLAN team
+ * $Id$
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
  *
  * 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
  *
  ****************************************************************************/
 
+#ifndef _ASF_H_
+#define _ASF_H_ 1
+
+#define ASF_STREAM_VIDEO    0x0001
+#define ASF_STREAM_AUDIO    0x0002
+#define ASF_STREAM_UNKNOWN  0xffff
+
+typedef struct
+{
+    int i_cat;      /* ASF_STREAM_VIDEO, ASF_STREAM_AUDIO */
+    int i_bitrate;  /* -1 if unknown */
+    int i_selected;
+} asf_stream_t;
+
+typedef struct
+{
+    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 */
@@ -36,36 +60,12 @@ typedef struct guid_s
     uint8_t  v4[8];
 } guid_t;
 
-static inline int CmpGuid( const guid_t *p_guid1, const guid_t *p_guid2 )
-{
-    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 void GenerateGuid( guid_t *p_guid )
-{
-    int i;
-
-    srand( mdate() & 0xffffffff );
 
-    /* FIXME should be generated using random data */
-    p_guid->v1 = 0xbabac001;
-    p_guid->v2 = ( (uint64_t)rand() << 16 ) / RAND_MAX;
-    p_guid->v3 = ( (uint64_t)rand() << 16 ) / RAND_MAX;
-    for( i = 0; i < 8; i++ )
-    {
-        p_guid->v4[i] = ( (uint64_t)rand() * 256 ) / RAND_MAX;
-    }
-}
+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 )  \
@@ -131,4 +131,20 @@ static const guid_t asf_object_bitrate_mutual_exclusion_guid =
     { 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