]> git.sesse.net Git - vlc/commitdiff
input/stream: remove STREAM_CONTROL_ACCESS and simplify
authorRémi Denis-Courmont <remi@remlab.net>
Sun, 25 Aug 2013 10:04:39 +0000 (13:04 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Sun, 25 Aug 2013 10:09:21 +0000 (13:09 +0300)
include/vlc_stream.h
modules/access/zip/zipstream.c
modules/demux/asf/asf.c
modules/demux/ts.c
src/input/stream.c
src/input/stream_demux.c
src/input/stream_memory.c

index f77a843dc28d2731404f1d8d2dafc71c095bbea6..50a42c38093858ffc8f263d9b0d3aeb9b00ebd65 100644 (file)
@@ -99,11 +99,6 @@ enum stream_query_e
 
     STREAM_GET_SIZE,            /**< arg1= uint64_t *     res=cannot fail (0 if no sense)*/
 
-    /* Special for direct access control from demuxer.
-     * XXX: avoid using it by all means */
-    STREAM_CONTROL_ACCESS,  /* arg1= int i_access_query, args   res: can fail
-                             if access unreachable or access control answer */
-
     /* You should update size of source if any and then update size 
      * FIXME find a way to avoid it */
     STREAM_UPDATE_SIZE,
@@ -120,6 +115,10 @@ enum stream_query_e
 
     /* XXX only data read through stream_Read/Block will be recorded */
     STREAM_SET_RECORD_STATE,     /**< arg1=bool, arg2=const char *psz_ext (if arg1 is true)  res=can fail */
+
+    STREAM_SET_PRIVATE_ID_STATE = 0x1000, /* arg1= int i_private_data, bool b_selected    res=can fail */
+    STREAM_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 */
+    STREAM_GET_PRIVATE_ID_STATE,          /* arg1=int i_private_data arg2=bool *          res=can fail */
 };
 
 VLC_API int stream_Read( stream_t *s, void *p_read, int i_read );
index 27919251b69d0a1f8d0efd3b247ab85968561ad8..b27fe008120cc856d4869eebacdbd3b195115726 100644 (file)
@@ -322,7 +322,6 @@ static int Control( stream_t *s, int i_query, va_list args )
             return VLC_EGENERIC;
 
         case STREAM_UPDATE_SIZE:
-        case STREAM_CONTROL_ACCESS:
         case STREAM_CAN_SEEK:
         case STREAM_CAN_FASTSEEK:
         case STREAM_SET_RECORD_STATE:
index 05bb108662ec8efdd23033598a61fba21b339119..cbf8b431f2c66d61a778cd39bc11e7943e7c900a 100644 (file)
@@ -789,7 +789,7 @@ static int DemuxInit( demux_t *p_demux )
         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,
+        if( !stream_Control( p_demux->s, STREAM_GET_PRIVATE_ID_STATE,
                              p_sp->i_stream_number, &b_access_selected ) &&
             !b_access_selected )
         {
index a9bc15d22ca928f015474653d6c7f5790a775efb..4c279f720a5a6b47bb616d61e6985530398641db 100644 (file)
@@ -1359,8 +1359,8 @@ static int SetPIDFilter( demux_t *p_demux, int i_pid, bool b_selected )
     if( !p_sys->b_access_control )
         return VLC_EGENERIC;
 
-    return stream_Control( p_demux->s, STREAM_CONTROL_ACCESS,
-                           ACCESS_SET_PRIVATE_ID_STATE, i_pid, b_selected );
+    return stream_Control( p_demux->s, STREAM_SET_PRIVATE_ID_STATE,
+                           i_pid, b_selected );
 }
 
 static void SetPrgFilter( demux_t *p_demux, int i_prg_id, bool b_selected )
@@ -4181,8 +4181,8 @@ static void PMTCallBack( void *data, dvbpsi_pmt_t *p_pmt )
 
     /* Set CAM descrambling */
     if( !ProgramIsSelected( p_demux, prg->i_number )
-     || stream_Control( p_demux->s, STREAM_CONTROL_ACCESS,
-                        ACCESS_SET_PRIVATE_ID_CA, p_pmt ) != VLC_SUCCESS )
+     || stream_Control( p_demux->s, STREAM_SET_PRIVATE_ID_CA,
+                        p_pmt ) != VLC_SUCCESS )
         dvbpsi_DeletePMT( p_pmt );
 
     for( int i = 0; i < i_clean; i++ )
index 15b02df91569ea4d4cc04ff25f4ec3cec286cc87..9236f056c82e890e9987eb1cbcd81d5bcc1d9c40 100644 (file)
@@ -561,6 +561,9 @@ static int AStreamControl( stream_t *s, int i_query, va_list args )
     static_control_match(SET_PAUSE_STATE);
     static_control_match(SET_TITLE);
     static_control_match(SET_SEEKPOINT);
+    static_control_match(SET_PRIVATE_ID_STATE);
+    static_control_match(SET_PRIVATE_ID_CA);
+    static_control_match(GET_PRIVATE_ID_STATE);
 
     switch( i_query )
     {
@@ -573,6 +576,9 @@ static int AStreamControl( stream_t *s, int i_query, va_list args )
         case STREAM_GET_CONTENT_TYPE:
         case STREAM_GET_SIGNAL:
         case STREAM_SET_PAUSE_STATE:
+        case STREAM_SET_PRIVATE_ID_STATE:
+        case STREAM_SET_PRIVATE_ID_CA:
+        case STREAM_GET_PRIVATE_ID_STATE:
             return access_vaControl( p_access, i_query, args );
 
         case STREAM_GET_SIZE:
@@ -609,20 +615,6 @@ static int AStreamControl( stream_t *s, int i_query, va_list args )
             }
         }
 
-        case STREAM_CONTROL_ACCESS:
-        {
-            int i_int = (int) va_arg( args, int );
-            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 !!!" );
-                return VLC_EGENERIC;
-            }
-            return access_vaControl( p_access, i_int, args );
-        }
-
         case STREAM_UPDATE_SIZE:
             AStreamControlUpdate( s );
             return VLC_SUCCESS;
index 01d251c83950047237756942da8e6ea39b89895e..fbfa2d0a3a64caac4f0d93514cc9ecba0a7d09c5 100644 (file)
@@ -296,7 +296,6 @@ static int DStreamControl( stream_t *s, int i_query, va_list args )
             return VLC_SUCCESS;
         }
 
-        case STREAM_CONTROL_ACCESS:
         case STREAM_GET_TITLE_INFO:
         case STREAM_GET_META:
         case STREAM_GET_CONTENT_TYPE:
@@ -305,6 +304,9 @@ static int DStreamControl( stream_t *s, int i_query, va_list args )
         case STREAM_SET_TITLE:
         case STREAM_SET_SEEKPOINT:
         case STREAM_SET_RECORD_STATE:
+        case STREAM_SET_PRIVATE_ID_STATE:
+        case STREAM_SET_PRIVATE_ID_CA:
+        case STREAM_GET_PRIVATE_ID_STATE:
             return VLC_EGENERIC;
 
         default:
index 87b7f1bb6863ae87b3e13c7e4dda24f636897d56..daefe302e4f1b5cce07c87fb84ed4d35b0868234 100644 (file)
@@ -133,9 +133,11 @@ static int Control( stream_t *s, int i_query, va_list args )
         case STREAM_SET_PAUSE_STATE:
             break; /* nothing to do */
 
-        case STREAM_CONTROL_ACCESS:
-            msg_Err( s, "Hey, what are you thinking ?"
-                     "DON'T USE STREAM_CONTROL_ACCESS !!!" );
+        case STREAM_SET_PRIVATE_ID_STATE:
+        case STREAM_SET_PRIVATE_ID_CA:
+        case STREAM_GET_PRIVATE_ID_STATE:
+            msg_Err( s, "Hey, what are you thinking? "
+                     "DO NOT USE PRIVATE STREAM CONTROLS!!!" );
             return VLC_EGENERIC;
 
         default: