[GStreamer][MSE] Fix player private selection when MSE is enabled
authoreocanha@igalia.com <eocanha@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Dec 2016 10:36:32 +0000 (10:36 +0000)
committereocanha@igalia.com <eocanha@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Dec 2016 10:36:32 +0000 (10:36 +0000)
https://bugs.webkit.org/show_bug.cgi?id=164116

Reviewed by Philippe Normand.

Covered by existing tests.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::load):
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(WebCore::MediaPlayerPrivateGStreamerMSE::load):

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

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

index 8a2c9a4..2c7144f 100644 (file)
@@ -1,3 +1,17 @@
+2016-12-14  Enrique Oca├▒a Gonz├ílez  <eocanha@igalia.com>
+
+        [GStreamer][MSE] Fix player private selection when MSE is enabled
+        https://bugs.webkit.org/show_bug.cgi?id=164116
+
+        Reviewed by Philippe Normand.
+
+        Covered by existing tests.
+
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+        (WebCore::MediaPlayerPrivateGStreamer::load):
+        * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
+        (WebCore::MediaPlayerPrivateGStreamerMSE::load):
+
 2016-12-13  Commit Queue  <commit-queue@webkit.org>
 
         Unreviewed, rolling out r209792.
index feadddd..b66e29b 100644 (file)
@@ -272,7 +272,9 @@ void MediaPlayerPrivateGStreamer::load(const String& urlString)
 #if ENABLE(MEDIA_SOURCE)
 void MediaPlayerPrivateGStreamer::load(const String&, MediaSourcePrivateClient*)
 {
-    notImplemented();
+    // Properly fail so the global MediaPlayer tries to fallback to the next MediaPlayerPrivate.
+    m_networkState = MediaPlayer::FormatError;
+    m_player->networkStateChanged();
 }
 #endif
 
index 06d9791..76aee72 100644 (file)
@@ -125,14 +125,16 @@ MediaPlayerPrivateGStreamerMSE::~MediaPlayerPrivateGStreamerMSE()
 
 void MediaPlayerPrivateGStreamerMSE::load(const String& urlString)
 {
-    if (UNLIKELY(!initializeGStreamerAndRegisterWebKitMSEElement()))
-        return;
-
     if (!urlString.startsWith("mediasource")) {
-        GST_ERROR("Unsupported url: %s", urlString.utf8().data());
+        // Properly fail so the global MediaPlayer tries to fallback to the next MediaPlayerPrivate.
+        m_networkState = MediaPlayer::FormatError;
+        m_player->networkStateChanged();
         return;
     }
 
+    if (UNLIKELY(!initializeGStreamerAndRegisterWebKitMSEElement()))
+        return;
+
     if (!m_playbackPipeline)
         m_playbackPipeline = PlaybackPipeline::create();