[vlc-commits] [Git][videolan/vlc][master] 2 commits: vout_intf: fix missing local "fit" variable to hook the callback

Steve Lhomme (@robUx4) gitlab at videolan.org
Fri Jul 26 06:00:49 UTC 2024



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
86993d0d by Steve Lhomme at 2024-07-26T05:46:40+00:00
vout_intf: fix missing local "fit" variable to hook the callback

Since dfdc613df56e011e427d1361e2ac15e7c2fb17a5

- - - - -
7f413298 by Steve Lhomme at 2024-07-26T05:46:40+00:00
qt: add a menu to change the fit mode

- - - - -


5 changed files:

- modules/gui/qt/menus/menus.cpp
- modules/gui/qt/player/player_controller.cpp
- modules/gui/qt/player/player_controller.hpp
- modules/gui/qt/player/player_controller_p.hpp
- src/video_output/vout_intf.c


Changes:

=====================================
modules/gui/qt/menus/menus.cpp
=====================================
@@ -470,6 +470,7 @@ void VLCMenuBar::VideoMenu( qt_intf_t *p_intf, QMenu *current )
         current->addMenu( new CheckableListMenu(qtr( "&Zoom" ), THEMIM->getZoom(), CheckableListMenu::GROUPED_EXLUSIVE, current) );
         current->addMenu( new CheckableListMenu(qtr( "&Aspect Ratio" ), THEMIM->getAspectRatio(), CheckableListMenu::GROUPED_EXLUSIVE, current) );
         current->addMenu( new CheckableListMenu(qtr( "&Crop" ), THEMIM->getCrop(), CheckableListMenu::GROUPED_EXLUSIVE, current) );
+        current->addMenu( new CheckableListMenu(qtr( "&Fit" ), THEMIM->getFit(), CheckableListMenu::GROUPED_EXLUSIVE, current) );
 
         current->addSeparator();
         /* Rendering modifiers */


=====================================
modules/gui/qt/player/player_controller.cpp
=====================================
@@ -218,6 +218,7 @@ void PlayerControllerPrivate::UpdateVouts(vout_thread_t **vouts, size_t i_vouts)
     m_zoom.resetObject( main_vout );
     m_aspectRatio.resetObject( main_vout );
     m_crop.resetObject(  main_vout );
+    m_fit.resetObject(  main_vout );
     m_deinterlace.resetObject( main_vout );
     m_deinterlaceMode.resetObject( main_vout );
     m_autoscale.resetObject( main_vout );
@@ -1089,6 +1090,7 @@ PlayerControllerPrivate::PlayerControllerPrivate(PlayerController *playercontrol
     , m_zoom((vout_thread_t*)nullptr, "zoom")
     , m_aspectRatio((vout_thread_t*)nullptr, "aspect-ratio")
     , m_crop((vout_thread_t*)nullptr, "crop")
+    , m_fit((vout_thread_t*)nullptr, "fit")
     , m_deinterlace((vout_thread_t*)nullptr, "deinterlace")
     , m_deinterlaceMode((vout_thread_t*)nullptr, "deinterlace-mode")
     , m_autoscale((vout_thread_t*)nullptr, "autoscale")
@@ -2048,6 +2050,7 @@ QABSTRACTLIST_GETTER( ProgramListModel, getPrograms, m_programList)
 QABSTRACTLIST_GETTER( VLCVarChoiceModel, getZoom, m_zoom)
 QABSTRACTLIST_GETTER( VLCVarChoiceModel, getAspectRatio, m_aspectRatio)
 QABSTRACTLIST_GETTER( VLCVarChoiceModel, getCrop, m_crop)
+QABSTRACTLIST_GETTER( VLCVarChoiceModel, getFit, m_fit)
 QABSTRACTLIST_GETTER( VLCVarChoiceModel, getDeinterlace, m_deinterlace)
 QABSTRACTLIST_GETTER( VLCVarChoiceModel, getDeinterlaceMode, m_deinterlaceMode)
 QABSTRACTLIST_GETTER( VLCVarChoiceModel, getAudioStereoMode, m_audioStereoMode)


=====================================
modules/gui/qt/player/player_controller.hpp
=====================================
@@ -169,6 +169,7 @@ public:
     Q_PROPERTY(VLCVarChoiceModel* zoom READ getZoom CONSTANT FINAL)
     Q_PROPERTY(VLCVarChoiceModel* aspectRatio READ getAspectRatio CONSTANT FINAL)
     Q_PROPERTY(VLCVarChoiceModel* crop READ getCrop CONSTANT FINAL)
+    Q_PROPERTY(VLCVarChoiceModel* fit READ getFit CONSTANT FINAL)
     Q_PROPERTY(VLCVarChoiceModel* deinterlace READ getDeinterlace CONSTANT FINAL)
     Q_PROPERTY(VLCVarChoiceModel* deinterlaceMode READ getDeinterlaceMode CONSTANT FINAL)
     Q_PROPERTY(bool fullscreen READ isFullscreen WRITE setFullscreen NOTIFY fullscreenChanged FINAL)
@@ -348,6 +349,7 @@ public slots:
     VLCVarChoiceModel* getZoom();
     VLCVarChoiceModel* getAspectRatio();
     VLCVarChoiceModel* getCrop();
+    VLCVarChoiceModel* getFit();
     VLCVarChoiceModel* getDeinterlace();
     VLCVarChoiceModel* getDeinterlaceMode();
     bool isFullscreen() const;


=====================================
modules/gui/qt/player/player_controller_p.hpp
=====================================
@@ -138,6 +138,7 @@ public:
     VLCVarChoiceModel m_zoom;
     VLCVarChoiceModel m_aspectRatio;
     VLCVarChoiceModel m_crop;
+    VLCVarChoiceModel m_fit;
     VLCVarChoiceModel m_deinterlace;
     VLCVarChoiceModel m_deinterlaceMode;
     QVLCBool m_autoscale;


=====================================
src/video_output/vout_intf.c
=====================================
@@ -131,6 +131,18 @@ static const struct
     { "5:4", "5:4" },
 };
 
+static const struct
+{
+    enum vlc_video_fitting fit;
+    char psz_label[15];
+} p_fit_values[] = {
+    { VLC_VIDEO_FIT_NONE,    N_("None") },
+    { VLC_VIDEO_FIT_SMALLER, N_("Inside Window") },
+    { VLC_VIDEO_FIT_LARGER,  N_("Outside Window") },
+    { VLC_VIDEO_FIT_WIDTH,   N_("Window Width") },
+    { VLC_VIDEO_FIT_HEIGHT,  N_("Window Height") },
+};
+
 static void AddCustomRatios( vout_thread_t *p_vout, const char *psz_var,
                              char *psz_list )
 {
@@ -248,6 +260,18 @@ void vout_CreateVars( vout_thread_t *p_vout )
         free( psz_buf );
     }
 
+    /* display fit */
+    var_Create( p_vout, "fit", VLC_VAR_INTEGER | VLC_VAR_ISCOMMAND |
+                VLC_VAR_DOINHERIT );
+    var_Change( p_vout, "fit", VLC_VAR_SETTEXT, _("Fit Mode") );
+
+    for( size_t i = 0; i < ARRAY_SIZE(p_fit_values); i++ )
+    {
+        val.i_int = p_fit_values[i].fit;
+        var_Change( p_vout, "fit", VLC_VAR_ADDCHOICE, val,
+                    p_fit_values[i].psz_label );
+    }
+
     /* Add a variable to indicate if the window should be on top of others */
     var_Create( p_vout, "video-on-top", VLC_VAR_BOOL | VLC_VAR_DOINHERIT
                 | VLC_VAR_ISCOMMAND );



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/309aecb876573d8240daab5d585d5efeaea1dc48...7f41329811c2173f53d9152aa0032d92779ee575

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/309aecb876573d8240daab5d585d5efeaea1dc48...7f41329811c2173f53d9152aa0032d92779ee575
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list