[GStreamer] Warn early about incomplete MSE track switching support
authorphiln@webkit.org <philn@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 Aug 2018 13:20:44 +0000 (13:20 +0000)
committerphiln@webkit.org <philn@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 Aug 2018 13:20:44 +0000 (13:20 +0000)
https://bugs.webkit.org/show_bug.cgi?id=188653

Patch by Philippe Normand <philn@igalia.com> on 2018-08-21
Reviewed by Xabier Rodriguez-Calvar.

The proper track switching support shall be fixed at some point by:
https://bugs.webkit.org/show_bug.cgi?id=182531.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::updateTracks): Remove redundant test.
(WebCore::MediaPlayerPrivateGStreamer::enableTrack): Exit early if
this method is called by the MSE player.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235112 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp

index 67ce640..9a14112 100644 (file)
@@ -1,5 +1,20 @@
 2018-08-21  Philippe Normand  <philn@igalia.com>
 
+        [GStreamer] Warn early about incomplete MSE track switching support
+        https://bugs.webkit.org/show_bug.cgi?id=188653
+
+        Reviewed by Xabier Rodriguez-Calvar.
+
+        The proper track switching support shall be fixed at some point by:
+        https://bugs.webkit.org/show_bug.cgi?id=182531.
+
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+        (WebCore::MediaPlayerPrivateGStreamer::updateTracks): Remove redundant test.
+        (WebCore::MediaPlayerPrivateGStreamer::enableTrack): Exit early if
+        this method is called by the MSE player.
+
+2018-08-21  Philippe Normand  <philn@igalia.com>
+
         [GStreamer][MSE] Generic main thread notification support
         https://bugs.webkit.org/show_bug.cgi?id=188647
 
index 348651c..a36d1a4 100644 (file)
@@ -724,18 +724,18 @@ void MediaPlayerPrivateGStreamer::updateTracks()
     if (m_hasVideo)
         m_player->sizeChanged();
 
-    if (useMediaSource) {
-        GST_DEBUG("Tracks managed by source element. Bailing out now.");
-        m_player->client().mediaPlayerEngineUpdated(m_player);
-        return;
-    }
-
     m_player->client().mediaPlayerEngineUpdated(m_player);
 }
 #endif // GST_CHECK_VERSION(1, 10, 0)
 
 void MediaPlayerPrivateGStreamer::enableTrack(TrackPrivateBaseGStreamer::TrackType trackType, unsigned index)
 {
+    // FIXME: Remove isMediaSource() test below when fixing https://bugs.webkit.org/show_bug.cgi?id=182531.
+    if (isMediaSource()) {
+        GST_FIXME_OBJECT(m_pipeline.get(), "Audio/Video/Text track switching is not yet supported by the MSE backend.");
+        return;
+    }
+
     const char* propertyName;
     const char* trackTypeAsString;
     Vector<String> selectedStreams;
@@ -801,11 +801,8 @@ void MediaPlayerPrivateGStreamer::enableTrack(TrackPrivateBaseGStreamer::TrackTy
     }
 
     GST_INFO("Enabling %s track with index: %u", trackTypeAsString, index);
-    // FIXME: Remove isMediaSource() test below when fixing https://bugs.webkit.org/show_bug.cgi?id=182531
-    if (m_isLegacyPlaybin || isMediaSource()) {
-        GstElement* element = isMediaSource() ? m_source.get() : m_pipeline.get();
-        g_object_set(element, propertyName, index, nullptr);
-    }
+    if (m_isLegacyPlaybin)
+        g_object_set(m_pipeline.get(), propertyName, index, nullptr);
 #if GST_CHECK_VERSION(1, 10, 0)
     else {
         GList* selectedStreamsList = nullptr;