Skip to content

gst1-plugins-base: add the Raspberry Pi column formats - #31248

Draft
dangowrt wants to merge 1 commit into
openwrt:masterfrom
dangowrt:gst1-plugins-base-rpi-column-formats
Draft

dangowrt wants to merge 1 commit into
openwrt:masterfrom
dangowrt:gst1-plugins-base-rpi-column-formats

Conversation

@dangowrt

Copy link
Copy Markdown
Member

📦 Package Details

Maintainer: @flyn-org @thess

Description:
The Raspberry Pi HEVC decoder (rpi-hevc-dec) writes its pictures in Broadcom's 128-byte column layout, which libgstvideo has no format for, so a decoder negotiating it as DMA_DRM NV12 or P030 with the SAND128 modifier cannot configure its buffer pool. This adds Dave Stevenson's libgstvideo patches from https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9247, with his authorship kept in the patch files: the NV12_128C8 and NV12_10LE32_128C8 formats with their DRM mappings, the translation of their column strides in GL memory and EGL dma-buf import, and DMA_DRM caps in the decoder base class when it sets up its pool. The v4l2codecs side of the merge request is in #31074, which depends on this.

LLM use: the packaging, the commit message and this description were written with an LLM coding agent working under my direction, which also ran the tests below on my device. The patches are Dave Stevenson's.


🔬 Run Testing Details

  • OpenWrt Version: SNAPSHOT (main)
  • OpenWrt Target/Subtarget: bcm27xx/bcm2711
  • OpenWrt Device: Raspberry Pi Compute Module 4, WPE WebKit 2.54.2
  • With gst1-plugins-bad: v4l2codecs fixes, Raspberry Pi HEVC and the DASH demuxer #31074, v4l2slh265dec decodes HEVC Main and Main10 at 1080p and 2160p in WPE WebKit, put out as DRM PRIME frames in the column layout (NV12 and P030 with the Broadcom SAND128 modifier). The decoded pictures are bit-exact against avdec_h265 over 500 frames, 8-bit and 10-bit.

✅ Formalities

If your PR contains a patch:

  • It can be applied using git am
  • It has been refreshed to avoid offsets, fuzzes, etc.
  • It is structured in a way that it is potentially upstreamable

The Raspberry Pi HEVC decoder writes its pictures in Broadcom's
128-byte column layout, which libgstvideo has no format for. A decoder
negotiating it as DMA_DRM NV12 or P030 with the SAND128 modifier fails
to configure its buffer pool, so hardware HEVC never reaches a sink.
Add the NV12_128C8 and NV12_10LE32_128C8 formats with their DRM
mappings, translate their column strides in GL memory and EGL dma-buf
import, and let the decoder base class read DMA_DRM caps when it sets
up its pool.

Link: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9247
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
- "UYVP, v210, I420_10LE, I420_10BE, P010_10LE, NV12_10LE40, NV12_10LE32, " \
- "P010_10BE, MT2110R, MT2110T, NV12_10BE_8L128, NV12_10LE40_4L4, Y444, " \
- "BGRP, GBR, RGBP, NV24, v308, IYU2, RGBx, xRGB, BGRx, xBGR, RGB, BGR, " \
+ "UYVP, v210, I420_10LE, I420_10BE, P010_10LE, NV12_10LE32_128C8, NV12_10LE40, " \

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NV12_10LE32_128C8 goes only into the little-endian GST_VIDEO_FORMATS_ALL_STR. Patch 200 adds NV12_128C8 to both lists, and the [big-endian list](https://github.com/GStreamer/gstreamer/blob/070125524a8422e29d3b69a372ed4f62fd343ffa/subprojects/gst-plugins-base/gst-libs/gst/video/video-format.h#L1181-L1200) already contains the other *_10LE* formats. With the new format missing there, GST_VIDEO_FORMATS_ALL no longer covers every format on mips/powerpc BE, and test_video_formats_all (num == GST_VIDEO_FORMAT_LAST - 3) fails. Please add it next to NV12_10LE40 in the G_BIG_ENDIAN block too, here and upstream in MR 9247.


Generated by Claude Code

format

Adds the new format GST_VIDEO_FORMAT_NV12_128C8 as a column-striped
NV12 used on the Raspberry Pi HEVC decoder.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: these five patches are non-trivial and not yet merged upstream, but only the commit message points to the MR. Please add a Link: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9247 (or an Upstream-Status:) line to each patch header, so whoever bumps to 1.30 can tell which ones to drop.


Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants