Commit graph

362 commits

Author SHA1 Message Date
He Junyan 3497bbb8a8 va: No need to sort the device after registered
The va devices are already registered by the drm path order, so
there is no need to sort them again after registered.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4643>
2023-05-16 08:37:48 +00:00
He Junyan 8e52e42444 va: Sort udev path name before register the va plugins
The devices list returned by g_udev_client_query_by_subsystem() may
contain udev devices in disorder path name. For example, on some
platform it may contain renderD129 before renderD128 device. This
will cause we register wrong va plugin name. In this case, the
renderD129 will be registered as default plugins such as vah265dec,
while the renderD128 will be registered as varenderD128h265dec.
This conflicts with the non-udev version of gst_va_device_find_devices().

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4643>
2023-05-16 08:37:48 +00:00
He Junyan 96e576a818 va: h265enc: map the mbbrc to correct enum value in get_property()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4509>
2023-04-28 16:46:24 +00:00
He Junyan 5d1c35bd16 va: h264enc: map the mbbrc to correct enum value in get_property()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4509>
2023-04-28 16:46:24 +00:00
Nirbheek Chauhan 479f0175b5 meson: Add feature options for optional va deps libdrm and gudev
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4428>
2023-04-28 15:22:31 +05:30
Nicolas Dufresne e709e2d97c meson: Add a wrap file for libgudev
And allow fallback to it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4447>
2023-04-19 22:47:19 +00:00
Víctor Manuel Jáquez Leal 292d6cdbed vaencoder: remove display reference in decode picture
Since it's possible to grab the VA display from the GstBuffer and
GstMemory, there's no need to keep a reference to it in
GstVaEncodePicture.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3066>
2023-03-24 14:05:15 +00:00
Víctor Manuel Jáquez Leal 494169aad4 vadecoder: remove display reference in decode picture
Since it's possible to grab the VA display from the GstBuffer and
GstMemory, there's no need to keep a reference to it in
GstVaDecodePicture.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3066>
2023-03-24 14:05:15 +00:00
Víctor Manuel Jáquez Leal e794fcaa1c va: add driver description in element metadata
In the same spirit of libva-win32 elements this patch shows the driver of each
element in gst-inspect, giving more information to the user. This driver
description is parsed from vaQueryVendorString from mesa and intel drivers,
while copied as is for others. Also appends the render node for multi gpu
systems.

Fixes #2349

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4204>
2023-03-20 15:27:25 +00:00
Seungha Yang 3bbfab1cf3 va: Return default device from device-path property getter
Otherwise application would not be able to know matching element
for wanted device. Typical use case of the read-only device path
(DXGI Adapter LUID, CUDA device index, etc) property is that
application enumerates physical devices and then selects matching
GStreamer element (in null state) via device path property.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4220>
2023-03-19 17:50:43 +00:00
Seungha Yang fe63034dd4 va: Don't error out on plugin registration
Keep enumerate devices and don't return FALSE on plugin_init()

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4149>
2023-03-15 01:37:03 +00:00
Seungha Yang 7624871b00 va: Update "device-path" property description for Windows
DRM does not make sense on Windows

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4114>
2023-03-10 13:57:47 +00:00
Seungha Yang 7bc6ba63b2 va: Add Windows specific element type/feature naming support
Adapter LUID will be changed per boot. Use different naming rule on Windows

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4114>
2023-03-10 13:57:47 +00:00
Seungha Yang c1946c0209 va: Add support for Win32 backend
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4114>
2023-03-10 13:57:47 +00:00
Seungha Yang bc8db7bc3e va: Drop all GSlice bits
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4114>
2023-03-10 13:57:47 +00:00
Seungha Yang b6e45d0de8 vavp8dec: Fix return type of decode_picture()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4113>
2023-03-06 13:39:20 +00:00
Seungha Yang c5ae00f58c vajpegdec: Hide gst_jpeg_decoder_get_type() symbol
It's not a public symbol yet

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4113>
2023-03-06 13:39:20 +00:00
Seungha Yang fbf143b0fd vabaseenc: Fix return type of encode_frame vfunc
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4113>
2023-03-06 13:39:19 +00:00
Seungha Yang 2f98234287 va: Fix struct empty initialization syntax
"struct Foo bar; bar = {};" is not a valid syntax. Also remove use
of __typeof__ which is GCC specific

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4113>
2023-03-06 13:39:19 +00:00
He Junyan c24c4e9b3f jpegdecoder: fail early if no input caps have been provided
The jpegdecoder class does not implement the ->parse() virtual function,
and we always need to add the jpegparse element before it. So we should
set_needs_format of the decoder to TRUE, then if no parse before it, it
can fail with a "not-negotiated" error early, rather than go on and
generate unexpected error.

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1829
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4064>
2023-02-25 10:41:53 +08:00
He Junyan cbbfab0f3b va: jpegdecoder: Do not check SOS state when parsing DRI marker.
According to spec, the JPEG_MARKER_DRI(Restart interval definition)
marker can come before the SOS marker. So we should not check the SOS
state when parsing the DRI marker.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3943>
2023-02-22 11:24:57 +00:00
Víctor Manuel Jáquez Leal 573eecac30 vah265enc: Use helper to update properties.
This is a continuation of the original patch by
 Mengkejiergeli Ba <mengkejiergeli.ba@intel.com>

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3996>
2023-02-20 18:18:27 +00:00
Mengkejiergeli Ba 735b6af5b9 va: Fix some code defects
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3919>
2023-02-20 16:02:38 +00:00
He Junyan 60731adea6 va: Avoid the array index overflow when filling 8x8 scaling list.
The VA API has not defined the scaling list entries for U/V planes
for the 4:4:4 stream. In fact, we do not meet the 4:4:4 format output
for H264 so far, and scaling list is not used frequently, so we just
print out some warning and ignore these scaling list values.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3749>
2023-02-02 00:41:42 +00:00
Edward Hervey b01ed725be va: Fix path leak
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3755>
2023-01-19 16:41:44 +01:00
Seungha Yang aba7f7c7eb vajpegdec: Set maybe-leaked flag on template caps
The fixup function could return new caps object

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3642>
2022-12-27 17:15:20 +00:00
He Junyan ad0ba3ab7d va: Delay the VAProcPipelineCaps query after context created.
The VAAPI vaQueryVideoProcPipelineCaps() requires the context as the
parameter. So far, we always pass VA_INVALID_ID and it can succeed.
But the API does not say that and in theory, a valid context is required.
Now the new platform really needs a valid context and so we have to
delay that query until the context is created.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3613>
2022-12-21 14:31:23 +00:00
Victor Manuel Jaquez Leal 171a626c6c vaav1dec: Remove double caps unref.
There was a duplicated caps unref raising a warning.

Also it reorgs the sorrounding code for simplicity.

Fixes: #1196
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3587>
2022-12-16 19:18:25 +00:00
Víctor Manuel Jáquez Leal 901ad2b4f5 vajpegdec: Reenable element negotiation.
negotiation vmethod were overwritten by vabasedec, leading to errors.

This was a regression of commit b6538e0560.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3509>
2022-12-02 08:37:02 +00:00
Victor Manuel Jaquez Leal 4cbdf43e7d va: Handle input caps change.
Update output caps if it's notified by baseclass

See https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3328

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3480>
2022-12-01 18:54:14 +00:00
Victor Manuel Jaquez Leal 19b83bc156 vaav1dec: Use gst_va_base_dec_set_output_state().
And even that vaav1dec doesn't use vabasedec negotiate vmethod, it should align
with the new scheme of using base's width & height for surface size and
output_info structure for downstream display size negotiation.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3480>
2022-12-01 18:54:14 +00:00
Victor Manuel Jaquez Leal e5417b2db7 vavp9dec: Use gst_va_base_dec_set_output_state().
As this element reopen the internal decoder differently, it only uses the helper
function to negotiate.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3480>
2022-12-01 18:54:14 +00:00
Victor Manuel Jaquez Leal 6dfca46ada vampeg2dec: Streams are progressive by default.
By initializating progressive, then interlaced streams are detected correctly.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3480>
2022-12-01 18:54:14 +00:00
Victor Manuel Jaquez Leal b6538e0560 va: Add and use common decode negotiate vmethod.
This vmethod can be used by decoders with the same VA decoder reopen logic:
same profile, chroma, width and height.

Also a new public method called gst_va_base_dec_set_output_state() with the
common GStreamer code for setting the output state, which is always called by
the negotiate vmethod.

In order to do this refactoring, new variables in vabasedec have to be populated
by the decoders:

* width and height define the resolution set in VA decoder. In the case of H264
  would be de coded_width and codec_height, or max_width and max_height in AV1.
* output_info is the downstream video info used for negotiation in
  gst_va_base_dec_set_output_state().
* input_state, from codec parent class shall be also held by vabasedec

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3480>
2022-12-01 18:54:14 +00:00
Víctor Manuel Jáquez Leal 31c63a6e6c vaav1dec: Use gst_va_base_dec_prepare_output_frame().
And simplify a bit the code flow.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3480>
2022-12-01 18:54:14 +00:00
Víctor Manuel Jáquez Leal 4a8ecc2dba va: Add and use gst_va_base_dec_prepare_output_frame().
This helper will do downstream negotiation and later will
allocate the output frame.

H265 and AV1 decoders don't use this approach since their output
frame allocation is different.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3480>
2022-12-01 18:54:14 +00:00
Víctor Manuel Jáquez Leal f1a9728b30 va: Remove last_ret error handling in decoders.
It was used in the early development of the base classes. Now it
shouldn't be needed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3480>
2022-12-01 18:54:14 +00:00
Víctor Manuel Jáquez Leal de5b76a922 va: Add and use gst_va_base_dec_process_output().
This function will copy the frame, if it's needed, and will apply buffer flags.

The function is used by all the decoders.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3480>
2022-12-01 18:54:14 +00:00
He Junyan 765adf5325 va: Fix the caps memory leak by gst_va_pool_new_with_config().
The gst_va_pool_new_with_config() will ref the caps, and so we need
to unref after that.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3503>
2022-12-01 17:31:16 +00:00
Víctor Manuel Jáquez Leal c8a0d706ca va: Add render node name in non-first devices.
There could be multi-GPU setups where the non-first has more
entrypoints than the first one, and the elements names are not
homogeneous, leading to pipeline building error.

This patch add the render node in the elements names when they belong
to the non-first device.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3491>
2022-12-01 16:00:55 +00:00
Victor Manuel Jaquez Leal cccbf1f02d vafilter: Increase the caps for HDR.
As they might be other medatadata types.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3473>
2022-12-01 15:17:49 +00:00
Victor Manuel Jaquez Leal b25b1be70d vafilter: Increase the number of 3DLUT caps to 16.
To fix the warning on Alderlake

vafilter gstvafilter.c:534:gst_va_filter_ensure_filters:<vafilter0>
vaQueryVideoProcFiltersCaps: list argument exceeds maximum number

Increase the number of caps to 16 as vadumpcaps does.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3473>
2022-12-01 15:17:49 +00:00
He Junyan c365389930 va: Add H265 SCC profile support.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2036>
2022-12-01 09:45:19 +08:00
He Junyan 0952c556dc va: Add extended formats support such as 10/12 bits, 4:2:2 and 4:4:4.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2036>
2022-12-01 09:45:14 +08:00
He Junyan 17c416ca92 va: enable multi tile support for H265 encoder.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2036>
2022-12-01 09:45:07 +08:00
He Junyan 2f8ce208e8 va: enable vah265lpenc for low power mode H265 encoder.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2036>
2022-12-01 09:45:00 +08:00
He Junyan 2677d4c6db va: Add the low-delay-b frame support for H265.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2036>
2022-12-01 09:44:41 +08:00
He Junyan 9ee657cdee va: Add prediction direction attribute support for H265 encoder.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2036>
2022-12-01 09:44:33 +08:00
He Junyan 4e7eddeafe va: Register and enable and the vah265enc plugin.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2036>
2022-12-01 09:44:26 +08:00
He Junyan 3d99f24843 va: Implement the vah265enc plugin for va HEVC encoding.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2036>
2022-12-01 09:44:08 +08:00
Víctor Manuel Jáquez Leal b2bfb066ec vabaseenc: Reduce logging noise if finish_frame fails.
Fixes: #1579
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3423>
2022-11-17 05:25:18 +00:00
Colin Kinloch 99fc124f25 videocrop, videobox: Simplify navigation event handling and support touch events
Signed-off-by: Colin Kinloch <colin.kinloch@collabora.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3053>
2022-11-11 06:45:49 +00:00
Colin Kinloch 841f50f0d9 va: Fix vapostproc navigation event co-ordinate mapping
Signed-off-by: Colin Kinloch <colin.kinloch@collabora.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3053>
2022-11-11 06:45:49 +00:00
Colin Kinloch d54e597278 va: Use gst_video_orientation_from_tag to parse orientation
Signed-off-by: Colin Kinloch <colin.kinloch@collabora.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3053>
2022-11-11 06:45:48 +00:00
Víctor Manuel Jáquez Leal eb0f90f6ec vafilter: Log out processed surfaces for debug.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3373>
2022-11-11 04:19:54 +00:00
Víctor Manuel Jáquez Leal bc4aa017ac vadeinterlace, vapostproc: Drop output buffer if process failed.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3373>
2022-11-11 04:19:54 +00:00
Víctor Manuel Jáquez Leal 1f7cf1d408 va: caps: Fix raw caps for H264 encoding.
Mesa gallium and Intel i965 ill reports unsupported video formats.

This commit reverts ecb12a05 and adds a deeper workaround, since
ecb12a05 only fix the template caps, but not when renegotation
happens.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2466>
2022-11-09 06:15:23 +01:00
Víctor Manuel Jáquez Leal 4994487b8f vabaseenc: Log out the flow error name.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2466>
2022-11-09 06:15:23 +01:00
Víctor Manuel Jáquez Leal dbf8c38667 vah264enc: Enable parameters change while running.
1. Removes the verification if the internal encoder is not opened
   yet to allow the property setting.

2. And toggles on the base class' reconf flag for each property
   variable that can be modified at run time.

3. Mark those modifiable properties as mutable while playing.

Currently the run-time modifiable properties are:

qpi, qpp, qpb, bitrate, target percentage, target usage and rate control

Other properties can be enabled too, but they need testing.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2466>
2022-11-09 06:15:21 +01:00
Víctor Manuel Jáquez Leal bd3c50e50f vabaseenc: Enable encoder reconfiguration.
Adds an internal function reset() which drains the internal queues and
calls the reconfig() vmethod.

This reset() method is called inconditionally at set_format() and in
handle_frame() if the instance's reconf flag is enabled.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2466>
2022-11-09 06:13:26 +01:00
Víctor Manuel Jáquez Leal 351a107ecc vah264enc: Avoid reopen encoder or renegotiate.
If parameters remain similar enough to avoid either encoder reopening
or downstream renegotiation, avoid it.

This is going to be useful for dynamic parameters setting.

To check if the stream parameters changed, so the internal encoder has
to be closed and opened again, are required two steps:

1. If input caps, profile, chroma or rate control mode have changed.
2. If any of the calculated variables and element properties have
   changed.

Later on, only if the output caps also changed, the pipeline
is renegotiated.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2466>
2022-11-09 06:13:26 +01:00
Víctor Manuel Jáquez Leal 38f1a4ee3d vaencoder: Add gst_va_encoder_get_reconstruct_pool_config()
This method will return the caps configured in the reconstruct buffer
pool, and its maxium number of buffers to allocate.

The caps are needed later to know if the internal encoder has to be
reopened if the stream properties change.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2466>
2022-11-09 06:13:25 +01:00
Victor Manuel Jaquez Leal bb86728a1a vah264enc: Fix properties documentation.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3361>
2022-11-08 21:49:05 +00:00
Victor Manuel Jaquez Leal c60504bd9e va: Document device-path property.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3361>
2022-11-08 21:49:05 +00:00
Victor Manuel Jaquez Leal 0918910a7d vavp8dec, vampeg2dec: Fix type name.
The camel case name is wrong when registering the type.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3361>
2022-11-08 21:49:05 +00:00
Víctor Manuel Jáquez Leal 96a6b33029 vacaps: Sort raw caps according their efficiency.
Caps negotiations considers template caps order. This patch sets the
correct order according the feture caps: VAMemory, DMABuf and
SystemMemory.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3349>
2022-11-08 05:15:09 +00:00
Víctor Manuel Jáquez Leal bbd2bce11d vabasetransform: Fail if cannot import the input buffer.
Otherwise got a buffer double free.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3348>
2022-11-07 17:57:05 +00:00
He Junyan 1881d1826a va: baseenc: Do not import the VA surface from other display.
Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1167
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3322>
2022-11-05 13:39:34 +08:00
He Junyan d51b29b1dc va: compositor: Do not use allocator and pool from other display.
Just like the va decoder, the compositor should not use allocator
and pool from other display. Also, when importing the input buffer,
if it is from other display, we should fallback to memory copy.

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1167
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3322>
2022-11-05 13:39:34 +08:00
He Junyan b9b211c1d1 va: basetransform: Do not use allocator and pool from other display.
Just like the va decoder, the vpp and deinterlace should not use allocator
and pool from other display. Also, when importing the input buffer, if it
is from other display, we should fallback to memory copy.

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1167
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3322>
2022-11-05 13:39:34 +08:00
He Junyan a8330686cb va: basedec: Do not use allocator and pool from other display.
The command line such as:
  gst-launch-1.0 -vf filesrc location=1.264 ! h264parse !
  vah264dec ! varenderD129postproc ! fakesink
The decoder here gets the allocation proposal from the vpp which is
on another GPU device. The allocator and pool belong to other display
and should not be used in the decoder.

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1167
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3322>
2022-11-05 13:39:34 +08:00
Eric Knapp 87e9952b8f vah264enc: Added option to insert CEA-708 closed captions
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2910>
2022-11-01 23:22:03 +00:00
Víctor Manuel Jáquez Leal 96f0521155 vaencoder: Reset attribute index to one.
Further fix to 4ffb3663 where I forgot to reset the attribute index.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3285>
2022-10-27 20:32:15 +00:00
He Junyan c294ba82e6 h264bitwriter: Correct the all API to byte aligned.
In fact, all the h264 bit writer have byte aligned output except
the slice header. So we change the API from bit size in unit to
byte size, which is easy to use. For slice header, we add a extra
"trail_bits_num" to return the unaligned bits number.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3193>
2022-10-27 12:15:43 +00:00
Víctor Manuel Jáquez Leal ba24191f2a vaencoder: Fix caps semantics.
When using gst_va_caps_from_profiles() the semantics of sink/src caps
depends if the element is an encoder or a decoder.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3063>
2022-10-26 08:19:32 +00:00
Víctor Manuel Jáquez Leal d32fdf975d va: Fix typos.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3063>
2022-10-26 08:19:32 +00:00
Víctor Manuel Jáquez Leal 4ffb3663a8 vah264enc: Fail if unsupported rate control.
Handle when encoder doesn't support rate control, which is set as
VA_RC_NONE, and if the set rate control mode is not supported by the
GStreamer element, the element configuration fails.

Also it logs out max and target bitrate.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3063>
2022-10-26 08:19:32 +00:00
Víctor Manuel Jáquez Leal 5e531c1a88 vah264enc: Add todo item.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3063>
2022-10-26 08:19:32 +00:00
Víctor Manuel Jáquez Leal d463feaa08 vaencoder: Honor entrypoint at constructor.
The entrypoint is set when the encoder helper is constructed,
nonetheless it was also passed as parameter when opening. That's
buggy.

In order to simplify the code, the entrypoint at construction is
honored.

But gst_va_encoder_has_profile_and_entrypoint() now doesn't rely in
the internal list of profiles since it only contains those that
belongs to codec and entrypoint, thus it queries directly the VA
driver.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3063>
2022-10-26 08:19:32 +00:00
Víctor Manuel Jáquez Leal 79c47fbdb8 vabaseenc: Scope error bail out.
Though this is not enforced by the GStreamer code style, it's clearer
to add a nested scope for error handling using label/goto.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3063>
2022-10-26 08:19:32 +00:00
Víctor Manuel Jáquez Leal d608872ba3 vabaseenc: Use class entrypoint.
Add a macro to access to class entrypoint and use it instead of move
it to a variable.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3063>
2022-10-26 08:19:32 +00:00
Stéphane Cerveau fb09c028e3 h265parse: fix typo in member of GstH265SPS
Rename sps_extnsion_params to sps_extension_params

Fix comment about vui_parameters_present_flag

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3072>
2022-10-04 10:01:12 +00:00
Víctor Manuel Jáquez Leal f9371ccc38 vabaseenc: Move out encoder validation from assertion.
Assertion can be disabled at compilation time. Still it's important to
validate it the encoder object was opened by the subclass. This patch
removes the assertion and returns if the encoder is open.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3051>
2022-09-20 18:59:18 +00:00
He Junyan cf2581953b va: h264enc: Fix rate control enum register failure for the second GPU.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3041>
2022-09-19 09:24:36 +00:00
Víctor Manuel Jáquez Leal a8387fdc6b vah264enc: Avoid precision lost by just rounding up.
The code where dividing by 16 and later multiplying by 16, which is
spurious and a potential loose of precision.
2022-09-17 10:14:40 +02:00
Víctor Manuel Jáquez Leal 69c75f9827 vah264enc: Update AUD property if driver can't handle raw data. 2022-09-17 10:10:19 +02:00
Víctor Manuel Jáquez Leal 42861617d5 vah264enc: Remove unused dispose method. 2022-09-17 10:04:51 +02:00
Eric Knapp f720a5dd66 vadeinterlace: Fix passthrough latency query
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3038>
2022-09-17 05:47:41 +00:00
Víctor Manuel Jáquez Leal f4260ecdc5 va: baseenc: Fix gobject style for chained method.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3035>
2022-09-16 19:10:12 +00:00
He Junyan 9a991cfe9e va: av1dec: user internal buffer pool for non output layers.
The AV1 support multi spatial layers within one TU with different
resolutions, and only the highest spatial layer need to be output.
For example, there are two spatial layer, base level is 800x600
and higher level is 1920x1080. We need to decode both because the
higher level needs base layer as reference, but we only need to output
1920x1080 frames here.

The current manner always renegotiates the caps once we detect the
current picture resolution changes, so we renegotiate again and
again between different layers. That's a big waste and has very
low performance. We now only do the renegotiation for the highest
output layer. For other non output layers, we just keep a internal
buffer pool which is big enough to handle the surface allocation.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2382>
2022-09-16 09:45:00 +00:00
Víctor Manuel Jáquez Leal e4f6ade308 va: Complete library and plugin documentation.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1025>
2022-09-13 14:57:21 +02:00
Víctor Manuel Jáquez Leal a51ac72b5e va: Move gstvavideoformat out of library headers.
Since it's no needed for API consumers. Though it can be added later.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1025>
2022-09-13 14:57:21 +02:00
Víctor Manuel Jáquez Leal 1c69fe3fc8 vajpegdec: Enhance explanation comment.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2948>
2022-09-07 05:57:40 +00:00
Víctor Manuel Jáquez Leal 230e1e6bb4 va: caps: Use G_STMT_START / END
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2948>
2022-09-07 05:57:40 +00:00
Víctor Manuel Jáquez Leal 44fe871534 vajpegdec: Check if driver has internal color conversion.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2948>
2022-09-07 05:57:40 +00:00
Florian Zwoch a1b60be22b va: Fix log message when registering H264 encoder.
The log message would report an error for the H264 decoder when
registering failed, but we tried to register the H264 encoder instead.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2974>
2022-09-02 10:29:11 +00:00
Thibault Saunier 6a4425e46a meson: Call pkgconfig.generate in the loop where we declare plugins dependencies
Removing some copy pasted code

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2970>
2022-09-01 21:17:35 +00:00
He Junyan 67eb1223c0 jpegdecoder: return the real error of decode_scan and decode_frame.
The current handle_frame() does not return the real error that happens
in decode_scan and decode_frame, which makes the pipeline continue with
the error and may trigger asserting later.

We also return the error when decode_quant_table or decode_huffman_table
fails.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2938>
2022-08-25 17:42:55 +08:00
He Junyan 42838c3b9e va: h265dec: Enable the scc_main_4:4:4_10 profile.
We should enable this profile which is already allown in vaprofile.c
after libva 1.8 version.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2909>
2022-08-19 00:50:53 +00:00
Víctor Manuel Jáquez Leal b10fc4d8db vajpegdec: Fix memory leak.
Free value content.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2899>
2022-08-17 18:34:10 +00:00
Víctor Manuel Jáquez Leal a075e57c61 vajpegdec: Fix 4:2:2 for i965.
Since i965 uses NV12 either for 4:2:0 and 4:2:2 chroma (using an
internal color conversion) the chroma validation has to be shortcut.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2899>
2022-08-17 18:34:10 +00:00
Víctor Manuel Jáquez Leal 4dd6728ed5 va: Validate JPEG subsampling configurations.
There are Mesa Gallium drivers that report subsampling but without
any pixel format. So, strip out these subsamplings.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2899>
2022-08-17 18:34:10 +00:00
Víctor Manuel Jáquez Leal 0446e35a14 va: gst_va_create_raw_caps_from_config() may return NULL.
This patch verifies if the function returns NULL in the caller.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2899>
2022-08-17 18:34:10 +00:00
Víctor Manuel Jáquez Leal ad15fc9169 vah264enc: Set codec frame sync point if IDR
This flag is used by GstVideoEncoder base class for certain configurations.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2852>
2022-08-10 08:00:18 +00:00
Víctor Manuel Jáquez Leal c4706ed219 vah264enc: Packed headers can be zero.
A driver can report back no packed header support (VA_ENC_PACKED_HEADER_NONE).
This patch removes that false verification.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2851>
2022-08-10 04:31:27 +00:00
Víctor Manuel Jáquez Leal ecb12a05b8 vah264enc: Fix caps for mesa gallium.
Radeon mesa gallium driver has a bug which adds P010_10LE sink caps
format. This patch removes formats which arent 420 chroma.

gst_caps_set_format_array() wasn't used because the fix traverse
several structures with potential different formats.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2844>
2022-08-08 17:47:56 +00:00
Víctor Manuel Jáquez Leal 8c59ee29c2 vah264dec: Complete profiles in decoder.
Instead of specifying all the H.264 "supported" profiles in the global
hash table (used either by decoders and encoders), just complete them
in the decoder only, since the encoder doesn't support them.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2844>
2022-08-08 17:47:56 +00:00
Víctor Manuel Jáquez Leal 67ce55f33e vah264enc: Lock properties read/write.
This is a first step for changing properties at runtime.

And add missing bitrate upate and notification.

Fixes: #1258
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2836>
2022-08-04 14:26:00 +00:00
Víctor Manuel Jáquez Leal cc9d69cb66 vah264enc: Use guint32 for rc_ctrl as it's for rc_ctrl_mode.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2836>
2022-08-04 14:26:00 +00:00
Víctor Manuel Jáquez Leal 7e95a8fc92 vah264enc: Split aud property and its usage.
Just as other property variables, it's split for ease it usage,
particularly after adding access locks.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2836>
2022-08-04 14:26:00 +00:00
Víctor Manuel Jáquez Leal c9f2108b43 va: baseenc: Untabbify and format.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2836>
2022-08-04 14:26:00 +00:00
Víctor Manuel Jáquez Leal ce7070bf5b vapostproc: Check for colorimetry changes.
It uses what's merged in
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2765

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2777>
2022-08-02 17:39:24 +00:00
Eric Knapp d11a0d04ec va: h264enc: Make AUD the first NAL unit
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2796>
2022-07-27 06:46:21 +00:00
He Junyan 8e2bbfed13 va: baseenc: Do not use codec frame structure again after finish_frame().
In _push_out_one_buffer(), we use codec frame structure again for error handling
after we already call finish_frame(), which is a latent segment fault.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2739>
2022-07-11 10:12:29 +00:00
He Junyan 27c33f0161 va: baseenc: Do not clear the codec frame twice when error.
The current manner will clear the input codec frame twice if we fail
to push the output data, which will trigger an assert.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2739>
2022-07-11 10:12:29 +00:00
U. Artie Eoff c4a9a96a15 va: postproc: add scale-method property
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2654>
2022-06-27 12:17:54 -04:00
U. Artie Eoff 211ba46369 va: filter/postproc: move unconditional props to vavpp
Only conditional/dynamic properties should be installed/handled
by vafilter.  Thus, move and install the unconditional/static
properties in vavpp.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2654>
2022-06-27 12:17:53 -04:00
U. Artie Eoff 178f4fcd20 va: compositor/filter: use scale method setter
Use the filter's scale method member instead of the sample's member.

Removes the filter_flags member from the composite sample.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2654>
2022-06-27 10:53:11 -04:00
U. Artie Eoff 280678fe42 va: filter: add scale method field and setter
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2654>
2022-06-27 10:52:03 -04:00
Víctor Manuel Jáquez Leal 63a8fc505e va: Add vajpegdec element.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1575>
2022-06-27 13:43:14 +00:00
Víctor Manuel Jáquez Leal ec55017a83 va: allocator: Add hack for no fourcc when surface creation.
This patch adds general mechanism for handling specific hacks. In this
case for jpeg decoder in i965 driver, which cannot create surfaces
with fourcc specified.

From jpeg decoder to the allocator, which creates the surfaces,
there's a non-simple path: basedec pseudo-class adds a hacks guint32
which will be set by actual elements (vajpegdec, in this case) and
basedec will always set the hack to the allocator when the allocator
is instantiated.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1575>
2022-06-27 13:43:14 +00:00
Víctor Manuel Jáquez Leal 5b28509564 va: caps: Add jpeg fields in coded caps.
Given the supported rt formats in a profile/entrypoint config it's
possible to know the supported JPEG colorspace and subsampling. This
patch adds this information in coded caps to a safer autoplugging
after jpegparser.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1575>
2022-06-27 13:43:14 +00:00
Víctor Manuel Jáquez Leal cc30854893 va: Add jpegdecoder base class.
This base class is intented for hardware accelerated decoders, but since
only VA uses it, it will be kept internally in va plugin.

It follows the same logic as the others video decoders in the library but.
as JPEG are independet images, there's no need to handle a DBP so no need
of a picture object. Instead a scan object is added with all the structures
required to decode the image (huffman and quant tables, mcus, etc.).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1575>
2022-06-27 13:43:14 +00:00
Víctor Manuel Jáquez Leal f36d2671e4 va: build: Remove duplicated source.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1575>
2022-06-27 13:43:14 +00:00
Víctor Manuel Jáquez Leal 685a611812 va: Use driver implementation macro rather than function.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2642>
2022-06-21 18:21:46 +00:00
Víctor Manuel Jáquez Leal bb84a533bf va: basedec: Select output format with the used chroma in decoder.
Currently, video format is decided with downstream caps intersection,
but that's not correct since chroma is not considered. The video
decoders have to decide the output format given the used chroma, not
by the downstream caps negotiation.

This patch changes that. Still, caps feature is selected by caps
negotiation, then, with the preferred caps feature, the output format
is search within that caps feature.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2569>
2022-06-15 00:00:53 +00:00
Tim-Philipp Müller 9d9e59622f Bump GLib requirement to >= 2.62
Can't require 2.64 yet because of
https://gitlab.freedesktop.org/gstreamer/cerbero/-/issues/323

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2568>
2022-06-10 06:01:41 +00:00
Víctor Manuel Jáquez Leal 045b6f5ea3 vah264enc: Guard logging functions
.. and use spec for rate control rather than static switch.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2522>
2022-06-07 12:02:21 +00:00
Víctor Manuel Jáquez Leal 261714e25d vah264enc: Support default and none rate control.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2522>
2022-06-07 12:02:21 +00:00
Víctor Manuel Jáquez Leal e27ad1a273 va: encoder: Rate control property.
Fixes: #1241
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2522>
2022-06-07 12:02:21 +00:00
Víctor Manuel Jáquez Leal be948816d3 va: Register base classes as abstract.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2521>
2022-05-29 16:03:46 +00:00
Víctor Manuel Jáquez Leal ae9fe4a851 va: encoder: Use entrypoint type.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2521>
2022-05-29 16:03:46 +00:00
Víctor Manuel Jáquez Leal 4474056f6f va264enc: Fix typo.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2508>
2022-05-29 11:56:39 +00:00
Víctor Manuel Jáquez Leal e83983d7ca va: encoder: Fix regression since commit 2042c2d4f0.
There's no need to compare with the open entrypoint to query the
encoder. This commit removes the checks to the configured entrypoint
with the parameter.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2508>
2022-05-29 11:56:39 +00:00
Víctor Manuel Jáquez Leal 24527856cb vacompositor: Pass video info pointer than copying it.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2496>
2022-05-28 00:00:39 +00:00
Víctor Manuel Jáquez Leal f9b631e0ea vacompositor: Remove useless consts.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2496>
2022-05-28 00:00:39 +00:00
He Junyan 2042c2d4f0 va: H264enc: Add encoder for VAEntrypointEncSliceLP.
We name vah264lpenc to support H264's VAEntrypointEncSliceLP encoder.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2472>
2022-05-25 20:40:48 +00:00
He Junyan d47416d3a2 va: encoder: Do not reset the frame count when reconfig().
We should not reset the input/output_frame_count when some configure
changes. For example, the if resolution changes, the current way just
resets the frame count and make the PTS of the output buffer restart
from the original PTS of the first frame. That causes a lot of QOS
event and drop all the new frames.
We should only reset them when encoder start().

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2489>
2022-05-25 18:56:34 +00:00
He Junyan 994f2c56e2 va: encoder: change reset_state() to a virtual function of base class.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2489>
2022-05-25 18:56:34 +00:00
U. Artie Eoff 8a161880fc vacompositor: check caps and info return values
Check return values for get caps and video info from caps.

This was flagged by static analysis.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2480>
2022-05-25 10:16:00 +00:00
Víctor Manuel Jáquez Leal 8433bab0b5 va: Avoid unused variable if logging is disabled.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2478>
2022-05-24 19:07:47 +00:00
Víctor Manuel Jáquez Leal 84c0d02755 va: Keep include's code style
Headers are in alphabetical order.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2465>
2022-05-24 13:41:50 +00:00
Víctor Manuel Jáquez Leal 46e536898f vafilter: Fix logging of unsupported alpha blending.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2477>
2022-05-24 12:30:49 +00:00
He Junyan fc75e38496 va: baseenc: No need to check the frame pointer in handle_frame().
No need to check the NULL pointer of "frame" in error handling, it
is assured non-NULL by base class and we already use it everywhere
in this function.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2471>
2022-05-23 15:03:03 +08:00
He Junyan de5952bc83 va: baseenc: include the "vacompat.h" for old version glib.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2463>
2022-05-22 15:03:54 +08:00
U. Artie Eoff d2651a1e0b va: vpp: enable compositor
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2332>
2022-05-21 21:18:15 +02:00
U. Artie Eoff afe8723196 va: vpp: add compositor
New implementation of a VA-API compositor with blend feature.

Various chunks of code was taken from vavpp.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2332>
2022-05-21 21:18:15 +02:00
He Junyan a2920411d3 va: Apply the va base encoder to the vah264enc.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2330>
2022-05-20 22:58:58 +02:00
He Junyan 21a9ba7e7e va: Add the GstVaBaseEnc common object for all va encoders.
Just like the GstVaBaseDec and GstVaBaseTransform, this base encoder
will handle all common logic for all va encoders.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2330>
2022-05-20 22:58:58 +02:00
Víctor Manuel Jáquez Leal 4c97ffeafb va: basedec: Always select first available format.
If the stream chroma doesn't match with any video format in the source
caps template (generated from va config surface formats) instead of
return unknown, return the first available format in the template,
assuming that the driver would be capable to do color conversions.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2404>
2022-05-11 15:03:54 +02:00