<html>
<head>
<base href="https://bugs.webkit.org/" />
</head>
<body><span class="vcard"><a class="email" href="mailto:mario@webkit.org" title="Mario Sanchez Prada <mario@webkit.org>"> <span class="fn">Mario Sanchez Prada</span></a>
</span> changed
<a class="bz_bug_link
bz_status_NEW "
title="NEW - [GStreamer] unrelated codecs required to play videos"
href="https://bugs.webkit.org/show_bug.cgi?id=135972">bug 135972</a>
<br>
<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>What</th>
<th>Removed</th>
<th>Added</th>
</tr>
<tr>
<td style="text-align:right;">CC</td>
<td>
</td>
<td>mario@webkit.org
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - [GStreamer] unrelated codecs required to play videos"
href="https://bugs.webkit.org/show_bug.cgi?id=135972#c13">Comment # 13</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - [GStreamer] unrelated codecs required to play videos"
href="https://bugs.webkit.org/show_bug.cgi?id=135972">bug 135972</a>
from <span class="vcard"><a class="email" href="mailto:mario@webkit.org" title="Mario Sanchez Prada <mario@webkit.org>"> <span class="fn">Mario Sanchez Prada</span></a>
</span></b>
<pre>For the record, I'm pasting below the patch that I just applied downstream yesterday that is serving us well for the time being in our particular and controlled scenario.
Notice that I'm not asking for review over it, as I understand that solution is not valid for upstream, just sharing in case it's useful to someone else. That said, if someone wants to take over on making a real patch, or guiding me on what exactly would be a good enough way to do it, I'm happy to help.
--- a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
+++ b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
@@ -1690,6 +1690,25 @@ void MediaPlayerPrivateGStreamer::loadin
m_readyTimerHandler.cancel();
}
+static bool gstRegistryHasDecoder(const String& decoder)
+{
+ GList *decoder_factories, *gst_decoders;
+ GstCaps *caps;
+ bool retval;
+
+ decoder_factories = gst_element_factory_list_get_elements (GST_ELEMENT_FACTORY_TYPE_DECODER | GST_ELEMENT_FACTORY_TYPE_MEDIA_VIDEO, GST_RANK_MARGINAL);
+ caps = gst_caps_new_empty_simple (decoder.utf8().data());
+ gst_decoders = gst_element_factory_list_filter (decoder_factories, caps, GST_PAD_SINK, FALSE);
+ gst_caps_unref (caps);
+
+ retval = gst_decoders != NULL;
+
+ gst_plugin_feature_list_free (gst_decoders);
+ gst_plugin_feature_list_free (decoder_factories);
+
+ return retval;
+}
+
static HashSet<String> mimeTypeCache()
{
initializeGStreamerAndRegisterWebKitElements();
@@ -1768,7 +1787,6 @@ static HashSet<String> mimeTypeCache()
"video/flv",
"video/mj2",
"video/mp2t",
- "video/mp4",
"video/mpeg",
"video/mpegts",
"video/ogg",
@@ -1795,6 +1813,15 @@ static HashSet<String> mimeTypeCache()
for (unsigned i = 0; i < (sizeof(mimeTypes) / sizeof(*mimeTypes)); ++i)
cache.add(String(mimeTypes[i]));
+ if (gstRegistryHasDecoder(String::fromUTF8("video/x-h264")))
+ cache.add(String::fromUTF8("video/mp4"));
+
typeListInitialized = true;
return cache;
}</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>