Commit 14106cb1 authored by Laurent Aimar's avatar Laurent Aimar

* vlc_meta.h: added a few const

 * es_out: added ES_OUT_SET_GROUP_META to add on the fly meta for a program
 (it's not yet really clean).
 * demux/ts: parse SI tables of DVB (channel names + events), it needs last
 libdvbpsi svn (set TS_USE_DVB_SI to 1 in modules/demux/ts.c to use it).
parent 652b8fc0
......@@ -78,6 +78,8 @@ enum es_out_query_e
/* Allow preroll of data (data with dts/pts < i_pts for one ES will be decoded but not displayed */
ES_OUT_SET_NEXT_DISPLAY_TIME, /* arg1=es_out_id_t* arg2=int64_t i_pts(microsecond) */
/* Set meta data for group (dynamic) */
ES_OUT_SET_GROUP_META, /* arg1=int i_group arg2=vlc_meta_t */
};
struct es_out_t
......
......@@ -108,7 +108,8 @@ static inline void vlc_meta_Delete( vlc_meta_t *m )
free( m );
}
static inline void vlc_meta_Add( vlc_meta_t *m, char *name, char *value )
static inline void vlc_meta_Add( vlc_meta_t *m,
const char *name, const char *value )
{
m->name = (char**)realloc( m->name, sizeof(char*) * ( m->i_meta + 1 ) );
m->name[m->i_meta] = strdup( name );
......@@ -156,7 +157,7 @@ static inline void vlc_meta_Merge( vlc_meta_t *dst, vlc_meta_t *src )
}
}
static inline char *vlc_meta_GetValue( vlc_meta_t *m, char *name )
static inline char *vlc_meta_GetValue( vlc_meta_t *m, const char *name )
{
int i;
......
This diff is collapsed.
......@@ -479,6 +479,28 @@ static es_out_pgrm_t *EsOutProgramAdd( es_out_t *out, int i_group )
return p_pgrm;
}
/* EsOutProgramMeta:
*/
static void EsOutProgramMeta( es_out_t *out, int i_group, vlc_meta_t *p_meta )
{
es_out_sys_t *p_sys = out->p_sys;
input_thread_t *p_input = p_sys->p_input;
char *psz_cat = malloc( strlen(_("Program")) + 10 );
int i;
msg_Dbg( p_input, "EsOutProgramMeta: number=%d", i_group );
sprintf( psz_cat, "%s %d", _("Program"), i_group );
for( i = 0; i < p_meta->i_meta; i++ )
{
msg_Dbg( p_input, " - %s = %s", p_meta->name[i], p_meta->value[i] );
input_Control( p_input, INPUT_ADD_INFO, psz_cat,
_(p_meta->name[i]), "%s", p_meta->value[i] );
}
free( psz_cat );
}
/* EsOutAdd:
* Add an es_out
*/
......@@ -1211,6 +1233,14 @@ static int EsOutControl( es_out_t *out, int i_query, va_list args )
return VLC_SUCCESS;
}
case ES_OUT_SET_GROUP_META:
{
int i_group = (int)va_arg( args, int );
vlc_meta_t *p_meta = (vlc_meta_t*)va_arg( args, vlc_meta_t * );
EsOutProgramMeta( out, i_group, p_meta );
return VLC_SUCCESS;
}
default:
msg_Err( p_sys->p_input, "unknown query in es_out_Control" );
......
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