Title: [222550] trunk/Source/WebCore
Revision
222550
Author
[email protected]
Date
2017-09-27 02:21:44 -0700 (Wed, 27 Sep 2017)

Log Message

Add initial experimental support for webm in WebKitGTK+ with VP8, VP9,
Vorbis and Opus formats, as long as suitable plugins are installed in
GStreamer.
https://bugs.webkit.org/show_bug.cgi?id=177355

Patch by Alicia Boya García <[email protected]> on 2017-09-27
Reviewed by Xabier Rodriguez-Calvar.

* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::AppendPipeline):
* platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (222549 => 222550)


--- trunk/Source/WebCore/ChangeLog	2017-09-27 05:05:27 UTC (rev 222549)
+++ trunk/Source/WebCore/ChangeLog	2017-09-27 09:21:44 UTC (rev 222550)
@@ -1,3 +1,16 @@
+2017-09-27  Alicia Boya García  <[email protected]>
+
+        Add initial experimental support for webm in WebKitGTK+ with VP8, VP9,
+        Vorbis and Opus formats, as long as suitable plugins are installed in
+        GStreamer.
+        https://bugs.webkit.org/show_bug.cgi?id=177355
+
+        Reviewed by Xabier Rodriguez-Calvar.
+
+        * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
+        (WebCore::AppendPipeline::AppendPipeline):
+        * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h:
+
 2017-09-26  Zalan Bujtas  <[email protected]>
 
         AX: Defer RenderImage's imageChanged event until after layout is done.

Modified: trunk/Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.cpp (222549 => 222550)


--- trunk/Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.cpp	2017-09-27 05:05:27 UTC (rev 222549)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.cpp	2017-09-27 09:21:44 UTC (rev 222550)
@@ -1,6 +1,6 @@
 /*
- * Copyright (C) 2016 Metrological Group B.V.
- * Copyright (C) 2016 Igalia S.L
+ * Copyright (C) 2016, 2017 Metrological Group B.V.
+ * Copyright (C) 2016, 2017 Igalia S.L
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -133,7 +133,15 @@
     // We assign the created instances here instead of adoptRef() because gst_bin_add_many()
     // below will already take the initial reference and we need an additional one for us.
     m_appsrc = gst_element_factory_make("appsrc", nullptr);
-    m_demux = gst_element_factory_make("qtdemux", nullptr);
+
+    const String& type = m_sourceBufferPrivate->type().containerType();
+    if (type.endsWith("mp4"))
+        m_demux = gst_element_factory_make("qtdemux", nullptr);
+    else if (type.endsWith("webm"))
+        m_demux = gst_element_factory_make("matroskademux", nullptr);
+    else
+        ASSERT_NOT_REACHED();
+
     m_appsink = gst_element_factory_make("appsink", nullptr);
 
     gst_app_sink_set_emit_signals(GST_APP_SINK(m_appsink.get()), TRUE);

Modified: trunk/Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp (222549 => 222550)


--- trunk/Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp	2017-09-27 05:05:27 UTC (rev 222549)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp	2017-09-27 09:21:44 UTC (rev 222550)
@@ -3,9 +3,9 @@
  * Copyright (C) 2007 Collabora Ltd.  All rights reserved.
  * Copyright (C) 2007 Alp Toker <[email protected]>
  * Copyright (C) 2009 Gustavo Noronha Silva <[email protected]>
- * Copyright (C) 2009, 2010, 2011, 2012, 2013, 2016 Igalia S.L
+ * Copyright (C) 2009, 2010, 2011, 2012, 2013, 2016, 2017 Igalia S.L
  * Copyright (C) 2015 Sebastian Dröge <[email protected]>
- * Copyright (C) 2015, 2016 Metrological Group B.V.
+ * Copyright (C) 2015, 2016, 2017 Metrological Group B.V.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -714,7 +714,9 @@
         HashSet<String, ASCIICaseInsensitiveHash> set;
         const char* mimeTypes[] = {
             "video/mp4",
-            "audio/mp4"
+            "audio/mp4",
+            "video/webm",
+            "audio/webm"
         };
         for (auto& type : mimeTypes)
             set.add(type);
@@ -775,10 +777,14 @@
             Vector<AtomicString> webkitCodecs;
         };
 
-        std::array<GstCapsWebKitMapping, 3> mapping = { {
+        std::array<GstCapsWebKitMapping, 7> mapping = { {
             { VideoDecoder, "video/x-h264,  profile="" constrained-baseline, baseline }", { "x-h264" } },
             { VideoDecoder, "video/x-h264, stream-format=avc", { "avc*"} },
-            { VideoDecoder, "video/mpeg, mpegversion=(int){1,2}, systemstream=(boolean)false", { "mpeg" } }
+            { VideoDecoder, "video/mpeg, mpegversion=(int){1,2}, systemstream=(boolean)false", { "mpeg" } },
+            { VideoDecoder, "video/x-vp8", { "vp8", "x-vp8" } },
+            { VideoDecoder, "video/x-vp9", { "vp9", "x-vp9" } },
+            { AudioDecoder, "audio/x-vorbis", { "vorbis", "x-vorbis" } },
+            { AudioDecoder, "audio/x-opus", { "opus", "x-opus" } }
         } };
 
         for (auto& current : mapping) {
@@ -864,9 +870,6 @@
         return result;
 
     auto containerType = parameters.type.containerType();
-    // Disable VPX/Opus on MSE for now, mp4/avc1 seems way more reliable currently.
-    if (containerType.endsWith("webm"))
-        return result;
 
     // YouTube TV provides empty types for some videos and we want to be selected as best media engine for them.
     if (containerType.isEmpty()) {

Modified: trunk/Source/WebCore/platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h (222549 => 222550)


--- trunk/Source/WebCore/platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h	2017-09-27 05:05:27 UTC (rev 222549)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h	2017-09-27 09:21:44 UTC (rev 222550)
@@ -2,8 +2,8 @@
  * Copyright (C) 2013 Google Inc. All rights reserved.
  * Copyright (C) 2013 Orange
  * Copyright (C) 2014 Sebastian Dröge <[email protected]>
- * Copyright (C) 2015, 2016 Metrological Group B.V.
- * Copyright (C) 2015, 2016 Igalia, S.L
+ * Copyright (C) 2015, 2016, 2017 Metrological Group B.V.
+ * Copyright (C) 2015, 2016, 2017 Igalia, S.L
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
@@ -76,6 +76,8 @@
     void didReceiveSample(MediaSample&);
     void didReceiveAllPendingSamples();
 
+    ContentType type() const { return m_type; }
+
 private:
     SourceBufferPrivateGStreamer(MediaSourceGStreamer*, Ref<MediaSourceClientGStreamerMSE>, const ContentType&);
     friend class MediaSourceClientGStreamerMSE;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to