Changeset 50736 in webkit


Ignore:
Timestamp:
Nov 10, 2009 3:34:48 AM (14 years ago)
Author:
eric@webkit.org
Message:

2009-11-10 Philippe Normand <pnormand@igalia.com>

Reviewed by Eric Seidel.

https://bugs.webkit.org/show_bug.cgi?id=31047
[GTK] Failing test media/video-played-ranges-1.html

WebKit coding style fixes.

  • platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp: (WebCore::mediaPlayerPrivateMessageCallback): (WebCore::MediaPlayerPrivate::naturalSize): (WebCore::MediaPlayerPrivate::paint): (WebCore::mimeTypeCache):
Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r50734 r50736  
     12009-11-10  Philippe Normand  <pnormand@igalia.com>
     2
     3        Reviewed by Eric Seidel.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=31047
     6        [GTK] Failing test media/video-played-ranges-1.html
     7
     8        WebKit coding style fixes.
     9
     10        * platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp:
     11        (WebCore::mediaPlayerPrivateMessageCallback):
     12        (WebCore::MediaPlayerPrivate::naturalSize):
     13        (WebCore::MediaPlayerPrivate::paint):
     14        (WebCore::mimeTypeCache):
     15
    1162009-11-10  Oliver Hunt  <oliver@apple.com>
    217
  • trunk/WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp

    r50726 r50736  
    6767
    6868        error = MediaPlayer::Empty;
    69         if (err->code == GST_STREAM_ERROR_CODEC_NOT_FOUND ||
    70             err->code == GST_STREAM_ERROR_WRONG_TYPE ||
    71             err->code == GST_STREAM_ERROR_FAILED ||
    72             err->code == GST_CORE_ERROR_MISSING_PLUGIN ||
    73             err->code == GST_RESOURCE_ERROR_NOT_FOUND)
     69        if (err->code == GST_STREAM_ERROR_CODEC_NOT_FOUND
     70            || err->code == GST_STREAM_ERROR_WRONG_TYPE
     71            || err->code == GST_STREAM_ERROR_FAILED
     72            || err->code == GST_CORE_ERROR_MISSING_PLUGIN
     73            || err->code == GST_RESOURCE_ERROR_NOT_FOUND)
    7474            error = MediaPlayer::FormatError;
    7575        else if (err->domain == GST_STREAM_ERROR)
     
    336336        gint pixelAspectRatioNumerator, pixelAspectRatioDenominator;
    337337
    338         if (!GST_IS_CAPS(caps) || !gst_caps_is_fixed(caps) ||
    339             !gst_video_format_parse_caps(caps, NULL, &width, &height) ||
    340             !gst_video_parse_caps_pixel_aspect_ratio(caps, &pixelAspectRatioNumerator,
    341                                                            &pixelAspectRatioDenominator)) {
     338        if (!GST_IS_CAPS(caps) || !gst_caps_is_fixed(caps)
     339            || !gst_video_format_parse_caps(caps, 0, &width, &height)
     340            || !gst_video_parse_caps_pixel_aspect_ratio(caps, &pixelAspectRatioNumerator,
     341                                                        &pixelAspectRatioDenominator)) {
    342342            gst_object_unref(GST_OBJECT(pad));
    343343            return IntSize();
     
    696696    GstVideoFormat format;
    697697
    698     GstCaps *caps = gst_buffer_get_caps(m_buffer);
    699 
    700     if (G_UNLIKELY(!gst_video_format_parse_caps(caps, &format, &width, &height) ||
    701         !gst_video_parse_caps_pixel_aspect_ratio(caps, &pixelAspectRatioNumerator, &pixelAspectRatioDenominator))) {
     698    GstCaps* caps = gst_buffer_get_caps(m_buffer);
     699
     700    if (G_UNLIKELY(!gst_video_format_parse_caps(caps, &format, &width, &height)
     701                   || !gst_video_parse_caps_pixel_aspect_ratio(caps, &pixelAspectRatioNumerator, &pixelAspectRatioDenominator))) {
    702702      gst_caps_unref(caps);
    703703      return;
     
    729729
    730730    // Calculate the largest scale factor that would fill the target surface
    731     scale = MIN(rect.width() / displayWidth, rect.height() / displayHeight);
     731    scale = std::min(rect.width() / displayWidth, rect.height() / displayHeight);
    732732    // And calculate the new display width/height
    733733    displayWidth *= scale;
     
    796796            // Examples of what GStreamer can support but should not be added:
    797797            // text/plain, text/html, image/jpeg, application/xml
    798             if (g_str_equal(mimetype[0], "audio") ||
    799                     g_str_equal(mimetype[0], "video") ||
    800                     (g_str_equal(mimetype[0], "application") &&
    801                         !ignoredApplicationSubtypes.contains(String(mimetype[1])))) {
     798            if (g_str_equal(mimetype[0], "audio")
     799                || g_str_equal(mimetype[0], "video")
     800                || (g_str_equal(mimetype[0], "application")
     801                    && !ignoredApplicationSubtypes.contains(String(mimetype[1])))) {
    802802                cache.add(String(capability[0]));
    803803
    804804                // These formats are supported by GStreamer, but not correctly advertised
    805                 if (g_str_equal(capability[0], "video/x-h264") ||
    806                     g_str_equal(capability[0], "audio/x-m4a")) {
     805                if (g_str_equal(capability[0], "video/x-h264")
     806                    || g_str_equal(capability[0], "audio/x-m4a")) {
    807807                    cache.add(String("video/mp4"));
    808808                    cache.add(String("audio/aac"));
     
    819819                    gchar** versionAndLayer = g_strsplit(capability[1], ",", 2);
    820820
    821                     if (g_str_has_suffix (versionAndLayer[0], "(int)1")) {
     821                    if (g_str_has_suffix(versionAndLayer[0], "(int)1")) {
    822822                        for (int i = 0; versionAndLayer[1][i] != '\0'; i++) {
    823823                            if (versionAndLayer[1][i] == '1')
Note: See TracChangeset for help on using the changeset viewer.