Commit ddb88bf1 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

input/stream: remove STREAM_CONTROL_ACCESS and simplify

parent 86d3a929
...@@ -99,11 +99,6 @@ enum stream_query_e ...@@ -99,11 +99,6 @@ enum stream_query_e
STREAM_GET_SIZE, /**< arg1= uint64_t * res=cannot fail (0 if no sense)*/ 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 /* You should update size of source if any and then update size
* FIXME find a way to avoid it */ * FIXME find a way to avoid it */
STREAM_UPDATE_SIZE, STREAM_UPDATE_SIZE,
...@@ -120,6 +115,10 @@ enum stream_query_e ...@@ -120,6 +115,10 @@ enum stream_query_e
/* XXX only data read through stream_Read/Block will be recorded */ /* 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_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 ); VLC_API int stream_Read( stream_t *s, void *p_read, int i_read );
......
...@@ -322,7 +322,6 @@ static int Control( stream_t *s, int i_query, va_list args ) ...@@ -322,7 +322,6 @@ static int Control( stream_t *s, int i_query, va_list args )
return VLC_EGENERIC; return VLC_EGENERIC;
case STREAM_UPDATE_SIZE: case STREAM_UPDATE_SIZE:
case STREAM_CONTROL_ACCESS:
case STREAM_CAN_SEEK: case STREAM_CAN_SEEK:
case STREAM_CAN_FASTSEEK: case STREAM_CAN_FASTSEEK:
case STREAM_SET_RECORD_STATE: case STREAM_SET_RECORD_STATE:
......
...@@ -789,7 +789,7 @@ static int DemuxInit( demux_t *p_demux ) ...@@ -789,7 +789,7 @@ static int DemuxInit( demux_t *p_demux )
tk->p_frame = NULL; tk->p_frame = NULL;
/* Check (in case of mms) if this track is selected (ie will receive data) */ /* 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 ) && p_sp->i_stream_number, &b_access_selected ) &&
!b_access_selected ) !b_access_selected )
{ {
......
...@@ -1359,8 +1359,8 @@ static int SetPIDFilter( demux_t *p_demux, int i_pid, bool b_selected ) ...@@ -1359,8 +1359,8 @@ static int SetPIDFilter( demux_t *p_demux, int i_pid, bool b_selected )
if( !p_sys->b_access_control ) if( !p_sys->b_access_control )
return VLC_EGENERIC; return VLC_EGENERIC;
return stream_Control( p_demux->s, STREAM_CONTROL_ACCESS, return stream_Control( p_demux->s, STREAM_SET_PRIVATE_ID_STATE,
ACCESS_SET_PRIVATE_ID_STATE, i_pid, b_selected ); i_pid, b_selected );
} }
static void SetPrgFilter( demux_t *p_demux, int i_prg_id, bool 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 ) ...@@ -4181,8 +4181,8 @@ static void PMTCallBack( void *data, dvbpsi_pmt_t *p_pmt )
/* Set CAM descrambling */ /* Set CAM descrambling */
if( !ProgramIsSelected( p_demux, prg->i_number ) if( !ProgramIsSelected( p_demux, prg->i_number )
|| stream_Control( p_demux->s, STREAM_CONTROL_ACCESS, || stream_Control( p_demux->s, STREAM_SET_PRIVATE_ID_CA,
ACCESS_SET_PRIVATE_ID_CA, p_pmt ) != VLC_SUCCESS ) p_pmt ) != VLC_SUCCESS )
dvbpsi_DeletePMT( p_pmt ); dvbpsi_DeletePMT( p_pmt );
for( int i = 0; i < i_clean; i++ ) for( int i = 0; i < i_clean; i++ )
......
...@@ -561,6 +561,9 @@ static int AStreamControl( stream_t *s, int i_query, va_list args ) ...@@ -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_PAUSE_STATE);
static_control_match(SET_TITLE); static_control_match(SET_TITLE);
static_control_match(SET_SEEKPOINT); 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 ) switch( i_query )
{ {
...@@ -573,6 +576,9 @@ static int AStreamControl( stream_t *s, int i_query, va_list args ) ...@@ -573,6 +576,9 @@ static int AStreamControl( stream_t *s, int i_query, va_list args )
case STREAM_GET_CONTENT_TYPE: case STREAM_GET_CONTENT_TYPE:
case STREAM_GET_SIGNAL: case STREAM_GET_SIGNAL:
case STREAM_SET_PAUSE_STATE: 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 ); return access_vaControl( p_access, i_query, args );
case STREAM_GET_SIZE: case STREAM_GET_SIZE:
...@@ -609,20 +615,6 @@ static int AStreamControl( stream_t *s, int i_query, va_list args ) ...@@ -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: case STREAM_UPDATE_SIZE:
AStreamControlUpdate( s ); AStreamControlUpdate( s );
return VLC_SUCCESS; return VLC_SUCCESS;
......
...@@ -296,7 +296,6 @@ static int DStreamControl( stream_t *s, int i_query, va_list args ) ...@@ -296,7 +296,6 @@ static int DStreamControl( stream_t *s, int i_query, va_list args )
return VLC_SUCCESS; return VLC_SUCCESS;
} }
case STREAM_CONTROL_ACCESS:
case STREAM_GET_TITLE_INFO: case STREAM_GET_TITLE_INFO:
case STREAM_GET_META: case STREAM_GET_META:
case STREAM_GET_CONTENT_TYPE: case STREAM_GET_CONTENT_TYPE:
...@@ -305,6 +304,9 @@ static int DStreamControl( stream_t *s, int i_query, va_list args ) ...@@ -305,6 +304,9 @@ static int DStreamControl( stream_t *s, int i_query, va_list args )
case STREAM_SET_TITLE: case STREAM_SET_TITLE:
case STREAM_SET_SEEKPOINT: case STREAM_SET_SEEKPOINT:
case STREAM_SET_RECORD_STATE: 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; return VLC_EGENERIC;
default: default:
......
...@@ -133,9 +133,11 @@ static int Control( stream_t *s, int i_query, va_list args ) ...@@ -133,9 +133,11 @@ static int Control( stream_t *s, int i_query, va_list args )
case STREAM_SET_PAUSE_STATE: case STREAM_SET_PAUSE_STATE:
break; /* nothing to do */ break; /* nothing to do */
case STREAM_CONTROL_ACCESS: case STREAM_SET_PRIVATE_ID_STATE:
msg_Err( s, "Hey, what are you thinking ?" case STREAM_SET_PRIVATE_ID_CA:
"DON'T USE STREAM_CONTROL_ACCESS !!!" ); case STREAM_GET_PRIVATE_ID_STATE:
msg_Err( s, "Hey, what are you thinking? "
"DO NOT USE PRIVATE STREAM CONTROLS!!!" );
return VLC_EGENERIC; return VLC_EGENERIC;
default: default:
......
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