Commit graph

3969 commits

Author SHA1 Message Date
Víctor Manuel Jáquez Leal
fbeb012617 vkencoder-private: remove rate control handling
It will be reintroduced later with different approach.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8007>
2024-12-04 02:17:44 +00:00
Víctor Manuel Jáquez Leal
8fc2af44c8 vkencoder-private: enhance algorithm to get the slot index
The algorithm for generating the current slot index is a simple round robin,
nonetheless it's not assured that the next slot index it's not still used by a
still living encode picture.

This new way holds an array with the still living encode pictures and the next
slot index looks for a released index in the array.

Its downside is deallocating a picture need to be removed from the array, so the
helper has to be passed to the uninit() function

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8007>
2024-12-04 02:17:44 +00:00
Víctor Manuel Jáquez Leal
d4de932664 vkencoder-private: add VkVideoReferenceSlotInfoKHR in GstVulkanEncoderPicture
And remove slotIndex since it's part of VkVideoReferenceSlotInfoKHR, simplifying
the reference slots array creation, and changing the tests accordingly.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8007>
2024-12-04 02:17:44 +00:00
Víctor Manuel Jáquez Leal
75a6ddf2be vkencoder-private: check for codec buffer
gst_vulkan_video_codec_buffer_new() can return NULL, so it's required to check
the returned value and bail out if needed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8007>
2024-12-04 02:17:44 +00:00
Víctor Manuel Jáquez Leal
d9e9d2ff72 vkencoder-private: avoid GstVulkanEncoderPicture allocation
By using it as apart of the encoder picture structure that has to initialized
and uninitalized.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8007>
2024-12-04 02:17:44 +00:00
Víctor Manuel Jáquez Leal
c1e364ecdc vkencoder-private: remove width, height and fps from GstVulkanEncoderPicture
In GStreamer that buffer information is decoupled, holding other structures to
describe the stream: GstCaps. So, to keep the GStreamer design this patch
removes these information from GstVulkanEncoderPicture and pass to
gst_vulkan_encoder_encode() a pointer to GstVideoInfo.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8007>
2024-12-04 02:17:44 +00:00
Víctor Manuel Jáquez Leal
eef9717478 vkencoder-private: replace packed headers with offset handling
Instead of holding all headers in an external array and add them into the
bitstream buffer before the encoding operation, adding extra memory and extra
copy operations, the encoder picture should specify the offset where the Vulkan
will start to add the bitstream slices/frame, because the element has written
already the headers until that offset.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8007>
2024-12-04 02:17:44 +00:00
Víctor Manuel Jáquez Leal
48b2c3cf74 vkencoder-private: remove nb_refs from GstVulkanEncoderPicture
That's the number of references that gst_vulkan_encoder_encode() receives to
process, so it has to go as a parameter, because it's part of the reference
list, not of the picture.

This commit also modified unit tests accordingly.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8007>
2024-12-04 02:17:44 +00:00
Víctor Manuel Jáquez Leal
87db136cc7 vkencoder-private: remove pic_num and pic_order_cnt from GstVulkanEncoderPicture
Since they aren't semantically part of the codec-independent encoding operation.
And modify unit tests accordingly.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8007>
2024-12-04 02:17:44 +00:00
Víctor Manuel Jáquez Leal
a8e676a0da vkencoder-private: remove is_ref member from GstVulkanEncoderPicture
It's not used. Modified the unit test accordingly.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8007>
2024-12-04 02:17:44 +00:00
Víctor Manuel Jáquez Leal
4a221aad8a vkencoder-private: don't store output data size
There's no need to store in encoder helper the output data size, that's
responsibility of the caller when an output buffer is allocated.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8007>
2024-12-04 02:17:44 +00:00
Víctor Manuel Jáquez Leal
091fe0c1e7 vkencoder-private: enhance capabilities logging
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8007>
2024-12-04 02:17:44 +00:00
Víctor Manuel Jáquez Leal
1df99ec0d4 vulkan: store in GstVulkanVideoCapabilities encoder and decoder caps
The structure already stored the generic video capabilities and the specific
codec capabilities both for encoding an decoding. The generic decoder
capabilities weren't stored because it was only used internally in the decoder
helper object. Nonetheless, for the encoder, the elements will need the generic
encoder capabilities to configure the encoding. That's why it's required to
expose it as part of GstVulkanVideoCapabilities. And the generic decoder is
included for the sake of symmetry.

While updating the API vkvideoencodeh265 test got some code-style fixes.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8007>
2024-12-04 02:17:44 +00:00
Víctor Manuel Jáquez Leal
cf9cc5ec1b vkencoder-private: rename GstVulkanEncoderPicture
GstVulkanEncodePicture breaks the namespace. This commit fixes it by renaming it
to GstVulkanEncoderPicture, also new() and free() signature functions.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8007>
2024-12-04 02:17:44 +00:00
Seungha Yang
a830c58139 nvdswrapper: Add NVIDIA DeepStream wrapper plugin
Adding a NVIDIA DeepStream SDK based plugin with a dewarp element

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7357>
2024-12-04 01:19:19 +00:00
Pablo Sun
4507f92b0d kmssink: Add mediatek auto-detection
Add MediaTek display controller into list of
auto-detected modules.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8023>
2024-12-02 16:43:45 +00:00
Víctor Manuel Jáquez Leal
1cc0a7d2bb vkencoder-private: keep only one DPB view for layered DPB
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7993>
2024-11-29 06:36:52 +00:00
Víctor Manuel Jáquez Leal
133011c9ba vkencoder-private: increase reference slots array
H264 has the maximum number of refs (36) of any supported codec.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7993>
2024-11-29 06:36:52 +00:00
Víctor Manuel Jáquez Leal
479defdcf9 vkencoder_private: move view creation to picture init
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7993>
2024-11-29 06:36:52 +00:00
Víctor Manuel Jáquez Leal
15a3ebf01e vkencoder-private: shuffle up operation and query creation
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7993>
2024-11-29 06:36:52 +00:00
Víctor Manuel Jáquez Leal
83cd24a30d vkencoder-private: shuffle up get format to bail out better
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7993>
2024-11-29 06:36:52 +00:00
Víctor Manuel Jáquez Leal
98d30cc30a vkencoder-private: define encoded feedback flags by removing override bit
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7993>
2024-11-29 06:36:52 +00:00
Víctor Manuel Jáquez Leal
984956a6fe vkencoder-private: fix parameters overrides
First remove validations since they will fail if there isn't a write operation.
It's valid to pass data without write operations.

Finally, it should check for hasOverride in feedback info. Nonetheless, there's
a NVIDIA bug returning always FALSE for hasOverride, that's why we currently
force it to TRUE.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7993>
2024-11-29 06:36:52 +00:00
Nirbheek Chauhan
75848859f1 kms: Bump libdrm requirement to 2.4.108
DRM modifier support requires drmModeFormatModifierBlobIterNext()
which was added in 2.4.108. See:

https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5174#note_2673883

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7991>
2024-11-28 15:43:42 +00:00
Jan Alexander Steffens (heftig)
4586260191 cccombiner: Improve get_next_time to avoid spinning
Avoid aggregate getting called in a loop when timed out but we're not in
a state where we can produce a buffer.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1746>
2024-11-28 14:37:07 +00:00
Jan Alexander Steffens (heftig)
0f2583d286 cccombiner: Add caption_pad field to avoid get_static_pad
Save a reference to the caption pad as well. This will make the
`get_next_time` implementation cheaper.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1746>
2024-11-28 14:37:07 +00:00
Jan Alexander Steffens (heftig)
49ecde573c cccombiner: Pass caption_pad to schedule_caption
Avoid having to find this pad again.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1746>
2024-11-28 14:37:07 +00:00
Jan Alexander Steffens (heftig)
9ef06d77a7 cccombiner: Add video_pad field to avoid pad get/ref/unref
Saving a reference to this always-present pad simplifies the code and
avoids a lot of pad list scans and refcounting.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1746>
2024-11-28 14:37:07 +00:00
Víctor Manuel Jáquez Leal
603e7c3e5f vulkan: add gst_vulkan_video_image_create_view()
This function is moved from gstvkdecoder-private so it could be used by
gstvkencoder-private too, removing there what it should be duplicated code.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7984>
2024-11-28 07:05:40 +01:00
Víctor Manuel Jáquez Leal
3389347467 vkencoder-private: fix documentation
The function doesn't take the reference from caller, it keeps it's own
reference, so transfer is none.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7974>
2024-11-27 20:13:12 +00:00
Víctor Manuel Jáquez Leal
b88f15406f vkencoder-private: fix code style and use gpointer
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7974>
2024-11-27 20:13:12 +00:00
Víctor Manuel Jáquez Leal
20a0a46676 vkencoder-private: fix and complete public functions prechecks
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7974>
2024-11-27 20:13:12 +00:00
Víctor Manuel Jáquez Leal
e9ef5e0c36 vkencoder-private: check for layered buffer when new picture
And balance `if` curly brackets.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7974>
2024-11-27 20:13:12 +00:00
Víctor Manuel Jáquez Leal
066144f78c vkencoder-private: early return if dpb pool or dpb buffer already exist
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7974>
2024-11-27 20:13:12 +00:00
Víctor Manuel Jáquez Leal
52bd1931b8 vkencoder-private: usage structure is provided by caller
As all the profile structure, it's not intended to be filled in
gst_vulkan_encoder_start() function, but by the caller.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7974>
2024-11-27 20:13:12 +00:00
Víctor Manuel Jáquez Leal
a12daaca28 vkencoder-private: fix how to get bitstream buffer size
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7974>
2024-11-27 20:13:12 +00:00
Víctor Manuel Jáquez Leal
7a9bd2c9d4 vkencoder-private: doc: fix function name
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7974>
2024-11-27 20:13:12 +00:00
Víctor Manuel Jáquez Leal
e79ff5a4f1 vkencoder-private: use gst_clear_object()
Instead of g_clear_object() for sake of coherence.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7974>
2024-11-27 20:13:12 +00:00
Víctor Manuel Jáquez Leal
5e78ffe87a vkencoder-private: fix return value to gst_vulkan_encoder_encode()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7974>
2024-11-27 20:13:12 +00:00
Víctor Manuel Jáquez Leal
751d628160 vkencoder-private: doc: remove (in) annotation
because it's the default one

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7974>
2024-11-27 20:13:12 +00:00
Víctor Manuel Jáquez Leal
af0e15e9be vkencoder-private: move out indent macros
Outside of the structures whenever is possible, given indent limitations. In this way
the code has a better readability.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7974>
2024-11-27 20:13:12 +00:00
Xi Ruoyao
ee3802cf71 x265: Allow building with x265-4.1
In x265-4.1 masteringDisplayColorVolume is changed from a pointer to a
character array embedded in struct x265_param.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7968>
2024-11-27 13:04:57 +00:00
Nirbheek Chauhan
23a006c64f meson: Don't unconditionally invoke the libsoup subproject
fallback: kwarg will invoke the specified subproject even if required:
false, which is not what we want here.

Reported at https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/4045#note_2674340

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7965>
2024-11-27 12:12:36 +00:00
Mathieu Duponchelle
b433d72a4d cccombiner: expose input-meta-processing property
It can be used to discard closed captions from the input pad if the
matching video buffer already held closed captions.

It is useful in a scenario where captions are generated for an AV
stream, but the incoming stream already has embedded captions for
some intervals, and those original captions should be preferred.

It can also be used to make sure input CC meta is always dropped,
the default behavior remains to append aggregated CC to whatever
CC meta was already present on the input video buffer

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6072>
2024-11-27 10:02:22 +00:00
Seungha Yang
6bcedb0d8b d3d12converter: Gamma LUT related enhancements
* Build gamma LUT using shader, instead of CPU side math then uploading
* Make gamma LUT sharable across multiple converters

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7951>
2024-11-26 16:06:08 +00:00
Seungha Yang
f3191aca58 d3dshader: Add shader for building gamma LUT
Newly added shader will be used by converter to construct
gamma encode/decode LUT texture

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7951>
2024-11-26 16:06:08 +00:00
Jan Alexander Steffens (heftig)
59d98aa4ac ccutils: Rename wrote_first to write_field1
This better describes what we're doing.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7967>
2024-11-26 14:02:24 +00:00
Jan Alexander Steffens (heftig)
9a3b4dff24 ccutils: Fix a typo in cc_buffer_take_cea608_field2
There are no users of cc_buffer_take_cea608_field2, so this never was a
problem.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7967>
2024-11-26 14:02:24 +00:00
Jan Alexander Steffens (heftig)
a6a5401891 ccutils: Fix a typo in max_buffer_time handling
All users set max_buffer_time to GST_CLOCK_TIME_NONE, effectively
infinite, so this never was a problem.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7967>
2024-11-26 14:02:24 +00:00
Jan Alexander Steffens (heftig)
3a119b20b3 ccutils: Remove broken branch
This branch was added in dd00dab5e9 but is
never actually taken, as it requires `cc_data` to be null but
`cc_data_len` to be non-null. It would then dereference the null
`cc_data`.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7967>
2024-11-26 14:02:24 +00:00