Commit 520ac5b0 authored by François Cartegnie's avatar François Cartegnie 🤞

es_out: add ES_OUT_SET_GROUP_EPG_EVENT

We need finer updates for EPG events than full EPG tables
updates. Will allow dropping epg merging on SET_GROUP_EPG
as the epg tables are segmented and only use it for full
updates / version change.
parent 94f0635d
......@@ -70,7 +70,8 @@ enum es_out_query_e
/* Set meta data for group (dynamic) (The vlc_meta_t is not modified nor released) */
ES_OUT_SET_GROUP_META, /* arg1=int i_group arg2=const vlc_meta_t */
/* Set epg for group (dynamic) (The vlc_epg_t is not modified nor released) */
ES_OUT_SET_GROUP_EPG, /* arg1=int i_group arg2=const vlc_epg_t */
ES_OUT_SET_GROUP_EPG, /* arg1=int i_group arg2=const vlc_epg_t * */
ES_OUT_SET_GROUP_EPG_EVENT, /* arg1=int i_group arg2=const vlc_epg_event_t * */
/* */
ES_OUT_DEL_GROUP, /* arg1=int i_group */
......
......@@ -1317,6 +1317,23 @@ static void EsOutProgramMeta( es_out_t *out, int i_group, const vlc_meta_t *p_me
input_Control( p_input, INPUT_MERGE_INFOS, p_cat );
}
static void EsOutProgramEpgEvent( es_out_t *out, int i_group, const vlc_epg_event_t *p_event )
{
es_out_sys_t *p_sys = out->p_sys;
input_thread_t *p_input = p_sys->p_input;
input_item_t *p_item = input_priv(p_input)->p_item;
es_out_pgrm_t *p_pgrm;
/* Find program */
if( !EsOutIsProgramVisible( out, i_group ) )
return;
p_pgrm = EsOutProgramFind( out, i_group );
if( !p_pgrm )
return;
input_item_SetEpgEvent( p_item, p_event );
}
static void EsOutProgramEpg( es_out_t *out, int i_group, const vlc_epg_t *p_epg )
{
es_out_sys_t *p_sys = out->p_sys;
......@@ -2465,6 +2482,14 @@ static int EsOutControlLocked( es_out_t *out, int i_query, va_list args )
EsOutProgramEpg( out, i_group, p_epg );
return VLC_SUCCESS;
}
case ES_OUT_SET_GROUP_EPG_EVENT:
{
int i_group = (int)va_arg( args, int );
const vlc_epg_event_t *p_evt = va_arg( args, const vlc_epg_event_t * );
EsOutProgramEpgEvent( out, i_group, p_evt );
return VLC_SUCCESS;
}
case ES_OUT_DEL_GROUP:
{
......
......@@ -113,6 +113,11 @@ typedef struct attribute_packed
vlc_epg_t *p_epg;
} int_epg;
struct
{
int i_int;
vlc_epg_event_t *p_evt;
} int_epg_evt;
struct
{
es_out_id_t *p_es;
bool b_bool;
......@@ -632,6 +637,7 @@ static int ControlLocked( es_out_t *p_out, int i_query, va_list args )
case ES_OUT_SET_NEXT_DISPLAY_TIME:
case ES_OUT_SET_GROUP_META:
case ES_OUT_SET_GROUP_EPG:
case ES_OUT_SET_GROUP_EPG_EVENT:
case ES_OUT_SET_ES_SCRAMBLED_STATE:
case ES_OUT_DEL_GROUP:
case ES_OUT_SET_META:
......@@ -1443,6 +1449,24 @@ static int CmdInitControl( ts_cmd_t *p_cmd, int i_query, va_list args, bool b_co
}
break;
}
case ES_OUT_SET_GROUP_EPG_EVENT: /* arg1=int i_group arg2=const vlc_epg_event_t* */
{
p_cmd->u.control.u.int_epg_evt.i_int = (int)va_arg( args, int );
const vlc_epg_event_t *p_evt = va_arg( args, const vlc_epg_event_t * );
if( b_copy )
{
p_cmd->u.control.u.int_epg_evt.p_evt = vlc_epg_event_Duplicate( p_evt );
if( !p_cmd->u.control.u.int_epg_evt.p_evt )
return VLC_EGENERIC;
}
else
{
/* The cast is only needed to avoid warning */
p_cmd->u.control.u.int_epg_evt.p_evt = (vlc_epg_event_t*)p_evt;
}
break;
}
/* Modified control */
case ES_OUT_SET_ES: /* arg1= es_out_id_t* */
......@@ -1541,6 +1565,10 @@ static int CmdExecuteControl( es_out_t *p_out, ts_cmd_t *p_cmd )
return es_out_Control( p_out, i_query, p_cmd->u.control.u.int_epg.i_int,
p_cmd->u.control.u.int_epg.p_epg );
case ES_OUT_SET_GROUP_EPG_EVENT: /* arg1=int i_group arg2=const vlc_epg_event_t* */
return es_out_Control( p_out, i_query, p_cmd->u.control.u.int_epg_evt.i_int,
p_cmd->u.control.u.int_epg_evt.p_evt );
case ES_OUT_SET_ES_SCRAMBLED_STATE: /* arg1=int es_out_id_t* arg2=bool */
return es_out_Control( p_out, i_query, p_cmd->u.control.u.es_bool.p_es->p_es,
p_cmd->u.control.u.es_bool.b_bool );
......@@ -1594,6 +1622,10 @@ static void CmdCleanControl( ts_cmd_t *p_cmd )
if( p_cmd->u.control.u.int_epg.p_epg )
vlc_epg_Delete( p_cmd->u.control.u.int_epg.p_epg );
break;
case ES_OUT_SET_GROUP_EPG_EVENT:
if( p_cmd->u.control.u.int_epg_evt.p_evt )
vlc_epg_event_Delete( p_cmd->u.control.u.int_epg_evt.p_evt );
break;
case ES_OUT_SET_ES_FMT:
if( p_cmd->u.control.u.es_fmt.p_fmt )
{
......
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