[vlc-commits] es_out: add ES_OUT_SET_GROUP_EPG_EVENT
Francois Cartegnie
git at videolan.org
Tue Dec 20 21:42:46 CET 2016
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon Dec 19 14:24:15 2016 +0100| [520ac5b0b181dbba8a02663ef286d06813ec4042] | committer: Francois 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.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=520ac5b0b181dbba8a02663ef286d06813ec4042
---
include/vlc_es_out.h | 3 ++-
src/input/es_out.c | 25 +++++++++++++++++++++++++
src/input/es_out_timeshift.c | 32 ++++++++++++++++++++++++++++++++
3 files changed, 59 insertions(+), 1 deletion(-)
diff --git a/include/vlc_es_out.h b/include/vlc_es_out.h
index c524013..4f7b77a 100644
--- a/include/vlc_es_out.h
+++ b/include/vlc_es_out.h
@@ -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 */
diff --git a/src/input/es_out.c b/src/input/es_out.c
index 5007124..10e9627 100644
--- a/src/input/es_out.c
+++ b/src/input/es_out.c
@@ -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:
{
diff --git a/src/input/es_out_timeshift.c b/src/input/es_out_timeshift.c
index 5992c44..0c4a7d9 100644
--- a/src/input/es_out_timeshift.c
+++ b/src/input/es_out_timeshift.c
@@ -114,6 +114,11 @@ typedef struct attribute_packed
} 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;
} es_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 )
{
More information about the vlc-commits
mailing list