[vlc-devel] [PATCH 5/7] vout_intf: add menu options for 3d output

Mohammed (Shaan) Huzaifa Danish shaan3 at gmail.com
Thu Jul 13 11:11:26 CEST 2017


From: Mohammed Danish <shaan3 at gmail.com>

New options:
Auto-detect, Stereo, Left Only, Right Only
---
 modules/gui/qt/menus.cpp     |  4 ++++
 src/video_output/vout_intf.c | 23 +++++++++++++++++++++++
 2 files changed, 27 insertions(+)

diff --git a/modules/gui/qt/menus.cpp b/modules/gui/qt/menus.cpp
index 6395a0a068..baae734690 100644
--- a/modules/gui/qt/menus.cpp
+++ b/modules/gui/qt/menus.cpp
@@ -241,6 +241,7 @@ static int VideoAutoMenuBuilder( playlist_t *pl, input_thread_t *p_input,
     PUSH_PLVAR( "video-on-top" );
     PUSH_PLVAR( "video-wallpaper" );
     PUSH_VAR( "video-snapshot" );
+    PUSH_VAR( "video-stereo-mode" );
     PUSH_VAR( "zoom" );
     PUSH_VAR( "autoscale" );
     PUSH_VAR( "aspect-ratio" );
@@ -671,6 +672,9 @@ QMenu *VLCMenuBar::VideoMenu( intf_thread_t *p_intf, QMenu *current )
         current->addMenu( rendererMenu );
 
         current->addSeparator();
+        addActionWithSubmenu( current, "video-stereo-mode", qtr( "&3D Output" ) );
+
+        current->addSeparator();
         /* Surface modifiers */
         addActionWithCheckbox( current, "fullscreen", qtr( "&Fullscreen" ) );
         addActionWithCheckbox( current, "autoscale", qtr( "Always Fit &Window" ) );
diff --git a/src/video_output/vout_intf.c b/src/video_output/vout_intf.c
index 631099c3ee..03de0f0b25 100644
--- a/src/video_output/vout_intf.c
+++ b/src/video_output/vout_intf.c
@@ -81,6 +81,17 @@ static int ViewpointCallback( vlc_object_t *, char const *,
  *****************************************************************************/
 static const struct
 {
+    int i_value;
+    char psz_label[12];
+} p_3D_output_format_values[] = {
+    { VIDEO_STEREO_OUTPUT_AUTO, N_("Auto-detect") },
+    { VIDEO_STEREO_OUTPUT_STEREO, N_("Stereo") },
+    { VIDEO_STEREO_OUTPUT_LEFT_ONLY, N_("Left Only") },
+    { VIDEO_STEREO_OUTPUT_RIGHT_ONLY, N_("Right Only") },
+};
+
+static const struct
+{
     double f_value;
     char psz_label[13];
 } p_zoom_values[] = {
@@ -185,6 +196,18 @@ void vout_IntfInit( vout_thread_t *p_vout )
 
     var_AddCallback( p_vout, "zoom", ZoomCallback, NULL );
 
+    var_Create( p_vout, "video-stereo-mode", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
+
+    text.psz_string = _("video-stereo-output");
+    var_Change( p_vout, "video-stereo-mode", VLC_VAR_SETTEXT, &text, NULL );
+
+    for( size_t i = 0; i < ARRAY_SIZE(p_3D_output_format_values); i++ )
+    {
+        val.i_int = p_3D_output_format_values[i].i_value;
+        text.psz_string = vlc_gettext( p_3D_output_format_values[i].psz_label );
+        var_Change( p_vout, "video-stereo-mode", VLC_VAR_ADDCHOICE, &val, &text );
+    }
+
     /* Crop offset vars */
     var_Create( p_vout, "crop-left", VLC_VAR_INTEGER | VLC_VAR_ISCOMMAND );
     var_Create( p_vout, "crop-top", VLC_VAR_INTEGER | VLC_VAR_ISCOMMAND );
-- 
2.12.2.windows.2



More information about the vlc-devel mailing list