Commit graph

20 commits

Author SHA1 Message Date
Víctor Manuel Jáquez Leal
44b8a50879 vkencoder-private: add gst_vulkan_encoder_is_started()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8007>
2024-12-04 02:17:45 +00:00
Víctor Manuel Jáquez Leal
e03b124c10 vkencoder-private: implement callback to chain control rate structures
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8007>
2024-12-04 02:17:45 +00:00
Víctor Manuel Jáquez Leal
b99276a7f9 vkencoder-private: implement callback to chain codec specific structures
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8007>
2024-12-04 02:17:45 +00:00
Víctor Manuel Jáquez Leal
ab6aafb076 vkencoder-private: handle quality level
It creates a new structure for passing the codec quality structure at _start(),
where it will be filled. The quality level can be set or changed according
encoder limits.

Later the quality level will be set at _update_session_parameters() and at each
frame encoding. That's why it has to be set at _start().

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8007>
2024-12-04 02:17:45 +00:00
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
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
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
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
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
Sebastian Dröge
b7b24573ce common: Use more efficient versions of GstCapsFeatures API where possible
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7432>
2024-09-26 19:26:18 +03:00
Víctor Manuel Jáquez Leal
2990cc5f71 vulkan: add source pipeline stage to _operation_add_frame_barrier()
Instead of dragging the last destination pipeline stage as current barrier
source pipeline stage (which isn't a valid semantic) this patch adds a parameter
to gst_vulkan_operation_add_frame_barrier() to set the source pipeline stage to
define the barrier.

The previous logic brought problems particularly with queue transfers, when the
new queue doesn't support the stage set during a previous operation in a
different queue.

Now the operation API is closer to Vulkan semantics.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7165>
2024-07-19 14:45:39 +02:00
Víctor Manuel Jáquez Leal
dd4027388e vulkan: fix wrong stages or access in barriers
While working on !7165 we found out that some parameters for barriers were wrong
or the destination pipeline stage was too coarse.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7200>
2024-07-19 12:44:51 +02:00
Stéphane Cerveau
df33ae2da6 gst-plugins-bad: tests: rename vkvideoencode tests
Rename vulkan encode tests to be able to use the namespace
libs_vkvideoencode*.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6992>
2024-06-05 17:50:27 +00:00
Renamed from subprojects/gst-plugins-bad/tests/check/libs/vkvideoh265encode.c (Browse further)