Bug 207208 - [GStreamer] Client-side video rendering doesn't fallback to internal compositing
Summary: [GStreamer] Client-side video rendering doesn't fallback to internal compositing
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Philippe Normand
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-02-04 09:52 PST by Philippe Normand
Modified: 2020-02-05 02:01 PST (History)
13 users (show)

See Also:


Attachments
Patch (8.72 KB, patch)
2020-02-04 09:56 PST, Philippe Normand
calvaris: review+
calvaris: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Philippe Normand 2020-02-04 09:52:43 PST
For instance when the EGLImage export fails, we should fallback to internal compositing (eg, no hole punching).
Comment 1 Philippe Normand 2020-02-04 09:56:37 PST
Created attachment 389674 [details]
Patch
Comment 2 Xabier Rodríguez Calvar 2020-02-04 10:47:48 PST
Comment on attachment 389674 [details]
Patch

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

> Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:3172
> +    auto internalCompositingOperation = [this](TextureMapperPlatformLayerProxy& proxy, std::unique_ptr<GstVideoFrameHolder> frameHolder) {

You're moving the frameholder when calling this, so I guess you should make this && as well.

Anyway, why do you create a lambda instead of a method considering that we are only capturing this?
Comment 3 Zan Dobersek 2020-02-05 01:08:49 PST
Comment on attachment 389674 [details]
Patch

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

> Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:218
> +        static std::once_flag onceFlag;
> +        std::call_once(onceFlag, [] {

Nit: I'd recommend using `s_onceFlag` as the name, the `s_` prefix more explicitly describing the storage nature.

> Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:372
> +        return m_dmabufFD;

This should test for m_dmabufFD being >= 0, i.e. a valid fd. Related to this, m_dmabufFD should be initialized to -1 and in handoffVideoDmaBuf() reset to -1 after the hand-off and closure.

> Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:3203
> +            std::unique_ptr<GstVideoFrameHolder> frameHolder = makeUnique<GstVideoFrameHolder>(m_sample.get(), m_videoDecoderPlatform, m_textureMapperFlags, !m_isUsingFallbackVideoSink);
> +            if (frameHolder->hasDMABuf()) {
> +                std::unique_ptr<TextureMapperPlatformLayerBuffer> layerBuffer = makeUnique<TextureMapperPlatformLayerBuffer>(0, m_size, TextureMapperGL::ShouldNotBlend, GL_DONT_CARE);

Could use `auto object = makeUnique<>()` in both cases.
Comment 4 Philippe Normand 2020-02-05 01:21:42 PST
Comment on attachment 389674 [details]
Patch

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

>> Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:3172
>> +    auto internalCompositingOperation = [this](TextureMapperPlatformLayerProxy& proxy, std::unique_ptr<GstVideoFrameHolder> frameHolder) {
> 
> You're moving the frameholder when calling this, so I guess you should make this && as well.
> 
> Anyway, why do you create a lambda instead of a method considering that we are only capturing this?

I don't really see the point of adding a method for this. As the logic remains self-contained in pushTextureToCompositor() anyway. This new closure is an implementation detail of it.
Comment 5 Philippe Normand 2020-02-05 02:00:08 PST
Committed r255790: <https://trac.webkit.org/changeset/255790>
Comment 6 Radar WebKit Bug Importer 2020-02-05 02:01:14 PST
<rdar://problem/59182626>