[vlc-devel] commit: Added input "teletext-es" variable to ease teletext support from ( Laurent Aimar )

git version control git at videolan.org
Sun Jul 13 17:06:39 CEST 2008


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Sun Jul 13 17:04:17 2008 +0200| [0e3098c5e6e58e2c6861c461a1842f7718771c4d]

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)

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0e3098c5e6e58e2c6861c461a1842f7718771c4d
---

 src/input/es_out.c |    9 +++++++++
 src/input/input.c  |    1 +
 src/input/var.c    |    2 ++
 3 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/src/input/es_out.c b/src/input/es_out.c
index f25f545..24bd6ba 100644
--- a/src/input/es_out.c
+++ b/src/input/es_out.c
@@ -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;
     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;
 
     const char *psz_var;
@@ -437,8 +438,12 @@ static void EsOutESVarUpdateGeneric( es_out_t *out, int i_id, es_format_t *fmt,
 
     if( b_delete )
     {
+        if( b_teletext )
+            var_SetInteger( p_sys->p_input, "teletext-es", -1 );
+
         val.i_int = i_id;
         var_Change( p_input, psz_var, VLC_VAR_DELCHOICE, &val, NULL );
+
         var_SetBool( p_sys->p_input, "intf-change", true );
         return;
     }
@@ -490,6 +495,9 @@ static void EsOutESVarUpdateGeneric( es_out_t *out, int i_id, es_format_t *fmt,
 
     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 );
 }
 
@@ -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, "video-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++ )
     {
         if( p_sys->es[i]->p_pgrm == p_sys->p_pgrm )
diff --git a/src/input/input.c b/src/input/input.c
index d23cd4f..7ce4c94 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -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
  *    or not, for that check position != 0.0)
  *  - can-pause
+ *  - teletext-es to get the index of spu track that is teletext --1 if no teletext)
  * * For intf callback upon changes
  *  - intf-change
  *  - rate-change for when playback rate changes
diff --git a/src/input/var.c b/src/input/var.c
index afdc1c6..1dbba72 100644
--- a/src/input/var.c
+++ b/src/input/var.c
@@ -462,6 +462,8 @@ void input_ConfigVarInit ( input_thread_t *p_input )
     var_Create( p_input, "can-pause", VLC_VAR_BOOL );
     val.b_bool = true; /* Fixed later*/
     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 );




More information about the vlc-devel mailing list