Bug 206289 - [GStreamer][WPE] Client-side video rendering support
Summary: [GStreamer][WPE] Client-side video rendering support
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-01-15 07:27 PST by Philippe Normand
Modified: 2020-01-24 02:58 PST (History)
19 users (show)

See Also:


Attachments
Patch (19.17 KB, patch)
2020-01-15 07:38 PST, Philippe Normand
no flags Details | Formatted Diff | Diff
Patch (20.04 KB, patch)
2020-01-16 03:14 PST, Philippe Normand
calvaris: review+
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-01-15 07:27:07 PST
Using the WPEBackend-FDO video-plane-display-dmabuf protocol, to be shipped in 1.6.
Comment 1 Philippe Normand 2020-01-15 07:38:15 PST
Created attachment 387790 [details]
Patch
Comment 2 Xabier Rodríguez Calvar 2020-01-15 08:41:04 PST
Comment on attachment 387790 [details]
Patch

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

> Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:259
> +        wpe_video_plane_display_dmabuf_source_update(videoPlaneDisplayDmaBufSource, m_dmabufFD, rect.x(), rect.y(), m_size.width(), m_size.height(), m_dmabufStride, [](void* data) {
> +            gst_buffer_unref(GST_BUFFER_CAST(data));
> +        }, gst_buffer_ref(m_buffer.get()));

Is this lambda a C callback? If not, then it would be nice to capture the smart pointer (by copy!) inside the lambda.

> Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:487
> +#if USE(WPE_VIDEO_PLANE_DISPLAY_DMABUF)
> +    if (m_wpeVideoPlaneDisplayDmaBuf)
> +        wpe_video_plane_display_dmabuf_source_destroy(m_wpeVideoPlaneDisplayDmaBuf);
> +#endif
> +

I think we can use GUniquePtr by defining this as deleter in GUniquePtrGStreamer.h, can't we?

> Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:3146
> +    GStreamerDMABufHolePunchClient(std::unique_ptr<GstVideoFrameHolder> frameHolder, struct wpe_video_plane_display_dmabuf_source* videoPlaneDisplayDmaBufSource)

I think we should be taking a std::unique_ptr<GstVideoFrameHolder>&& frameHolder, specially with the way you call this constructor.

> Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:3181
> +            proxy.pushNextBuffer(WTFMove(layerBuffer));

And from what I see, TextureMapperPlatformLayerProxy::pushNextBuffer lacks a && in the parameter as well. Either we add it or we are not taking advantage of all the WTFMove calling it.
Comment 3 Philippe Normand 2020-01-16 03:04:14 PST
Comment on attachment 387790 [details]
Patch

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

>> Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:259
>> +        }, gst_buffer_ref(m_buffer.get()));
> 
> Is this lambda a C callback? If not, then it would be nice to capture the smart pointer (by copy!) inside the lambda.

I think it's what you call a C callback? https://github.com/Igalia/WPEBackend-fdo/blob/master/include/wpe-fdo/extensions/video-plane-display-dmabuf.h#L66
Comment 4 Philippe Normand 2020-01-16 03:14:39 PST
Created attachment 387904 [details]
Patch
Comment 5 Xabier Rodríguez Calvar 2020-01-16 07:26:07 PST
(In reply to Xabier Rodríguez Calvar from comment #2)
> > Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:3181
> > +            proxy.pushNextBuffer(WTFMove(layerBuffer));
> 
> And from what I see, TextureMapperPlatformLayerProxy::pushNextBuffer lacks a
> && in the parameter as well. Either we add it or we are not taking advantage
> of all the WTFMove calling it.

Is this coming in a follow up or did you forget?
Comment 6 Philippe Normand 2020-01-16 07:57:52 PST
Committed r254682: <https://trac.webkit.org/changeset/254682>
Comment 7 Radar WebKit Bug Importer 2020-01-16 07:58:11 PST
<rdar://problem/58644258>
Comment 8 Andrey Lushnikov 2020-01-23 19:08:39 PST
Hi Philippe!

This broke `//Tools/Scripts/update-webkitwpe-libs` script - the cmake config is complaining for libwpe. 

I filed the bug upstream to libwpe: https://github.com/WebPlatformForEmbedded/libwpe/issues/63

Meanwhile, is there anything we can do about this change to fix it?

Thanks,
Andrey
Comment 9 Zan Dobersek 2020-01-24 02:29:18 PST
(In reply to Andrey Lushnikov from comment #8)
> This broke `//Tools/Scripts/update-webkitwpe-libs` script - the cmake config
> is complaining for libwpe. 
> 
> I filed the bug upstream to libwpe:
> https://github.com/WebPlatformForEmbedded/libwpe/issues/63
> 

I have a fix for this. I'll push it into libwpe and then update the jhbuild tag.
Comment 10 Zan Dobersek 2020-01-24 02:58:04 PST
(In reply to Zan Dobersek from comment #9)
> (In reply to Andrey Lushnikov from comment #8)
> > This broke `//Tools/Scripts/update-webkitwpe-libs` script - the cmake config
> > is complaining for libwpe. 
> > 
> > I filed the bug upstream to libwpe:
> > https://github.com/WebPlatformForEmbedded/libwpe/issues/63
> > 
> 
> I have a fix for this. I'll push it into libwpe and then update the jhbuild
> tag.

Done in r255062.
http://trac.webkit.org/changeset/255062/webkit