]> git.sesse.net Git - vlc/blobdiff - src/control/video.c
Don't include config.h from the headers - refs #297.
[vlc] / src / control / video.c
index 28f4228c298e6556454a234eb0631985d2f5fbbc..e9aea7ac0c574d20898122ffd6fe7fcee8a3f8af 100644 (file)
@@ -3,7 +3,7 @@
  *****************************************************************************
  * Copyright (C) 2005 the VideoLAN team
  *
- * $Id: core.c 14187 2006-02-07 16:37:40Z courmisch $
+ * $Id$
  *
  * Authors: Cl�ent Stenac <zorglub@videolan.org>
  *          Filippo Carone <littlejohn@videolan.org>
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
+#include "libvlc_internal.h"
+
 #include <vlc/libvlc.h>
 #include <vlc_input.h>
 #include <vlc_vout.h>
 
-#include "libvlc_internal.h"
-
 /*
  * Remember to release the returned vout_thread_t since it is locked at
  * the end of this function.
@@ -527,6 +527,31 @@ void libvlc_video_set_teletext( libvlc_media_instance_t *p_mi, int i_page,
     vlc_object_release( p_vout );
 }
 
+void libvlc_toggle_teletext( libvlc_media_instance_t *p_mi,
+                             libvlc_exception_t *p_e )
+{
+    /* We only work on the first vout */
+    vout_thread_t *p_vout = GetVout( p_mi, p_e );
+    vlc_value_t val; int i_ret;
+
+    /* GetVout will raise the exception for us */
+    if( !p_vout )
+        return;
+
+    i_ret = var_Get( p_vout, "vbi-opaque", &val );
+    if( i_ret )
+        libvlc_exception_raise( p_e,
+                        "Unexpected error while looking up teletext value" );
+
+    val.b_bool = !val.b_bool;
+    i_ret = var_Set( p_vout, "vbi-opaque", val );
+    if( i_ret )
+        libvlc_exception_raise( p_e,
+                        "Unexpected error while setting teletext value" );
+
+    vlc_object_release( p_vout );
+}
+
 int libvlc_video_destroy( libvlc_media_instance_t *p_mi,
                           libvlc_exception_t *p_e )
 {