Title: [291283] trunk/Source/WebCore
Revision
291283
Author
eoca...@igalia.com
Date
2022-03-15 05:40:14 -0700 (Tue, 15 Mar 2022)

Log Message

[GStreamer][MSE] add ac-3,ec-3 and flac codecs gst caps
https://bugs.webkit.org/show_bug.cgi?id=237843

Reviewed by Philippe Normand.

AC-3, EC-3 and FLAC formats should be supported on MSE and EME on those
platforms having the appropriate decoders for them.

This patch adds the appropriate mime types, factories and caps to the
set of codecs whose local support will be tested on MSE.

This patch is authored by Eugene Mutavchi <ievgen_mutav...@comcast.com>
See: https://github.com/WebPlatformForEmbedded/WPEWebKit/pull/804

* platform/graphics/gstreamer/GStreamerRegistryScanner.cpp: Add support for the codecs, factories and caps.
* platform/graphics/gstreamer/eme/WebKitThunderDecryptorGStreamer.cpp: Add support for the caps.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (291282 => 291283)


--- trunk/Source/WebCore/ChangeLog	2022-03-15 11:40:00 UTC (rev 291282)
+++ trunk/Source/WebCore/ChangeLog	2022-03-15 12:40:14 UTC (rev 291283)
@@ -1,3 +1,22 @@
+2022-03-15  Enrique Ocaña González  <eoca...@igalia.com>
+
+        [GStreamer][MSE] add ac-3,ec-3 and flac codecs gst caps
+        https://bugs.webkit.org/show_bug.cgi?id=237843
+
+        Reviewed by Philippe Normand.
+
+        AC-3, EC-3 and FLAC formats should be supported on MSE and EME on those
+        platforms having the appropriate decoders for them.
+
+        This patch adds the appropriate mime types, factories and caps to the
+        set of codecs whose local support will be tested on MSE.
+
+        This patch is authored by Eugene Mutavchi <ievgen_mutav...@comcast.com>
+        See: https://github.com/WebPlatformForEmbedded/WPEWebKit/pull/804
+
+        * platform/graphics/gstreamer/GStreamerRegistryScanner.cpp: Add support for the codecs, factories and caps.
+        * platform/graphics/gstreamer/eme/WebKitThunderDecryptorGStreamer.cpp: Add support for the caps.
+
 2022-03-15  Antoine Quint  <grao...@webkit.org>
 
         Dialog element only animates once

Modified: trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerRegistryScanner.cpp (291282 => 291283)


--- trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerRegistryScanner.cpp	2022-03-15 11:40:00 UTC (rev 291282)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerRegistryScanner.cpp	2022-03-15 12:40:14 UTC (rev 291283)
@@ -337,6 +337,13 @@
         m_decoderCodecMap.add(AtomString("x-av1"), av1DecoderAvailable.isUsingHardware);
     }
 
+    Vector<GstCapsWebKitMapping> mseCompatibleMapping = {
+        { ElementFactories::Type::AudioDecoder, "audio/x-ac3", { }, {"x-ac3", "ac-3", "ac3"} },
+        { ElementFactories::Type::AudioDecoder, "audio/x-eac3", {"audio/x-ac3"},  {"x-eac3", "ec3", "ec-3", "eac3"} },
+        { ElementFactories::Type::AudioDecoder, "audio/x-flac", {"audio/x-flac", "audio/flac"}, {"x-flac", "flac" } },
+    };
+    fillMimeTypeSetFromCapsMapping(factories, mseCompatibleMapping);
+
     if (m_isMediaSource)
         return;
 
@@ -344,10 +351,7 @@
 
     Vector<GstCapsWebKitMapping> mapping = {
         { ElementFactories::Type::AudioDecoder, "audio/midi", { "audio/midi", "audio/riff-midi" }, { } },
-        { ElementFactories::Type::AudioDecoder, "audio/x-ac3", { }, { } },
         { ElementFactories::Type::AudioDecoder, "audio/x-dts", { }, { } },
-        { ElementFactories::Type::AudioDecoder, "audio/x-eac3", { "audio/x-ac3" }, { } },
-        { ElementFactories::Type::AudioDecoder, "audio/x-flac", { "audio/x-flac", "audio/flac" }, { } },
         { ElementFactories::Type::AudioDecoder, "audio/x-sbc", { }, { } },
         { ElementFactories::Type::AudioDecoder, "audio/x-sid", { }, { } },
         { ElementFactories::Type::AudioDecoder, "audio/x-speex", { "audio/speex", "audio/x-speex" }, { } },

Modified: trunk/Source/WebCore/platform/graphics/gstreamer/eme/WebKitThunderDecryptorGStreamer.cpp (291282 => 291283)


--- trunk/Source/WebCore/platform/graphics/gstreamer/eme/WebKitThunderDecryptorGStreamer.cpp	2022-03-15 11:40:00 UTC (rev 291282)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/eme/WebKitThunderDecryptorGStreamer.cpp	2022-03-15 12:40:14 UTC (rev 291283)
@@ -46,7 +46,7 @@
 GST_DEBUG_CATEGORY(webkitMediaThunderDecryptDebugCategory);
 #define GST_CAT_DEFAULT webkitMediaThunderDecryptDebugCategory
 
-static const char* cencEncryptionMediaTypes[] = { "video/mp4", "audio/mp4", "video/x-h264", "video/x-h265", "audio/mpeg", "video/x-vp9", nullptr };
+static const char* cencEncryptionMediaTypes[] = { "video/mp4", "audio/mp4", "video/x-h264", "video/x-h265", "audio/mpeg", "audio/x-eac3", "audio/x-ac3", "audio/x-flac", "video/x-vp9", nullptr };
 static const char** cbcsEncryptionMediaTypes = cencEncryptionMediaTypes;
 static const char* webmEncryptionMediaTypes[] = { "video/webm", "audio/webm", "video/x-vp9", "audio/x-opus", "audio/x-vorbis", "video/x-vp8", nullptr };
 
@@ -59,6 +59,9 @@
         "video/mp4; "
         "audio/mp4; "
         "audio/mpeg; "
+        "audio/x-flac; "
+        "audio/x-eac3; "
+        "audio/x-ac3; "
         "video/x-h264; "
         "video/x-h265; "
         "video/x-vp9; video/x-vp8;"
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to