[Webkit-unassigned] [Bug 30308] [GStreamer] Add direct support for ARGB videos

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Oct 29 05:40:23 PDT 2009


https://bugs.webkit.org/show_bug.cgi?id=30308


Gustavo Noronha (kov) <gns at gnome.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #41094|review?                     |review-
               Flag|                            |




--- Comment #7 from Gustavo Noronha (kov) <gns at gnome.org>  2009-10-29 05:40:24 PDT ---
(From update of attachment 41094)

> +    // Calculate the display width/height from the storage width/height and the pixel aspect ratio
>      displayWidth *= doublePixelAspectRatioNumerator / doublePixelAspectRatioDenominator;
>      displayHeight *= doublePixelAspectRatioDenominator / doublePixelAspectRatioNumerator;
>  
> -    scale = MIN (rect.width () / displayWidth, rect.height () / displayHeight);
> +    // Calculate the largest scale factor that would fill the target surface
> +    scale = MIN(rect.width() / displayWidth, rect.height() / displayHeight);
> +    // And calculate the new display width/height
>      displayWidth *= scale;
>      displayHeight *= scale;
>  
> -    // Calculate gap between border an picture
> +    // Calculate gap between border an picture on every side
>      gapWidth = (rect.width() - displayWidth) / 2.0;
>      gapHeight = (rect.height() - displayHeight) / 2.0;
>  
> -    // paint the rectangle on the context and draw the surface inside.
> +    // paint the rectangle on the context and draw the buffer inside

You may want to make this a full sentence.

> +    // Go to the new origin and center the video frame.
>      cairo_translate(cr, rect.x() + gapWidth, rect.y() + gapHeight);
>      cairo_rectangle(cr, 0, 0, rect.width(), rect.height());
> +    // Scale the video frame according to the pixel aspect ratio.
>      cairo_scale(cr, doublePixelAspectRatioNumerator / doublePixelAspectRatioDenominator,
>                  doublePixelAspectRatioDenominator / doublePixelAspectRatioNumerator);
> +    // Scale the video frame to fill the target surface as good as possible.
>      cairo_scale(cr, scale, scale);
> +    // And paint it.
>      cairo_set_source_surface(cr, src, 0, 0);
>      cairo_fill(cr);
>      cairo_restore(cr);

I like the comments, and style fix, but I think they deserve a separate commit.

>      // Use HIGH_IDLE+20 priority, like Gtk+ for redrawing operations.
>      priv->timeout_id = g_timeout_add_full(G_PRIORITY_HIGH_IDLE + 20, 0,
>                                            webkit_video_sink_timeout_func,
>                                            gst_object_ref(sink),
> -                                          (GDestroyNotify)gst_object_unref);
> +                                          (GDestroyNotify) gst_object_unref);

rogue space addition. Fix these, and split the patches, and they look good to
go.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list