<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[51734] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/51734">51734</a></dd>
<dt>Author</dt> <dd>kov@webkit.org</dd>
<dt>Date</dt> <dd>2009-12-05 17:50:28 -0800 (Sat, 05 Dec 2009)</dd>
</dl>

<h3>Log Message</h3>
<pre>WebCore

2009-12-03  Philippe Normand  &lt;pnormand@igalia.com&gt;

        Reviewed by Gustavo Noronha.

        Advertize audio/ogg correctly and refactored mime-type cache
        building.

        [GTK] Recognize oga as audio/ogg
        https://bugs.webkit.org/show_bug.cgi?id=31990

        Test: media/media-can-play-ogg.html

        * platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp:
        (WebCore::mimeTypeCache):

LayoutTests

2009-12-05  Philippe Normand  &lt;pnormand@igalia.com&gt;

        Reviewed by Gustavo Noronha.

        New test for video.canPlayType and ogg containers.

        [GTK] Recognize oga as audio/ogg
        https://bugs.webkit.org/show_bug.cgi?id=31990

        * media/media-can-play-ogg-expected.txt: Added.
        * media/media-can-play-ogg.html: Added.
        * platform/mac-leopard/Skipped:
        * platform/mac-snowleopard/Skipped:
        * platform/mac-tiger/Skipped:
        * platform/mac/Skipped:
        * platform/qt-mac/Skipped:
        * platform/qt-win/Skipped:
        * platform/qt/Skipped:
        * platform/win/Skipped:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsplatformmacSkipped">trunk/LayoutTests/platform/mac/Skipped</a></li>
<li><a href="#trunkLayoutTestsplatformmacleopardSkipped">trunk/LayoutTests/platform/mac-leopard/Skipped</a></li>
<li><a href="#trunkLayoutTestsplatformmacsnowleopardSkipped">trunk/LayoutTests/platform/mac-snowleopard/Skipped</a></li>
<li><a href="#trunkLayoutTestsplatformmactigerSkipped">trunk/LayoutTests/platform/mac-tiger/Skipped</a></li>
<li><a href="#trunkLayoutTestsplatformqtSkipped">trunk/LayoutTests/platform/qt/Skipped</a></li>
<li><a href="#trunkLayoutTestsplatformqtmacSkipped">trunk/LayoutTests/platform/qt-mac/Skipped</a></li>
<li><a href="#trunkLayoutTestsplatformqtwinSkipped">trunk/LayoutTests/platform/qt-win/Skipped</a></li>
<li><a href="#trunkLayoutTestsplatformwinSkipped">trunk/LayoutTests/platform/win/Skipped</a></li>
<li><a href="#trunkWebCoreChangeLog">trunk/WebCore/ChangeLog</a></li>
<li><a href="#trunkWebCoreplatformgraphicsgtkMediaPlayerPrivateGStreamercpp">trunk/WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (51733 => 51734)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2009-12-06 00:30:28 UTC (rev 51733)
+++ trunk/LayoutTests/ChangeLog        2009-12-06 01:50:28 UTC (rev 51734)
</span><span class="lines">@@ -1,3 +1,23 @@
</span><ins>+2009-12-05  Philippe Normand  &lt;pnormand@igalia.com&gt;
+
+        Reviewed by Gustavo Noronha.
+
+        New test for video.canPlayType and ogg containers.
+
+        [GTK] Recognize oga as audio/ogg
+        https://bugs.webkit.org/show_bug.cgi?id=31990
+
+        * media/media-can-play-ogg-expected.txt: Added.
+        * media/media-can-play-ogg.html: Added.
+        * platform/mac-leopard/Skipped:
+        * platform/mac-snowleopard/Skipped:
+        * platform/mac-tiger/Skipped:
+        * platform/mac/Skipped:
+        * platform/qt-mac/Skipped:
+        * platform/qt-win/Skipped:
+        * platform/qt/Skipped:
+        * platform/win/Skipped:
+
</ins><span class="cx"> 2009-12-05  Dan Bernstein  &lt;mitz@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Rubber-stamped by Mark Rowe.
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacSkipped"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/Skipped (51733 => 51734)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/Skipped        2009-12-06 00:30:28 UTC (rev 51733)
+++ trunk/LayoutTests/platform/mac/Skipped        2009-12-06 01:50:28 UTC (rev 51734)
</span><span class="lines">@@ -108,3 +108,7 @@
</span><span class="cx"> 
</span><span class="cx"> # These test require Qt Widgets
</span><span class="cx"> plugins/qt-qwidget-plugin.html
</span><ins>+
+# This test requires ogg codecs
+media/media-can-play-ogg.html
+
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformmacleopardSkipped"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac-leopard/Skipped (51733 => 51734)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac-leopard/Skipped        2009-12-06 00:30:28 UTC (rev 51733)
+++ trunk/LayoutTests/platform/mac-leopard/Skipped        2009-12-06 01:50:28 UTC (rev 51734)
</span><span class="lines">@@ -27,3 +27,6 @@
</span><span class="cx"> 
</span><span class="cx"> # Tests of accessibility functionality not supported on Leopard
</span><span class="cx"> accessibility/aria-list-and-listitem.html
</span><ins>+
+# This test requires ogg codecs
+media/media-can-play-ogg.html
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformmacsnowleopardSkipped"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac-snowleopard/Skipped (51733 => 51734)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac-snowleopard/Skipped        2009-12-06 00:30:28 UTC (rev 51733)
+++ trunk/LayoutTests/platform/mac-snowleopard/Skipped        2009-12-06 01:50:28 UTC (rev 51734)
</span><span class="lines">@@ -49,3 +49,5 @@
</span><span class="cx"> # thrown
</span><span class="cx"> plugins/netscape-invoke-failure.html
</span><span class="cx"> 
</span><ins>+# This test requires ogg codecs
+media/media-can-play-ogg.html
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformmactigerSkipped"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac-tiger/Skipped (51733 => 51734)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac-tiger/Skipped        2009-12-06 00:30:28 UTC (rev 51733)
+++ trunk/LayoutTests/platform/mac-tiger/Skipped        2009-12-06 01:50:28 UTC (rev 51734)
</span><span class="lines">@@ -77,3 +77,6 @@
</span><span class="cx"> inspector/console-format-collections.html
</span><span class="cx"> inspector/console-format.html
</span><span class="cx"> inspector/console-tests.html
</span><ins>+
+# This test requires ogg codecs
+media/media-can-play-ogg.html
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformqtSkipped"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/qt/Skipped (51733 => 51734)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/qt/Skipped        2009-12-06 00:30:28 UTC (rev 51733)
+++ trunk/LayoutTests/platform/qt/Skipped        2009-12-06 01:50:28 UTC (rev 51734)
</span><span class="lines">@@ -5164,3 +5164,6 @@
</span><span class="cx"> http/tests/security/dataURL/xss-DENIED-from-javascript-url-window-open.html
</span><span class="cx"> http/tests/security/javascriptURL/xss-ALLOWED-from-javascript-url-window-open.html
</span><span class="cx"> http/tests/security/javascriptURL/xss-DENIED-from-javascript-url-in-foreign-domain-window-open.html
</span><ins>+
+# This test requires ogg codecs
+media/media-can-play-ogg.html
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformqtmacSkipped"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/qt-mac/Skipped (51733 => 51734)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/qt-mac/Skipped        2009-12-06 00:30:28 UTC (rev 51733)
+++ trunk/LayoutTests/platform/qt-mac/Skipped        2009-12-06 01:50:28 UTC (rev 51734)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+
+# This test requires ogg codecs
+media/media-can-play-ogg.html
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformqtwinSkipped"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/qt-win/Skipped (51733 => 51734)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/qt-win/Skipped        2009-12-06 00:30:28 UTC (rev 51733)
+++ trunk/LayoutTests/platform/qt-win/Skipped        2009-12-06 01:50:28 UTC (rev 51734)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+
+# This test requires ogg codecs
+media/media-can-play-ogg.html
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformwinSkipped"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/win/Skipped (51733 => 51734)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/win/Skipped        2009-12-06 00:30:28 UTC (rev 51733)
+++ trunk/LayoutTests/platform/win/Skipped        2009-12-06 01:50:28 UTC (rev 51734)
</span><span class="lines">@@ -723,3 +723,6 @@
</span><span class="cx"> 
</span><span class="cx"> # https://bugs.webkit.org/show_bug.cgi?id=32038 - Flaky on Windows
</span><span class="cx"> http/tests/cache/subresource-failover-to-network.html
</span><ins>+
+# This test requires ogg codecs
+media/media-can-play-ogg.html
</ins></span></pre></div>
<a id="trunkWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/ChangeLog (51733 => 51734)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/ChangeLog        2009-12-06 00:30:28 UTC (rev 51733)
+++ trunk/WebCore/ChangeLog        2009-12-06 01:50:28 UTC (rev 51734)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2009-12-03  Philippe Normand  &lt;pnormand@igalia.com&gt;
+
+        Reviewed by Gustavo Noronha.
+
+        Advertize audio/ogg correctly and refactored mime-type cache
+        building.
+
+        [GTK] Recognize oga as audio/ogg
+        https://bugs.webkit.org/show_bug.cgi?id=31990
+
+        Test: media/media-can-play-ogg.html
+
+        * platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp:
+        (WebCore::mimeTypeCache):
+
</ins><span class="cx"> 2009-12-05  Alexey Proskuryakov  &lt;ap@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Reviewed by Eric Seidel.
</span></span></pre></div>
<a id="trunkWebCoreplatformgraphicsgtkMediaPlayerPrivateGStreamercpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp (51733 => 51734)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp        2009-12-06 00:30:28 UTC (rev 51733)
+++ trunk/WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp        2009-12-06 01:50:28 UTC (rev 51734)
</span><span class="lines">@@ -777,56 +777,78 @@
</span><span class="cx">             GstTypeFindFactory* factory = GST_TYPE_FIND_FACTORY(iterator-&gt;data);
</span><span class="cx">             GstCaps* caps = gst_type_find_factory_get_caps(factory);
</span><span class="cx"> 
</span><del>-            // Splitting the capability by comma and taking the first part
-            // as capability can be something like &quot;audio/x-wavpack, framed=(boolean)false&quot;
-            GOwnPtr&lt;gchar&gt; capabilityString(gst_caps_to_string(caps));
-            gchar** capability = g_strsplit(capabilityString.get(), &quot;,&quot;, 2);
-            gchar** mimetype = g_strsplit(capability[0], &quot;/&quot;, 2);
</del><ins>+            if (!caps)
+                continue;
</ins><span class="cx"> 
</span><del>-            // GStreamer plugins can be capable of supporting types which WebKit supports
-            // by default. In that case, we should not consider these types supportable by GStreamer.
-            // Examples of what GStreamer can support but should not be added:
-            // text/plain, text/html, image/jpeg, application/xml
-            if (g_str_equal(mimetype[0], &quot;audio&quot;)
-                || g_str_equal(mimetype[0], &quot;video&quot;)
-                || (g_str_equal(mimetype[0], &quot;application&quot;)
-                    &amp;&amp; !ignoredApplicationSubtypes.contains(String(mimetype[1])))) {
-                cache.add(String(capability[0]));
</del><ins>+            for (guint structureIndex = 0; structureIndex &lt; gst_caps_get_size(caps); structureIndex++) {
+                GstStructure* structure = gst_caps_get_structure(caps, structureIndex);
+                const gchar* name = gst_structure_get_name(structure);
+                bool cached = false;
</ins><span class="cx"> 
</span><del>-                // These formats are supported by GStreamer, but not correctly advertised
-                if (g_str_equal(capability[0], &quot;video/x-h264&quot;)
-                    || g_str_equal(capability[0], &quot;audio/x-m4a&quot;)) {
</del><ins>+                // These formats are supported by GStreamer, but not
+                // correctly advertised.
+                if (g_str_equal(name, &quot;video/x-h264&quot;)
+                    || g_str_equal(name, &quot;audio/x-m4a&quot;)) {
</ins><span class="cx">                     cache.add(String(&quot;video/mp4&quot;));
</span><span class="cx">                     cache.add(String(&quot;audio/aac&quot;));
</span><ins>+                    cached = true;
</ins><span class="cx">                 }
</span><span class="cx"> 
</span><del>-                if (g_str_equal(capability[0], &quot;video/x-theora&quot;))
</del><ins>+                if (g_str_equal(name, &quot;video/x-theora&quot;)) {
</ins><span class="cx">                     cache.add(String(&quot;video/ogg&quot;));
</span><ins>+                    cached = true;
+                }
</ins><span class="cx"> 
</span><del>-                if (g_str_equal(capability[0], &quot;audio/x-wav&quot;))
</del><ins>+                if (g_str_equal(name, &quot;audio/x-vorbis&quot;)) {
+                    cache.add(String(&quot;audio/ogg&quot;));
+                    cached = true;
+                }
+
+                if (g_str_equal(name, &quot;audio/x-wav&quot;)) {
</ins><span class="cx">                     cache.add(String(&quot;audio/wav&quot;));
</span><ins>+                    cached = true;
+                }
</ins><span class="cx"> 
</span><del>-                if (g_str_equal(capability[0], &quot;audio/mpeg&quot;)) {
-                    // This is what we are handling: mpegversion=(int)1, layer=(int)[ 1, 3 ]
-                    gchar** versionAndLayer = g_strsplit(capability[1], &quot;,&quot;, 2);
</del><ins>+                if (g_str_equal(name, &quot;audio/mpeg&quot;)) {
+                    cache.add(String(name));
+                    cached = true;
</ins><span class="cx"> 
</span><del>-                    if (g_str_has_suffix(versionAndLayer[0], &quot;(int)1&quot;)) {
-                        for (int i = 0; versionAndLayer[1][i] != '\0'; i++) {
-                            if (versionAndLayer[1][i] == '1')
</del><ins>+                    // This is what we are handling:
+                    // mpegversion=(int)1, layer=(int)[ 1, 3 ]
+                    gint mpegVersion = 0;
+                    if (gst_structure_get_int(structure, &quot;mpegversion&quot;, &amp;mpegVersion) &amp;&amp; (mpegVersion == 1)) {
+                        const GValue* layer = gst_structure_get_value(structure, &quot;layer&quot;);
+                        if (G_VALUE_TYPE(layer) == GST_TYPE_INT_RANGE) {
+                            gint minLayer = gst_value_get_int_range_min(layer);
+                            gint maxLayer = gst_value_get_int_range_max(layer);
+                            if (minLayer &lt;= 1 &lt;= maxLayer)
</ins><span class="cx">                                 cache.add(String(&quot;audio/mp1&quot;));
</span><del>-                            else if (versionAndLayer[1][i] == '2')
</del><ins>+                            if (minLayer &lt;= 2 &lt;= maxLayer)
</ins><span class="cx">                                 cache.add(String(&quot;audio/mp2&quot;));
</span><del>-                            else if (versionAndLayer[1][i] == '3')
</del><ins>+                            if (minLayer &lt;= 3 &lt;= maxLayer)
</ins><span class="cx">                                 cache.add(String(&quot;audio/mp3&quot;));
</span><span class="cx">                         }
</span><span class="cx">                     }
</span><ins>+                }
</ins><span class="cx"> 
</span><del>-                    g_strfreev(versionAndLayer);
</del><ins>+                if (!cached) {
+                    // GStreamer plugins can be capable of supporting
+                    // types which WebKit supports by default. In that
+                    // case, we should not consider these types
+                    // supportable by GStreamer.  Examples of what
+                    // GStreamer can support but should not be added:
+                    // text/plain, text/html, image/jpeg,
+                    // application/xml
+                    gchar** mimetype = g_strsplit(name, &quot;/&quot;, 2);
+                    if (g_str_equal(mimetype[0], &quot;audio&quot;)
+                        || g_str_equal(mimetype[0], &quot;video&quot;)
+                        || (g_str_equal(mimetype[0], &quot;application&quot;)
+                            &amp;&amp; !ignoredApplicationSubtypes.contains(String(mimetype[1]))))
+                        cache.add(String(name));
+
+                    g_strfreev(mimetype);
</ins><span class="cx">                 }
</span><span class="cx">             }
</span><del>-
-            g_strfreev(capability);
-            g_strfreev(mimetype);
</del><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         gst_plugin_feature_list_free(factories);
</span></span></pre>
</div>
</div>

</body>
</html>