[vlc-commits] [Git][videolan/vlc][master] 8 commits: qt: rename PlaylistItemPtr to SharedPlaylistItem

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Sun Jul 23 18:17:27 UTC 2023



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
b75fd726 by Fatih Uzunoglu at 2023-07-23T17:59:16+00:00
qt: rename PlaylistItemPtr to SharedPlaylistItem

- - - - -
ebcb3f57 by Fatih Uzunoglu at 2023-07-23T17:59:16+00:00
qt: rename EsIdPtr to SharedEsId

- - - - -
e1ffd2cb by Fatih Uzunoglu at 2023-07-23T17:59:16+00:00
qt: rename TitleListPtr to SharedTitleList

- - - - -
20e03f02 by Fatih Uzunoglu at 2023-07-23T17:59:16+00:00
qt: rename VoutPtr to SharedVOutThread

- - - - -
b6f4f7bc by Fatih Uzunoglu at 2023-07-23T17:59:16+00:00
qt: rename VoutPtrList to VOutThreadList

- - - - -
7891fd65 by Fatih Uzunoglu at 2023-07-23T17:59:16+00:00
qt: rename AoutPtr to SharedAOut

- - - - -
e6bf52a1 by Fatih Uzunoglu at 2023-07-23T17:59:16+00:00
qt: use `using` instead of `typedef` for SharedVOutThread

- - - - -
4b9955aa by Fatih Uzunoglu at 2023-07-23T17:59:16+00:00
qt: use `using` instead of `typedef` for SharedAOut

- - - - -


5 changed files:

- modules/gui/qt/dialogs/extended/extended_panels.cpp
- modules/gui/qt/menus/menus.cpp
- modules/gui/qt/player/player_controller.cpp
- modules/gui/qt/player/player_controller.hpp
- modules/gui/qt/playlist/playlist_item.hpp


Changes:

=====================================
modules/gui/qt/dialogs/extended/extended_panels.cpp
=====================================
@@ -282,8 +282,8 @@ void ExtVideo::cropChange()
         ui.cropBotPx->setValue( ui.cropTopPx->value() );
     if( ui.leftRightCropSync->isChecked() )
         ui.cropRightPx->setValue( ui.cropLeftPx->value() );
-
-    PlayerController::VoutPtrList p_vouts = THEMIM->getVouts();
+    
+    PlayerController::VOutThreadList p_vouts = THEMIM->getVouts();
     for( auto p_vout: p_vouts )
     {
         var_SetInteger( p_vout.get(), "crop-top", ui.cropTopPx->value() );
@@ -866,7 +866,7 @@ void FilterSliderData::updateText( int i )
 
 float FilterSliderData::initialValue()
 {
-    PlayerController::AoutPtr p_aout = THEMIM->getAout();
+    SharedAOut p_aout = THEMIM->getAout();
     float f = p_data->f_value;
     if( p_aout )
     {
@@ -885,7 +885,7 @@ float FilterSliderData::initialValue()
 void FilterSliderData::onValueChanged( int i )
 {
     float f = ((float) i) * p_data->f_resolution;
-    PlayerController::AoutPtr p_aout = THEMIM->getAout();
+    SharedAOut p_aout = THEMIM->getAout();
     if ( p_aout )
     {
         var_SetFloat( p_aout.get(), qtu(p_data->name), f );
@@ -995,7 +995,7 @@ EqualizerSliderData::EqualizerSliderData( QObject *parent, qt_intf_t *_p_intf,
 
 QStringList EqualizerSliderData::getBandsFromAout() const
 {
-    PlayerController::AoutPtr p_aout = THEMIM->getAout();
+    SharedAOut p_aout = THEMIM->getAout();
     QStringList bands;
     if( p_aout )
     {
@@ -1056,7 +1056,7 @@ void EqualizerSliderData::onValueChanged( int i )
     {
         float f = ((float) i) * p_data->f_resolution;
         bands[ index ] = QLocale( QLocale::C ).toString( f );
-        PlayerController::AoutPtr p_aout = THEMIM->getAout();
+        SharedAOut p_aout = THEMIM->getAout();
         if ( p_aout )
         {
             var_SetString( p_aout.get(), qtu(p_data->name), qtu(bands.join( " " )) );
@@ -1185,7 +1185,7 @@ void Equalizer::build()
     connect( ui.presetsCombo, QOverload<int>::of(&QComboBox::activated), this, &Equalizer::setCorePreset );
 
     /* Set enable checkbox */
-    PlayerController::AoutPtr p_aout = THEMIM->getAout();
+    SharedAOut p_aout = THEMIM->getAout();
     char *psz_af;
     if( p_aout )
         psz_af = var_GetNonEmptyString( p_aout.get(), "audio-filter" );
@@ -1231,8 +1231,8 @@ void Equalizer::setCorePreset( int i_preset )
     for ( int i=0; i< qMin( eqz_preset_10b[i_preset].i_band,
                             sliderDatas.count() ) ; i++ )
         sliderDatas[i]->setValue( eqz_preset_10b[i_preset].f_amp[i] );
-
-    PlayerController::AoutPtr p_aout = THEMIM->getAout();
+    
+    SharedAOut p_aout = THEMIM->getAout();
     if( p_aout )
     {
         var_SetString( p_aout.get() , "equalizer-preset" , preset_list[i_preset] );
@@ -1243,7 +1243,7 @@ void Equalizer::setCorePreset( int i_preset )
 /* Function called when the set2Pass button is activated */
 void Equalizer::enable2Pass( bool b_enable )
 {
-    PlayerController::AoutPtr p_aout= THEMIM->getAout();
+    SharedAOut p_aout= THEMIM->getAout();
 
     if( p_aout )
     {
@@ -1601,7 +1601,7 @@ void SyncControls::subsdelayClean()
 
 void SyncControls::subsdelaySetFactor( double f_factor )
 {
-    PlayerController::VoutPtrList p_vouts = THEMIM->getVouts();
+    PlayerController::VOutThreadList p_vouts = THEMIM->getVouts();
     for( auto p_vout: p_vouts )
     {
         var_SetFloat( p_vout.get(), SUBSDELAY_CFG_FACTOR, f_factor );


=====================================
modules/gui/qt/menus/menus.cpp
=====================================
@@ -746,7 +746,7 @@ QMenu* VLCMenuBar::PopupMenu( qt_intf_t *p_intf, bool show )
     if( p_input )
     {
         QMenu *submenu;
-        PlayerController::VoutPtr p_vout = THEMIM->getVout();
+        SharedVOutThread p_vout = THEMIM->getVout();
 
         /* Add a fullscreen switch button, since it is the most used function */
         if( p_vout )
@@ -930,7 +930,7 @@ void VLCMenuBar::updateAudioDevice( qt_intf_t * p_intf, QMenu *current )
         return;
 
     current->clear();
-    PlayerController::AoutPtr aout = THEMIM->getAout();
+    SharedAOut aout = THEMIM->getAout();
     if (!aout)
         return;
 


=====================================
modules/gui/qt/player/player_controller.cpp
=====================================
@@ -44,13 +44,13 @@
 
 //PlayerController private implementation
 
-using EsIdPtr = vlc_shared_data_ptr_type(vlc_es_id_t,
-                                         vlc_es_id_Hold,
-                                         vlc_es_id_Release);
+using SharedEsId = vlc_shared_data_ptr_type(vlc_es_id_t,
+                                            vlc_es_id_Hold,
+                                            vlc_es_id_Release);
 
-using TitleListPtr = vlc_shared_data_ptr_type(vlc_player_title_list,
-                                              vlc_player_title_list_Hold,
-                                              vlc_player_title_list_Release);
+using SharedTitleList = vlc_shared_data_ptr_type(vlc_player_title_list,
+                                                 vlc_player_title_list_Hold,
+                                                 vlc_player_title_list_Release);
 
 PlayerControllerPrivate::~PlayerControllerPrivate()
 {
@@ -315,7 +315,7 @@ static void on_player_state_changed(vlc_player_t *, enum vlc_player_state state,
         case VLC_PLAYER_STATE_PLAYING:
         {
             msg_Dbg( that->p_intf, "on_player_state_changed VLC_PLAYER_STATE_PLAYING");
-            PlayerController::AoutPtr aout = q->getAout();
+            SharedAOut aout = q->getAout();
             that->m_audioStereoMode.resetObject( aout.get() );
             that->m_audioMixMode.resetObject( aout.get() );
             that->m_audioVisualization.resetObject( aout.get() );
@@ -479,8 +479,8 @@ static void on_player_track_selection_changed(vlc_player_t *, vlc_es_id_t * unse
     PlayerControllerPrivate* that = static_cast<PlayerControllerPrivate*>(data);
     msg_Dbg( that->p_intf, "on_player_track_selection_changed");
 
-    EsIdPtr unselectedPtr = EsIdPtr(unselected);
-    EsIdPtr selectedPtr = EsIdPtr(selected);
+    SharedEsId unselectedPtr = SharedEsId(unselected);
+    SharedEsId selectedPtr = SharedEsId(selected);
 
     that->callAsync([that,unselectedPtr,selectedPtr] () {
         if (unselectedPtr)
@@ -521,10 +521,10 @@ static void on_player_titles_changed(vlc_player_t *, struct vlc_player_title_lis
     PlayerControllerPrivate* that = static_cast<PlayerControllerPrivate*>(data);
     msg_Dbg( that->p_intf, "on_player_title_array_changed");
 
-    TitleListPtr titleListPtr = TitleListPtr(titles);
+    SharedTitleList sharedTitleList = SharedTitleList(titles);
 
-    that->callAsync([that,titleListPtr] (){
-        struct vlc_player_title_list *titles = titleListPtr.get();
+    that->callAsync([that,sharedTitleList] (){
+        struct vlc_player_title_list *titles = sharedTitleList.get();
         that->m_chapterList.resetTitle(nullptr);
         that->m_titleList.resetTitles(titles);
 
@@ -662,10 +662,10 @@ static void on_player_track_delay_changed(vlc_player_t *,
                                 void *data)
 {
     PlayerControllerPrivate* that = static_cast<PlayerControllerPrivate*>(data);
-    EsIdPtr esIdPtr = EsIdPtr(es_id);
+    SharedEsId sharedEsId = SharedEsId(es_id);
 
-    that->callAsync([that,esIdPtr,new_delay] (){
-        if (that->m_secondarySpuEsId == esIdPtr)
+    that->callAsync([that,sharedEsId,new_delay] (){
+        if (that->m_secondarySpuEsId == sharedEsId)
         {
             that->m_secondarySubtitleDelay = new_delay;
             emit that->q_func()->secondarySubtitleDelayChanged( new_delay );
@@ -812,9 +812,9 @@ static void on_player_vout_changed(vlc_player_t *player, enum vlc_player_vout_ac
         }
         case SPU_ES:
         {
-            EsIdPtr esIdPtr = EsIdPtr(es_id);
-            that->callAsync([that,esIdPtr,order] () {
-                that->UpdateSpuOrder(esIdPtr.get(), order);
+            SharedEsId sharedEsId = SharedEsId(es_id);
+            that->callAsync([that,sharedEsId,order] () {
+                that->UpdateSpuOrder(sharedEsId.get(), order);
             });
             break;
         }
@@ -830,12 +830,12 @@ static void on_player_vout_fullscreen_changed(vout_thread_t* vout, bool is_fulls
     PlayerControllerPrivate* that = static_cast<PlayerControllerPrivate*>(data);
     msg_Dbg( that->p_intf, "on_player_vout_fullscreen_changed %s", is_fullscreen ? "fullscreen" : "windowed");
 
-    PlayerController::VoutPtr voutPtr = PlayerController::VoutPtr(vout);
-    that->callAsync([that,voutPtr,is_fullscreen] () {
+    SharedVOutThread vOutThread(vout);
+    that->callAsync([that,vOutThread,is_fullscreen] () {
         PlayerController* q = that->q_func();
-        const PlayerController::VoutPtrList voutList = q->getVouts();
-        if (voutPtr == nullptr //property sets for all vout
-            || (voutList.size() == 1 && voutPtr.get() == voutList[0].get()) ) //on the only vout
+        const PlayerController::VOutThreadList voutList = q->getVouts();
+        if (vOutThread == nullptr //property sets for all vout
+            || (voutList.size() == 1 && vOutThread.get() == voutList[0].get()) ) //on the only vout
         {
             that->m_fullscreen = is_fullscreen;
             emit q->fullscreenChanged(is_fullscreen);
@@ -848,12 +848,12 @@ static void on_player_vout_wallpaper_mode_changed(vout_thread_t* vout, bool enab
     PlayerControllerPrivate* that = static_cast<PlayerControllerPrivate*>(data);
     msg_Dbg( that->p_intf, "on_player_vout_wallpaper_mode_changed %s", enabled ? "enabled" : "disabled");
 
-    PlayerController::VoutPtr voutPtr = PlayerController::VoutPtr(vout);
-    that->callAsync([that,voutPtr, enabled] () {
+    SharedVOutThread vOutThread(vout);
+    that->callAsync([that,vOutThread, enabled] () {
         PlayerController* q = that->q_func();
-        const PlayerController::VoutPtrList voutList = q->getVouts();
-        if (voutPtr == nullptr  //property sets for all vout
-            || (voutList.size() == 1 && voutPtr.get() == voutList[0].get()) ) //on the only vout
+        const PlayerController::VOutThreadList voutList = q->getVouts();
+        if (vOutThread == nullptr  //property sets for all vout
+            || (voutList.size() == 1 && vOutThread.get() == voutList[0].get()) ) //on the only vout
         {
             that->m_wallpaperMode = enabled;
             emit q->wallpaperModeChanged(enabled);
@@ -1521,41 +1521,41 @@ void PlayerController::setTeletextTransparency( bool transparent )
 
 //VOUT PROPERTIES
 
-PlayerController::VoutPtrList PlayerController::getVouts() const
+PlayerController::VOutThreadList PlayerController::getVouts() const
 {
     Q_D(const PlayerController);
     vout_thread_t **pp_vout;
-    VoutPtrList VoutList;
+    VOutThreadList VoutList;
     size_t i_vout;
     {
         vlc_player_locker lock{ d->m_player };
         if( !vlc_player_IsStarted( d->m_player ) )
-            return VoutPtrList{};
+            return VOutThreadList{};
         i_vout = 0;
         pp_vout = vlc_player_vout_HoldAll( d->m_player, &i_vout );
         if ( i_vout <= 0 )
-            return VoutPtrList{};
+            return VOutThreadList{};
     }
     VoutList.reserve( i_vout );
     for( size_t i = 0; i < i_vout; i++ )
     {
         assert( pp_vout[i] );
         //pass ownership
-        VoutList.append(VoutPtr(pp_vout[i], false));
+        VoutList.append(SharedVOutThread(pp_vout[i], false));
     }
     free( pp_vout );
 
     return VoutList;
 }
 
-PlayerController::VoutPtr PlayerController::getVout()
+SharedVOutThread PlayerController::getVout()
 {
     Q_D(PlayerController);
     vlc_player_locker lock{ d->m_player };
     vout_thread_t* vout = vlc_player_vout_Hold( d->m_player );
     if( vout == NULL )
-        return VoutPtr{};
-    return VoutPtr{vout, false};
+        return SharedVOutThread{};
+    return SharedVOutThread{vout, false};
 }
 
 void PlayerController::setFullscreen( bool new_val )
@@ -1593,11 +1593,11 @@ void PlayerController::setAutoscale( bool new_val )
 
 //AOUT PROPERTIES
 
-PlayerController::AoutPtr PlayerController::getAout()
+SharedAOut PlayerController::getAout()
 {
     Q_D(PlayerController);
     vlc_player_locker lock{ d->m_player };
-    return AoutPtr( vlc_player_aout_Hold( d->m_player ), false );
+    return SharedAOut( vlc_player_aout_Hold( d->m_player ), false );
 }
 
 void PlayerController::setVolume(float volume)
@@ -1645,7 +1645,7 @@ bool PlayerController::hasAudioVisualization() const
 
 void PlayerController::menusUpdateAudio( const QString& data )
 {
-    AoutPtr aout = getAout();
+    SharedAOut aout = getAout();
     if( aout )
         aout_DeviceSet( aout.get(), qtu(data) );
 }
@@ -1827,7 +1827,7 @@ void PlayerController::setRecording( bool recording )
 
 void PlayerController::snapshot()
 {
-    VoutPtr vout = getVout();
+    SharedVOutThread vout = getVout();
     if (vout)
     {
         /* Passing a lambda directly would require Qt 5.15:
@@ -1835,8 +1835,8 @@ void PlayerController::snapshot()
          */
         struct SnapshotTask : public QRunnable
         {
-            VoutPtr vout;
-            SnapshotTask(VoutPtr vout) : vout(std::move(vout)) {}
+            SharedVOutThread vout;
+            SnapshotTask(SharedVOutThread vout) : vout(std::move(vout)) {}
             void run() override
             {
                 var_TriggerCallback(vout.get(), "video-snapshot");


=====================================
modules/gui/qt/player/player_controller.hpp
=====================================
@@ -37,6 +37,9 @@
 
 using vlc_player_locker = vlc_locker<vlc_player_t, vlc_player_Lock, vlc_player_Unlock>;
 
+using SharedVOutThread = vlc_shared_data_ptr_type(vout_thread_t, vout_Hold, vout_Release);
+using SharedAOut = vlc_shared_data_ptr_type(audio_output_t, aout_Hold, aout_Release);
+
 class QSignalMapper;
 
 class IMEvent : public QEvent
@@ -251,14 +254,7 @@ public:
     ~PlayerController();
 
 public:
-    static void vout_Hold_fct( vout_thread_t* vout ) { vout_Hold(vout); }
-    static void vout_Release_fct( vout_thread_t* vout ) { vout_Release(vout); }
-    typedef vlc_shared_data_ptr_type(vout_thread_t, PlayerController::vout_Hold_fct, PlayerController::vout_Release_fct) VoutPtr;
-
-    static void aout_Hold_fct( audio_output_t* aout ) { aout_Hold(aout); }
-    static void aout_Release_fct( audio_output_t* aout ) { aout_Release(aout); }
-    typedef vlc_shared_data_ptr_type(audio_output_t, PlayerController::aout_Hold_fct, PlayerController::aout_Release_fct) AoutPtr;
-    typedef QVector<VoutPtr> VoutPtrList;
+    using VOutThreadList = QVector<SharedVOutThread>;
 
 
 public:
@@ -266,9 +262,9 @@ public:
 
     input_item_t *getInput();
 
-    VoutPtr getVout();
-    VoutPtrList getVouts() const;
-    PlayerController::AoutPtr getAout();
+    SharedVOutThread getVout();
+    VOutThreadList getVouts() const;
+    SharedAOut getAout();
     int AddAssociatedMedia(enum es_format_category_e cat, const QString& uri, bool select, bool notify, bool check_ext);
 
     void requestArtUpdate( input_item_t *p_item, bool b_forced );


=====================================
modules/gui/qt/playlist/playlist_item.hpp
=====================================
@@ -34,14 +34,14 @@
 //namespace vlc {
 //  namespace playlist {
 
-using PlaylistItemPtr = vlc_shared_data_ptr_type(vlc_playlist_item_t,
-                                                 vlc_playlist_item_Hold,
-                                                 vlc_playlist_item_Release);
+using SharedPlaylistItem = vlc_shared_data_ptr_type(vlc_playlist_item_t,
+                                                    vlc_playlist_item_Hold,
+                                                    vlc_playlist_item_Release);
 
 /**
  * Playlist item wrapper.
  *
- * It contains both the PlaylistItemPtr and cached data saved while the playlist
+ * It contains both the SharedPlaylistItem and cached data saved while the playlist
  * is locked, so that the fields may be read without synchronization or race
  * conditions.
  */
@@ -84,7 +84,7 @@ public:
 
 private:
     struct Data : public QSharedData {
-        PlaylistItemPtr item;
+        SharedPlaylistItem item;
 
         bool selected = false;
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/15eb690505b80e329b15a30ccdd382d1940b5031...4b9955aa998e514f59a9b38d0a386a8eba85445a

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/15eb690505b80e329b15a30ccdd382d1940b5031...4b9955aa998e514f59a9b38d0a386a8eba85445a
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