Changes of Revision 384

vlc-beta.spec Changed
x
 
1
@@ -86,13 +86,6 @@
2
 Provides:       vlc-beta-qt-debuginfo = %version-%release
3
 
4
 BuildRequires:  bash
5
-%if 0%{?suse_version} > 1500
6
-BuildRequires:  gcc
7
-BuildRequires:  gcc-c++
8
-%else
9
-BuildRequires:  gcc10
10
-BuildRequires:  gcc10-c++
11
-%endif
12
 BuildRequires:  flex
13
 BuildRequires:  bison
14
 %if 0%{?suse_version} > 1500
15
@@ -119,7 +112,7 @@
16
 BuildRequires:  pkgconfig(dvdread) >= 6.0.0
17
 BuildRequires:  pkgconfig(libplacebo)
18
 BuildRequires:  pkgconfig(vulkan) >= 1.0.26
19
-BuildRequires:  pkgconfig(libbluray) >= 0.6.2
20
+BuildRequires:  pkgconfig(libbluray)
21
 %if %{with vlc_opencv}
22
 BuildRequires:  pkgconfig(opencv) > 2.0
23
 %endif
24
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/extras/ci/gitlab-ci.yml -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/extras/ci/gitlab-ci.yml Changed
14
 
1
@@ -20,10 +20,10 @@
2
 
3
 variables:
4
     VLC_TEST_TIMEOUT: 60
5
-    VLC_WIN64_IMAGE: registry.videolan.org/vlc-debian-win64-posix:20240805192413
6
+    VLC_WIN64_IMAGE: registry.videolan.org/vlc-debian-win64-posix:20240808131936
7
     VLC_WIN_LLVM_MSVCRT_IMAGE: registry.videolan.org/vlc-debian-llvm-msvcrt:20240731083648
8
     VLC_WIN_LLVM_UCRT_IMAGE: registry.videolan.org/vlc-debian-llvm-ucrt:20240731083648
9
-    VLC_DEBIAN_IMAGE: registry.videolan.org/vlc-debian-unstable:20240402131352
10
+    VLC_DEBIAN_IMAGE: registry.videolan.org/vlc-debian-unstable:20240723100046
11
     VLC_ANDROID_IMAGE: registry.videolan.org/vlc-debian-android:20240731083648
12
     VLC_SNAP_IMAGE: registry.videolan.org/vlc-ubuntu-focal:20231013031754
13
     VLC_RASPBIAN_IMAGE: registry.videolan.org/vlc-ubuntu-raspberry:20240806085528
14
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/include/vlc_meta.h -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/include/vlc_meta.h Changed
45
 
1
@@ -62,6 +62,13 @@
2
 
3
 #define VLC_META_TYPE_COUNT 27
4
 
5
+typedef enum
6
+{
7
+    VLC_META_PRIORITY_BASIC,
8
+    VLC_META_PRIORITY_PLAYLIST,
9
+    VLC_META_PRIORITY_INBAND
10
+} vlc_meta_priority_t;
11
+
12
 #define ITEM_PREPARSED       1
13
 #define ITEM_ART_FETCHED     2
14
 #define ITEM_ART_NOTFOUND    4
15
@@ -73,7 +80,7 @@
16
 
17
 VLC_API vlc_meta_t * vlc_meta_New( void ) VLC_USED;
18
 VLC_API void vlc_meta_Delete( vlc_meta_t *m );
19
-VLC_API void vlc_meta_Set( vlc_meta_t *p_meta, vlc_meta_type_t meta_type, const char *psz_val );
20
+VLC_API void vlc_meta_SetWithPriority( vlc_meta_t *p_meta, vlc_meta_type_t meta_type, const char *psz_val, vlc_meta_priority_t priority );
21
 VLC_API const char * vlc_meta_Get( const vlc_meta_t *p_meta, vlc_meta_type_t meta_type );
22
 
23
 /**
24
@@ -83,8 +90,9 @@
25
  * \param psz_name meta extra name (nonnullable)
26
  * \param psz_value meta extra value (nullable)
27
  *  Removed from meta extra if set to NULL
28
+ * \param priority metadata priority (in terms of vlc_meta_priority_t)
29
  */
30
-VLC_API void vlc_meta_SetExtra( vlc_meta_t *m, const char *psz_name, const char *psz_value );
31
+VLC_API void vlc_meta_SetExtraWithPriority( vlc_meta_t *m, const char *psz_name, const char *psz_value, vlc_meta_priority_t priority );
32
 VLC_API const char * vlc_meta_GetExtra( const vlc_meta_t *m, const char *psz_name );
33
 VLC_API unsigned vlc_meta_GetExtraCount( const vlc_meta_t *m );
34
 
35
@@ -115,6 +123,9 @@
36
 
37
 VLC_API int input_item_WriteMeta(vlc_object_t *, input_item_t *);
38
 
39
+#define vlc_meta_Set( meta, meta_type, b )             vlc_meta_SetWithPriority( meta, meta_type, b, VLC_META_PRIORITY_BASIC )
40
+#define vlc_meta_SetExtra( meta, psz_name, psz_value ) vlc_meta_SetExtraWithPriority( meta, psz_name, psz_value, VLC_META_PRIORITY_BASIC )
41
+
42
 /* Setters for meta.
43
  * Warning: Make sure to use the input_item meta setters (defined in vlc_input_item.h)
44
  * instead of those one. */
45
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/modules/audio_output/apple/avsamplebuffer.m -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/modules/audio_output/apple/avsamplebuffer.m Changed
52
 
1
@@ -253,6 +253,12 @@
2
             _outChainLast = &_outChain;
3
 
4
         CMSampleBufferRef buffer = self wrapBuffer:█
5
+        if (buffer == nil)
6
+        {
7
+            vlc_mutex_unlock(&_bufferLock);
8
+            return;
9
+        }
10
+
11
         _ptsSamples += CMSampleBufferGetNumSamples(buffer);
12
 
13
         _renderer enqueueSampleBuffer:buffer;
14
@@ -298,6 +304,12 @@
15
 
16
     vlc_cond_signal(&_bufferWait);
17
     vlc_mutex_unlock(&_bufferLock);
18
+
19
+    if (_renderer.status == AVQueuedSampleBufferRenderingStatusFailed)
20
+    {
21
+        msg_Err(_aout, "AVQueuedSampleBufferRenderingStatusFailed, restarting");
22
+        aout_RestartRequest(_aout, false);
23
+    }
24
 }
25
 
26
 - (void)stopSyncRenderer
27
@@ -305,9 +317,6 @@
28
     _sync.rate = 0.0f;
29
 
30
     _sync removeTimeObserver:_observer;
31
-    /* From the doc: "Call dispatch_sync after removeTimeObserver: to wait for
32
-     * any in-flight blocks to finish executing." */
33
-    dispatch_sync(_timeQueue, ^{});
34
 
35
     _renderer stopRequestingMediaData;
36
     _renderer flush;
37
@@ -321,6 +330,14 @@
38
 
39
     vlc_cond_signal(&_bufferWait);
40
     vlc_mutex_unlock(&_bufferLock);
41
+
42
+    /* From the doc: "Call dispatch_sync after removeTimeObserver: to wait for
43
+     * any in-flight blocks to finish executing." */
44
+    dispatch_sync(_timeQueue, ^{});
45
+
46
+    /* Not in any doc:, stopRequestingMediaData() and flush() won't wait for
47
+     * any blocks to finish executing, so wait here. */
48
+     dispatch_sync(_dataQueue, ^{});
49
 }
50
 
51
 - (void)stop
52
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/modules/gui/qt/Makefile.am -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/modules/gui/qt/Makefile.am Changed
18
 
1
@@ -246,6 +246,8 @@
2
    network/mediatreelistener.hpp \
3
    network/devicesourceprovider.cpp \
4
    network/devicesourceprovider.hpp \
5
+   network/networkbasemodel.cpp \
6
+   network/networkbasemodel.hpp \
7
    network/networkdevicemodel.cpp \
8
    network/networkdevicemodel.hpp \
9
    network/networksourcesmodel.cpp \
10
@@ -442,6 +444,7 @@
11
    menus/menus.moc.cpp \
12
    network/devicesourceprovider.moc.cpp \
13
    network/networkdevicemodel.moc.cpp \
14
+   network/networkbasemodel.moc.cpp \
15
    network/networksourcesmodel.moc.cpp \
16
    network/networkmediamodel.moc.cpp \
17
    network/servicesdiscoverymodel.moc.cpp \
18
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/modules/gui/qt/maininterface/compositor.cpp -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/modules/gui/qt/maininterface/compositor.cpp Changed
45
 
1
@@ -200,12 +200,23 @@
2
     p_wnd->sys = this;
3
     p_wnd->ops = &ops;
4
     p_wnd->info.has_double_click = true;
5
+
6
+    // These need to be connected here, since the compositor might not be ready when
7
+    // these signals are emitted. VOut window might not be set, or worse, compositor's
8
+    // internal preparations might not be completed yet:
9
+    connect(m_videoSurfaceProvider.get(), &VideoSurfaceProvider::surfacePositionChanged,
10
+            this, &CompositorVideo::onSurfacePositionChanged, Qt::UniqueConnection);
11
+    connect(m_videoSurfaceProvider.get(), &VideoSurfaceProvider::surfaceSizeChanged,
12
+            this, &CompositorVideo::onSurfaceSizeChanged, Qt::UniqueConnection);
13
 }
14
 
15
 void CompositorVideo::windowDestroy()
16
 {
17
     if (m_destroyCb)
18
         m_destroyCb(m_wnd);
19
+
20
+    m_videoSurfaceProvider.reset();
21
+    m_videoWindowHandler.reset();
22
 }
23
 
24
 void CompositorVideo::windowResize(unsigned width, unsigned height)
25
@@ -252,10 +263,6 @@
26
     if (flags & CompositorVideo::CAN_SHOW_PIP)
27
     {
28
         m_mainCtx->setCanShowVideoPIP(true);
29
-        connect(m_videoSurfaceProvider.get(), &VideoSurfaceProvider::surfacePositionChanged,
30
-                this, &CompositorVideo::onSurfacePositionChanged);
31
-        connect(m_videoSurfaceProvider.get(), &VideoSurfaceProvider::surfaceSizeChanged,
32
-                this, &CompositorVideo::onSurfaceSizeChanged);
33
     }
34
     if (flags & CompositorVideo::HAS_ACRYLIC)
35
     {
36
@@ -316,8 +323,6 @@
37
 
38
 void CompositorVideo::commonIntfDestroy()
39
 {
40
-    m_videoWindowHandler.reset();
41
-    m_videoSurfaceProvider.reset();
42
     unloadGUI();
43
 }
44
 
45
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/modules/gui/qt/maininterface/mainctx.cpp -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/modules/gui/qt/maininterface/mainctx.cpp Changed
18
 
1
@@ -552,16 +552,6 @@
2
     return urlToDisplayString(mrl);
3
 }
4
 
5
-void MainCtx::setMediaLibraryVisible( bool visible )
6
-{
7
-    if (m_mediaLibraryVisible == visible)
8
-        return;
9
-
10
-    m_mediaLibraryVisible = visible;
11
-
12
-    emit mediaLibraryVisibleChanged(visible);
13
-}
14
-
15
 void MainCtx::setPlaylistDocked( bool docked )
16
 {
17
     b_playlistDocked = docked;
18
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/modules/gui/qt/maininterface/mainctx.hpp -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/modules/gui/qt/maininterface/mainctx.hpp Changed
68
 
1
@@ -45,6 +45,7 @@
2
 Q_MOC_INCLUDE( "util/csdbuttonmodel.hpp" )
3
 Q_MOC_INCLUDE( "playlist/playlist_controller.hpp" )
4
 Q_MOC_INCLUDE( "maininterface/mainctx_submodels.hpp" )
5
+Q_MOC_INCLUDE( "maininterface/videosurface.hpp" )
6
 
7
 class CSDButtonModel;
8
 class QSettings;
9
@@ -94,8 +95,6 @@
10
 {
11
     Q_OBJECT
12
 
13
-    Q_PROPERTY(bool mediaLibraryVisible READ isMediaLibraryVisible WRITE setMediaLibraryVisible
14
-               NOTIFY mediaLibraryVisibleChanged FINAL)
15
     Q_PROPERTY(bool playlistDocked READ isPlaylistDocked WRITE setPlaylistDocked NOTIFY playlistDockedChanged FINAL)
16
     Q_PROPERTY(bool playlistVisible READ isPlaylistVisible WRITE setPlaylistVisible NOTIFY playlistVisibleChanged FINAL)
17
     Q_PROPERTY(double playlistWidthFactor READ getPlaylistWidthFactor WRITE setPlaylistWidthFactor NOTIFY playlistWidthFactorChanged FINAL)
18
@@ -127,6 +126,7 @@
19
     Q_PROPERTY(bool useGlobalShortcuts READ getUseGlobalShortcuts WRITE setUseGlobalShortcuts NOTIFY useGlobalShortcutsChanged FINAL)
20
     Q_PROPERTY(int maxVolume READ maxVolume NOTIFY maxVolumeChanged FINAL)
21
     Q_PROPERTY(float safeArea READ safeArea NOTIFY safeAreaChanged FINAL)
22
+    Q_PROPERTY(VideoSurfaceProvider* videoSurfaceProvider READ getVideoSurfaceProvider WRITE setVideoSurfaceProvider NOTIFY hasEmbededVideoChanged FINAL)
23
 
24
     Q_PROPERTY(CSDButtonModel *csdButtonModel READ csdButtonModel CONSTANT FINAL)
25
 
26
@@ -191,7 +191,6 @@
27
     Q_ENUM(OsType)
28
 
29
     inline QWindow::Visibility interfaceVisibility() const { return m_windowVisibility; }
30
-    bool isMediaLibraryVisible() { return m_mediaLibraryVisible; }
31
     bool isPlaylistDocked() { return b_playlistDocked; }
32
     bool isPlaylistVisible() { return m_playlistVisible; }
33
     inline double getPlaylistWidthFactor() const { return m_playlistWidthFactor; }
34
@@ -339,7 +338,6 @@
35
     QUrl                 m_dialogFilepath; /* Last path used in dialogs */
36
 
37
     /* States */
38
-    bool                 m_mediaLibraryVisible = true;
39
     bool                 m_playlistVisible = false;       ///< Is the playlist visible ?
40
     double               m_playlistWidthFactor = 4.;   ///< playlist size: root.width / playlistScaleFactor
41
     double               m_playerPlaylistWidthFactor = 4.;
42
@@ -375,7 +373,6 @@
43
 public slots:
44
     void toggleToolbarMenu();
45
     void toggleInterfaceFullScreen();
46
-    void setMediaLibraryVisible( bool );
47
     void setPlaylistDocked( bool );
48
     void setPlaylistVisible( bool );
49
     void setPlaylistWidthFactor( double );
50
@@ -419,7 +416,6 @@
51
     void askRaise();
52
     void kc_pressed(); /* easter eggs */
53
 
54
-    void mediaLibraryVisibleChanged(bool);
55
     void playlistDockedChanged(bool);
56
     void playlistVisibleChanged(bool);
57
     void playlistWidthFactorChanged(double);
58
@@ -467,6 +463,9 @@
59
     void windowSuportExtendedFrameChanged();
60
     void windowExtendedMarginChanged(unsigned margin);
61
 
62
+    void requestShowMainView();
63
+    void requestShowPlayerView();
64
+
65
 private:
66
     void loadPrefs(bool callSignals);
67
     void loadFromSettingsImpl(bool callSignals);
68
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/modules/gui/qt/maininterface/qml/BannerSources.qml -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/modules/gui/qt/maininterface/qml/BannerSources.qml Changed
9
 
1
@@ -475,6 +475,7 @@
2
                                 Menus.QmlGlobalMenu {
3
                                     id: contextMenu
4
                                     ctx: MainCtx
5
+                                    playerViewVisible: History.match(History.viewPath, "player")
6
                                 }
7
                             }
8
                         }
9
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/modules/gui/qt/maininterface/qml/MainDisplay.qml -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/modules/gui/qt/maininterface/qml/MainDisplay.qml Changed
82
 
1
@@ -83,6 +83,11 @@
2
             _showMiniPlayer = true
3
     }
4
 
5
+    Component.onCompleted: {
6
+        if (MainCtx.canShowVideoPIP)
7
+            pipPlayerComponent.createObject(this)
8
+    }
9
+
10
     Navigation.cancelAction: function() {
11
         History.previous(Qt.BacktabFocusReason)
12
     }
13
@@ -465,36 +470,40 @@
14
         }
15
     }
16
 
17
-    PIPPlayer {
18
-        id: playerPip
19
-        anchors {
20
-            bottom: miniPlayer.top
21
-            left: parent.left
22
-            bottomMargin: VLCStyle.margin_normal
23
-            leftMargin: VLCStyle.margin_normal + VLCStyle.applicationHorizontalMargin
24
-        }
25
+    Component {
26
+        id: pipPlayerComponent
27
 
28
-        width: VLCStyle.dp(320, VLCStyle.scale)
29
-        height: VLCStyle.dp(180, VLCStyle.scale)
30
-        z: 2
31
-        visible: g_mainDisplay._showMiniPlayer && MainCtx.hasEmbededVideo
32
-        enabled: g_mainDisplay._showMiniPlayer && MainCtx.hasEmbededVideo
33
-
34
-        dragXMin: 0
35
-        dragXMax: g_mainDisplay.width - playerPip.width
36
-        dragYMin: sourcesBanner.y + sourcesBanner.height
37
-        dragYMax: miniPlayer.y - playerPip.height
38
-
39
-        //keep the player visible on resize
40
-        Connections {
41
-            target: g_mainDisplay
42
-            function onWidthChanged() {
43
-                if (playerPip.x > playerPip.dragXMax)
44
-                    playerPip.x = playerPip.dragXMax
45
+        PIPPlayer {
46
+            id: playerPip
47
+            anchors {
48
+                bottom: miniPlayer.top
49
+                left: parent.left
50
+                bottomMargin: VLCStyle.margin_normal
51
+                leftMargin: VLCStyle.margin_normal + VLCStyle.applicationHorizontalMargin
52
             }
53
-            function onHeightChanged() {
54
-                if (playerPip.y > playerPip.dragYMax)
55
-                    playerPip.y = playerPip.dragYMax
56
+
57
+            width: VLCStyle.dp(320, VLCStyle.scale)
58
+            height: VLCStyle.dp(180, VLCStyle.scale)
59
+            z: 2
60
+            visible: g_mainDisplay._showMiniPlayer && MainCtx.hasEmbededVideo
61
+            enabled: g_mainDisplay._showMiniPlayer && MainCtx.hasEmbededVideo
62
+
63
+            dragXMin: 0
64
+            dragXMax: g_mainDisplay.width - playerPip.width
65
+            dragYMin: sourcesBanner.y + sourcesBanner.height
66
+            dragYMax: miniPlayer.y - playerPip.height
67
+
68
+            //keep the player visible on resize
69
+            Connections {
70
+                target: g_mainDisplay
71
+                function onWidthChanged() {
72
+                    if (playerPip.x > playerPip.dragXMax)
73
+                        playerPip.x = playerPip.dragXMax
74
+                }
75
+                function onHeightChanged() {
76
+                    if (playerPip.y > playerPip.dragYMax)
77
+                        playerPip.y = playerPip.dragYMax
78
+                }
79
             }
80
         }
81
     }
82
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/modules/gui/qt/maininterface/qml/MainInterface.qml -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/modules/gui/qt/maininterface/qml/MainInterface.qml Changed
44
 
1
@@ -167,31 +167,21 @@
2
         Connections {
3
             target: MainCtx
4
 
5
-            function onMediaLibraryVisibleChanged() {
6
-                if (MainCtx.mediaLibraryVisible) {
7
-                    if (History.match(History.viewPath, "mc"))
8
-                        return
9
-
10
-                    // NOTE: Useful when we started the application on the 'player' view.
11
-                    if (History.previousEmpty) {
12
-                        if (MainCtx.hasEmbededVideo && MainCtx.canShowVideoPIP === false)
13
-                            MainPlaylistController.stop()
14
+            function onRequestShowMainView() {
15
+                if (History.match(History.viewPath, "mc"))
16
+                    return
17
 
18
-                        _pushHome()
19
-
20
-                        return
21
-                    }
22
+                if (MainCtx.hasEmbededVideo && MainCtx.canShowVideoPIP === false)
23
+                    MainPlaylistController.stop()
24
 
25
-                    if (MainCtx.hasEmbededVideo && MainCtx.canShowVideoPIP === false)
26
-                        MainPlaylistController.stop()
27
+                _pushHome()
28
+            }
29
 
30
-                    History.previous()
31
-                } else {
32
-                    if (History.match(History.viewPath, "player"))
33
-                        return
34
+            function onRequestShowPlayerView() {
35
+                if (History.match(History.viewPath, "player"))
36
+                    return
37
 
38
-                    History.push("player")
39
-                }
40
+                History.push("player")
41
             }
42
         }
43
 
44
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/modules/gui/qt/maininterface/videosurface.cpp -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/modules/gui/qt/maininterface/videosurface.cpp Changed
183
 
1
@@ -209,18 +209,14 @@
2
     setAcceptHoverEvents(true);
3
     setAcceptedMouseButtons(Qt::AllButtons);
4
     setFlag(ItemAcceptsInputMethod, true);
5
-    setFlag(ItemHasContents, true);
6
-}
7
 
8
-MainCtx* VideoSurface::getCtx()
9
-{
10
-    return m_ctx;
11
-}
12
+    {
13
+        connect(this, &QQuickItem::widthChanged, this, &VideoSurface::updateSurfaceSize);
14
+        connect(this, &QQuickItem::heightChanged, this, &VideoSurface::updateSurfaceSize);
15
 
16
-void VideoSurface::setCtx(MainCtx* ctx)
17
-{
18
-    m_ctx = ctx;
19
-    emit ctxChanged(ctx);
20
+        connect(this, &QQuickItem::xChanged, this, &VideoSurface::updateSurfacePosition);
21
+        connect(this, &QQuickItem::yChanged, this, &VideoSurface::updateSurfacePosition);
22
+    }
23
 }
24
 
25
 int VideoSurface::qtMouseButton2VLC( Qt::MouseButton qtButton )
26
@@ -306,12 +302,6 @@
27
     event->ignore();
28
 }
29
 
30
-void VideoSurface::geometryChange(const QRectF& newGeometry, const QRectF& oldGeometry)
31
-{
32
-    QQuickItem::geometryChange(newGeometry, oldGeometry);
33
-    onSurfaceSizeChanged();
34
-}
35
-
36
 #if QT_CONFIG(wheelevent)
37
 void VideoSurface::wheelEvent(QWheelEvent *event)
38
 {
39
@@ -330,97 +320,75 @@
40
     setCursor(shape);
41
 }
42
 
43
-QSGNode*VideoSurface::updatePaintNode(QSGNode* oldNode, QQuickItem::UpdatePaintNodeData* data)
44
+void VideoSurface::updatePolish()
45
 {
46
-    const auto node = ViewBlockingRectangle::updatePaintNode(oldNode, data);
47
+    QQuickItem::updatePolish();
48
 
49
-    if (m_provider == nullptr)
50
+    if (m_sizeDirty)
51
     {
52
-        if (m_ctx == nullptr)
53
-            return node;
54
-        m_provider =  m_ctx->getVideoSurfaceProvider();
55
-        if (!m_provider)
56
-            return node;
57
-
58
-        //forward signal to the provider
59
-        connect(this, &VideoSurface::mouseMoved, m_provider, &VideoSurfaceProvider::onMouseMoved);
60
-        connect(this, &VideoSurface::mousePressed, m_provider, &VideoSurfaceProvider::onMousePressed);
61
-        connect(this, &VideoSurface::mouseDblClicked, m_provider, &VideoSurfaceProvider::onMouseDoubleClick);
62
-        connect(this, &VideoSurface::mouseReleased, m_provider, &VideoSurfaceProvider::onMouseReleased);
63
-        connect(this, &VideoSurface::mouseWheeled, m_provider, &VideoSurfaceProvider::onMouseWheeled);
64
-        connect(this, &VideoSurface::keyPressed, m_provider, &VideoSurfaceProvider::onKeyPressed);
65
-        connect(this, &VideoSurface::surfaceSizeChanged, m_provider, &VideoSurfaceProvider::onSurfaceSizeChanged);
66
-        connect(this, &VideoSurface::surfacePositionChanged, m_provider, &VideoSurfaceProvider::surfacePositionChanged);
67
-
68
-        connect(m_provider, &VideoSurfaceProvider::hasVideoEmbedChanged, this, &VideoSurface::onProviderVideoChanged);
69
-
70
+        emit surfaceSizeChanged(size() * window()->effectiveDevicePixelRatio());
71
+        m_sizeDirty = false;
72
     }
73
-    updatePositionAndSize();
74
-    return node;
75
-}
76
-
77
-void VideoSurface::componentComplete()
78
-{
79
-    ViewBlockingRectangle::componentComplete();
80
 
81
-    connect(this, &QQuickItem::xChanged, this, &VideoSurface::onSurfacePositionChanged);
82
-    connect(this, &QQuickItem::yChanged, this, &VideoSurface::onSurfacePositionChanged);
83
-    connect(this, &QQuickItem::widthChanged, this, &VideoSurface::onSurfaceSizeChanged);
84
-    connect(this, &QQuickItem::heightChanged, this, &VideoSurface::onSurfaceSizeChanged);
85
-    connect(this, &VideoSurface::enabledChanged, this, &VideoSurface::updatePositionAndSize);
86
+    if (m_positionDirty)
87
+    {
88
+        QPointF scenePosition = this->mapToScene(QPointF(0,0));
89
 
90
-    updatePositionAndSize();
91
+        emit surfacePositionChanged(scenePosition * window()->effectiveDevicePixelRatio());
92
+        m_positionDirty = false;
93
+    }
94
 }
95
 
96
-void VideoSurface::onProviderVideoChanged(bool hasVideo)
97
+void VideoSurface::updateSurfacePosition()
98
 {
99
-    if (!hasVideo)
100
-        return;
101
-    updatePositionAndSize();
102
+    m_positionDirty = true;
103
+    polish();
104
 }
105
 
106
-static qreal dprForWindow(QQuickWindow* quickWindow)
107
+void VideoSurface::updateSurfaceSize()
108
 {
109
-    if (!quickWindow)
110
-        return 1.0;
111
-
112
-    QWindow* window = QQuickRenderControl::renderWindowFor(quickWindow);
113
-    if (!window)
114
-        window = quickWindow;
115
-
116
-    return window->devicePixelRatio();
117
+    m_sizeDirty = true;
118
+    polish();
119
 }
120
 
121
-void VideoSurface::onSurfaceSizeChanged()
122
+void VideoSurface::updateSurfacePositionAndSize()
123
 {
124
-    if (!isEnabled())
125
-        return;
126
-
127
-    qreal dpr = dprForWindow(window());
128
-
129
-    emit surfaceSizeChanged(size() * dpr);
130
+    updateSurfacePosition();
131
+    updateSurfaceSize();
132
 }
133
 
134
-void VideoSurface::onSurfacePositionChanged()
135
+void VideoSurface::setVideoSurfaceProvider(VideoSurfaceProvider *newVideoSurfaceProvider)
136
 {
137
-    if (!isEnabled())
138
+    if (m_provider == newVideoSurfaceProvider)
139
         return;
140
 
141
-    qreal dpr = dprForWindow(window());
142
+    if (m_provider)
143
+    {
144
+        disconnect(m_provider, nullptr, this, nullptr);
145
+    }
146
 
147
-    QPointF scenePosition = this->mapToScene(QPointF(0,0));
148
+    m_provider = newVideoSurfaceProvider;
149
 
150
-    emit surfacePositionChanged(scenePosition * dpr);
151
-}
152
+    if (m_provider)
153
+    {
154
+        connect(this, &VideoSurface::mouseMoved, m_provider, &VideoSurfaceProvider::onMouseMoved);
155
+        connect(this, &VideoSurface::mousePressed, m_provider, &VideoSurfaceProvider::onMousePressed);
156
+        connect(this, &VideoSurface::mouseDblClicked, m_provider, &VideoSurfaceProvider::onMouseDoubleClick);
157
+        connect(this, &VideoSurface::mouseReleased, m_provider, &VideoSurfaceProvider::onMouseReleased);
158
+        connect(this, &VideoSurface::mouseWheeled, m_provider, &VideoSurfaceProvider::onMouseWheeled);
159
+        connect(this, &VideoSurface::keyPressed, m_provider, &VideoSurfaceProvider::onKeyPressed);
160
+        connect(this, &VideoSurface::surfaceSizeChanged, m_provider, &VideoSurfaceProvider::onSurfaceSizeChanged);
161
+        connect(this, &VideoSurface::surfacePositionChanged, m_provider, &VideoSurfaceProvider::surfacePositionChanged);
162
 
163
-void VideoSurface::updatePositionAndSize()
164
-{
165
-    if (!isEnabled())
166
-        return;
167
+        connect(m_provider, &VideoSurfaceProvider::videoEnabledChanged, this, &VideoSurface::updateSurfacePositionAndSize);
168
 
169
-    qreal dpr = dprForWindow(window());
170
+        setFlag(ItemHasContents, true);
171
+        updateSurfacePositionAndSize(); // Polish is queued anyway, updatePolish() should be called when the initial size is set.
172
+    }
173
+    else
174
+    {
175
+        setFlag(ItemHasContents, false);
176
+    }
177
 
178
-    emit surfaceSizeChanged(size() * dpr);
179
-    QPointF scenePosition = this->mapToScene(QPointF(0, 0));
180
-    emit surfacePositionChanged(scenePosition * dpr);
181
+    emit videoSurfaceProviderChanged();
182
 }
183
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/modules/gui/qt/maininterface/videosurface.hpp -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/modules/gui/qt/maininterface/videosurface.hpp Changed
66
 
1
@@ -98,14 +98,14 @@
2
 class VideoSurface : public ViewBlockingRectangle
3
 {
4
     Q_OBJECT
5
-    Q_PROPERTY(MainCtx* ctx READ getCtx WRITE setCtx NOTIFY ctxChanged FINAL)
6
+    Q_PROPERTY(VideoSurfaceProvider* videoSurfaceProvider READ videoSurfaceProvider WRITE setVideoSurfaceProvider NOTIFY videoSurfaceProviderChanged FINAL)
7
     Q_PROPERTY(Qt::CursorShape cursorShape READ getCursorShape WRITE setCursorShape RESET unsetCursor FINAL)
8
 
9
 public:
10
     VideoSurface( QQuickItem* parent = nullptr );
11
 
12
-    MainCtx* getCtx();
13
-    void setCtx(MainCtx* ctx);
14
+    VideoSurfaceProvider* videoSurfaceProvider() const { return m_provider; };
15
+    void setVideoSurfaceProvider(VideoSurfaceProvider *newVideoSurfaceProvider);
16
 
17
 protected:
18
     int qtMouseButton2VLC( Qt::MouseButton qtButton );
19
@@ -120,18 +120,12 @@
20
     void wheelEvent(QWheelEvent *event) override;
21
 #endif
22
 
23
-    void geometryChange(const QRectF &newGeometry,
24
-                        const QRectF &oldGeometry) override;
25
-
26
     Qt::CursorShape getCursorShape() const;
27
     void setCursorShape(Qt::CursorShape);
28
 
29
-    QSGNode* updatePaintNode(QSGNode *, QQuickItem::UpdatePaintNodeData *) override;
30
-
31
-    void componentComplete() override;
32
+    void updatePolish() override;
33
 
34
 signals:
35
-    void ctxChanged(MainCtx*);
36
     void surfaceSizeChanged(QSizeF);
37
     void surfacePositionChanged(QPointF);
38
 
39
@@ -142,18 +136,20 @@
40
     void keyPressed(int key, Qt::KeyboardModifiers modifier);
41
     void mouseWheeled(const QWheelEvent& event);
42
 
43
+    void videoSurfaceProviderChanged();
44
+
45
 protected slots:
46
-    void onProviderVideoChanged(bool);
47
-    void onSurfaceSizeChanged();
48
-    void onSurfacePositionChanged();
49
-    void updatePositionAndSize();
50
+    void updateSurfacePosition();
51
+    void updateSurfaceSize();
52
+    void updateSurfacePositionAndSize();
53
 
54
 private:
55
-    MainCtx* m_ctx = nullptr;
56
-
57
     QPointF m_oldHoverPos;
58
 
59
     QPointer<VideoSurfaceProvider> m_provider;
60
+
61
+    bool m_sizeDirty = false;
62
+    bool m_positionDirty = false;
63
 };
64
 
65
 #endif // VIDEOSURFACE_HPP
66
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/modules/gui/qt/medialibrary/mlalbummodel.cpp -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/modules/gui/qt/medialibrary/mlalbummodel.cpp Changed
66
 
1
@@ -17,18 +17,10 @@
2
  *****************************************************************************/
3
 
4
 #include "mlalbummodel.hpp"
5
+#include "mlhelper.hpp"
6
 
7
 #include "util/vlctick.hpp"
8
 
9
-QHash<QByteArray, vlc_ml_sorting_criteria_t> MLAlbumModel::M_names_to_criteria = {
10
-    {"id", VLC_ML_SORTING_DEFAULT},
11
-    {"title", VLC_ML_SORTING_ALPHA},
12
-    {"release_year", VLC_ML_SORTING_RELEASEDATE},
13
-    {"main_artist", VLC_ML_SORTING_ARTIST},
14
-    //{"nb_tracks"},
15
-    {"duration", VLC_ML_SORTING_DURATION}
16
-};
17
-
18
 MLAlbumModel::MLAlbumModel(QObject *parent)
19
     : MLBaseModel(parent)
20
 {
21
@@ -52,12 +44,14 @@
22
 
23
 vlc_ml_sorting_criteria_t MLAlbumModel::nameToCriteria(QByteArray name) const
24
 {
25
-    return M_names_to_criteria.value(name, VLC_ML_SORTING_DEFAULT);
26
-}
27
-
28
-QByteArray MLAlbumModel::criteriaToName(vlc_ml_sorting_criteria_t criteria) const
29
-{
30
-    return M_names_to_criteria.key(criteria, "");
31
+    return QHash<QByteArray, vlc_ml_sorting_criteria_t> {
32
+        {"id", VLC_ML_SORTING_DEFAULT},
33
+        {"title", VLC_ML_SORTING_ALPHA},
34
+        {"release_year", VLC_ML_SORTING_RELEASEDATE},
35
+        {"main_artist", VLC_ML_SORTING_ARTIST},
36
+        // {"nb_tracks"},
37
+        {"duration", VLC_ML_SORTING_DURATION},
38
+    }.value(name, VLC_ML_SORTING_DEFAULT);
39
 }
40
 
41
 void MLAlbumModel::onVlcMlEvent(const MLEvent &event)
42
@@ -98,23 +92,6 @@
43
     MLBaseModel::onVlcMlEvent( event );
44
 }
45
 
46
-vlc_ml_sorting_criteria_t MLAlbumModel::roleToCriteria(int role) const
47
-{
48
-    switch (role)
49
-    {
50
-    case ALBUM_TITLE :
51
-        return VLC_ML_SORTING_ALPHA;
52
-    case ALBUM_RELEASE_YEAR :
53
-        return VLC_ML_SORTING_RELEASEDATE;
54
-    case ALBUM_MAIN_ARTIST :
55
-        return VLC_ML_SORTING_ARTIST;
56
-    case ALBUM_DURATION:
57
-        return VLC_ML_SORTING_DURATION;
58
-    default:
59
-        return VLC_ML_SORTING_DEFAULT;
60
-    }
61
-}
62
-
63
 QVariant MLAlbumModel::itemRoleData(MLItem *item, const int role) const
64
 {
65
     auto ml_item = static_cast<MLAlbum *>(item);
66
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/modules/gui/qt/medialibrary/mlalbummodel.hpp -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/modules/gui/qt/medialibrary/mlalbummodel.hpp Changed
15
 
1
@@ -60,13 +60,9 @@
2
     std::unique_ptr<MLListCacheLoader> createMLLoader() const override;
3
 
4
 private:
5
-    vlc_ml_sorting_criteria_t roleToCriteria(int role) const override;
6
     vlc_ml_sorting_criteria_t nameToCriteria(QByteArray name) const override;
7
-    QByteArray criteriaToName(vlc_ml_sorting_criteria_t criteria) const override;
8
     void onVlcMlEvent( const MLEvent &event ) override;
9
 
10
-    static  QHash<QByteArray, vlc_ml_sorting_criteria_t> M_names_to_criteria;
11
-
12
     struct Loader : public MLListCacheLoader::MLOp
13
     {
14
         using MLListCacheLoader::MLOp::MLOp;
15
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/modules/gui/qt/medialibrary/mlalbumtrackmodel.cpp -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/modules/gui/qt/medialibrary/mlalbumtrackmodel.cpp Changed
56
 
1
@@ -20,16 +20,6 @@
2
 #include "util/vlctick.hpp"
3
 #include "mlhelper.hpp"
4
 
5
-QHash<QByteArray, vlc_ml_sorting_criteria_t> MLAlbumTrackModel::M_names_to_criteria = {
6
-    {"id", VLC_ML_SORTING_DEFAULT},
7
-    {"title", VLC_ML_SORTING_ALPHA},
8
-    {"album_title", VLC_ML_SORTING_ALBUM},
9
-    {"track_number", VLC_ML_SORTING_TRACKNUMBER},
10
-    {"release_year", VLC_ML_SORTING_RELEASEDATE},
11
-    {"main_artist", VLC_ML_SORTING_ARTIST},
12
-    {"duration", VLC_ML_SORTING_DURATION}
13
-};
14
-
15
 MLAlbumTrackModel::MLAlbumTrackModel(QObject *parent)
16
     : MLBaseModel(parent)
17
 {
18
@@ -93,28 +83,17 @@
19
     };
20
 }
21
 
22
-vlc_ml_sorting_criteria_t MLAlbumTrackModel::roleToCriteria(int role) const
23
-{
24
-    switch (role) {
25
-    case TRACK_TITLE :
26
-        return VLC_ML_SORTING_ALPHA;
27
-    case TRACK_NUMBER :
28
-        return VLC_ML_SORTING_TRACKNUMBER;
29
-    case TRACK_DURATION :
30
-        return VLC_ML_SORTING_DURATION;
31
-    default:
32
-        return VLC_ML_SORTING_DEFAULT;
33
-    }
34
-}
35
-
36
 vlc_ml_sorting_criteria_t MLAlbumTrackModel::nameToCriteria(QByteArray name) const
37
 {
38
-    return M_names_to_criteria.value(name, VLC_ML_SORTING_DEFAULT);
39
-}
40
-
41
-QByteArray MLAlbumTrackModel::criteriaToName(vlc_ml_sorting_criteria_t criteria) const
42
-{
43
-    return M_names_to_criteria.key(criteria, "");
44
+    return QHash<QByteArray, vlc_ml_sorting_criteria_t> {
45
+        {"id", VLC_ML_SORTING_DEFAULT},
46
+        {"title", VLC_ML_SORTING_ALPHA},
47
+        {"album_title", VLC_ML_SORTING_ALBUM},
48
+        {"track_number", VLC_ML_SORTING_TRACKNUMBER},
49
+        {"release_year", VLC_ML_SORTING_RELEASEDATE},
50
+        {"main_artist", VLC_ML_SORTING_ARTIST},
51
+        {"duration", VLC_ML_SORTING_DURATION},
52
+    }.value(name, VLC_ML_SORTING_DEFAULT);
53
 }
54
 
55
 void MLAlbumTrackModel::onVlcMlEvent(const MLEvent &event)
56
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/modules/gui/qt/medialibrary/mlalbumtrackmodel.hpp -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/modules/gui/qt/medialibrary/mlalbumtrackmodel.hpp Changed
15
 
1
@@ -62,13 +62,9 @@
2
     std::unique_ptr<MLListCacheLoader> createMLLoader() const override;
3
 
4
 private:
5
-    vlc_ml_sorting_criteria_t roleToCriteria(int role) const override;
6
     vlc_ml_sorting_criteria_t nameToCriteria(QByteArray name) const override;
7
-    QByteArray criteriaToName(vlc_ml_sorting_criteria_t criteria) const override;
8
     void onVlcMlEvent( const MLEvent &event ) override;
9
 
10
-    static QHash<QByteArray, vlc_ml_sorting_criteria_t> M_names_to_criteria;
11
-
12
     struct Loader : public MLListCacheLoader::MLOp
13
     {
14
         using MLListCacheLoader::MLOp::MLOp;
15
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/modules/gui/qt/medialibrary/mlartistmodel.cpp -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/modules/gui/qt/medialibrary/mlartistmodel.cpp Changed
43
 
1
@@ -18,11 +18,6 @@
2
 
3
 #include "mlartistmodel.hpp"
4
 
5
-QHash<QByteArray, vlc_ml_sorting_criteria_t> MLArtistModel::M_names_to_criteria = {
6
-    {"name", VLC_ML_SORTING_ALPHA},
7
-    {"nb_tracks", VLC_ML_SORTING_TRACKNUMBER},
8
-};
9
-
10
 MLArtistModel::MLArtistModel(QObject *parent)
11
     : MLBaseModel(parent)
12
 {
13
@@ -64,25 +59,12 @@
14
     };
15
 }
16
 
17
-vlc_ml_sorting_criteria_t MLArtistModel::roleToCriteria(int role) const
18
-{
19
-    switch (role)
20
-    {
21
-    case ARTIST_NAME :
22
-        return VLC_ML_SORTING_ALPHA;
23
-    default :
24
-        return VLC_ML_SORTING_DEFAULT;
25
-    }
26
-}
27
-
28
 vlc_ml_sorting_criteria_t MLArtistModel::nameToCriteria(QByteArray name) const
29
 {
30
-    return M_names_to_criteria.value(name, VLC_ML_SORTING_DEFAULT);
31
-}
32
-
33
-QByteArray MLArtistModel::criteriaToName(vlc_ml_sorting_criteria_t criteria) const
34
-{
35
-    return M_names_to_criteria.key(criteria, "");
36
+    return QHash<QByteArray, vlc_ml_sorting_criteria_t> {
37
+        {"name", VLC_ML_SORTING_ALPHA},
38
+        {"nb_tracks", VLC_ML_SORTING_TRACKNUMBER},
39
+    }.value(name, VLC_ML_SORTING_DEFAULT);
40
 }
41
 
42
 void MLArtistModel::onVlcMlEvent(const MLEvent &event)
43
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/modules/gui/qt/medialibrary/mlartistmodel.hpp -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/modules/gui/qt/medialibrary/mlartistmodel.hpp Changed
15
 
1
@@ -52,13 +52,9 @@
2
     std::unique_ptr<MLListCacheLoader> createMLLoader() const override;
3
 
4
 private:
5
-    vlc_ml_sorting_criteria_t roleToCriteria(int role) const override;
6
     vlc_ml_sorting_criteria_t nameToCriteria(QByteArray name) const override;
7
-    QByteArray criteriaToName(vlc_ml_sorting_criteria_t criteria) const override;
8
     void onVlcMlEvent(const MLEvent &event) override;
9
 
10
-    static QHash<QByteArray, vlc_ml_sorting_criteria_t> M_names_to_criteria;
11
-
12
     struct Loader : public MLListCacheLoader::MLOp
13
     {
14
         using MLListCacheLoader::MLOp::MLOp;
15
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/modules/gui/qt/medialibrary/mlbasemodel.cpp -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/modules/gui/qt/medialibrary/mlbasemodel.cpp Changed
16
 
1
@@ -278,14 +278,6 @@
2
     }
3
 }
4
 
5
-QString MLBaseModel::getFirstSymbol(QString str)
6
-{
7
-    QString ret("#");
8
-    if ( str.length() > 0 && str0.isLetter() )
9
-        ret = str0.toUpper();
10
-    return ret;
11
-}
12
-
13
 void MLBaseModel::onVlcMlEvent(void* data, const vlc_ml_event_t* event)
14
 {
15
     auto self = static_cast<MLBaseModel*>(data);
16
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/modules/gui/qt/medialibrary/mlbasemodel.hpp -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/modules/gui/qt/medialibrary/mlbasemodel.hpp Changed
18
 
1
@@ -91,14 +91,9 @@
2
 protected:
3
     virtual std::unique_ptr<MLListCacheLoader> createMLLoader() const  = 0;
4
 
5
-    virtual vlc_ml_sorting_criteria_t roleToCriteria(int role) const = 0;
6
-    static QString getFirstSymbol(QString str);
7
-    virtual vlc_ml_sorting_criteria_t nameToCriteria(QByteArray) const {
8
-        return VLC_ML_SORTING_DEFAULT;
9
-    }
10
-    virtual QByteArray criteriaToName(vlc_ml_sorting_criteria_t ) const
11
+    virtual vlc_ml_sorting_criteria_t nameToCriteria(QByteArray /* name */) const
12
     {
13
-        return "";
14
+        return VLC_ML_SORTING_DEFAULT;
15
     }
16
 
17
     MLItem *item(int signedidx) const;
18
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/modules/gui/qt/medialibrary/mlgenremodel.cpp -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/modules/gui/qt/medialibrary/mlgenremodel.cpp Changed
41
 
1
@@ -39,10 +39,6 @@
2
 
3
 //-------------------------------------------------------------------------------------------------
4
 
5
-QHash<QByteArray, vlc_ml_sorting_criteria_t> MLGenreModel::M_names_to_criteria = {
6
-    {"name", VLC_ML_SORTING_ALPHA}
7
-};
8
-
9
 MLGenreModel::MLGenreModel(QObject *parent)
10
     : MLBaseModel(parent)
11
 {
12
@@ -121,25 +117,11 @@
13
     MLBaseModel::onVlcMlEvent(event);
14
 }
15
 
16
-vlc_ml_sorting_criteria_t MLGenreModel::roleToCriteria(int role) const
17
-{
18
-    switch (role)
19
-    {
20
-    case GENRE_NAME:
21
-        return VLC_ML_SORTING_ALPHA;
22
-    default :
23
-        return VLC_ML_SORTING_DEFAULT;
24
-    }
25
-}
26
-
27
 vlc_ml_sorting_criteria_t MLGenreModel::nameToCriteria(QByteArray name) const
28
 {
29
-    return M_names_to_criteria.value(name, VLC_ML_SORTING_DEFAULT);
30
-}
31
-
32
-QByteArray MLGenreModel::criteriaToName(vlc_ml_sorting_criteria_t criteria) const
33
-{
34
-    return M_names_to_criteria.key(criteria, "");
35
+    return QHash<QByteArray, vlc_ml_sorting_criteria_t> {
36
+        {"name", VLC_ML_SORTING_ALPHA},
37
+    }.value(name, VLC_ML_SORTING_DEFAULT);
38
 }
39
 
40
 QString MLGenreModel::getCover(MLGenre * genre) const
41
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/modules/gui/qt/medialibrary/mlgenremodel.hpp -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/modules/gui/qt/medialibrary/mlgenremodel.hpp Changed
21
 
1
@@ -65,9 +65,7 @@
2
 
3
 private:
4
     void onVlcMlEvent(const MLEvent &event) override;
5
-    vlc_ml_sorting_criteria_t roleToCriteria(int role) const override;
6
     vlc_ml_sorting_criteria_t nameToCriteria(QByteArray name) const override;
7
-    QByteArray criteriaToName(vlc_ml_sorting_criteria_t criteria) const override;
8
 
9
     QString getCover(MLGenre * genre) const;
10
 
11
@@ -81,9 +79,6 @@
12
         std::vector<std::unique_ptr<MLItem>> load(vlc_medialibrary_t* ml, const vlc_ml_query_params_t* queryParams) const override;
13
         std::unique_ptr<MLItem> loadItemById(vlc_medialibrary_t* ml, MLItemId itemId) const override;
14
     };
15
-
16
-private: // Variables
17
-    static QHash<QByteArray, vlc_ml_sorting_criteria_t> M_names_to_criteria;
18
 };
19
 
20
 
21
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/modules/gui/qt/medialibrary/mlhelper.cpp -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/modules/gui/qt/medialibrary/mlhelper.cpp Changed
23
 
1
@@ -18,9 +18,6 @@
2
 
3
 #include "mlhelper.hpp"
4
 
5
-// MediaLibrary includes
6
-#include "mlbasemodel.hpp"
7
-
8
 #include <QDir>
9
 
10
 QString toValidLocalFile(const char *mrl)
11
@@ -37,3 +34,11 @@
12
 
13
     return displayString;
14
 }
15
+
16
+QString getFirstSymbol(const QString &str)
17
+{
18
+    QString ret("#");
19
+    if ( str.length() > 0 && str0.isLetter() )
20
+        ret = str0.toUpper();
21
+    return ret;
22
+}
23
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/modules/gui/qt/medialibrary/mlhelper.hpp -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/modules/gui/qt/medialibrary/mlhelper.hpp Changed
35
 
1
@@ -19,23 +19,17 @@
2
 #ifndef MLHELPER_HPP
3
 #define MLHELPER_HPP
4
 
5
-#include <memory>
6
-
7
 #ifdef HAVE_CONFIG_H
8
 #include "config.h"
9
 #endif
10
 
11
+#include <memory>
12
+
13
 #include <vlc_media_library.h>
14
+
15
 #include <QString>
16
 #include <QUrl>
17
 
18
-// Forward declarations
19
-class MLBaseModel;
20
-class MLItem;
21
-class MLItemId;
22
-class CoverGenerator;
23
-class QUrl;
24
-
25
 template<typename T>
26
 class MLDeleter
27
 {
28
@@ -116,4 +110,6 @@
29
     return parentDirUrl;
30
 }
31
 
32
+QString getFirstSymbol(const QString &);
33
+
34
 #endif // MLHELPER_HPP
35
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/modules/gui/qt/medialibrary/mlplaylistlistmodel.cpp -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/modules/gui/qt/medialibrary/mlplaylistlistmodel.cpp Changed
16
 
1
@@ -323,14 +323,6 @@
2
 // Protected MLBaseModel implementation
3
 //-------------------------------------------------------------------------------------------------
4
 
5
-vlc_ml_sorting_criteria_t MLPlaylistListModel::roleToCriteria(int role) const /* override */
6
-{
7
-    if (role == PLAYLIST_NAME)
8
-        return VLC_ML_SORTING_ALPHA;
9
-    else
10
-        return VLC_ML_SORTING_DEFAULT;
11
-}
12
-
13
 std::unique_ptr<MLListCacheLoader> MLPlaylistListModel::createMLLoader() const /* override */
14
 {
15
     return std::make_unique<MLListCacheLoader>(m_mediaLib, std::make_shared<MLPlaylistListModel::Loader>(*this, m_playlistType));
16
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/modules/gui/qt/medialibrary/mlplaylistlistmodel.hpp -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/modules/gui/qt/medialibrary/mlplaylistlistmodel.hpp Changed
10
 
1
@@ -86,8 +86,6 @@
2
 protected: // MLBaseModel implementation
3
     QVariant itemRoleData(MLItem* item, int role = Qt::DisplayRole) const override;
4
 
5
-    vlc_ml_sorting_criteria_t roleToCriteria(int role) const override;
6
-
7
     std::unique_ptr<MLListCacheLoader> createMLLoader() const override;
8
 
9
 private: // Functions
10
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/modules/gui/qt/medialibrary/mlplaylistmodel.cpp -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/modules/gui/qt/medialibrary/mlplaylistmodel.cpp Changed
55
 
1
@@ -33,17 +33,6 @@
2
 #include "playlist/playlist_controller.hpp"
3
 #include "playlist/media.hpp"
4
 
5
-//-------------------------------------------------------------------------------------------------
6
-// Static variables
7
-
8
-static const QHash<QByteArray, vlc_ml_sorting_criteria_t> criterias =
9
-{
10
-    {"id",             VLC_ML_SORTING_DEFAULT},
11
-    {"title",          VLC_ML_SORTING_ALPHA},
12
-    {"duration",       VLC_ML_SORTING_DURATION},
13
-    {"playcount",      VLC_ML_SORTING_PLAYCOUNT},
14
-};
15
-
16
 //=================================================================================================
17
 // MLPlaylistModel
18
 //=================================================================================================
19
@@ -384,29 +373,14 @@
20
 // Protected MLBaseModel implementation
21
 //-------------------------------------------------------------------------------------------------
22
 
23
-vlc_ml_sorting_criteria_t MLPlaylistModel::roleToCriteria(int role) const /* override */
24
-{
25
-    switch (role)
26
-    {
27
-        case MEDIA_TITLE:
28
-            return VLC_ML_SORTING_ALPHA;
29
-        case MEDIA_DURATION:
30
-            return VLC_ML_SORTING_DURATION;
31
-        case MEDIA_PLAYCOUNT:
32
-            return VLC_ML_SORTING_PLAYCOUNT;
33
-        default:
34
-            return VLC_ML_SORTING_DEFAULT;
35
-    }
36
-}
37
-
38
 vlc_ml_sorting_criteria_t MLPlaylistModel::nameToCriteria(QByteArray name) const /* override */
39
 {
40
-    return criterias.value(name, VLC_ML_SORTING_DEFAULT);
41
-}
42
-
43
-QByteArray MLPlaylistModel::criteriaToName(vlc_ml_sorting_criteria_t criteria) const /* override */
44
-{
45
-    return criterias.key(criteria, "");
46
+    return QHash<QByteArray, vlc_ml_sorting_criteria_t> {
47
+        {"id",             VLC_ML_SORTING_DEFAULT},
48
+        {"title",          VLC_ML_SORTING_ALPHA},
49
+        {"duration",       VLC_ML_SORTING_DURATION},
50
+        {"playcount",      VLC_ML_SORTING_PLAYCOUNT},
51
+    }.value(name, VLC_ML_SORTING_DEFAULT);
52
 }
53
 
54
 //-------------------------------------------------------------------------------------------------
55
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/modules/gui/qt/medialibrary/mlplaylistmodel.hpp -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/modules/gui/qt/medialibrary/mlplaylistmodel.hpp Changed
14
 
1
@@ -68,12 +68,8 @@
2
 protected: // MLBaseModel implementation
3
     QVariant itemRoleData(MLItem *item, int role = Qt::DisplayRole) const override;
4
 
5
-    vlc_ml_sorting_criteria_t roleToCriteria(int role) const override;
6
-
7
     vlc_ml_sorting_criteria_t nameToCriteria(QByteArray name) const override;
8
 
9
-    QByteArray criteriaToName(vlc_ml_sorting_criteria_t criteria) const override;
10
-
11
     std::unique_ptr<MLListCacheLoader> createMLLoader() const override;
12
 
13
 protected: // MLBaseModel reimplementation
14
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/modules/gui/qt/medialibrary/mlrecentsmodel.hpp -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/modules/gui/qt/medialibrary/mlrecentsmodel.hpp Changed
14
 
1
@@ -68,12 +68,6 @@
2
     std::unique_ptr<MLListCacheLoader> createMLLoader() const override;
3
 
4
 private:
5
-    vlc_ml_sorting_criteria_t roleToCriteria( int /* role */ ) const override{
6
-        return VLC_ML_SORTING_DEFAULT;
7
-    }
8
-    vlc_ml_sorting_criteria_t nameToCriteria( QByteArray /* name */ ) const override{
9
-        return VLC_ML_SORTING_DEFAULT;
10
-    }
11
     void onVlcMlEvent( const MLEvent &event ) override;
12
 
13
     struct Loader : public MLListCacheLoader::MLOp
14
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/modules/gui/qt/medialibrary/mlurlmodel.cpp -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/modules/gui/qt/medialibrary/mlurlmodel.cpp Changed
20
 
1
@@ -106,18 +106,6 @@
2
         });
3
 }
4
 
5
-vlc_ml_sorting_criteria_t MLUrlModel::roleToCriteria(int role) const
6
-{
7
-    switch (role) {
8
-    case URL_URL :
9
-        return VLC_ML_SORTING_DEFAULT;
10
-    case URL_LAST_PLAYED_DATE :
11
-        return VLC_ML_SORTING_LASTMODIFICATIONDATE;
12
-    default:
13
-        return VLC_ML_SORTING_DEFAULT;
14
-    }
15
-}
16
-
17
 void MLUrlModel::onVlcMlEvent(const MLEvent &event)
18
 {
19
     switch (event.i_type)
20
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/modules/gui/qt/medialibrary/mlurlmodel.hpp -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/modules/gui/qt/medialibrary/mlurlmodel.hpp Changed
9
 
1
@@ -71,7 +71,6 @@
2
     std::unique_ptr<MLListCacheLoader> createMLLoader() const override;
3
 
4
 private:
5
-    vlc_ml_sorting_criteria_t roleToCriteria(int role) const override;
6
     void onVlcMlEvent( const MLEvent &event ) override;
7
 
8
     struct Loader : public MLListCacheLoader::MLOp
9
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/modules/gui/qt/medialibrary/mlvideofoldersmodel.cpp -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/modules/gui/qt/medialibrary/mlvideofoldersmodel.cpp Changed
47
 
1
@@ -42,12 +42,6 @@
2
 static const int MLVIDEOFOLDERSMODEL_COVER_WIDTH  = 260 * 3; // 16 / 10 ratio
3
 static const int MLVIDEOFOLDERSMODEL_COVER_HEIGHT = 162 * 3;
4
 
5
-static const QHash<QByteArray, vlc_ml_sorting_criteria_t> criterias =
6
-{
7
-    { "title",    VLC_ML_SORTING_ALPHA    },
8
-    { "duration", VLC_ML_SORTING_DURATION }
9
-};
10
-
11
 // Ctor / dtor
12
 
13
 /* explicit */ MLVideoFoldersModel::MLVideoFoldersModel(QObject * parent) : MLBaseModel(parent) {}
14
@@ -102,28 +96,12 @@
15
     }
16
 }
17
 
18
-vlc_ml_sorting_criteria_t MLVideoFoldersModel::roleToCriteria(int role) const /* override */
19
-{
20
-    switch (role)
21
-    {
22
-        case FOLDER_TITLE:
23
-            return VLC_ML_SORTING_ALPHA;
24
-        case FOLDER_DURATION:
25
-            return VLC_ML_SORTING_DURATION;
26
-        default:
27
-            return VLC_ML_SORTING_DEFAULT;
28
-    }
29
-}
30
-
31
 vlc_ml_sorting_criteria_t MLVideoFoldersModel::nameToCriteria(QByteArray name) const /* override */
32
 {
33
-    return criterias.value(name, VLC_ML_SORTING_DEFAULT);
34
-}
35
-
36
-QByteArray MLVideoFoldersModel::criteriaToName(vlc_ml_sorting_criteria_t criteria) const
37
-/* override */
38
-{
39
-    return criterias.key(criteria, "");
40
+    return QHash<QByteArray, vlc_ml_sorting_criteria_t> {
41
+        { "title",    VLC_ML_SORTING_ALPHA    },
42
+        { "duration", VLC_ML_SORTING_DURATION },
43
+    }.value(name, VLC_ML_SORTING_DEFAULT);
44
 }
45
 
46
 std::unique_ptr<MLListCacheLoader>
47
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/modules/gui/qt/medialibrary/mlvideofoldersmodel.hpp -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/modules/gui/qt/medialibrary/mlvideofoldersmodel.hpp Changed
14
 
1
@@ -51,12 +51,8 @@
2
 protected:
3
     QVariant itemRoleData(MLItem *item, int role = Qt::DisplayRole) const override;
4
 
5
-    vlc_ml_sorting_criteria_t roleToCriteria(int role) const override;
6
-
7
     vlc_ml_sorting_criteria_t nameToCriteria(QByteArray name) const override;
8
 
9
-    QByteArray criteriaToName(vlc_ml_sorting_criteria_t criteria) const override;
10
-
11
     std::unique_ptr<MLListCacheLoader> createMLLoader() const override;
12
 
13
 protected: // MLBaseModel reimplementation
14
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/modules/gui/qt/medialibrary/mlvideogroupsmodel.cpp -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/modules/gui/qt/medialibrary/mlvideogroupsmodel.cpp Changed
51
 
1
@@ -44,13 +44,6 @@
2
 static const int MLVIDEOGROUPSMODEL_COVER_WIDTH  = 260 * 3; // 16 / 10 ratio
3
 static const int MLVIDEOGROUPSMODEL_COVER_HEIGHT = 162 * 3;
4
 
5
-static const QHash<QByteArray, vlc_ml_sorting_criteria_t> criterias =
6
-{
7
-    { "title",    VLC_ML_SORTING_ALPHA         },
8
-    { "duration", VLC_ML_SORTING_DURATION      },
9
-    { "date",     VLC_ML_SORTING_INSERTIONDATE }
10
-};
11
-
12
 //=================================================================================================
13
 // MLVideoGroupsModel
14
 //=================================================================================================
15
@@ -144,30 +137,13 @@
16
     }
17
 }
18
 
19
-vlc_ml_sorting_criteria_t MLVideoGroupsModel::roleToCriteria(int role) const /* override */
20
-{
21
-    switch (role)
22
-    {
23
-        case VIDEO_TITLE:
24
-            return VLC_ML_SORTING_ALPHA;
25
-        case VIDEO_DURATION:
26
-            return VLC_ML_SORTING_DURATION;
27
-        case GROUP_DATE:
28
-            return VLC_ML_SORTING_INSERTIONDATE;
29
-        default:
30
-            return VLC_ML_SORTING_DEFAULT;
31
-    }
32
-}
33
-
34
 vlc_ml_sorting_criteria_t MLVideoGroupsModel::nameToCriteria(QByteArray name) const /* override */
35
 {
36
-    return criterias.value(name, VLC_ML_SORTING_DEFAULT);
37
-}
38
-
39
-QByteArray MLVideoGroupsModel::criteriaToName(vlc_ml_sorting_criteria_t criteria) const
40
-/* override */
41
-{
42
-    return criterias.key(criteria, "");
43
+    return QHash<QByteArray, vlc_ml_sorting_criteria_t> {
44
+        { "title",    VLC_ML_SORTING_ALPHA         },
45
+        { "duration", VLC_ML_SORTING_DURATION      },
46
+        { "date",     VLC_ML_SORTING_INSERTIONDATE },
47
+    }.value(name, VLC_ML_SORTING_DEFAULT);
48
 }
49
 
50
 std::unique_ptr<MLListCacheLoader> MLVideoGroupsModel::createMLLoader() const /* override */
51
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/modules/gui/qt/medialibrary/mlvideogroupsmodel.hpp -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/modules/gui/qt/medialibrary/mlvideogroupsmodel.hpp Changed
14
 
1
@@ -50,12 +50,8 @@
2
 protected: // MLVideoModel reimplementation
3
     QVariant itemRoleData(MLItem *item, int role = Qt::DisplayRole) const override;
4
 
5
-    vlc_ml_sorting_criteria_t roleToCriteria(int role) const override;
6
-
7
     vlc_ml_sorting_criteria_t nameToCriteria(QByteArray name) const override;
8
 
9
-    QByteArray criteriaToName(vlc_ml_sorting_criteria_t criteria) const override;
10
-
11
     std::unique_ptr<MLListCacheLoader> createMLLoader() const override;
12
 
13
     void onVlcMlEvent(const MLEvent & event) override;
14
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/modules/gui/qt/medialibrary/mlvideomodel.cpp -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/modules/gui/qt/medialibrary/mlvideomodel.cpp Changed
49
 
1
@@ -33,12 +33,6 @@
2
     return list;
3
 }
4
 
5
-QHash<QByteArray, vlc_ml_sorting_criteria_t> MLVideoModel::M_names_to_criteria = {
6
-    {"title", VLC_ML_SORTING_ALPHA},
7
-    {"duration", VLC_ML_SORTING_DURATION},
8
-    {"playcount", VLC_ML_SORTING_PLAYCOUNT},
9
-};
10
-
11
 MLVideoModel::MLVideoModel(QObject* parent)
12
     : MLBaseModel(parent)
13
 {
14
@@ -177,29 +171,13 @@
15
     };
16
 }
17
 
18
-vlc_ml_sorting_criteria_t MLVideoModel::roleToCriteria(int role) const
19
-{
20
-    switch(role)
21
-    {
22
-        case VIDEO_TITLE:
23
-            return VLC_ML_SORTING_ALPHA;
24
-        case VIDEO_DURATION:
25
-            return VLC_ML_SORTING_DURATION;
26
-        case VIDEO_PLAYCOUNT:
27
-            return VLC_ML_SORTING_PLAYCOUNT;
28
-        default:
29
-            return VLC_ML_SORTING_DEFAULT;
30
-    }
31
-}
32
-
33
 vlc_ml_sorting_criteria_t MLVideoModel::nameToCriteria(QByteArray name) const
34
 {
35
-    return M_names_to_criteria.value(name, VLC_ML_SORTING_DEFAULT);
36
-}
37
-
38
-QByteArray MLVideoModel::criteriaToName(vlc_ml_sorting_criteria_t criteria) const
39
-{
40
-    return M_names_to_criteria.key(criteria, "");
41
+    return QHash<QByteArray, vlc_ml_sorting_criteria_t> {
42
+        {"title", VLC_ML_SORTING_ALPHA},
43
+        {"duration", VLC_ML_SORTING_DURATION},
44
+        {"playcount", VLC_ML_SORTING_PLAYCOUNT},
45
+    }.value(name, VLC_ML_SORTING_DEFAULT);
46
 }
47
 
48
 // Protected MLBaseModel reimplementation
49
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/modules/gui/qt/medialibrary/mlvideomodel.hpp -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/modules/gui/qt/medialibrary/mlvideomodel.hpp Changed
14
 
1
@@ -88,12 +88,8 @@
2
 private:
3
     void generateThumbnail(uint64_t id) const;
4
 
5
-    vlc_ml_sorting_criteria_t roleToCriteria(int role) const override;
6
     vlc_ml_sorting_criteria_t nameToCriteria(QByteArray name) const override;
7
 
8
-    static QHash<QByteArray, vlc_ml_sorting_criteria_t> M_names_to_criteria;
9
-    QByteArray criteriaToName(vlc_ml_sorting_criteria_t criteria) const override;
10
-
11
     struct Loader : public MLListCacheLoader::MLOp
12
     {
13
         using MLListCacheLoader::MLOp::MLOp;
14
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/modules/gui/qt/menus/menus.cpp -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/modules/gui/qt/menus/menus.cpp Changed
44
 
1
@@ -281,7 +281,7 @@
2
  * Interface modification, load other interfaces, activate Extensions
3
  * \param current, set to NULL for menu creation, else for menu update
4
  **/
5
-void VLCMenuBar::ViewMenu( qt_intf_t *p_intf, QMenu *menu )
6
+void VLCMenuBar::ViewMenu(qt_intf_t *p_intf, QMenu *menu, std::optional<bool> playerViewVisible)
7
 {
8
     QAction *action;
9
 
10
@@ -300,21 +300,20 @@
11
         if( m && m->parent() == menu ) delete m;
12
     }
13
 
14
-    QString title;
15
+    if (playerViewVisible.has_value())
16
+    {
17
+        QString title;
18
 
19
-    if (mi->hasMediaLibrary())
20
-        title = qtr("Media Library");
21
-    else
22
-        title = qtr("Browse and Discover");
23
+        if (*playerViewVisible)
24
+            title = qtr("Show &main view");
25
+        else
26
+            title = qtr("Show &player view");
27
 
28
-    action = menu->addAction(
29
-#ifndef __APPLE__
30
-            QIcon( ":/menu/media_library.svg" ),
31
-#endif
32
-            title);
33
-    action->setCheckable( true );
34
-    connect( action, &QAction::triggered, mi, &MainCtx::setMediaLibraryVisible );
35
-    action->setChecked( mi->isMediaLibraryVisible() );
36
+        action = menu->addAction(title);
37
+
38
+        connect( action, &QAction::triggered, mi, *playerViewVisible ? &MainCtx::requestShowMainView
39
+                                                                     : &MainCtx::requestShowPlayerView );
40
+    }
41
 
42
     action = menu->addAction(
43
 #ifndef __APPLE__
44
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/modules/gui/qt/menus/menus.hpp -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/modules/gui/qt/menus/menus.hpp Changed
10
 
1
@@ -80,7 +80,7 @@
2
 
3
     static void ToolsMenu( qt_intf_t *, QMenu * );
4
 
5
-    static void ViewMenu( qt_intf_t *, QMenu *);
6
+    static void ViewMenu( qt_intf_t *, QMenu *, std::optional<bool> playerViewVisible = std::nullopt );
7
 
8
     static void InterfacesMenu( qt_intf_t *p_intf, QMenu * );
9
     static void ExtensionsMenu( qt_intf_t *p_intf, QMenu * );
10
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/modules/gui/qt/menus/qml/Menubar.qml -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/modules/gui/qt/menus/qml/Menubar.qml Changed
9
 
1
@@ -83,6 +83,7 @@
2
         id: menubar
3
         ctx: MainCtx
4
         menubar: menubarLayout
5
+        playerViewVisible: History.match(History.viewPath, "player")
6
 
7
         onMenuClosed: _menuIndex = -1
8
         onNavigateMenu: (direction) => {
9
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/modules/gui/qt/menus/qml_menu_wrapper.cpp -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/modules/gui/qt/menus/qml_menu_wrapper.cpp Changed
24
 
1
@@ -235,7 +235,7 @@
2
 
3
     /* View menu, a bit different */
4
     submenu = m_menu->addMenu(qtr( "V&iew" ));
5
-    ViewMenu( p_intf, submenu );
6
+    ViewMenu( p_intf, submenu, m_playerViewVisible );
7
 
8
     submenu = m_menu->addMenu(qtr( "&Help" ));
9
     HelpMenu(submenu);
10
@@ -348,11 +348,11 @@
11
     });
12
 }
13
 
14
-void QmlMenuBar::popupViewMenu( QQuickItem* button )
15
+void QmlMenuBar::popupViewMenu(QQuickItem* button )
16
 {
17
     popupMenuCommon(button, this(QMenu* menu) {
18
         qt_intf_t* p_intf = m_ctx->getIntf();
19
-        ViewMenu( p_intf, menu );
20
+        ViewMenu( p_intf, menu, m_playerViewVisible );
21
     });
22
 }
23
 
24
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/modules/gui/qt/menus/qml_menu_wrapper.hpp -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/modules/gui/qt/menus/qml_menu_wrapper.hpp Changed
26
 
1
@@ -117,6 +117,7 @@
2
 {
3
     Q_OBJECT
4
     SIMPLE_MENU_PROPERTY(MainCtx*, ctx, nullptr)
5
+    SIMPLE_MENU_PROPERTY(bool, playerViewVisible, false)
6
 
7
     Q_PROPERTY(bool shown READ isShown NOTIFY shownChanged FINAL)
8
 
9
@@ -131,7 +132,7 @@
10
     void shownChanged();
11
 
12
 public slots:
13
-    void popup( QPoint pos );
14
+    void popup(QPoint pos);
15
 private:
16
     std::unique_ptr<QMenu> m_menu;
17
     bool m_shown = false;
18
@@ -145,6 +146,7 @@
19
     SIMPLE_MENU_PROPERTY(MainCtx*, ctx, nullptr)
20
     SIMPLE_MENU_PROPERTY(QQuickItem*, menubar, nullptr)
21
     SIMPLE_MENU_PROPERTY(bool, openMenuOnHover, false)
22
+    SIMPLE_MENU_PROPERTY(bool, playerViewVisible, false)
23
 
24
 public:
25
     explicit QmlMenuBar(QObject *parent = nullptr);
26
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/modules/gui/qt/meson.build -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/modules/gui/qt/meson.build Changed
18
 
1
@@ -104,6 +104,7 @@
2
     'menus/qml_menu_wrapper.hpp',
3
     'menus/menus.hpp',
4
     'network/devicesourceprovider.hpp',
5
+    'network/networkbasemodel.hpp',
6
     'network/networkdevicemodel.hpp',
7
     'network/networksourcesmodel.hpp',
8
     'network/networkmediamodel.hpp',
9
@@ -374,6 +375,8 @@
10
     'network/mediatreelistener.hpp',
11
     'network/devicesourceprovider.cpp',
12
     'network/devicesourceprovider.hpp',
13
+    'network/networkbasemodel.cpp',
14
+    'network/networkbasemodel.hpp',
15
     'network/networkdevicemodel.cpp',
16
     'network/networkdevicemodel.hpp',
17
     'network/networksourcesmodel.cpp',
18
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/modules/gui/qt/network/devicesourceprovider.hpp -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/modules/gui/qt/network/devicesourceprovider.hpp Changed
47
 
1
@@ -32,18 +32,19 @@
2
 #include "mediatreelistener.hpp"
3
 
4
 //represents an entry of the model
5
-struct NetworkDeviceItem
6
+struct NetworkDeviceItem : public NetworkBaseItem
7
 {
8
-    NetworkDeviceItem(const SharedInputItem& item, const NetworkDeviceModel::MediaSourcePtr& mediaSource)
9
-        : name(qfu(item->psz_name))
10
-        , mainMrl(QUrl::fromEncoded(item->psz_uri))
11
-        , protocol(mainMrl.scheme())
12
-        , type( static_cast<NetworkDeviceModel::ItemType>(item->i_type))
13
-        , mediaSource(mediaSource)
14
-        , inputItem(item)
15
+    NetworkDeviceItem(const SharedInputItem& item, const NetworkDeviceModel::MediaSourcePtr& source)
16
     {
17
+        name = qfu(item->psz_name);
18
+        mainMrl = QUrl::fromEncoded(item->psz_uri);
19
+        protocol = mainMrl.scheme();
20
+        type = static_cast<NetworkDeviceModel::ItemType>(item->i_type);
21
+        mediaSource = source;
22
+        inputItem = item;
23
+
24
         id = qHash(name) ^ qHash(protocol);
25
-        mrls.push_back(std::make_pair(mainMrl, mediaSource));
26
+        mrls.push_back(std::make_pair(mainMrl, source));
27
 
28
         char* artworkUrl = input_item_GetArtworkURL(inputItem.get());
29
         if (artworkUrl)
30
@@ -54,15 +55,10 @@
31
     }
32
 
33
     uint id;
34
-    QString name;
35
-    QUrl mainMrl;
36
     std::vector<std::pair<QUrl, NetworkDeviceModel::MediaSourcePtr>> mrls;
37
-    QString protocol;
38
-    NetworkDeviceModel::ItemType type;
39
     NetworkDeviceModel::MediaSourcePtr mediaSource;
40
     SharedInputItem inputItem;
41
-    QString artwork;
42
-};
43
+ };
44
 
45
 using NetworkDeviceItemPtr =std::shared_ptr<NetworkDeviceItem>;
46
 
47
_service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/modules/gui/qt/network/networkbasemodel.cpp Added
71
 
1
@@ -0,0 +1,69 @@
2
+/*****************************************************************************
3
+ * Copyright (C) 2019 VLC authors and VideoLAN
4
+ *
5
+ * This program is free software; you can redistribute it and/or modify
6
+ * it under the terms of the GNU General Public License as published by
7
+ * the Free Software Foundation; either version 2 of the License, or
8
+ * ( at your option ) any later version.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU General Public License
16
+ * along with this program; if not, write to the Free Software
17
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
18
+ *****************************************************************************/
19
+#include "networkbasemodel.hpp"
20
+
21
+QVariant NetworkBaseModel::basedata(const NetworkBaseItem& item, int role) const
22
+{
23
+    switch (role)
24
+    {
25
+    case NETWORK_BASE_NAME:
26
+        return item.name;
27
+    case NETWORK_BASE_MRL:
28
+        return item.mainMrl;
29
+    case NETWORK_BASE_TYPE:
30
+        return item.type;
31
+    case NETWORK_BASE_PROTOCOL:
32
+        return item.protocol;
33
+    case NETWORK_BASE_ARTWORK:
34
+        return item.artwork;
35
+    case NETWORK_BASE_ARTWORK_FALLBACK:
36
+        return artworkFallbackForType(item.type);
37
+    default:
38
+        return {};
39
+    };
40
+}
41
+
42
+QString NetworkBaseModel::artworkFallbackForType(const ItemType type) const
43
+{
44
+    switch (type) {
45
+    case TYPE_DISC:
46
+        return "qrc:///sd/disc.svg";
47
+    case TYPE_CARD:
48
+        return "qrc:///sd/capture-card.svg";
49
+    case TYPE_STREAM:
50
+        return "qrc:///sd/stream.svg";
51
+    case TYPE_PLAYLIST:
52
+        return "qrc:///sd/playlist.svg";
53
+    case TYPE_FILE:
54
+        return "qrc:///sd/file.svg";
55
+    default:
56
+        return "qrc:///sd/directory.svg";
57
+    }
58
+}
59
+
60
+QHash<int, QByteArray> NetworkBaseModel::roleNames() const
61
+{
62
+    return {
63
+        { NETWORK_BASE_NAME, "name" },
64
+        { NETWORK_BASE_MRL, "mrl" },
65
+        { NETWORK_BASE_TYPE, "type" },
66
+        { NETWORK_BASE_PROTOCOL, "protocol" },
67
+        { NETWORK_BASE_ARTWORK, "artwork" },
68
+        { NETWORK_BASE_ARTWORK_FALLBACK, "artworkFallback" },
69
+    };
70
+}
71
_service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/modules/gui/qt/network/networkbasemodel.hpp Added
82
 
1
@@ -0,0 +1,80 @@
2
+/*****************************************************************************
3
+ * Copyright (C) 2019 VLC authors and VideoLAN
4
+ *
5
+ * This program is free software; you can redistribute it and/or modify
6
+ * it under the terms of the GNU General Public License as published by
7
+ * the Free Software Foundation; either version 2 of the License, or
8
+ * ( at your option ) any later version.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU General Public License
16
+ * along with this program; if not, write to the Free Software
17
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
18
+ *****************************************************************************/
19
+
20
+#ifndef NETWORKBASEMODEL_HPP
21
+#define NETWORKBASEMODEL_HPP
22
+
23
+#ifdef HAVE_CONFIG_H
24
+#include "config.h"
25
+#endif
26
+
27
+#include "util/base_model.hpp"
28
+#include <vlc_media_source.h>
29
+
30
+#include <QString>
31
+#include <QUrl>
32
+
33
+struct NetworkBaseItem;
34
+class NetworkBaseModel: public BaseModel
35
+{
36
+    Q_OBJECT
37
+
38
+public:
39
+    enum Role {
40
+        NETWORK_BASE_NAME = Qt::UserRole + 1,
41
+        NETWORK_BASE_MRL,
42
+        NETWORK_BASE_TYPE,
43
+        NETWORK_BASE_PROTOCOL,
44
+        NETWORK_BASE_ARTWORK,
45
+        NETWORK_BASE_ARTWORK_FALLBACK,
46
+        NETWORK_BASE_MAX
47
+    };
48
+
49
+    enum ItemType{
50
+        // qt version of input_item_type_e
51
+        TYPE_UNKNOWN = ITEM_TYPE_UNKNOWN,
52
+        TYPE_FILE,
53
+        TYPE_DIRECTORY,
54
+        TYPE_DISC,
55
+        TYPE_CARD,
56
+        TYPE_STREAM,
57
+        TYPE_PLAYLIST,
58
+        TYPE_NODE,
59
+    };
60
+    Q_ENUM( ItemType )
61
+
62
+    using BaseModel::BaseModel;
63
+
64
+    QHash<int, QByteArray> roleNames() const override;
65
+
66
+    Q_INVOKABLE QString artworkFallbackForType(const ItemType type) const;
67
+
68
+protected:
69
+    QVariant basedata(const NetworkBaseItem& item, int role) const;
70
+};
71
+
72
+struct NetworkBaseItem
73
+{
74
+    QString name;
75
+    QUrl mainMrl;
76
+    QString protocol;
77
+    NetworkBaseModel::ItemType type;
78
+    QString artwork;
79
+};
80
+
81
+#endif /* NETWORKBASEMODEL_HPP */
82
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/modules/gui/qt/network/networkdevicemodel.cpp -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/modules/gui/qt/network/networkdevicemodel.cpp Changed
52
 
1
@@ -221,7 +221,7 @@
2
 }
3
 
4
 NetworkDeviceModel::NetworkDeviceModel( NetworkDeviceModelPrivate* priv, QObject* parent)
5
-    : BaseModel(priv, parent)
6
+    : NetworkBaseModel(priv, parent)
7
 {
8
 }
9
 
10
@@ -237,36 +237,21 @@
11
 
12
     switch ( role )
13
     {
14
-        case NETWORK_NAME:
15
-            return item->name;
16
-        case NETWORK_MRL:
17
-            return item->mainMrl;
18
-        case NETWORK_TYPE:
19
-            return item->type;
20
-        case NETWORK_PROTOCOL:
21
-            return item->protocol;
22
         case NETWORK_SOURCE:
23
             return item->mediaSource->description;
24
         case NETWORK_TREE:
25
             return QVariant::fromValue( NetworkTreeItem(MediaTreePtr{ item->mediaSource->tree }, item->inputItem.get()) );
26
-        case NETWORK_ARTWORK:
27
-            return item->artwork;
28
         default:
29
-            return {};
30
+            return NetworkBaseModel::basedata(*item, role);
31
     }
32
 }
33
 
34
 QHash<int, QByteArray> NetworkDeviceModel::roleNames() const
35
 {
36
-    return {
37
-        { NETWORK_NAME, "name" },
38
-        { NETWORK_MRL, "mrl" },
39
-        { NETWORK_TYPE, "type" },
40
-        { NETWORK_PROTOCOL, "protocol" },
41
-        { NETWORK_SOURCE, "source" },
42
-        { NETWORK_TREE, "tree" },
43
-        { NETWORK_ARTWORK, "artwork" },
44
-    };
45
+    QHash<int, QByteArray> roles = NetworkBaseModel::roleNames();
46
+    rolesNETWORK_SOURCE = "source";
47
+    rolesNETWORK_TREE = "tree";
48
+    return roles;
49
 }
50
 
51
 void NetworkDeviceModel::setCtx(MainCtx* ctx)
52
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/modules/gui/qt/network/networkdevicemodel.hpp -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/modules/gui/qt/network/networkdevicemodel.hpp Changed
49
 
1
@@ -28,7 +28,7 @@
2
 
3
 #include <vlc_media_source.h>
4
 
5
-#include "util/base_model.hpp"
6
+#include "networkbasemodel.hpp"
7
 #include "util/shared_input_item.hpp"
8
 
9
 #include <memory>
10
@@ -38,7 +38,7 @@
11
 class MainCtx;
12
 
13
 class NetworkDeviceModelPrivate;
14
-class NetworkDeviceModel : public BaseModel
15
+class NetworkDeviceModel : public NetworkBaseModel
16
 {
17
     Q_OBJECT
18
 
19
@@ -49,28 +49,10 @@
20
 
21
 public: // Enums
22
     enum Role {
23
-        NETWORK_NAME = Qt::UserRole + 1,
24
-        NETWORK_MRL,
25
-        NETWORK_TYPE,
26
-        NETWORK_PROTOCOL,
27
-        NETWORK_SOURCE,
28
+        NETWORK_SOURCE = NetworkBaseModel::NETWORK_BASE_MAX,
29
         NETWORK_TREE,
30
-        NETWORK_ARTWORK,
31
     };
32
 
33
-    enum ItemType{
34
-        // qt version of input_item_type_e
35
-        TYPE_UNKNOWN = ITEM_TYPE_UNKNOWN,
36
-        TYPE_FILE,
37
-        TYPE_DIRECTORY,
38
-        TYPE_DISC,
39
-        TYPE_CARD,
40
-        TYPE_STREAM,
41
-        TYPE_PLAYLIST,
42
-        TYPE_NODE,
43
-    };
44
-    Q_ENUM( ItemType )
45
-
46
     enum SDCatType{
47
         // qt version of input_item_type_e
48
         CAT_UNDEFINED = 0,
49
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/modules/gui/qt/network/networkmediamodel.cpp -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/modules/gui/qt/network/networkmediamodel.cpp Changed
93
 
1
@@ -40,17 +40,12 @@
2
 //use the same queue as in mlfoldermodel
3
 static const char* const ML_FOLDER_ADD_QUEUE = "ML_FOLDER_ADD_QUEUE";
4
 
5
-struct NetworkMediaItem
6
+struct NetworkMediaItem : public NetworkBaseItem
7
 {
8
-    QString name;
9
     QString uri;
10
-    QUrl mainMrl;
11
-    QString protocol;
12
     bool indexed;
13
-    NetworkMediaModel::ItemType type;
14
     bool canBeIndexed;
15
     NetworkTreeItem tree;
16
-    QString artwork;
17
     qint64 fileSize;
18
     QDateTime fileModified;
19
     MLMedia media;
20
@@ -487,7 +482,7 @@
21
 // NetworkMediaModel implementation
22
 
23
 NetworkMediaModel::NetworkMediaModel( QObject* parent )
24
-    : BaseModel( new  NetworkMediaModelPrivate(this), parent )
25
+    : NetworkBaseModel( new  NetworkMediaModelPrivate(this), parent )
26
 {
27
 }
28
 
29
@@ -515,21 +510,13 @@
30
 
31
     switch ( role )
32
     {
33
-        case NETWORK_NAME:
34
-            return item->name;
35
-        case NETWORK_MRL:
36
-            return item->mainMrl;
37
         case NETWORK_INDEXED:
38
             return item->indexed;
39
         case NETWORK_CANINDEX:
40
             return item->canBeIndexed;
41
-        case NETWORK_TYPE:
42
-            return item->type;
43
-        case NETWORK_PROTOCOL:
44
-            return item->protocol;
45
         case NETWORK_TREE:
46
             return QVariant::fromValue( item->tree );
47
-        case NETWORK_ARTWORK:
48
+        case NETWORK_BASE_ARTWORK:
49
         {
50
             if (!item->artwork.isEmpty())
51
                 return item->artwork;
52
@@ -570,27 +557,24 @@
53
             return {};
54
         }
55
         default:
56
-            return {};
57
+            return basedata(*item, role);
58
     }
59
 }
60
 
61
 QHash<int, QByteArray> NetworkMediaModel::roleNames() const
62
 {
63
-    return {
64
-        { NETWORK_NAME, "name" },
65
-        { NETWORK_MRL, "mrl" },
66
-        { NETWORK_INDEXED, "indexed" },
67
-        { NETWORK_CANINDEX, "can_index" },
68
-        { NETWORK_TYPE, "type" },
69
-        { NETWORK_PROTOCOL, "protocol" },
70
-        { NETWORK_TREE, "tree" },
71
-        { NETWORK_ARTWORK, "artwork" },
72
-        { NETWORK_FILE_SIZE, "fileSizeRaw64" },
73
-        { NETWORK_FILE_MODIFIED, "fileModified" },
74
-        { NETWORK_MEDIA, "media" },
75
-        { NETWORK_MEDIA_PROGRESS, "progress" },
76
-        { NETWORK_MEDIA_DURATION, "duration" }
77
-    };
78
+    auto roles = NetworkBaseModel::roleNames();
79
+
80
+    rolesNETWORK_INDEXED = "indexed";
81
+    rolesNETWORK_CANINDEX = "can_index";
82
+    rolesNETWORK_TREE = "tree";
83
+    rolesNETWORK_FILE_SIZE = "fileSizeRaw64";
84
+    rolesNETWORK_FILE_MODIFIED = "fileModified";
85
+    rolesNETWORK_MEDIA = "media";
86
+    rolesNETWORK_MEDIA_PROGRESS = "progress";
87
+    rolesNETWORK_MEDIA_DURATION = "duration";
88
+
89
+    return roles;
90
 }
91
 
92
 Qt::ItemFlags NetworkMediaModel::flags( const QModelIndex& idx ) const
93
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/modules/gui/qt/network/networkmediamodel.hpp -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/modules/gui/qt/network/networkmediamodel.hpp Changed
53
 
1
@@ -30,7 +30,7 @@
2
 #include <vlc_cxx_helpers.hpp>
3
 
4
 #include "util/shared_input_item.hpp"
5
-#include "util/base_model.hpp"
6
+#include "networkbasemodel.hpp"
7
 
8
 #include <memory>
9
 
10
@@ -101,20 +101,15 @@
11
 };
12
 
13
 class NetworkMediaModelPrivate;
14
-class NetworkMediaModel : public BaseModel
15
+class NetworkMediaModel : public NetworkBaseModel
16
 {
17
     Q_OBJECT
18
 
19
 public:
20
     enum Role {
21
-        NETWORK_NAME = Qt::UserRole + 1,
22
-        NETWORK_MRL,
23
-        NETWORK_INDEXED,
24
+        NETWORK_INDEXED = NETWORK_BASE_MAX,
25
         NETWORK_CANINDEX,
26
-        NETWORK_TYPE,
27
-        NETWORK_PROTOCOL,
28
         NETWORK_TREE,
29
-        NETWORK_ARTWORK,
30
         NETWORK_FILE_SIZE,
31
         NETWORK_FILE_MODIFIED,
32
         NETWORK_MEDIA,
33
@@ -122,19 +117,6 @@
34
         NETWORK_MEDIA_DURATION,
35
     };
36
 
37
-    enum ItemType{
38
-        // qt version of input_item_type_e
39
-        TYPE_UNKNOWN = ITEM_TYPE_UNKNOWN,
40
-        TYPE_FILE,
41
-        TYPE_DIRECTORY,
42
-        TYPE_DISC,
43
-        TYPE_CARD,
44
-        TYPE_STREAM,
45
-        TYPE_PLAYLIST,
46
-        TYPE_NODE,
47
-    };
48
-    Q_ENUM( ItemType )
49
-
50
     Q_PROPERTY(MainCtx* ctx READ getCtx WRITE setCtx NOTIFY ctxChanged)
51
     Q_PROPERTY(QVariant tree READ getTree WRITE setTree NOTIFY treeChanged)
52
     Q_PROPERTY(QVariantList path READ getPath NOTIFY pathChanged)
53
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/modules/gui/qt/network/qml/BrowseDeviceView.qml -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/modules/gui/qt/network/qml/BrowseDeviceView.qml Changed
50
 
1
@@ -248,7 +248,7 @@
2
 
3
                     text: qsTr("Name"),
4
 
5
-                    headerDelegate: artworkHeader,
6
+                    headerDelegate: tableColumns.titleHeaderDelegate,
7
                     colDelegate: artworkColumn
8
                 })
9
             }
10
@@ -263,7 +263,7 @@
11
 
12
                     isSortable: false,
13
 
14
-                    headerDelegate: artworkHeader,
15
+                    headerDelegate: tableColumns.titleHeaderDelegate,
16
                     colDelegate: artworkColumn
17
                 }
18
             }, {
19
@@ -309,25 +309,13 @@
20
 
21
             onItemDoubleClicked: (index, model) => root.onDoubleClicked(model, index)
22
 
23
-            Component {
24
-                id: artworkHeader
25
-
26
-                Widgets.TableHeaderDelegate {
27
-                    Widgets.IconLabel {
28
-
29
-                        height: VLCStyle.listAlbumCover_height
30
-                        width: VLCStyle.listAlbumCover_width
31
-                        anchors.centerIn: parent
32
+            Widgets.TableColumns {
33
+                id: tableColumns
34
 
35
-                        horizontalAlignment: Text.AlignHCenter
36
-                        verticalAlignment: Text.AlignVCenter
37
-                        font.pixelSize: VLCStyle.icon_tableHeader
38
+                titleCover_width: VLCStyle.listAlbumCover_width
39
+                titleCover_height: VLCStyle.listAlbumCover_height
40
 
41
-                        text: VLCIcons.album_cover
42
-
43
-                        color: parent.colorContext.fg.secondary
44
-                    }
45
-                }
46
+                showTitleText: false
47
             }
48
 
49
             Component {
50
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/modules/gui/qt/network/qml/BrowseTreeDisplay.qml -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/modules/gui/qt/network/qml/BrowseTreeDisplay.qml Changed
79
 
1
@@ -94,24 +94,7 @@
2
         defaultText:  qsTr("Unknown Share")
3
 
4
         coverProvider: function(index, data) {
5
-            function _baseUri(type) {
6
-                switch (type) {
7
-                case NetworkMediaModel.TYPE_DISC:
8
-                    return "qrc:///sd/disc.svg"
9
-                case NetworkMediaModel.TYPE_CARD:
10
-                    return "qrc:///sd/capture-card.svg"
11
-                case NetworkMediaModel.TYPE_STREAM:
12
-                    return "qrc:///sd/stream.svg"
13
-                case NetworkMediaModel.TYPE_PLAYLIST:
14
-                    return "qrc:///sd/playlist.svg"
15
-                case NetworkMediaModel.TYPE_FILE:
16
-                    return "qrc:///sd/file.svg"
17
-                default:
18
-                    return "qrc:///sd/directory.svg"
19
-                }
20
-            }
21
-
22
-            const fallbackImage = SVGColorImage.colorize(_baseUri(data.type))
23
+            const fallbackImage = SVGColorImage.colorize(data.artworkFallback)
24
                 .background(networkDragItem.colorContext.bg.secondary)
25
                 .color1(networkDragItem.colorContext.fg.primary)
26
                 .accent(networkDragItem.colorContext.accent)
27
@@ -209,21 +192,6 @@
28
         MainTableView {
29
             id: tableView
30
 
31
-            property Component thumbnailHeader: Widgets.TableHeaderDelegate {
32
-                Widgets.IconLabel {
33
-                    height: VLCStyle.listAlbumCover_height
34
-                    width: VLCStyle.listAlbumCover_width
35
-
36
-                    anchors.centerIn: parent
37
-
38
-                    horizontalAlignment: Text.AlignHCenter
39
-                    verticalAlignment: Text.AlignVCenter
40
-                    font.pixelSize: VLCStyle.icon_tableHeader
41
-                    text: VLCIcons.album_cover
42
-                    color: parent.colorContext.fg.secondary
43
-                }
44
-            }
45
-
46
             property Component thumbnailColumn: NetworkThumbnailItem {
47
                 onPlayClicked: index => playAt(index)
48
             }
49
@@ -240,7 +208,7 @@
50
 
51
                     text: qsTr("Name"),
52
 
53
-                    headerDelegate: thumbnailHeader,
54
+                    headerDelegate: tableColumns.titleHeaderDelegate,
55
                     colDelegate: thumbnailColumn
56
                 })
57
             }
58
@@ -255,7 +223,7 @@
59
 
60
                     isSortable: false,
61
 
62
-                    headerDelegate: thumbnailHeader,
63
+                    headerDelegate: tableColumns.titleHeaderDelegate,
64
                     colDelegate: thumbnailColumn
65
                 }
66
             }, {
67
@@ -331,6 +299,11 @@
68
 
69
             Widgets.TableColumns {
70
                 id: tableColumns
71
+
72
+                titleCover_width: VLCStyle.listAlbumCover_width
73
+                titleCover_height: VLCStyle.listAlbumCover_height
74
+
75
+                showTitleText: false
76
             }
77
         }
78
     }
79
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/modules/gui/qt/network/qml/NetworkCustomCover.qml -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/modules/gui/qt/network/qml/NetworkCustomCover.qml Changed
36
 
1
@@ -45,25 +45,6 @@
2
     // currently shown image
3
     property var _image: typeImage.visible ? typeImage : artwork
4
 
5
-
6
-    function _baseUri(type) {
7
-        switch (type) {
8
-        case NetworkMediaModel.TYPE_DISC:
9
-            return "qrc:///sd/disc.svg"
10
-        case NetworkMediaModel.TYPE_CARD:
11
-            return "qrc:///sd/capture-card.svg"
12
-        case NetworkMediaModel.TYPE_STREAM:
13
-            return "qrc:///sd/stream.svg"
14
-        case NetworkMediaModel.TYPE_PLAYLIST:
15
-            return "qrc:///sd/playlist.svg"
16
-        case NetworkMediaModel.TYPE_FILE:
17
-            return "qrc:///sd/file.svg"
18
-        default:
19
-            return "qrc:///sd/directory.svg"
20
-        }
21
-    }
22
-
23
-
24
     Widgets.ScaledImage {
25
         // failsafe cover, we show this while loading artwork or if loading fails
26
 
27
@@ -83,7 +64,7 @@
28
             if (!networkModel || !visible)
29
                 return ""
30
 
31
-            const img = SVGColorImage.colorize(_baseUri(networkModel.type))
32
+            const img = SVGColorImage.colorize(networkModel.artworkFallback)
33
                 .color1(root.color1)
34
                 .accent(root.accent)
35
 
36
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/modules/gui/qt/network/qml/NetworkGridItem.qml -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/modules/gui/qt/network/qml/NetworkGridItem.qml Changed
27
 
1
@@ -49,24 +49,7 @@
2
     cacheImage: true // we may have network thumbnail
3
 
4
     fallbackImage: {
5
-        const f = function(type) {
6
-            switch (type) {
7
-            case NetworkMediaModel.TYPE_DISC:
8
-                return "qrc:///sd/disc.svg"
9
-            case NetworkMediaModel.TYPE_CARD:
10
-                return "qrc:///sd/capture-card.svg"
11
-            case NetworkMediaModel.TYPE_STREAM:
12
-                return "qrc:///sd/stream.svg"
13
-            case NetworkMediaModel.TYPE_PLAYLIST:
14
-                return "qrc:///sd/playlist.svg"
15
-            case NetworkMediaModel.TYPE_FILE:
16
-                return "qrc:///sd/file.svg"
17
-            default:
18
-                return "qrc:///sd/directory.svg"
19
-            }
20
-        }
21
-
22
-        return SVGColorImage.colorize(f(model.type))
23
+        return SVGColorImage.colorize(model.artworkFallback)
24
                             .color1(root.colorContext.fg.primary)
25
                             .accent(root.colorContext.accent)
26
                             .uri()
27
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/modules/gui/qt/network/standardpathmodel.cpp -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/modules/gui/qt/network/standardpathmodel.cpp Changed
128
 
1
@@ -38,19 +38,10 @@
2
                                               vlc_media_tree_Hold,
3
                                               vlc_media_tree_Release);
4
 
5
-struct StandardPathItem
6
+struct StandardPathItem : public NetworkBaseItem
7
 {
8
-    QString name;
9
-    QUrl    mrl;
10
-
11
-    QString protocol;
12
-
13
-    NetworkDeviceModel::ItemType type;
14
-
15
     SharedInputItem inputItem;
16
     MediaTreePtr tree;
17
-
18
-    QUrl artwork;
19
 };
20
 
21
 using StandardPathItemPtr =  std::shared_ptr<StandardPathItem>;
22
@@ -79,7 +70,7 @@
23
 bool ascendingMrl(const StandardPathItemPtr& a,
24
                    const StandardPathItemPtr& b)
25
 {
26
-    return (QString::compare(a->mrl.toString(), b->mrl.toString(), Qt::CaseInsensitive) <= 0);
27
+    return (QString::compare(a->mainMrl.toString(), b->mainMrl.toString(), Qt::CaseInsensitive) <= 0);
28
 }
29
 
30
 bool descendingName(const StandardPathItemPtr& a,
31
@@ -91,7 +82,7 @@
32
 bool descendingMrl(const StandardPathItemPtr& a,
33
                    const StandardPathItemPtr& b)
34
 {
35
-    return (QString::compare(a->mrl.toString(), b->mrl.toString(), Qt::CaseInsensitive) >= 0);
36
+    return (QString::compare(a->mainMrl.toString(), b->mainMrl.toString(), Qt::CaseInsensitive) >= 0);
37
 }
38
 
39
 }
40
@@ -130,13 +121,13 @@
41
         Q_Q(StandardPathModel);
42
         assert(m_qmlInitializing == false);
43
 #ifdef Q_OS_UNIX
44
-        addItem(QVLCUserDir(VLC_HOME_DIR), qtr("Home"), QUrl());
45
+        addItem(QVLCUserDir(VLC_HOME_DIR), qtr("Home"), {});
46
 #endif
47
-        addItem(QVLCUserDir(VLC_DESKTOP_DIR), qtr("Desktop"), QUrl());
48
-        addItem(QVLCUserDir(VLC_DOCUMENTS_DIR), qtr("Documents"), QUrl());
49
-        addItem(QVLCUserDir(VLC_MUSIC_DIR), qtr("Music"), QUrl());
50
-        addItem(QVLCUserDir(VLC_VIDEOS_DIR), qtr("Videos"), QUrl());
51
-        addItem(QVLCUserDir(VLC_DOWNLOAD_DIR), qtr("Download"), QUrl());
52
+        addItem(QVLCUserDir(VLC_DESKTOP_DIR), qtr("Desktop"), {});
53
+        addItem(QVLCUserDir(VLC_DOCUMENTS_DIR), qtr("Documents"), {});
54
+        addItem(QVLCUserDir(VLC_MUSIC_DIR), qtr("Music"), {});
55
+        addItem(QVLCUserDir(VLC_VIDEOS_DIR), qtr("Videos"), {});
56
+        addItem(QVLCUserDir(VLC_DOWNLOAD_DIR), qtr("Download"), {});
57
         //model is never updated, but this is still needed to fit the LocalListBaseModelPrivate requirements
58
         ++m_revision;
59
         m_loading = false;
60
@@ -152,14 +143,14 @@
61
         return nullptr;
62
     }
63
 
64
-    void addItem(const QString & path, const QString & name, const QUrl & artwork)
65
+    void addItem(const QString & path, const QString & name, const QString& artwork)
66
     {
67
         QUrl url = QUrl::fromLocalFile(path);
68
 
69
         auto item = std::make_shared<StandardPathItem>();
70
 
71
         item->name = name;
72
-        item->mrl  = url;
73
+        item->mainMrl  = url;
74
         item->protocol = url.scheme();
75
         item->type = NetworkDeviceModel::TYPE_DIRECTORY;
76
 
77
@@ -200,7 +191,7 @@
78
 // Ctor / dtor
79
 
80
 StandardPathModel::StandardPathModel(QObject * parent)
81
-    : BaseModel(new StandardPathModelPrivate(this), parent)
82
+    : NetworkBaseModel(new StandardPathModelPrivate(this), parent)
83
 {
84
 }
85
 
86
@@ -208,16 +199,10 @@
87
 
88
 QHash<int, QByteArray> StandardPathModel::roleNames() const /* override */
89
 {
90
-    return
91
-    {
92
-        { PATH_NAME, "name" },
93
-        { PATH_MRL, "mrl" },
94
-        { PATH_PROTOCOL, "protocol" },
95
-        { PATH_TYPE, "type" },
96
-        { PATH_SOURCE, "source" },
97
-        { PATH_TREE, "tree" },
98
-        { PATH_ARTWORK, "artwork" }
99
-    };
100
+    auto roles = NetworkBaseModel::roleNames();
101
+    rolesPATH_SOURCE = "source";
102
+    rolesPATH_TREE = "tree";
103
+    return roles;
104
 }
105
 
106
 QVariant StandardPathModel::data(const QModelIndex & index, int role) const /* override */
107
@@ -230,19 +215,9 @@
108
 
109
     switch (role)
110
     {
111
-        case PATH_NAME:
112
-            return item->name;
113
-        case PATH_MRL:
114
-            return item->mrl;
115
-        case PATH_PROTOCOL:
116
-            return item->protocol;
117
-        case PATH_TYPE:
118
-            return item->type;
119
         case PATH_TREE:
120
             return QVariant::fromValue(NetworkTreeItem(item->tree, item->inputItem.get()));
121
-        case PATH_ARTWORK:
122
-            return item->artwork;
123
         default:
124
-            return QVariant();
125
+            return NetworkBaseModel::basedata(*item, role);
126
     }
127
 }
128
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/modules/gui/qt/network/standardpathmodel.hpp -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/modules/gui/qt/network/standardpathmodel.hpp Changed
27
 
1
@@ -26,10 +26,10 @@
2
 #endif
3
 
4
 // VLC includes
5
-#include "util/base_model.hpp"
6
+#include "networkbasemodel.hpp"
7
 
8
 class StandardPathModelPrivate;
9
-class StandardPathModel : public BaseModel
10
+class StandardPathModel : public NetworkBaseModel
11
 {
12
     Q_OBJECT
13
 
14
@@ -37,11 +37,7 @@
15
     // NOTE: Roles should be aligned with the NetworkDeviceModel.
16
     enum Role
17
     {
18
-        PATH_NAME = Qt::UserRole + 1,
19
-        PATH_MRL,
20
-        PATH_TYPE,
21
-        PATH_PROTOCOL,
22
-        PATH_SOURCE,
23
+        PATH_SOURCE = NetworkBaseModel::NETWORK_BASE_MAX,
24
         PATH_TREE,
25
         PATH_ARTWORK
26
     };
27
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/modules/gui/qt/player/qml/PIPPlayer.qml -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/modules/gui/qt/player/qml/PIPPlayer.qml Changed
21
 
1
@@ -31,8 +31,8 @@
2
     height: VLCStyle.dp(180, VLCStyle.scale)
3
 
4
     //VideoSurface x,y won't update
5
-    onXChanged: videoSurface.onSurfacePositionChanged()
6
-    onYChanged: videoSurface.onSurfacePositionChanged()
7
+    onXChanged: videoSurface.updateSurfacePosition()
8
+    onYChanged: videoSurface.updateSurfacePosition()
9
 
10
     objectName: "pip window"
11
 
12
@@ -93,7 +93,7 @@
13
 
14
     background: VideoSurface {
15
         id: videoSurface
16
-        ctx: MainCtx
17
+        videoSurfaceProvider: MainCtx.videoSurfaceProvider
18
     }
19
 
20
     contentItem: Rectangle {
21
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/modules/gui/qt/player/qml/Player.qml -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/modules/gui/qt/player/qml/Player.qml Changed
14
 
1
@@ -191,9 +191,10 @@
2
     VideoSurface {
3
         id: videoSurface
4
 
5
-        ctx: MainCtx
6
+        videoSurfaceProvider: MainCtx.videoSurfaceProvider
7
+
8
         visible: rootPlayer.hasEmbededVideo
9
-        enabled: rootPlayer.hasEmbededVideo
10
+
11
         anchors.fill: parent
12
         anchors.topMargin: rootPlayer._controlsUnderVideo ? topBar.height : 0
13
         anchors.bottomMargin: rootPlayer._controlsUnderVideo ? controlBar.height : 0
14
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/modules/gui/qt/player/qml/TopBar.qml -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/modules/gui/qt/player/qml/TopBar.qml Changed
9
 
1
@@ -440,6 +440,7 @@
2
                 id: contextMenu
3
 
4
                 ctx: MainCtx
5
+                playerViewVisible: History.match(History.viewPath, "player")
6
 
7
                 onAboutToShow: root.requestLockUnlockAutoHide(true)
8
                 onAboutToHide: root.requestLockUnlockAutoHide(false)
9
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/modules/gui/qt/player/qml/controlbarcontrols/ArtworkInfoWidget.qml -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/modules/gui/qt/player/qml/controlbarcontrols/ArtworkInfoWidget.qml Changed
38
 
1
@@ -107,13 +107,29 @@
2
         indexes: 0
3
     }
4
 
5
-    DragHandler {
6
-        target: null
7
-        onActiveChanged: {
8
-            if (active) {
9
-                dragItem.Drag.active = true
10
-            } else {
11
-                dragItem.Drag.drop()
12
+    // TODO: Qt bug 6.2: QTBUG-103604
13
+    Item {
14
+        anchors.fill: parent
15
+
16
+        TapHandler {
17
+            gesturePolicy: TapHandler.ReleaseWithinBounds // TODO: Qt 6.2 bug: Use TapHandler.DragThreshold
18
+
19
+            grabPermissions: TapHandler.CanTakeOverFromHandlersOfDifferentType | TapHandler.ApprovesTakeOverByAnything
20
+
21
+            onTapped: History.push("player")
22
+        }
23
+
24
+        DragHandler {
25
+            target: null
26
+
27
+            grabPermissions: PointerHandler.CanTakeOverFromHandlersOfDifferentType | PointerHandler.ApprovesTakeOverByAnything
28
+
29
+            onActiveChanged: {
30
+                if (active) {
31
+                    dragItem.Drag.active = true
32
+                } else {
33
+                    dragItem.Drag.drop()
34
+                }
35
             }
36
         }
37
     }
38
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/modules/gui/qt/player/qml/controlbarcontrols/MenuButton.qml -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/modules/gui/qt/player/qml/controlbarcontrols/MenuButton.qml Changed
9
 
1
@@ -38,6 +38,7 @@
2
         id: contextMenu
3
 
4
         ctx: MainCtx
5
+        playerViewVisible: History.match(History.viewPath, "player")
6
 
7
         onAboutToShow: menuBtn.requestLockUnlockAutoHide(true)
8
         onAboutToHide: menuBtn.requestLockUnlockAutoHide(false)
9
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/modules/gui/qt/qt.cpp -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/modules/gui/qt/qt.cpp Changed
10
 
1
@@ -902,7 +902,7 @@
2
     //       Windows 7 and Windows 8, since it may not support
3
     //       the default graphics api (Direct3D 11.2).
4
 
5
-    if (qEnvironmentVariableIsEmpty("QSG_RHI_BACKEND"))
6
+    if (qEnvironmentVariableIsEmpty("QSG_RHI_BACKEND") && qEnvironmentVariableIsEmpty("QT_QUICK_BACKEND"))
7
     {
8
         if (QOperatingSystemVersion::current() < QOperatingSystemVersion::Windows8_1)
9
         {
10
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/modules/lua/vlc.c -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/modules/lua/vlc.c Changed
79
 
1
@@ -95,6 +95,18 @@
2
     return strcmp( *a, *b );
3
 }
4
 
5
+/* Function to parse the trusted property of a file */
6
+static bool file_is_playlist( lua_State *L )
7
+{
8
+    bool trusted = false;
9
+    lua_getfield(L, -1, "trusted");
10
+    if( !lua_isnil(L, -1) && lua_isboolean(L, -1) )
11
+        trusted = lua_toboolean(L, -1);
12
+
13
+    lua_pop( L, 1 );
14
+    return trusted;
15
+}
16
+
17
 static char **vlclua_dir_list_append( char **restrict list, char *basedir,
18
                                       const char *luadirname )
19
 {
20
@@ -246,6 +258,8 @@
21
 void vlclua_read_meta_data( vlc_object_t *p_this, lua_State *L,
22
                             input_item_t *p_input )
23
 {
24
+    vlc_meta_priority_t priority = file_is_playlist( L )? VLC_META_PRIORITY_PLAYLIST:
25
+                                                          VLC_META_PRIORITY_BASIC;
26
 #define TRY_META( a, b )                                        \
27
     lua_getfield( L, -1, a );                                   \
28
     if( lua_isstring( L, -1 ) &&                                \
29
@@ -254,16 +268,20 @@
30
         char *psz_value = strdup( lua_tostring( L, -1 ) );      \
31
         EnsureUTF8( psz_value );                                \
32
         msg_Dbg( p_this, #b ": %s", psz_value );                \
33
-        input_item_Set ## b ( p_input, psz_value );             \
34
+        vlc_meta_SetWithPriority( p_input->p_meta,              \
35
+                                  vlc_meta_ ## b,               \
36
+                                  psz_value,                    \
37
+                                  priority );                   \
38
         free( psz_value );                                      \
39
     }                                                           \
40
     lua_pop( L, 1 ); /* pop a */
41
+    vlc_mutex_lock( &p_input->lock );
42
     TRY_META( "title", Title );
43
     TRY_META( "artist", Artist );
44
     TRY_META( "genre", Genre );
45
     TRY_META( "copyright", Copyright );
46
     TRY_META( "album", Album );
47
-    TRY_META( "tracknum", TrackNum );
48
+    TRY_META( "tracknum", TrackNumber );
49
     TRY_META( "description", Description );
50
     TRY_META( "rating", Rating );
51
     TRY_META( "date", Date );
52
@@ -273,13 +291,14 @@
53
     TRY_META( "nowplaying", NowPlaying );
54
     TRY_META( "publisher",  Publisher );
55
     TRY_META( "encodedby",  EncodedBy );
56
-    TRY_META( "arturl",     ArtURL );
57
+    TRY_META( "arturl",     ArtworkURL );
58
     TRY_META( "trackid",    TrackID );
59
     TRY_META( "director",   Director );
60
     TRY_META( "season",     Season );
61
     TRY_META( "episode",    Episode );
62
     TRY_META( "show_name",  ShowName );
63
     TRY_META( "actors",     Actors );
64
+    vlc_mutex_unlock( &p_input->lock );
65
 }
66
 
67
 #undef vlclua_read_custom_meta_data
68
@@ -311,7 +330,9 @@
69
             const char *psz_key = lua_tostring( L, -2 );
70
             const char *psz_value = lua_tostring( L, -1 );
71
 
72
-            vlc_meta_SetExtra( p_input->p_meta, psz_key, psz_value );
73
+            vlc_meta_priority_t priority = file_is_playlist( L )? VLC_META_PRIORITY_PLAYLIST:
74
+                                                                  VLC_META_PRIORITY_BASIC;
75
+            vlc_meta_SetExtraWithPriority( p_input->p_meta, psz_key, psz_value, priority );
76
 
77
             lua_pop( L, 1 ); /* pop "value" */
78
         }
79
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/modules/mux/asf.c -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/modules/mux/asf.c Changed
29
 
1
@@ -840,6 +840,7 @@
2
     vlc_tick_t i_duration = 0;
3
     int i_size, i_header_ext_size;
4
     int i_ci_size, i_cm_size = 0, i_cd_size = 0;
5
+    int i_subo_count = 0; /* header sub object count */
6
     block_t *out;
7
     bo_t bo;
8
 
9
@@ -912,11 +913,17 @@
10
         bo_init( &bo, out->p_buffer, i_size + 50 );
11
     }
12
 
13
+    /* calculate header sub object count */
14
+    i_subo_count += 1; /* file properties */
15
+    i_subo_count += 1; /* header extension */
16
+    i_subo_count += vlc_array_count( &p_sys->tracks ); /* stream info */
17
+    i_subo_count += 1; /* codec info */
18
+    i_subo_count += (i_cd_size ? 1 : 0); /* content description if any */
19
+
20
     /* header object */
21
     bo_add_guid ( &bo, &asf_object_header_guid );
22
     bo_addle_u64( &bo, i_size );
23
-    bo_addle_u32( &bo, 2 + vlc_array_count( &p_sys->tracks ) + 1 +
24
-                  (i_cd_size ? 1 : 0) + (i_cm_size ? 1 : 0) );
25
+    bo_addle_u32( &bo, i_subo_count );
26
     bo_add_u8   ( &bo, 1 );
27
     bo_add_u8   ( &bo, 2 );
28
 
29
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/modules/packetizer/h264_slice.c -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/modules/packetizer/h264_slice.c Changed
10
 
1
@@ -181,7 +181,7 @@
2
                                                   p_pps->num_ref_idx_l01_default_active_minus11 };
3
 
4
     if( i_slice_type == 1 || i_slice_type == 6 ) /* B slices */
5
-        bs_read1( &s ); /* direct_spatial_mv_pred_flag */
6
+        bs_skip( &s, 1 ); /* direct_spatial_mv_pred_flag */
7
     if( i_slice_type == 0 || i_slice_type == 5 ||
8
         i_slice_type == 3 || i_slice_type == 8 ||
9
         i_slice_type == 1 || i_slice_type == 6 ) /* P SP B slices */
10
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/modules/packetizer/mpeg4video.c -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/modules/packetizer/mpeg4video.c Changed
10
 
1
@@ -409,7 +409,7 @@
2
     {
3
         /* vol control parameter */
4
         bs_skip( &s, 2 ); /* chroma_format */
5
-        bs_read1( &s ); /* low_delay */
6
+        bs_skip( &s, 1 ); /* low_delay */
7
 
8
         if( bs_read1( &s ) )
9
         {
10
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/share/lua/playlist/cue.lua -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/share/lua/playlist/cue.lua Changed
9
 
1
@@ -74,6 +74,7 @@
2
     t.date = track.date or global.date
3
     t.description = global.comment
4
     t.tracknum = track.num
5
+    t.trusted = true
6
     t.options = { ":start-time=" .. track.index01}
7
 
8
     return t
9
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/src/clock/input_clock.c -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/src/clock/input_clock.c Changed
58
 
1
@@ -220,12 +220,15 @@
2
  *  i_ck_system: date in system clock
3
  *****************************************************************************/
4
 vlc_tick_t input_clock_Update( input_clock_t *cl, vlc_object_t *p_log,
5
-                         bool b_can_pace_control, bool b_buffering_allowed,
6
+                         bool b_can_pace_control, bool b_buffering,
7
+                         bool b_extra_buffering_allowed,
8
                          vlc_tick_t i_ck_stream, vlc_tick_t i_ck_system )
9
 {
10
     bool b_reset_reference = false;
11
     bool discontinuity = false;
12
 
13
+    b_can_pace_control |= b_buffering;
14
+
15
     assert( i_ck_stream != VLC_TICK_INVALID && i_ck_system != VLC_TICK_INVALID );
16
 
17
     if( !cl->b_has_reference )
18
@@ -233,8 +236,7 @@
19
         /* */
20
         b_reset_reference= true;
21
     }
22
-    /* Don't check discontinuities if the origin has just been changed */
23
-    else if (cl->last.stream != VLC_TICK_INVALID && !cl->b_origin_changed)
24
+    else if (!b_buffering && cl->last.stream != VLC_TICK_INVALID)
25
     {
26
         assert(cl->last.system != VLC_TICK_INVALID);
27
 
28
@@ -245,8 +247,9 @@
29
         vlc_tick_t diff = stream_diff - system_diff;
30
 
31
         /* A discontinuity happen if stream timings increase much more than
32
-         * system timings or if the stream is going backward. */
33
-        if (diff > CR_MAX_GAP || stream_diff < 0)
34
+         * system timings or if the stream is going backward.
35
+         * Don't compare system timings if the origin has just been changed */
36
+        if ((!cl->b_origin_changed && diff > CR_MAX_GAP) || stream_diff < 0)
37
         {
38
             /* Stream discontinuity, for which we haven't received a
39
              * warning from the stream control facilities (dd-edited
40
@@ -292,7 +295,7 @@
41
     {
42
         cl->i_buffering_duration = 0;
43
     }
44
-    else if( b_buffering_allowed )
45
+    else if( b_extra_buffering_allowed )
46
     {
47
         /* Try to bufferize more than necessary by reading
48
          * CR_BUFFERING_RATE/256 faster until we have CR_BUFFERING_TARGET.
49
@@ -303,7 +306,7 @@
50
         if( cl->i_buffering_duration > CR_BUFFERING_TARGET )
51
             cl->i_buffering_duration = CR_BUFFERING_TARGET;
52
     }
53
-    //fprintf( stderr, "input_clock_Update: %d :: %lld\n", b_buffering_allowed, cl->i_buffering_duration/1000 );
54
+    //fprintf( stderr, "input_clock_Update: %d :: %lld\n", b_extra_buffering_allowed, cl->i_buffering_duration/1000 );
55
 
56
     /* */
57
     cl->last = clock_point_Create( i_ck_system, i_ck_stream );
58
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/src/clock/input_clock.h -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/src/clock/input_clock.h Changed
22
 
1
@@ -100,15 +100,17 @@
2
  * \param clock the input clock object to update with the new point
3
  * \param p_log the logger object to use
4
  * \param b_can_pace_control whether the input can control the speed of playback
5
- * \param b_buffering_allowed tells if we are allowed to bufferize more data in
6
-          advanced (if possible).
7
+ * \param b_buffering whether the input is buffering
8
+ * \param b_extra_buffering_allowed tells if we are allowed to bufferize more
9
+ *        data in advance (if possible).
10
  * \param i_clock the new clock reference value
11
  * \param i_system the timestmap at which the new reference has been reported
12
  *
13
  * \return clock update delay
14
  */
15
 vlc_tick_t input_clock_Update( input_clock_t *clock, vlc_object_t *p_log,
16
-                            bool b_can_pace_control, bool b_buffering_allowed,
17
+                            bool b_can_pace_control, bool b_buffering,
18
+                            bool b_extra_buffering_allowed,
19
                             vlc_tick_t i_clock, vlc_tick_t i_system );
20
 
21
 /**
22
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/src/input/es_out.c -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/src/input/es_out.c Changed
10
 
1
@@ -3365,7 +3365,7 @@
2
         bool b_extra_buffering_allowed = !b_low_delay && EsOutIsExtraBufferingAllowed(p_sys);
3
         vlc_tick_t i_late = input_clock_Update(
4
                             p_pgrm->p_input_clock, VLC_OBJECT(p_sys->p_input),
5
-                            input_CanPaceControl(p_sys->p_input) || p_sys->b_buffering,
6
+                            input_CanPaceControl(p_sys->p_input), p_sys->b_buffering,
7
                             b_extra_buffering_allowed,
8
                             i_pcr, vlc_tick_now() );
9
 
10
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/src/input/input.c -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/src/input/input.c Changed
39
 
1
@@ -897,6 +897,11 @@
2
                 priv->master->i_seekpoint_offset;
3
     if( val.i_int > 0 /* TODO: check upper boundary */ )
4
         input_ControlPushHelper( p_input, INPUT_CONTROL_SET_SEEKPOINT, &val );
5
+}
6
+
7
+static void SetStopStart( input_thread_t * p_input )
8
+{
9
+    input_thread_private_t *priv = input_priv(p_input);
10
 
11
     /* Start/stop/run time */
12
     priv->i_start = llroundl(CLOCK_FREQ *
13
@@ -1335,6 +1340,7 @@
14
 
15
     InitTitle( p_input, false );
16
 
17
+    SetStopStart( p_input );
18
     /* Load master infos */
19
     InputSourceStatistics( master, priv->p_item, priv->p_es_out );
20
 
21
@@ -3477,3 +3483,16 @@
22
     input_thread_private_t *priv = input_priv(input);
23
     return priv->master->b_can_pace_control;
24
 }
25
+
26
+void input_SetItemDuration(input_thread_t *input, vlc_tick_t duration)
27
+{
28
+    input_thread_private_t *priv = input_priv(input);
29
+    input_item_t *item = input_GetItem(input);
30
+
31
+    if( priv->i_stop == 0 ) /* consider `duration` as stop time, if stop-time not set */
32
+        duration -= priv->i_start;
33
+    else /* calculate duration based on start-time and stop-time */
34
+        duration = priv->i_stop - priv->i_start;
35
+
36
+    input_item_SetDuration(item, duration);
37
+}
38
\ No newline at end of file
39
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/src/input/input_internal.h -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/src/input/input_internal.h Changed
19
 
1
@@ -639,6 +639,17 @@
2
 
3
 bool input_CanPaceControl(input_thread_t *input);
4
 
5
+/**
6
+ * Set the duration of the input item.
7
+ *
8
+ * This function sets the duration of the input item associated with the input thread.
9
+ * It uses the 'start-time' and 'stop-time' values to calculate the track duration.
10
+ *
11
+ * @param input The input thread object.
12
+ * @param duration The duration to be set, in vlc_tick_t units.
13
+ */
14
+void input_SetItemDuration(input_thread_t *input, vlc_tick_t duration);
15
+
16
 /* Bound pts_delay */
17
 #define INPUT_PTS_DELAY_MAX VLC_TICK_FROM_SEC(60)
18
 
19
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/src/input/meta.c -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/src/input/meta.c Changed
151
 
1
@@ -36,9 +36,15 @@
2
 #include "../preparser/art.h"
3
 #include <vlc_charset.h>
4
 
5
+struct vlc_meta_value
6
+{
7
+    vlc_meta_priority_t priority;
8
+    char *value;
9
+};
10
+
11
 struct vlc_meta_t
12
 {
13
-    char * ppsz_metaVLC_META_TYPE_COUNT;
14
+    struct vlc_meta_value metaVLC_META_TYPE_COUNT;
15
 
16
     vlc_dictionary_t extra_tags;
17
 
18
@@ -99,23 +105,41 @@
19
     vlc_meta_t *m = (vlc_meta_t*)malloc( sizeof(*m) );
20
     if( !m )
21
         return NULL;
22
-    memset( m->ppsz_meta, 0, sizeof(m->ppsz_meta) );
23
+    for( int i = 0; i < VLC_META_TYPE_COUNT ; i++ )
24
+    {
25
+        m->metai.value = NULL;
26
+        m->metai.priority = VLC_META_PRIORITY_BASIC;
27
+    }
28
     m->i_status = 0;
29
     vlc_dictionary_init( &m->extra_tags, 0 );
30
     return m;
31
 }
32
 
33
-/* Free a dictionary key allocated by strdup() in vlc_meta_SetExtra() */
34
+/* Allocate and insert the new value in the dictionary key `psz_name` */
35
+static void vlc_meta_InsertExtra( vlc_meta_t *m, const char *psz_name, const char *psz_value, vlc_meta_priority_t priority )
36
+{
37
+    struct vlc_meta_value *meta_value = malloc( sizeof(*meta_value) );
38
+    if( meta_value )
39
+    {
40
+        meta_value->value = strdup(psz_value);
41
+        meta_value->priority = priority;
42
+        vlc_dictionary_insert( &m->extra_tags, psz_name, meta_value );
43
+    }
44
+}
45
+
46
+/* Free a dictionary key allocated by strdup() in vlc_meta_SetExtraWithPriority() */
47
 static void vlc_meta_FreeExtraKey( void *p_data, void *p_obj )
48
 {
49
     VLC_UNUSED( p_obj );
50
-    free( p_data );
51
+    struct vlc_meta_value *meta_value = p_data;
52
+    free( meta_value->value );
53
+    free( meta_value );
54
 }
55
 
56
 void vlc_meta_Delete( vlc_meta_t *m )
57
 {
58
     for( int i = 0; i < VLC_META_TYPE_COUNT ; i++ )
59
-        free( m->ppsz_metai );
60
+        free( m->metai.value );
61
     vlc_dictionary_clear( &m->extra_tags, vlc_meta_FreeExtraKey, NULL );
62
     free( m );
63
 }
64
@@ -126,32 +150,36 @@
65
  * FIXME - Why don't we merge those two?
66
  */
67
 
68
-void vlc_meta_Set( vlc_meta_t *p_meta, vlc_meta_type_t meta_type, const char *psz_val )
69
+void vlc_meta_SetWithPriority( vlc_meta_t *p_meta, vlc_meta_type_t meta_type, const char *psz_val, vlc_meta_priority_t priority )
70
 {
71
-    free( p_meta->ppsz_metameta_type );
72
+    free( p_meta->metameta_type.value );
73
     assert( psz_val == NULL || IsUTF8( psz_val ) );
74
-    p_meta->ppsz_metameta_type = psz_val ? strdup( psz_val ) : NULL;
75
+    p_meta->metameta_type.value = psz_val ? strdup( psz_val ) : NULL;
76
+    p_meta->metameta_type.priority = priority;
77
 }
78
 
79
 const char *vlc_meta_Get( const vlc_meta_t *p_meta, vlc_meta_type_t meta_type )
80
 {
81
-    return p_meta->ppsz_metameta_type;
82
+    return p_meta->metameta_type.value;
83
 }
84
 
85
-void vlc_meta_SetExtra( vlc_meta_t *m, const char *psz_name, const char *psz_value )
86
+void vlc_meta_SetExtraWithPriority( vlc_meta_t *m, const char *psz_name, const char *psz_value, vlc_meta_priority_t priority )
87
 {
88
     assert( psz_name );
89
-    char *psz_oldvalue = (char *)vlc_dictionary_value_for_key( &m->extra_tags, psz_name );
90
-    if( psz_oldvalue != kVLCDictionaryNotFound )
91
+    struct vlc_meta_value *old_meta_value = vlc_dictionary_value_for_key( &m->extra_tags, psz_name );
92
+    if( old_meta_value != kVLCDictionaryNotFound )
93
         vlc_dictionary_remove_value_for_key( &m->extra_tags, psz_name,
94
                                             vlc_meta_FreeExtraKey, NULL );
95
     if ( psz_value )
96
-        vlc_dictionary_insert( &m->extra_tags, psz_name, strdup(psz_value) );
97
+        vlc_meta_InsertExtra( m, psz_name, psz_value, priority );
98
 }
99
 
100
 const char * vlc_meta_GetExtra( const vlc_meta_t *m, const char *psz_name )
101
 {
102
-    return (char *)vlc_dictionary_value_for_key(&m->extra_tags, psz_name);
103
+    struct vlc_meta_value *meta_value = vlc_dictionary_value_for_key(&m->extra_tags, psz_name);
104
+    if( !meta_value )
105
+        return NULL;
106
+    return meta_value->value;
107
 }
108
 
109
 unsigned vlc_meta_GetExtraCount( const vlc_meta_t *m )
110
@@ -188,10 +216,13 @@
111
 
112
     for( int i = 0; i < VLC_META_TYPE_COUNT; i++ )
113
     {
114
-        if( src->ppsz_metai )
115
+        /* overwrite metadata only when priority of src is 
116
+           greater than or equal to the priority of dst */
117
+        if( src->metai.value && src->metai.priority >= dst->metai.priority )
118
         {
119
-            free( dst->ppsz_metai );
120
-            dst->ppsz_metai = strdup( src->ppsz_metai );
121
+            free( dst->metai.value );
122
+            dst->metai.value = strdup( src->metai.value );
123
+            dst->metai.priority = src->metai.priority;
124
         }
125
     }
126
 
127
@@ -200,10 +231,20 @@
128
     for( int i = 0; ppsz_all_keys && ppsz_all_keysi; i++ )
129
     {
130
         /* Always try to remove the previous value */
131
-        vlc_dictionary_remove_value_for_key( &dst->extra_tags, ppsz_all_keysi, vlc_meta_FreeExtraKey, NULL );
132
+        struct vlc_meta_value *dst_meta_value = vlc_dictionary_value_for_key( &dst->extra_tags, ppsz_all_keysi );
133
+        struct vlc_meta_value *src_meta_value = vlc_dictionary_value_for_key( &src->extra_tags, ppsz_all_keysi );
134
+        if( dst_meta_value )
135
+        {
136
+            /* overwrite metadata only when priority of src is 
137
+               greater than or equal to the priority of dst */
138
+            if( src_meta_value->priority < dst_meta_value->priority )
139
+                continue;
140
+
141
+            vlc_dictionary_remove_value_for_key( &dst->extra_tags, ppsz_all_keysi, vlc_meta_FreeExtraKey, NULL );
142
+        }
143
+
144
+        vlc_meta_InsertExtra( dst, ppsz_all_keysi, src_meta_value->value, src_meta_value->priority );
145
 
146
-        void *p_value = vlc_dictionary_value_for_key( &src->extra_tags, ppsz_all_keysi );
147
-        vlc_dictionary_insert( &dst->extra_tags, ppsz_all_keysi, strdup( (const char*)p_value ) );
148
         free( ppsz_all_keysi );
149
     }
150
     free( ppsz_all_keys );
151
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/src/input/parse.c -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/src/input/parse.c Changed
10
 
1
@@ -56,7 +56,7 @@
2
     switch (event->type)
3
     {
4
         case INPUT_EVENT_TIMES:
5
-            input_item_SetDuration(input_GetItem(input), event->times.length);
6
+            input_SetItemDuration(input, event->times.length);
7
             break;
8
         case INPUT_EVENT_STATE:
9
             parser->state = event->state.value;
10
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/src/libvlccore.sym -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/src/libvlccore.sym Changed
19
 
1
@@ -668,7 +668,7 @@
2
 vlc_join
3
 vlc_thread_set_name
4
 vlc_list_children
5
-vlc_meta_SetExtra
6
+vlc_meta_SetExtraWithPriority
7
 vlc_meta_CopyExtraNames
8
 vlc_meta_Delete
9
 vlc_meta_Get
10
@@ -677,7 +677,7 @@
11
 vlc_meta_GetStatus
12
 vlc_meta_Merge
13
 vlc_meta_New
14
-vlc_meta_Set
15
+vlc_meta_SetWithPriority
16
 vlc_meta_SetStatus
17
 vlc_meta_TypeToLocalizedString
18
 vlc_meta_TypeToString
19
_service:obs_scm:vlc-beta-20240809.4c595eebe8.obscpio/src/player/input.c -> _service:obs_scm:vlc-beta-20240812.9b737741e3.obscpio/src/player/input.c Changed
10
 
1
@@ -933,7 +933,7 @@
2
             if (input->length != event->times.length)
3
             {
4
                 input->length = event->times.length;
5
-                input_item_SetDuration(input_GetItem(input->thread), event->times.length);
6
+                input_SetItemDuration(input->thread, event->times.length);
7
                 vlc_player_SendEvent(player, on_length_changed, input->length);
8
                 changed = true;
9
             }
10
_service:obs_scm:vlc-beta.obsinfo Changed
9
 
1
@@ -1,4 +1,4 @@
2
 name: vlc-beta
3
-version: 20240809.4c595eebe8
4
-mtime: 1723204896
5
-commit: 4c595eebe8144d3d4537e72d98e2d1f0e5e028aa
6
+version: 20240812.9b737741e3
7
+mtime: 1723476025
8
+commit: 9b737741e3afa3cd58e6804e7a33283839276fb8
9