Bug 172542 - [GTK][WPE][GSTREAMER_GL] Do not use cairo to copy video textures to an accelerated canvas
Summary: [GTK][WPE][GSTREAMER_GL] Do not use cairo to copy video textures to an accele...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Miguel Gomez
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-05-24 09:40 PDT by Miguel Gomez
Modified: 2017-05-30 20:20 PDT (History)
5 users (show)

See Also:


Attachments
Patch (12.56 KB, patch)
2017-05-24 10:01 PDT, Miguel Gomez
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews125 for ios-simulator-wk2 (10.91 MB, application/zip)
2017-05-24 11:26 PDT, Build Bot
no flags Details
Patch (12.49 KB, patch)
2017-05-30 02:58 PDT, Miguel Gomez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Miguel Gomez 2017-05-24 09:40:05 PDT
Instead of using the current approach of copying the video frame using cairo, use VideoTextureCopierGStreamer, as it's done when copying frames to webgl. This will allow to perform color adjustments with the shader during the GPU, which will be needed as we're going to change the video frames format to BGRA.
Comment 1 Miguel Gomez 2017-05-24 10:01:49 PDT
Created attachment 311124 [details]
Patch
Comment 2 Build Bot 2017-05-24 11:26:43 PDT
Comment on attachment 311124 [details]
Patch

Attachment 311124 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: http://webkit-queues.webkit.org/results/3807875

New failing tests:
fast/events/before-unload-returnValue.html
Comment 3 Build Bot 2017-05-24 11:26:44 PDT
Created attachment 311138 [details]
Archive of layout-test-results from ews125 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews125  Port: ios-simulator-wk2  Platform: Mac OS X 10.12.5
Comment 4 Zan Dobersek 2017-05-29 06:58:43 PDT
Comment on attachment 311124 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=311124&action=review

> Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:983
> +    unsigned textureID = *reinterpret_cast<unsigned*>(videoFrame.data[0]);

This variable can be set just before the copyVideoTextureToPlatformTexture() call.

> Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:998
> +    RefPtr<cairo_surface_t> surface = adoptRef(cairo_gl_surface_create_for_texture(context->cairoDevice(), CAIRO_CONTENT_COLOR_ALPHA, m_videoTextureCopier->resultTexture(), size.width(), size.height()));
> +    return surface;

This can be in one line.

> Source/WebCore/platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp:146
> +    // Use our own output texture if we are not given one.
> +    if (!outputTexture)
> +        outputTexture = m_resultTexture;

Do we want to wait with the m_resultTexture creation until this point?
Comment 5 Zan Dobersek 2017-05-29 08:20:01 PDT
Comment on attachment 311124 [details]
Patch

Fine otherwise.
Comment 6 Miguel Gomez 2017-05-30 02:58:48 PDT
Created attachment 311497 [details]
Patch
Comment 7 WebKit Commit Bot 2017-05-30 06:02:50 PDT
Comment on attachment 311497 [details]
Patch

Clearing flags on attachment: 311497

Committed r217551: <http://trac.webkit.org/changeset/217551>
Comment 8 WebKit Commit Bot 2017-05-30 06:02:52 PDT
All reviewed patches have been landed.  Closing bug.