Commit graph

9 commits

Author SHA1 Message Date
Robert Mader
5189e8b956 v4l2codecs: decoders: Add DMA_DRM caps support
In order to simplify caps negotiations for clients and, notably, be more
compatible with va* decoders.
Crucially this allows clients to know ahead of time whether buffers will
actually be DMABufs.

Similar to GstVaBaseDec we only announce system memory caps if the peer
has ANY caps. Further more, and again like va decoders, we fail in
`decide_allocation()` if DMA_DRM caps are used without VideoMeta.
Apart from buggy peers this can happen e.g. when a peer with ANY caps
is used in combination with caps filters.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5890>
2024-03-14 17:32:13 +00:00
Robert Mader
513d0d8cbb v4l2codecs: decoders: Introduce and use set_output_state helper class
Allowing us to avoid some code duplication. This will become more
important with upcoming changes to caps generation.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5890>
2024-03-14 17:32:13 +00:00
Robert Mader
a95acbcc11 v4l2codecs: decoder: Clean up select_src_format()
Most importantly rely on video info helpers instead of manual parsing
of caps, which will allow us to use additional helpers in the future.

While on it, tighen the check for supported formats - failing that
indicates a bug in caps negotiation - and make some style changes.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5890>
2024-03-14 17:32:13 +00:00
Robert Mader
65896dab75 v4l2codecs: decoders: Use src template for negotiation filter
This ensures we don't create filter caps that are not supported by the
individual codec implementations, as well as that the resulting caps
have the required fields so they can be turned into a GstVideoFormat.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5890>
2024-03-14 17:32:13 +00:00
Marek Vasut
5f3d4215a0 v4l2codecs: Switch gst_codec_picture_ts_ns() to gst_util_uint64_scale_int()
Instead of plain multiplication, use gst_util_uint64_scale_int()
to achieve the same effect with additional checks.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5791>
2023-12-20 18:47:39 +00:00
Marek Vasut
3335af0efe v4l2codecs: Deduplicate picture frame number to timestamp in ns
Add macro which converts picture frame number to suitable timestamp in
nanoseconds for use in V4L2 VB2 buffer lookup. Since multiple codecs do
the same operation and almost all got it wrong, do it in one place so it
can be fixed in one place again, if needed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5791>
2023-12-20 18:47:39 +00:00
Nicolas Dufresne
dcd62c35f0 v4l2codecs: Trace request by it FD
This helps when crossing the debug logs with the kernel logs.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2009>
2022-03-25 21:40:28 +00:00
Nicolas Dufresne
19d99dbcae v4l2codecs: decoder: Add method to get the pic_buf
This helper will be needed for VP9 frame duplication.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1402>
2021-11-30 17:11:59 -05:00
Thibault Saunier
019971a3c7 Move files from gst-plugins-bad into the "subprojects/gst-plugins-bad/" subdir 2021-09-24 16:14:36 -03:00
Renamed from sys/v4l2codecs/gstv4l2decoder.h (Browse further)