Bug 236883 - [GStreamer] Add WebKitDMABufVideoSink
Summary: [GStreamer] Add WebKitDMABufVideoSink
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Zan Dobersek
URL:
Keywords: InRadar
Depends on:
Blocks: DMA-BUF
  Show dependency treegraph
 
Reported: 2022-02-19 08:37 PST by Zan Dobersek
Modified: 2022-03-11 00:39 PST (History)
5 users (show)

See Also:


Attachments
Patch (20.41 KB, patch)
2022-02-19 08:38 PST, Zan Dobersek
no flags Details | Formatted Diff | Diff
Patch (30.00 KB, patch)
2022-02-21 00:18 PST, Zan Dobersek
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Zan Dobersek 2022-02-19 08:37:59 PST
[GStreamer] Add WebKitDMABufVideoSink
Comment 1 Zan Dobersek 2022-02-19 08:38:31 PST
Created attachment 452639 [details]
Patch
Comment 2 Víctor M. Jáquez L. 2022-02-19 10:01:43 PST
So just to say it explicitly, this approach will mean that color balance, color conversion, and perhaps others filters, will be processed outside of the gstreamer pipeline.
Comment 3 Víctor M. Jáquez L. 2022-02-19 10:06:13 PST
The patch looks simple and correct. Does it work as-is? (without modifying the player side)
Comment 4 Zan Dobersek 2022-02-19 11:22:04 PST
(In reply to Víctor M. Jáquez L. from comment #2)
> So just to say it explicitly, this approach will mean that color balance,
> color conversion, and perhaps others filters, will be processed outside of
> the gstreamer pipeline.

Yes, but in the current sinks AFAIU there's no color balance changes applied, and the color conversion is only used when necessary.

If color balance or some other filter would be required with the dmabuf-based sink, it would be done inside the pipeline.

But for any color conversion, with a dmabuf-capable decoder, we would need to cover composition of the given color format. Any other color conversion technique, if avoidable, would just add overhead.

For a raw-data decoder, if it had some unorthodox color format output, we're covered by the videoconvert element in the playbin.
Comment 5 Zan Dobersek 2022-02-19 11:24:21 PST
(In reply to Víctor M. Jáquez L. from comment #3)
> The patch looks simple and correct. Does it work as-is? (without modifying
> the player side)

Well it works, but it requires separate changes in MediaPlayerPrivateGStreamer to properly handle these samples as well as actually use the sink. The patch is split from the larger body of work to keep it easy to review.
Comment 6 Philippe Normand 2022-02-20 11:27:35 PST
Comment on attachment 452639 [details]
Patch

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

Can you make the style bubble green? The new file should be listed somewhere in a style-checker allowlist for GObject modules.

> Source/WebCore/platform/graphics/gstreamer/DMABufVideoSinkGStreamer.cpp:164
> +void webKitDMABufVideoSinkSetMediaPlayerPrivate(WebKitDMABufVideoSink* sink, MediaPlayerPrivateGStreamer* player)

maybe factor this out to a GStreamerVideoSinkCommon or Utilities module?
Comment 7 Zan Dobersek 2022-02-21 00:18:12 PST
Created attachment 452715 [details]
Patch
Comment 8 Philippe Normand 2022-02-22 10:41:48 PST
Let's land this then?
Comment 9 Zan Dobersek 2022-02-23 03:15:25 PST
Waiting for the branch to happen.
Comment 10 Zan Dobersek (Reviews) 2022-02-23 03:42:25 PST
Comment on attachment 452715 [details]
Patch

It happened.
Comment 11 EWS 2022-02-23 04:28:38 PST
Committed r290366 (247682@main): <https://commits.webkit.org/247682@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 452715 [details].
Comment 12 Radar WebKit Bug Importer 2022-02-23 04:29:19 PST
<rdar://problem/89349168>