[vlc-devel] [PATCH 1/2] lib: add libvlc_video_set_osd to enable/disable the OSD

Mark Lee mark.lee at capricasoftware.co.uk
Thu Feb 19 10:39:29 CET 2015


The OSD is now disabled by default in a LibVLC application, this API
provides a way to enable it again if an application needs it.
---
 NEWS                              |  2 ++
 include/vlc/libvlc_media_player.h | 11 +++++++++++
 lib/libvlc.sym                    |  1 +
 lib/media_player.c                |  2 ++
 lib/video.c                       |  5 +++++
 5 files changed, 21 insertions(+)

diff --git a/NEWS b/NEWS
index 3b6f5ec..7b09dcb 100644
--- a/NEWS
+++ b/NEWS
@@ -95,6 +95,8 @@ libVLC:
  * Add libvlc_media_parse_with_options that uses a flag to specify parse options
  * Add libvlc_audio_output_device_get to get the currently selected audio output device
    identifier (if there is one available)
+ * Add libvlc_video_set_osd to control whether or not the OSD (now disabled by default
+   for a libVLC application) is enabled
 
 Logging
  * Support for the SystemD Journal
diff --git a/include/vlc/libvlc_media_player.h b/include/vlc/libvlc_media_player.h
index 3f9441c..25e5b3b 100644
--- a/include/vlc/libvlc_media_player.h
+++ b/include/vlc/libvlc_media_player.h
@@ -1383,6 +1383,17 @@ LIBVLC_API float libvlc_video_get_adjust_float( libvlc_media_player_t *p_mi,
 LIBVLC_API void libvlc_video_set_adjust_float( libvlc_media_player_t *p_mi,
                                                    unsigned option, float value );
 
+/**
+ * Enable the OSD.
+ *
+ * In a LibVLC application, the OSD is disabled by default.
+ *
+ * \param p_mi libvlc media player instance
+ * \param enable true to enable the OSD, false to disable it
+ * \version LibVLC 3.0.0 and later
+ */
+LIBVLC_API void libvlc_video_set_osd( libvlc_media_player_t *p_mi, bool enable );
+
 /** @} video */
 
 /** \defgroup libvlc_audio LibVLC audio controls
diff --git a/lib/libvlc.sym b/lib/libvlc.sym
index 4fd2378..6460ea3 100644
--- a/lib/libvlc.sym
+++ b/lib/libvlc.sym
@@ -242,6 +242,7 @@ libvlc_video_set_logo_string
 libvlc_video_set_marquee_int
 libvlc_video_set_marquee_string
 libvlc_video_set_mouse_input
+libvlc_video_set_osd
 libvlc_video_set_scale
 libvlc_video_set_spu
 libvlc_video_set_spu_delay
diff --git a/lib/media_player.c b/lib/media_player.c
index b41d6f3..09e3d6e 100644
--- a/lib/media_player.c
+++ b/lib/media_player.c
@@ -556,6 +556,8 @@ libvlc_media_player_new( libvlc_instance_t *instance )
     var_Create (mp, "saturation", VLC_VAR_FLOAT | VLC_VAR_DOINHERIT);
     var_Create (mp, "gamma", VLC_VAR_FLOAT | VLC_VAR_DOINHERIT);
 
+    var_Create (mp, "osd", VLC_VAR_BOOL);
+
      /* Audio */
     var_Create (mp, "aout", VLC_VAR_STRING | VLC_VAR_DOINHERIT);
     var_Create (mp, "mute", VLC_VAR_BOOL);
diff --git a/lib/video.c b/lib/video.c
index 4abe36e..84dd7e70 100644
--- a/lib/video.c
+++ b/lib/video.c
@@ -908,3 +908,8 @@ float libvlc_video_get_adjust_float( libvlc_media_player_t *p_mi,
 {
     return get_float( p_mi, "adjust", adjust_option_bynumber(option) );
 }
+
+void libvlc_video_set_osd( libvlc_media_player_t *p_mi, bool enable )
+{
+    var_SetBool (p_mi, "osd", enable);
+}
-- 
2.1.0




More information about the vlc-devel mailing list