Changeset 51734 in webkit


Ignore:
Timestamp:
Dec 5, 2009 5:50:28 PM (14 years ago)
Author:
kov@webkit.org
Message:

WebCore

2009-12-03 Philippe Normand <pnormand@igalia.com>

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 <pnormand@igalia.com>

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:
Location:
trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r51731 r51734  
     12009-12-05  Philippe Normand  <pnormand@igalia.com>
     2
     3        Reviewed by Gustavo Noronha.
     4
     5        New test for video.canPlayType and ogg containers.
     6
     7        [GTK] Recognize oga as audio/ogg
     8        https://bugs.webkit.org/show_bug.cgi?id=31990
     9
     10        * media/media-can-play-ogg-expected.txt: Added.
     11        * media/media-can-play-ogg.html: Added.
     12        * platform/mac-leopard/Skipped:
     13        * platform/mac-snowleopard/Skipped:
     14        * platform/mac-tiger/Skipped:
     15        * platform/mac/Skipped:
     16        * platform/qt-mac/Skipped:
     17        * platform/qt-win/Skipped:
     18        * platform/qt/Skipped:
     19        * platform/win/Skipped:
     20
    1212009-12-05  Dan Bernstein  <mitz@apple.com>
    222
  • trunk/LayoutTests/platform/mac-leopard/Skipped

    r51270 r51734  
    2828# Tests of accessibility functionality not supported on Leopard
    2929accessibility/aria-list-and-listitem.html
     30
     31# This test requires ogg codecs
     32media/media-can-play-ogg.html
  • trunk/LayoutTests/platform/mac-snowleopard/Skipped

    r49805 r51734  
    5050plugins/netscape-invoke-failure.html
    5151
     52# This test requires ogg codecs
     53media/media-can-play-ogg.html
  • trunk/LayoutTests/platform/mac-tiger/Skipped

    r51270 r51734  
    7878inspector/console-format.html
    7979inspector/console-tests.html
     80
     81# This test requires ogg codecs
     82media/media-can-play-ogg.html
  • trunk/LayoutTests/platform/mac/Skipped

    r51516 r51734  
    109109# These test require Qt Widgets
    110110plugins/qt-qwidget-plugin.html
     111
     112# This test requires ogg codecs
     113media/media-can-play-ogg.html
     114
  • trunk/LayoutTests/platform/qt-mac/Skipped

    r49680 r51734  
     1
     2# This test requires ogg codecs
     3media/media-can-play-ogg.html
  • trunk/LayoutTests/platform/qt-win/Skipped

    r49680 r51734  
     1
     2# This test requires ogg codecs
     3media/media-can-play-ogg.html
  • trunk/LayoutTests/platform/qt/Skipped

    r51709 r51734  
    51655165http/tests/security/javascriptURL/xss-ALLOWED-from-javascript-url-window-open.html
    51665166http/tests/security/javascriptURL/xss-DENIED-from-javascript-url-in-foreign-domain-window-open.html
     5167
     5168# This test requires ogg codecs
     5169media/media-can-play-ogg.html
  • trunk/LayoutTests/platform/win/Skipped

    r51669 r51734  
    724724# https://bugs.webkit.org/show_bug.cgi?id=32038 - Flaky on Windows
    725725http/tests/cache/subresource-failover-to-network.html
     726
     727# This test requires ogg codecs
     728media/media-can-play-ogg.html
  • trunk/WebCore/ChangeLog

    r51732 r51734  
     12009-12-03  Philippe Normand  <pnormand@igalia.com>
     2
     3        Reviewed by Gustavo Noronha.
     4
     5        Advertize audio/ogg correctly and refactored mime-type cache
     6        building.
     7
     8        [GTK] Recognize oga as audio/ogg
     9        https://bugs.webkit.org/show_bug.cgi?id=31990
     10
     11        Test: media/media-can-play-ogg.html
     12
     13        * platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp:
     14        (WebCore::mimeTypeCache):
     15
    1162009-12-05  Alexey Proskuryakov  <ap@apple.com>
    217
  • trunk/WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp

    r51423 r51734  
    778778            GstCaps* caps = gst_type_find_factory_get_caps(factory);
    779779
    780             // Splitting the capability by comma and taking the first part
    781             // as capability can be something like "audio/x-wavpack, framed=(boolean)false"
    782             GOwnPtr<gchar> capabilityString(gst_caps_to_string(caps));
    783             gchar** capability = g_strsplit(capabilityString.get(), ",", 2);
    784             gchar** mimetype = g_strsplit(capability[0], "/", 2);
    785 
    786             // GStreamer plugins can be capable of supporting types which WebKit supports
    787             // by default. In that case, we should not consider these types supportable by GStreamer.
    788             // Examples of what GStreamer can support but should not be added:
    789             // text/plain, text/html, image/jpeg, application/xml
    790             if (g_str_equal(mimetype[0], "audio")
    791                 || g_str_equal(mimetype[0], "video")
    792                 || (g_str_equal(mimetype[0], "application")
    793                     && !ignoredApplicationSubtypes.contains(String(mimetype[1])))) {
    794                 cache.add(String(capability[0]));
    795 
    796                 // These formats are supported by GStreamer, but not correctly advertised
    797                 if (g_str_equal(capability[0], "video/x-h264")
    798                     || g_str_equal(capability[0], "audio/x-m4a")) {
     780            if (!caps)
     781                continue;
     782
     783            for (guint structureIndex = 0; structureIndex < gst_caps_get_size(caps); structureIndex++) {
     784                GstStructure* structure = gst_caps_get_structure(caps, structureIndex);
     785                const gchar* name = gst_structure_get_name(structure);
     786                bool cached = false;
     787
     788                // These formats are supported by GStreamer, but not
     789                // correctly advertised.
     790                if (g_str_equal(name, "video/x-h264")
     791                    || g_str_equal(name, "audio/x-m4a")) {
    799792                    cache.add(String("video/mp4"));
    800793                    cache.add(String("audio/aac"));
     794                    cached = true;
    801795                }
    802796
    803                 if (g_str_equal(capability[0], "video/x-theora"))
     797                if (g_str_equal(name, "video/x-theora")) {
    804798                    cache.add(String("video/ogg"));
    805 
    806                 if (g_str_equal(capability[0], "audio/x-wav"))
     799                    cached = true;
     800                }
     801
     802                if (g_str_equal(name, "audio/x-vorbis")) {
     803                    cache.add(String("audio/ogg"));
     804                    cached = true;
     805                }
     806
     807                if (g_str_equal(name, "audio/x-wav")) {
    807808                    cache.add(String("audio/wav"));
    808 
    809                 if (g_str_equal(capability[0], "audio/mpeg")) {
    810                     // This is what we are handling: mpegversion=(int)1, layer=(int)[ 1, 3 ]
    811                     gchar** versionAndLayer = g_strsplit(capability[1], ",", 2);
    812 
    813                     if (g_str_has_suffix(versionAndLayer[0], "(int)1")) {
    814                         for (int i = 0; versionAndLayer[1][i] != '\0'; i++) {
    815                             if (versionAndLayer[1][i] == '1')
     809                    cached = true;
     810                }
     811
     812                if (g_str_equal(name, "audio/mpeg")) {
     813                    cache.add(String(name));
     814                    cached = true;
     815
     816                    // This is what we are handling:
     817                    // mpegversion=(int)1, layer=(int)[ 1, 3 ]
     818                    gint mpegVersion = 0;
     819                    if (gst_structure_get_int(structure, "mpegversion", &mpegVersion) && (mpegVersion == 1)) {
     820                        const GValue* layer = gst_structure_get_value(structure, "layer");
     821                        if (G_VALUE_TYPE(layer) == GST_TYPE_INT_RANGE) {
     822                            gint minLayer = gst_value_get_int_range_min(layer);
     823                            gint maxLayer = gst_value_get_int_range_max(layer);
     824                            if (minLayer <= 1 <= maxLayer)
    816825                                cache.add(String("audio/mp1"));
    817                             else if (versionAndLayer[1][i] == '2')
     826                            if (minLayer <= 2 <= maxLayer)
    818827                                cache.add(String("audio/mp2"));
    819                             else if (versionAndLayer[1][i] == '3')
     828                            if (minLayer <= 3 <= maxLayer)
    820829                                cache.add(String("audio/mp3"));
    821830                        }
    822831                    }
    823 
    824                     g_strfreev(versionAndLayer);
     832                }
     833
     834                if (!cached) {
     835                    // GStreamer plugins can be capable of supporting
     836                    // types which WebKit supports by default. In that
     837                    // case, we should not consider these types
     838                    // supportable by GStreamer.  Examples of what
     839                    // GStreamer can support but should not be added:
     840                    // text/plain, text/html, image/jpeg,
     841                    // application/xml
     842                    gchar** mimetype = g_strsplit(name, "/", 2);
     843                    if (g_str_equal(mimetype[0], "audio")
     844                        || g_str_equal(mimetype[0], "video")
     845                        || (g_str_equal(mimetype[0], "application")
     846                            && !ignoredApplicationSubtypes.contains(String(mimetype[1]))))
     847                        cache.add(String(name));
     848
     849                    g_strfreev(mimetype);
    825850                }
    826851            }
    827 
    828             g_strfreev(capability);
    829             g_strfreev(mimetype);
    830852        }
    831853
Note: See TracChangeset for help on using the changeset viewer.