Browse Source

input: add controls to select track via vlc_es_id_t

Internal for now, will be used by the future vlc_player_t.

Won't be pushed now since this patch can't be tested. It will be tested via the
future vlc_player_t testsuite.
pull/77/head
Thomas Guillem 8 years ago
parent
commit
b06dcd639b
  1. 20
      src/input/input.c
  2. 15
      src/input/input_internal.h

20
src/input/input.c

@ -1655,6 +1655,11 @@ static void ControlRelease( int i_type, const input_control_param_t *p_param )
if( p_param->val.p_address )
vlc_renderer_item_release( p_param->val.p_address );
break;
case INPUT_CONTROL_SET_ES:
case INPUT_CONTROL_UNSET_ES:
case INPUT_CONTROL_RESTART_ES:
vlc_es_id_Release( p_param->id );
break;
default:
break;
@ -2064,6 +2069,21 @@ static bool Control( input_thread_t *p_input,
ES_OUT_RESTART_ES_BY_ID, (int)param.val.i_int );
break;
case INPUT_CONTROL_SET_ES:
if( es_out_Control( input_priv(p_input)->p_es_out_display,
ES_OUT_SET_ES, param.id ) == VLC_SUCCESS )
demux_Control( input_priv(p_input)->master->p_demux, DEMUX_SET_ES,
vlc_es_id_GetInputId( param.id ) );
break;
case INPUT_CONTROL_UNSET_ES:
es_out_Control( input_priv(p_input)->p_es_out_display,
ES_OUT_UNSET_ES, param.id );
break;
case INPUT_CONTROL_RESTART_ES:
es_out_Control( input_priv(p_input)->p_es_out_display,
ES_OUT_RESTART_ES, param.id );
break;
case INPUT_CONTROL_SET_VIEWPOINT:
case INPUT_CONTROL_SET_INITIAL_VIEWPOINT:
case INPUT_CONTROL_UPDATE_VIEWPOINT:

15
src/input/input_internal.h

@ -82,6 +82,7 @@ typedef union
{
vlc_value_t val;
vlc_viewpoint_t viewpoint;
vlc_es_id_t *id;
struct {
bool b_fast_seek;
vlc_tick_t i_val;
@ -233,6 +234,10 @@ enum input_control_e
INPUT_CONTROL_SET_ES_BY_ID,
INPUT_CONTROL_RESTART_ES_BY_ID,
INPUT_CONTROL_SET_ES,
INPUT_CONTROL_UNSET_ES,
INPUT_CONTROL_RESTART_ES,
INPUT_CONTROL_SET_VIEWPOINT, // new absolute viewpoint
INPUT_CONTROL_SET_INITIAL_VIEWPOINT, // set initial viewpoint (generally from video)
INPUT_CONTROL_UPDATE_VIEWPOINT, // update viewpoint relative to current
@ -269,6 +274,16 @@ static inline void input_ControlPushHelper( input_thread_t *p_input, int i_type,
}
}
static inline void input_ControlPushEsHelper( input_thread_t *p_input, int i_type,
vlc_es_id_t *id )
{
assert( i_type == INPUT_CONTROL_SET_ES || i_type == INPUT_CONTROL_UNSET_ES ||
i_type == INPUT_CONTROL_RESTART_ES );
input_ControlPush( p_input, i_type, &(input_control_param_t) {
.id = vlc_es_id_Hold( id ),
} );
}
bool input_Stopped( input_thread_t * );
int input_GetAttachments(input_thread_t *input, input_attachment_t ***attachments);

Loading…
Cancel
Save