Commit 0e3098c5 authored by Laurent Aimar's avatar Laurent Aimar

Added input "teletext-es" variable to ease teletext support from

interface.
(This variable will contain the id of spu-es that is teletext or -1 if
not present)
parent ee1da751
...@@ -422,6 +422,7 @@ static void EsOutESVarUpdateGeneric( es_out_t *out, int i_id, es_format_t *fmt, ...@@ -422,6 +422,7 @@ static void EsOutESVarUpdateGeneric( es_out_t *out, int i_id, es_format_t *fmt,
{ {
es_out_sys_t *p_sys = out->p_sys; es_out_sys_t *p_sys = out->p_sys;
input_thread_t *p_input = p_sys->p_input; input_thread_t *p_input = p_sys->p_input;
const bool b_teletext = fmt->i_cat == SPU_ES && fmt->i_codec == VLC_FOURCC( 't', 'e', 'l', 'x' );
vlc_value_t val, text; vlc_value_t val, text;
const char *psz_var; const char *psz_var;
...@@ -437,8 +438,12 @@ static void EsOutESVarUpdateGeneric( es_out_t *out, int i_id, es_format_t *fmt, ...@@ -437,8 +438,12 @@ static void EsOutESVarUpdateGeneric( es_out_t *out, int i_id, es_format_t *fmt,
if( b_delete ) if( b_delete )
{ {
if( b_teletext )
var_SetInteger( p_sys->p_input, "teletext-es", -1 );
val.i_int = i_id; val.i_int = i_id;
var_Change( p_input, psz_var, VLC_VAR_DELCHOICE, &val, NULL ); var_Change( p_input, psz_var, VLC_VAR_DELCHOICE, &val, NULL );
var_SetBool( p_sys->p_input, "intf-change", true ); var_SetBool( p_sys->p_input, "intf-change", true );
return; return;
} }
...@@ -490,6 +495,9 @@ static void EsOutESVarUpdateGeneric( es_out_t *out, int i_id, es_format_t *fmt, ...@@ -490,6 +495,9 @@ static void EsOutESVarUpdateGeneric( es_out_t *out, int i_id, es_format_t *fmt,
free( text.psz_string ); free( text.psz_string );
if( b_teletext )
var_SetInteger( p_sys->p_input, "teletext-es", i_id );
var_SetBool( p_sys->p_input, "intf-change", true ); var_SetBool( p_sys->p_input, "intf-change", true );
} }
...@@ -550,6 +558,7 @@ static void EsOutProgramSelect( es_out_t *out, es_out_pgrm_t *p_pgrm ) ...@@ -550,6 +558,7 @@ static void EsOutProgramSelect( es_out_t *out, es_out_pgrm_t *p_pgrm )
var_Change( p_input, "audio-es", VLC_VAR_CLEARCHOICES, NULL, NULL ); var_Change( p_input, "audio-es", VLC_VAR_CLEARCHOICES, NULL, NULL );
var_Change( p_input, "video-es", VLC_VAR_CLEARCHOICES, NULL, NULL ); var_Change( p_input, "video-es", VLC_VAR_CLEARCHOICES, NULL, NULL );
var_Change( p_input, "spu-es", VLC_VAR_CLEARCHOICES, NULL, NULL ); var_Change( p_input, "spu-es", VLC_VAR_CLEARCHOICES, NULL, NULL );
var_SetInteger( p_input, "teletext-es", -1 );
for( i = 0; i < p_sys->i_es; i++ ) for( i = 0; i < p_sys->i_es; i++ )
{ {
if( p_sys->es[i]->p_pgrm == p_sys->p_pgrm ) if( p_sys->es[i]->p_pgrm == p_sys->p_pgrm )
......
...@@ -112,6 +112,7 @@ static void AppendAttachment( int *pi_attachment, input_attachment_t ***ppp_atta ...@@ -112,6 +112,7 @@ static void AppendAttachment( int *pi_attachment, input_attachment_t ***ppp_atta
* - seekable (if you can seek, it doesn't say if 'bar display' has be shown * - seekable (if you can seek, it doesn't say if 'bar display' has be shown
* or not, for that check position != 0.0) * or not, for that check position != 0.0)
* - can-pause * - can-pause
* - teletext-es to get the index of spu track that is teletext --1 if no teletext)
* * For intf callback upon changes * * For intf callback upon changes
* - intf-change * - intf-change
* - rate-change for when playback rate changes * - rate-change for when playback rate changes
......
...@@ -462,6 +462,8 @@ void input_ConfigVarInit ( input_thread_t *p_input ) ...@@ -462,6 +462,8 @@ void input_ConfigVarInit ( input_thread_t *p_input )
var_Create( p_input, "can-pause", VLC_VAR_BOOL ); var_Create( p_input, "can-pause", VLC_VAR_BOOL );
val.b_bool = true; /* Fixed later*/ val.b_bool = true; /* Fixed later*/
var_Change( p_input, "can-pause", VLC_VAR_SETVALUE, &val, NULL ); var_Change( p_input, "can-pause", VLC_VAR_SETVALUE, &val, NULL );
var_Create( p_input, "teletext-es", VLC_VAR_INTEGER );
var_SetInteger( p_input, "teletext-es", -1 );
/* */ /* */
var_Create( p_input, "access-filter", VLC_VAR_STRING | VLC_VAR_DOINHERIT ); var_Create( p_input, "access-filter", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
......
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