From 19c98153b45cbf299cd47d69b0a2e93bb3973fc9 Mon Sep 17 00:00:00 2001 From: Laurent Aimar Date: Sun, 16 Nov 2008 12:37:52 +0100 Subject: [PATCH] Privatized ES_OUT_SET_ACTIVE/MODE and removed ES_OUT_GET_ACTIVE/MODE/GROUP. --- include/vlc_es_out.h | 10 -------- src/input/es_out.c | 18 -------------- src/input/es_out.h | 9 ++++++- src/input/es_out_timeshift.c | 46 ++++++++++++------------------------ 4 files changed, 23 insertions(+), 60 deletions(-) diff --git a/include/vlc_es_out.h b/include/vlc_es_out.h index 676a595134..e13c9ca4c1 100644 --- a/include/vlc_es_out.h +++ b/include/vlc_es_out.h @@ -44,15 +44,6 @@ enum es_out_mode_e enum es_out_query_e { - /* activate application of mode */ - ES_OUT_SET_ACTIVE, /* arg1= bool */ - /* see if mode is currently aplied or not */ - ES_OUT_GET_ACTIVE, /* arg1= bool* */ - - /* set/get mode */ - ES_OUT_SET_MODE, /* arg1= int */ - ES_OUT_GET_MODE, /* arg2= int* */ - /* set ES selected for the es category (audio/video/spu) */ ES_OUT_SET_ES, /* arg1= es_out_id_t* */ ES_OUT_RESTART_ES, /* arg1= es_out_id_t* */ @@ -66,7 +57,6 @@ enum es_out_query_e /* */ ES_OUT_SET_GROUP, /* arg1= int */ - ES_OUT_GET_GROUP, /* arg1= int* */ /* PCR handling, DTS/PTS will be automatically computed using thoses PCR * XXX: SET_PCR(_GROUP) are in charge of the pace control. They will wait diff --git a/src/input/es_out.c b/src/input/es_out.c index bdc49fef92..b7ad6d8ba5 100644 --- a/src/input/es_out.c +++ b/src/input/es_out.c @@ -2001,11 +2001,6 @@ static int EsOutControlLocked( es_out_t *out, int i_query, va_list args ) return VLC_SUCCESS; } - case ES_OUT_GET_ACTIVE: - pb = (bool*) va_arg( args, bool * ); - *pb = p_sys->b_active; - return VLC_SUCCESS; - case ES_OUT_SET_MODE: i = (int) va_arg( args, int ); if( i == ES_OUT_MODE_NONE || i == ES_OUT_MODE_ALL || @@ -2030,11 +2025,6 @@ static int EsOutControlLocked( es_out_t *out, int i_query, va_list args ) } return VLC_EGENERIC; - case ES_OUT_GET_MODE: - pi = (int*) va_arg( args, int* ); - *pi = p_sys->i_mode; - return VLC_SUCCESS; - case ES_OUT_SET_ES: case ES_OUT_RESTART_ES: { @@ -2186,14 +2176,6 @@ static int EsOutControlLocked( es_out_t *out, int i_query, va_list args ) } return VLC_EGENERIC; - case ES_OUT_GET_GROUP: - pi = (int*) va_arg( args, int* ); - if( p_sys->p_pgrm ) - *pi = p_sys->p_pgrm->i_id; - else - *pi = -1; /* FIXME */ - return VLC_SUCCESS; - case ES_OUT_SET_GROUP: { int j; diff --git a/src/input/es_out.h b/src/input/es_out.h index 84812c1d3b..580e92331d 100644 --- a/src/input/es_out.h +++ b/src/input/es_out.h @@ -33,8 +33,15 @@ enum es_out_query_private_e { + + /* activate application of mode */ + ES_OUT_SET_ACTIVE = ES_OUT_PRIVATE_START, /* arg1= bool */ + + /* set/get mode */ + ES_OUT_SET_MODE, /* arg1= int */ + /* Get date to wait before demuxing more data */ - ES_OUT_GET_WAKE_UP = ES_OUT_PRIVATE_START, /* arg1=mtime_t* res=cannot fail */ + ES_OUT_GET_WAKE_UP, /* arg1=mtime_t* res=cannot fail */ /* Wrapper for some ES command to work with id */ ES_OUT_SET_ES_BY_ID, diff --git a/src/input/es_out_timeshift.c b/src/input/es_out_timeshift.c index 40d24d228a..7d3aff311e 100644 --- a/src/input/es_out_timeshift.c +++ b/src/input/es_out_timeshift.c @@ -83,9 +83,7 @@ typedef struct int i_query; bool b_bool; - bool *pb_bool; int i_int; - int *pi_int; int64_t i_i64; vlc_meta_t *p_meta; vlc_epg_t *p_epg; @@ -506,11 +504,8 @@ static int ControlLocked( es_out_t *p_out, int i_query, va_list args ) /* Pass-through control */ case ES_OUT_SET_ACTIVE: - case ES_OUT_GET_ACTIVE: case ES_OUT_SET_MODE: - case ES_OUT_GET_MODE: case ES_OUT_SET_GROUP: - case ES_OUT_GET_GROUP: case ES_OUT_SET_PCR: case ES_OUT_SET_GROUP_PCR: case ES_OUT_RESET_PCR: @@ -522,7 +517,6 @@ static int ControlLocked( es_out_t *p_out, int i_query, va_list args ) case ES_OUT_RESTART_ES: case ES_OUT_SET_ES_DEFAULT: case ES_OUT_SET_ES_STATE: - case ES_OUT_GET_ES_STATE: case ES_OUT_SET_ES_FMT: { ts_cmd_t cmd; @@ -536,7 +530,21 @@ static int ControlLocked( es_out_t *p_out, int i_query, va_list args ) return CmdExecuteControl( p_sys->p_out, &cmd ); } - /* Special control */ + /* Special control when delayed */ + case ES_OUT_GET_ES_STATE: + { + es_out_id_t *p_es = (es_out_id_t*)va_arg( args, es_out_id_t * ); + bool *pb_enabled = (bool*)va_arg( args, bool* ); + + if( p_sys->b_delayed ) + { + *pb_enabled = true; + return VLC_SUCCESS; + } + return es_out_Control( p_sys->p_out, ES_OUT_GET_ES_STATE, p_es, pb_enabled ); + } + + /* Special internal input control */ case ES_OUT_GET_EMPTY: { bool *pb_empty = (bool*)va_arg( args, bool* ); @@ -983,21 +991,12 @@ static int CmdInitControl( ts_cmd_t *p_cmd, int i_query, va_list args, bool b_co p_cmd->control.b_bool = (bool)va_arg( args, int ); break; - case ES_OUT_GET_ACTIVE: /* arg1= bool* */ - p_cmd->control.pb_bool = (bool*)va_arg( args, bool * ); - break; - case ES_OUT_SET_MODE: /* arg1= int */ case ES_OUT_SET_GROUP: /* arg1= int */ case ES_OUT_DEL_GROUP: /* arg1=int i_group */ p_cmd->control.i_int = (int)va_arg( args, int ); break; - case ES_OUT_GET_MODE: /* arg2= int* */ - case ES_OUT_GET_GROUP: /* arg1= int* */ - p_cmd->control.pi_int = (int*)va_arg( args, int * ); - break; - case ES_OUT_SET_PCR: /* arg1=int64_t i_pcr(microsecond!) (using default group 0)*/ case ES_OUT_SET_NEXT_DISPLAY_TIME: /* arg1=int64_t i_pts(microsecond) */ p_cmd->control.i_i64 = (int64_t)va_arg( args, int64_t ); @@ -1071,11 +1070,6 @@ static int CmdInitControl( ts_cmd_t *p_cmd, int i_query, va_list args, bool b_co p_cmd->control.b_bool = (bool)va_arg( args, int ); break; - case ES_OUT_GET_ES_STATE:/* arg1= es_out_id_t* arg2=bool* */ - p_cmd->control.p_es = (es_out_id_t*)va_arg( args, es_out_id_t * ); - p_cmd->control.pb_bool = (bool*)va_arg( args, bool * ); - break; - case ES_OUT_SET_ES_FMT: /* arg1= es_out_id_t* arg2=es_format_t* */ { p_cmd->control.p_es = (es_out_id_t*)va_arg( args, es_out_id_t * ); @@ -1112,18 +1106,11 @@ static int CmdExecuteControl( es_out_t *p_out, ts_cmd_t *p_cmd ) case ES_OUT_SET_ACTIVE: /* arg1= bool */ return es_out_Control( p_out, i_query, p_cmd->control.b_bool ); - case ES_OUT_GET_ACTIVE: /* arg1= bool* */ - return es_out_Control( p_out, i_query, p_cmd->control.pb_bool ); - case ES_OUT_SET_MODE: /* arg1= int */ case ES_OUT_SET_GROUP: /* arg1= int */ case ES_OUT_DEL_GROUP: /* arg1=int i_group */ return es_out_Control( p_out, i_query, p_cmd->control.i_int ); - case ES_OUT_GET_MODE: /* arg2= int* */ - case ES_OUT_GET_GROUP: /* arg1= int* */ - return es_out_Control( p_out, i_query, p_cmd->control.pi_int ); - case ES_OUT_SET_PCR: /* arg1=int64_t i_pcr(microsecond!) (using default group 0)*/ case ES_OUT_SET_NEXT_DISPLAY_TIME: /* arg1=int64_t i_pts(microsecond) */ return es_out_Control( p_out, i_query, p_cmd->control.i_i64 ); @@ -1149,9 +1136,6 @@ static int CmdExecuteControl( es_out_t *p_out, ts_cmd_t *p_cmd ) case ES_OUT_SET_ES_STATE:/* arg1= es_out_id_t* arg2=bool */ return es_out_Control( p_out, i_query, p_cmd->control.p_es->p_es, p_cmd->control.b_bool ); - case ES_OUT_GET_ES_STATE:/* arg1= es_out_id_t* arg2=bool* */ - return es_out_Control( p_out, i_query, p_cmd->control.p_es->p_es, p_cmd->control.pb_bool ); - case ES_OUT_SET_ES_FMT: /* arg1= es_out_id_t* arg2=es_format_t* */ return es_out_Control( p_out, i_query, p_cmd->control.p_es->p_es, p_cmd->control.p_fmt ); -- 2.39.2