[Webkit-unassigned] [Bug 173097] New: [GTK][WPE] Fix alpha premultiplying when using cairo to draw the video frames

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jun 8 06:23:20 PDT 2017


            Bug ID: 173097
           Summary: [GTK][WPE] Fix alpha premultiplying when using cairo
                    to draw the video frames
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: WebKit Gtk
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: magomez at igalia.com
                CC: bugs-noreply at webkitgtk.org

GStreamer uses non premultiplied alpha on its video frames. But cairo uses premultiplied alpha. So when we want to paint video frames with cairo, we need to perform a manual premultiply.

With the current code, this is performed by VideoSinkGStreamer, in the webkitVideoSinkRequestRender() function, but this is wrong. This performs the premultiply assuming that the video frames are always going to rendered with cairo, but that's not true. When using accelerated compositing, the frame data is uploaded to a texture and rendered with OpenGL, so in that case premultiplying is an error. Also, premultiplying needs to be done as well when using gstreamer-gl, which is not happening now, and that can't be done inside VideoSinkGStreamer as we are using a different sink.

The appropriate thing to do here is to perform the premultiplying inside ImageGStreamerCairo, as there we know for sure that we are going to use cairo for rendering. Also this is used both with and without gstreamer-gl.

Manually performing the premultiplying has a performance penalty, but luckily this just has to be done when the video has an alpha component, which is a rare case. Usually the video will be using BGRx (or xRGB with big endian), which doesn't require the premultiply.

You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20170608/6d56595b/attachment.html>

More information about the webkit-unassigned mailing list