* all: better support for MBR mms stream (display only received streams).
authorLaurent Aimar <fenrir@videolan.org>
Tue, 8 Feb 2005 17:02:49 +0000 (17:02 +0000)
committerLaurent Aimar <fenrir@videolan.org>
Tue, 8 Feb 2005 17:02:49 +0000 (17:02 +0000)
include/vlc_access.h
modules/access/mms/mmsh.c
modules/access/mms/mmstu.c
modules/demux/asf/asf.c
src/input/stream.c

index 28495b4..97ae99e 100644 (file)
@@ -56,6 +56,7 @@ enum access_query_e
      * XXX: avoid to use it unless you can't */
     ACCESS_SET_PRIVATE_ID_STATE,    /* arg1= int i_private_data, vlc_bool_t b_selected can fail */
     ACCESS_SET_PRIVATE_ID_CA,    /* arg1= int i_program_number, uint16_t i_vpid, uint16_t i_apid1, uint16_t i_apid2, uint16_t i_apid3, uint8_t i_length, uint8_t *p_data */
+    ACCESS_GET_PRIVATE_ID_STATE,    /* arg1=int i_private_data arg2=vlc_bool_t *  res=can fail */
 };
 
 struct access_t
index a8fa8c1..46245b2 100644 (file)
@@ -167,6 +167,7 @@ static int Control( access_t *p_access, int i_query, va_list args )
     vlc_bool_t   *pb_bool;
     int          *pi_int;
     int64_t      *pi_64;
+    int          i_int;
 
     switch( i_query )
     {
@@ -193,6 +194,15 @@ static int Control( access_t *p_access, int i_query, va_list args )
             *pi_64 = (int64_t)var_GetInteger( p_access, "mms-caching" ) * I64C(1000);
             break;
 
+        case ACCESS_GET_PRIVATE_ID_STATE:
+            i_int = (int)va_arg( args, int );
+            pb_bool = (vlc_bool_t*)va_arg( args, vlc_bool_t );
+
+            if( i_int < 0 || i_int > 127 )
+                return VLC_EGENERIC;
+            *pb_bool =  p_sys->asfh.stream[i_int].i_selected ? VLC_TRUE : VLC_FALSE;
+            break;
+
         /* */
         case ACCESS_SET_PAUSE_STATE:
         case ACCESS_GET_TITLE_INFO:
index 107b752..d9d6ddd 100644 (file)
@@ -249,6 +249,7 @@ static int Control( access_t *p_access, int i_query, va_list args )
     vlc_bool_t   *pb_bool;
     int          *pi_int;
     int64_t      *pi_64;
+    int           i_int;
     vlc_value_t  val;
 
     switch( i_query )
@@ -277,6 +278,15 @@ static int Control( access_t *p_access, int i_query, va_list args )
             *pi_64 = (int64_t)var_GetInteger( p_access, "mms-caching" ) * I64C(1000);
             break;
 
+        case ACCESS_GET_PRIVATE_ID_STATE:
+            i_int = (int)va_arg( args, int );
+            pb_bool = (vlc_bool_t*)va_arg( args, vlc_bool_t );
+
+            if( i_int < 0 || i_int > 127 )
+                return VLC_EGENERIC;
+            *pb_bool =  p_sys->asfh.stream[i_int].i_selected ? VLC_TRUE : VLC_FALSE;
+            break;
+
         /* */
         case ACCESS_SET_PAUSE_STATE:
         case ACCESS_GET_TITLE_INFO:
@@ -285,6 +295,7 @@ static int Control( access_t *p_access, int i_query, va_list args )
         case ACCESS_SET_PRIVATE_ID_STATE:
             return VLC_EGENERIC;
 
+
         default:
             msg_Warn( p_access, "unimplemented query in control" );
             return VLC_EGENERIC;
index a7a73c8..9140227 100644 (file)
@@ -637,6 +637,7 @@ static int DemuxInit( demux_t *p_demux )
     {
         asf_track_t    *tk;
         asf_object_stream_properties_t *p_sp;
+        vlc_bool_t b_access_selected;
 
         p_sp = ASF_FindObject( p_sys->p_root->p_hdr,
                                &asf_object_stream_properties_guid,
@@ -650,6 +651,17 @@ static int DemuxInit( demux_t *p_demux )
         tk->p_es = NULL;
         tk->p_frame = NULL;
 
+        /* Check (in case of mms) if this track is selected (ie will receive data) */
+        if( !stream_Control( p_demux->s, STREAM_CONTROL_ACCESS, ACCESS_GET_PRIVATE_ID_STATE,
+                             p_sp->i_stream_number, &b_access_selected ) &&
+            !b_access_selected )
+        {
+            tk->i_cat = UNKNOWN_ES;
+            msg_Dbg( p_demux, "ignoring not selected stream(ID:%d) (by access)",
+                     p_sp->i_stream_number );
+            continue;
+        }
+
         if( ASF_CmpGUID( &p_sp->i_stream_type, &asf_object_stream_type_audio ) &&
             p_sp->i_type_specific_data_length >= sizeof( WAVEFORMATEX ) - 2 )
         {
index 17b967f..5afe400 100644 (file)
@@ -503,8 +503,9 @@ static int AStreamControl( stream_t *s, int i_query, va_list args )
 
         case STREAM_CONTROL_ACCESS:
             i_int = (int) va_arg( args, int );
-            if( i_int != ACCESS_SET_PRIVATE_ID_STATE
-                 && i_int != ACCESS_SET_PRIVATE_ID_CA )
+            if( i_int != ACCESS_SET_PRIVATE_ID_STATE &&
+                i_int != ACCESS_SET_PRIVATE_ID_CA &&
+                i_int != ACCESS_GET_PRIVATE_ID_STATE )
             {
                 msg_Err( s, "Hey, what are you thinking ?"
                             "DON'T USE STREAM_CONTROL_ACCESS !!!" );