[vlc-devel] commit: Added INPUT_EVENT_TELETEXT. (Laurent Aimar )
git version control
git at videolan.org
Sun Nov 23 14:34:46 CET 2008
vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Sun Nov 23 14:29:50 2008 +0100| [aa31cdc3aba6f1c7c8217c0ef87f52fb5a494ab4] | committer: Laurent Aimar
Added INPUT_EVENT_TELETEXT.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=aa31cdc3aba6f1c7c8217c0ef87f52fb5a494ab4
---
include/vlc_input.h | 4 +++-
src/input/es_out.c | 8 ++++----
src/input/event.c | 10 ++++++++++
src/input/event.h | 3 +++
4 files changed, 20 insertions(+), 5 deletions(-)
diff --git a/include/vlc_input.h b/include/vlc_input.h
index 7386d78..9500b4c 100644
--- a/include/vlc_input.h
+++ b/include/vlc_input.h
@@ -442,7 +442,7 @@ struct input_thread_t
* - "can-rate"
* - "can-rewind"
* - "can-record" (if a stream can be recorded while playing)
- * - "teletext-es" to get the index of spu track that is teletext --1 if no teletext)
+ * - "teletext-es" to get the index of spu track that is teletext -1 if no teletext)
* - "signal-quality"
* - "signal-strength"
*
@@ -541,6 +541,8 @@ typedef enum input_event_type_e
INPUT_EVENT_PROGRAM,
/* A ES has been added or removed or selected */
INPUT_EVENT_ES,
+ /* "teletext-es" has changed */
+ INPUT_EVENT_TELETEXT,
/* "record" has changed */
INPUT_EVENT_RECORD,
diff --git a/src/input/es_out.c b/src/input/es_out.c
index 37e6035..8ac7abb 100644
--- a/src/input/es_out.c
+++ b/src/input/es_out.c
@@ -800,9 +800,9 @@ static void EsOutESVarUpdateGeneric( es_out_t *out, int i_id, es_format_t *fmt,
if( b_delete )
{
- /* TODO event */
+ /* TODO it should probably be a list */
if( b_teletext )
- var_SetInteger( p_sys->p_input, "teletext-es", -1 );
+ input_SendEventTeletext( p_sys->p_input, -1 );
input_SendEventEsDel( p_input, SPU_ES, i_id );
return;
@@ -860,9 +860,9 @@ static void EsOutESVarUpdateGeneric( es_out_t *out, int i_id, es_format_t *fmt,
if( b_teletext )
{
- /* TODO event */
+ /* TODO it should probably be a list */
if( var_GetInteger( p_sys->p_input, "teletext-es" ) < 0 )
- var_SetInteger( p_sys->p_input, "teletext-es", i_id );
+ input_SendEventTeletext( p_sys->p_input, i_id );
}
}
diff --git a/src/input/event.c b/src/input/event.c
index 4c4e3c9..8c9613b 100644
--- a/src/input/event.c
+++ b/src/input/event.c
@@ -288,6 +288,16 @@ void input_SendEventEsSelect( input_thread_t *p_input, int i_cat, int i_id )
vlc_event_send( &p_input->p->event_manager, &event );
}
+void input_SendEventTeletext( input_thread_t *p_input, int i_id )
+{
+ vlc_value_t val;
+
+ val.i_int = i_id;
+ var_Change( p_input, "teletext-es", VLC_VAR_SETVALUE, &val, NULL );
+
+ Trigger( p_input, INPUT_EVENT_TELETEXT );
+}
+
void input_SendEventVout( input_thread_t *p_input )
{
Trigger( p_input, INPUT_EVENT_VOUT );
diff --git a/src/input/event.h b/src/input/event.h
index e4ad966..541e598 100644
--- a/src/input/event.h
+++ b/src/input/event.h
@@ -63,10 +63,13 @@ void input_SendEventProgramAdd( input_thread_t *p_input,
int i_program, const char *psz_text );
void input_SendEventProgramDel( input_thread_t *p_input, int i_program );
void input_SendEventProgramSelect( input_thread_t *p_input, int i_program );
+
void input_SendEventEsDel( input_thread_t *p_input, int i_cat, int i_id );
void input_SendEventEsAdd( input_thread_t *p_input, int i_cat, int i_id, const char *psz_text );
void input_SendEventEsSelect( input_thread_t *p_input, int i_cat, int i_id ); /* i_id == -1 will unselect */
+void input_SendEventTeletext( input_thread_t *p_input, int i_id );
+
/*****************************************************************************
* Event for decoder.c
*****************************************************************************/
More information about the vlc-devel
mailing list