Bug 2408887 - gtk4paintablesink build without native YCbCr support (missing GTK 4.20 feature?)
Summary: gtk4paintablesink build without native YCbCr support (missing GTK 4.20 feature?)
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: rust-gst-plugin-gtk4
Version: 43
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Fabio Valentini
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2025-10-31 16:20 UTC by Robert Mader
Modified: 2025-11-03 17:40 UTC (History)
5 users (show)

Fixed In Version: rust-gst-plugin-gtk4-0.14.3-1.fc44
Clone Of:
Environment:
Last Closed: 2025-11-03 17:40:18 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Robert Mader 2025-10-31 16:20:35 UTC
This issue causes core apps like Snapshot to not use the native GTK4 YCbCr support, falling back to `glsinkbin` instead, which is slower, does not support HDR (will only become relevant in the future) and - most importantly - does not use Vulkan.

As there are not many Vulkan apps using YCbCr formats yet, `gtk4paintablesink` / Snapshot is a valuable test app for driver development - so having this issue fixed would be very helpful :)

I had a look a the spec file, but did not spot the cause yet.

See also: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38160#note_3173168

Reproducible: Always

Steps to Reproduce:
1. Run `gst-inspect-1.0 gtk4paintablesink`
2. Check the advertised formats in the `Pad Templates`->`video/x-raw` section
Actual Results:
Only RGB formats are advertised.

Expected Results:
Lots of YCbCr formats should be advertised:
```
      video/x-raw
                 format: { (string)YUY2, (string)YVYU, (string)UYVY, (string)VYUY, (string)NV12, (string)NV21, (string)NV16, (string)NV61, (string)NV24, (string)P010_10LE, (string)P010_10BE, (string)P012_LE, (string)P012_BE, (string)P016_LE, (string)P016_BE, (string)YUV9, (string)YVU9, (string)Y41B, (string)I420, (string)YV12, (string)Y42B, (string)Y444, (string)I420_10LE, (string)I420_10BE, (string)I422_10LE, (string)I422_10BE, (string)Y444_10LE, (string)Y444_10BE, (string)I420_12LE, (string)I420_12BE, (string)I422_12LE, (string)I422_12BE, (string)Y444_12LE, (string)Y444_12BE, (string)Y444_16LE, (string)Y444_16BE, (string)BGRx, (string)xRGB, (string)RGBx, (string)xBGR, (string)BGRA, (string)ARGB, (string)RGBA, (string)ABGR, (string)RGB, (string)BGR } (GstValueList)
```

Additional Information:
Build the source branch with meson (`meson setup build -Dauto_features=disabled -Dgtk4=enabled`) produces the desired effect - possibly the spec file somehow fails to enable the `gtk_v4_20` feature, which is what enables the YCbCr formats (see https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/blob/main/video/gtk4/src/sink/frame.rs?ref_type=heads#L229)

Comment 1 Fabio Valentini 2025-10-31 16:27:01 UTC
> I had a look a the spec file, but did not spot the cause yet.

If the GTK 4.20 API level is not autodetected when GTK 4.20+ is available, then it looks like we need to pass that feature flag manually. meson.build is not available in the published gst-plugins-rs projects, so we build with plain cargo and cargo-c.

The manually enabled non-default features (currently) are "dmabuf,wayland,x11egl,x11glx". I can add "gtk_v4_20" to that list on Fedora 43+, that should resolve this issue?

Comment 2 Robert Mader 2025-10-31 16:29:38 UTC
> I can add "gtk_v4_20" to that list on Fedora 43+, that should resolve this issue?

Thanks for the quick reply! Yep, I guess that should do the trick - and can probably be combined with the 0.14.3 update that also just dropped :)

Comment 3 Fabio Valentini 2025-10-31 16:31:01 UTC
> can probably be combined with the 0.14.3 update that also just dropped

That was the idea - I should have time on Sunday or Monday to work on that.

Comment 4 Robert Mader 2025-10-31 16:38:39 UTC
Awesome, thanks a lot!

FTR.: AFAICS adding `gtk_v4_20` should automatically recursively enable `gtk_v4_18` etc., which would enable further (I think only performance related) improvements - but might be worth to double-check.

Comment 5 Robert Mader 2025-10-31 17:05:57 UTC
Update:
1. Right now we're building with the `gtk_v4_14` feature level which gets enabled by `dmabuf`. `gtk_v4_16` and `gtk_v4_18` aren't used, so we don't expect any further changes from `gtk_v4_20` apart from the YCbCr formats.
2. There have been a few YCbCr-related fixes that have been backported to 4.20 but need yet to be released in 4.20.3. I pinged GTK devs and they will make the release shortly - but it will probably make sense to wait for that before pushing a new release to stable (pushing to testing should be fine I guess).

Comment 6 Robert Mader 2025-10-31 18:05:15 UTC
Update2: enabling this locally has instantly uncovered a kernel bug on asahi (https://gitlab.freedesktop.org/mesa/mesa/-/issues/14217#note_3173360), so we should definitely give it some time in testing... (note that Snapshot on Asahi is already known to be broken - so it's not super likely that other platforms are affected by similar issues, but who knows).

Comment 7 Jeremy Bicha 2025-11-02 00:34:49 UTC
(In reply to Fabio Valentini from comment #1)
> The manually enabled non-default features (currently) are
> "dmabuf,wayland,x11egl,x11glx".

Please rename 'wayland' to 'waylandegl' since 'wayland' is deprecated

Comment 8 Robert Mader 2025-11-02 18:19:00 UTC
Debian testing just did the same in sid: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1119880#10 / https://packages.debian.org/sid/gstreamer1.0-gtk4

Comment 9 Fedora Update System 2025-11-03 16:42:54 UTC
FEDORA-2025-da167c95b9 (glycin-2.0.4-1.fc44, rust-gdk4-wayland-0.10.2-1.fc44, and 13 more) has been submitted as an update to Fedora 44.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-da167c95b9

Comment 10 Fedora Update System 2025-11-03 17:40:18 UTC
FEDORA-2025-da167c95b9 (glycin-2.0.4-1.fc44, rust-gdk4-wayland-0.10.2-1.fc44, and 13 more) has been pushed to the Fedora 44 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.