Commit graph

413 commits

Author SHA1 Message Date
He Junyan
db74da3f6f va: vp9enc: Change the set_property to make it atomic
The inside encoder may be set in other threads, so we should make
its accessing atomic.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6471>
2024-04-02 19:01:22 +00:00
Víctor Manuel Jáquez Leal
8bede7937c va{vp9,av1}enc: reconfigure when properties change
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6471>
2024-04-02 19:01:22 +00:00
He Junyan
d179fca13f va: h265enc: Change the set_property to make it atomic
The inside encoder may be set in other threads, so we should make
its accessing atomic.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6471>
2024-04-02 19:01:22 +00:00
He Junyan
33bc8d75ad va: h265enc: set the reconf flag when cpb_size updated
This feature can be changed dynamically in playing state, so we
need to set reconf flag to trigger reconfig.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6471>
2024-04-02 19:01:22 +00:00
He Junyan
045449e190 va: h264enc: Change the set_property to make it atomic
The inside encoder may be set in other threads, so we should make
its accessing atomic.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6471>
2024-04-02 19:01:22 +00:00
He Junyan
812e7efb90 va: h264enc: set the reconf flag when cpb_size updated
This feature can be changed dynamically in playing state, so we
need to set reconf flag to trigger reconfig.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6471>
2024-04-02 19:01:22 +00:00
He Junyan
78f1299ce4 va: av1enc: 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, format, 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/6441>
2024-04-02 09:06:07 +00:00
He Junyan
075937dc19 va: vp9enc: 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, format, 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/6441>
2024-04-02 09:06:07 +00:00
He Junyan
40629b84ee va: av1enc: Improve the LAST reference assignment
The last frame which has the smallest diff should be consider as
the first choice rather than the golden frame. Especially when only
one reference available, this way can improve the BD rate about 5
percentage.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6379>
2024-04-02 03:54:52 +00:00
He Junyan
1745a82516 va: av1enc: Fix the reference number setting bug
The current way will let the total reference number surplus the
reference number set by the "ref-frames" property.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6379>
2024-04-02 03:54:52 +00:00
He Junyan
e023546162 va: encoder: Fix the unit of bitrate in debug log message
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6483>
2024-04-01 15:39:13 +00:00
He Junyan
9c3bd3950e va: vp9enc: Adjust the coded buffer size to avoid failure
Some extreme case such as "videotestsrc pattern=1" can generate pure
white noise videoes, for which encoder may generate too big output
for current coded buffer size. We now consider the qindex and bitrate
to avoid that.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6483>
2024-04-01 15:39:13 +00:00
He Junyan
2560f4c581 va: vp9enc: Fix the frame size not enough issue for super frame
The current code forgets to add the current last frame size into
the total super frame size.

Fixes: #3427
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6483>
2024-04-01 15:39:13 +00:00
He Junyan
a170fa4f46 va: {av1, vp9}enc: Use g_free() to free frames
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6466>
2024-03-28 16:29:50 +08:00
He Junyan
7ac9d26533 va: vp9enc: Correct the flags for registering properties
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6437>
2024-03-27 10:24:12 +08:00
He Junyan
fa50571d3b va: av1enc: Correct the flags for registering properties
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6437>
2024-03-27 10:21:08 +08:00
He Junyan
73c1c1fe7f va: {vp9, av1}enc: Do not use g_slice_new() to create frames
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6437>
2024-03-27 10:18:04 +08:00
He Junyan
71eff7ce97 va: encoder: update the bitrate change correctly
We should update and notify the bitrate change at a common place,
no matter whether the bitrate is calculated or not.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6433>
2024-03-26 18:15:20 +00:00
He Junyan
56703704a5 va: av1enc: enable ICQ and QVBR modes
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6433>
2024-03-26 18:15:20 +00:00
He Junyan
5c51abfa71 va: vp9enc: enable ICQ and QVBR modes
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6433>
2024-03-26 18:15:20 +00:00
He Junyan
d90f718b1a va: h265enc: enable ICQ and QVBR modes
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6433>
2024-03-26 18:15:20 +00:00
He Junyan
f45f52a786 va: h264enc: enable ICQ and QVBR modes
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6433>
2024-03-26 18:15:20 +00:00
He Junyan
85bcea1776 va: encoder: Enable ICQ and QVBR mode in rate control map
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6433>
2024-03-26 18:15:20 +00:00
He Junyan
3f1ce4460a va: encoder: Set the quality_factor parameter in rate control
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6433>
2024-03-26 18:15:20 +00:00
He Junyan
3b57825ca6 va: Implement the vavp9enc plugin
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3293>
2024-03-20 08:53:11 +00:00
Ruijing Dong
bc858976db va: enc : checking surface alignment attribute
Apply surface alignment attribute when availalbe,
also fix frame cropping issue for va h265 encoder.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6282>
2024-03-18 16:34:42 +00:00
Michiel Westerbeek
a4aa9e197e gstcudaconvertscale, gstvavpp, videoconvertscale: downgrade 'Can't keep DAR' to debug
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5730>
2024-03-13 16:06:56 +00:00
Antonio Larrosa
7b8fa42f8a va{h264,h265,av1}enc: fix potential crash on devices without rate control
This fixes a crash in `gst_va_h264_enc_class_init` and `gst_va_h265_enc_class_init`
(and probably also in gst_va_av1_enc_class_init) when calling
`g_object_class_install_properties (object_class, n_props, properties);`

When rate_control_type is 0, the following code is executed in :

```
  } else {
    n_props--;
    properties[PROP_RATE_CONTROL] = NULL;
  }
```

n_props has initially a value of N_PROPERTIES but PROP_RATE_CONTROL
is not the last element in the array, so it's making
g_object_class_install_properties fail to iterate over the
properties array.

This applies the same fix to gstvah264enc.c, gstvah265enc.c and
gstvaav1enc.c.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6319>
2024-03-12 16:58:07 +00:00
He Junyan
861c1a44be va: av1enc: Init the output_frame_num when resetting gf group
Fixes: #3359
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6308>
2024-03-11 12:38:57 +00:00
He Junyan
1a78d61b9f vah265enc: Set backward_num to 1 in low delay mode
In low delay B mode, the P frame is converted as B frame with forward
references. For example, One P frame may refers to P-1, P-2 and P-3 in
list0 and refers to P-3, P-2 and P-1 in list1.
So the num in list0 and list1 does not reflect the forward_num and
backward_num. The vaapi does not provide ref num for forward or backward
so far. In this case, we just consider the backward_num to be 1 conservatively.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6249>
2024-03-05 23:39:43 +00:00
He Junyan
b9c28920e0 vah265enc: Improve B pyramid mode in HEVC
If the reference frame number is bigger than 2, we can enable the
pyramid B mode. We do not need to assign a reference frame to each
pyramid level.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6249>
2024-03-05 23:39:43 +00:00
He Junyan
196de61035 vah265enc: Expand log2_max_pic_order_cnt if needed
In b_pyramid mode, B frames can be ref and prevPicOrderCntLsb can
be the B frame POC which is smaller than the P frame. This can cause
POC diff bigger than MaxPicOrderCntLsb/2 and generate wrong POC value.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6249>
2024-03-05 23:39:43 +00:00
He Junyan
a734f95790 vabasedec: Fix a possible NULL pointer dereference
The format in _get_preferred_format_and_caps_features() may be NULL.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6206>
2024-02-23 16:55:50 +00:00
Víctor Manuel Jáquez Leal
95436d1eb4 vabasedec: disable derived images for i965 driver
Since it has a very poor performance at reading derived images, which is the
most common use case for decoders.

Partially fixes: #3325

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6202>
2024-02-23 14:20:14 +00:00
Víctor Manuel Jáquez Leal
9567f8f444 vapostproc: optimization for va memory to system memory only
When the conversion is only caps feature from memory:VAMemory to system memory,
it's possible to optimize by doing a pseudo pass-through since the va-backed
buffers are the same for system memory buffers.

This change will also mitigates #2940

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6174>
2024-02-23 12:40:38 +00:00
Víctor Manuel Jáquez Leal
cc7726ea39 vabase: fail decide allocation if dmabuf without videometa
If the allocation query received from downstream doesn't handle GstVideoMeta but
it requests memory:DMABuf caps feature, it's incomplete, so we rather reject the
negotiation.

Both in base decoder, base transform and compositor.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6155>
2024-02-23 09:52:50 +00:00
Víctor Manuel Jáquez Leal
301e281777 vabasedec: refactor format and capsfeature selection
This is a simplification of the venerable
gst_va_base_dec_get_preferred_format_and_caps_features() function, which
predates since gstreamer-vaapi. It's used to select the format and the
capsfeature to use when setting the output state. It was complex and hard to
follow. This refactor simplifies a lot the algorithm.

The first thing to remove _downstream_has_video_meta() since, most of the time
it will be called before the caps negotiation, and allocation queries make sense
only after caps negotiation. It might work during renegotiation but, in that
case, caps feature change is uncommon. Better a simple and common approach.

Also, for performance, instead of dealing with caps features as strings, GQuarks
are used.

The refactor works like this:

1. If peer pad returns any caps, the returned caps feature is system memory and
   looks for a proper format in the allowed caps.

2. The allowed caps are traversed at most 3 times: one per each valid caps
   feature. First VAMemory, later DMABuf, and last system memory. The first to
   match in allowed caps is picked, and the first format matching with the
   chroma is picked too.

Notice that, right now, using playbin videoconvert never return any.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6154>
2024-02-22 20:59:13 +00:00
He Junyan
637d253e9f va: baseenc: Fix the wrong parameter order to call va_map_buffer()
The current gst_va_base_enc_copy_output_data() uses wrong parameter
order to call va_map_buffer().

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6020>
2024-01-30 15:50:23 +00:00
He Junyan
b4eb97101f va: Implement the vaav1enc plugin
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3015>
2024-01-30 08:24:26 +00:00
He Junyan
f4779f1fab va: baseenc: Extend the create_output_buffer() to accept prefix data
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3015>
2024-01-30 08:24:25 +00:00
He Junyan
726cc895d8 va: encoder: Add copy_output_data() helper function
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3015>
2024-01-30 08:24:25 +00:00
He Junyan
39144f612e va: encoder: extend prepare_output() virtual function
The output of VP9 and AV1 encoder is a little different from the H264
and H265 encoder, it may contain repeat frames and so the output frame
number may be more than the input. We need to call finish_subframe()
when some frame will be repeated later. So we need to extend the
current prepare_output() virtual function.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3015>
2024-01-30 08:24:25 +00:00
Ruben Gonzalez
5e3fafd025 SA: Remove extra check since libva min version is 1.12
The libva version was updated to 1.12 in PR 4781 [1]
[1] https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4781

NOTE: I also sort va_sources
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5978>
2024-01-25 00:45:55 +00:00
Víctor Manuel Jáquez Leal
7f14bfe8b8 va: basedec: fix return type
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5903>
2024-01-10 12:48:16 +01:00
Víctor Manuel Jáquez Leal
fdfd51397b vajpegdec: only support progressive mjpeg streams
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5838>
2023-12-22 04:38:06 +00:00
He Junyan
35390de50d vacompositor: consider the DMA kind input for sink pad
Co-authored-by: Víctor Jáquez <vjaquez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5160>
2023-12-16 10:56:09 +00:00
He Junyan
0bbaa00c3f vacompositor: Override the update_caps() of video aggregator class
The input of the vacompositor may be DMA buffers. And in this case, the input
caps has the format=DMA_DRM, which can not be recognized by base video
aggregator class' find_best_format() function. So we need to override the
update_caps() virtual function.

Also we consider the DMA kind caps in negotiated_src_caps() for output.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5160>
2023-12-16 10:56:09 +00:00
He Junyan
e68724c8e0 vacompositor: add helper function to get formats from caps
Co-authored-by: Víctor Jáquez <vjaquez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5160>
2023-12-16 10:56:09 +00:00
He Junyan
c76999fe7b vacompositor: add helper function to choose format
The function is based on the most supported formats by Intel/Mesa VA drivers.

Co-authored-by: Víctor Jáquez <vjaquez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5160>
2023-12-16 10:56:09 +00:00
He Junyan
eb4d2dd204 vacompositor: record the input caps for each input pad
The caps of each input sink pad wil decide the final output format and
caps of the src pad.

Co-authored-by: Víctor Jáquez <vjaquez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5160>
2023-12-16 10:56:09 +00:00
Víctor Manuel Jáquez Leal
8210784dab vabasedec: clean up decide_allocation() vmethod
When creating a new VA pool set config size to zero because it's not used.

Also, given the potential different sizes from software buffer pools and VA
buffer pools, this patch handle that potential different values.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5805>
2023-12-14 12:50:32 +00:00
Víctor Manuel Jáquez Leal
4fab6bb45a vabasetransform: clean up decide_allocation() vmethod
When creating a new VA pool set config size to zero because it's not used.

Also, given the potential different sizes from software buffer pools and VA
buffer pools, this patch handle that potential different values.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5805>
2023-12-14 12:50:32 +00:00
Víctor Manuel Jáquez Leal
33e49023ff vacompositor: clean up decide_allocation() vmethod
When creating a new VA pool set config size to zero because it's not used.

Also, given the potential different sizes from software buffer pools and VA
buffer pools, this patch handle that potential different values.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5805>
2023-12-14 12:50:32 +00:00
Víctor Manuel Jáquez Leal
1c7ce208bd vapluginsutils: add helper gst_va_create_other_pool()
This helper function creates a software-based buffer pool, where if size is
zero, its value is retrieved from the canonical size.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5805>
2023-12-14 12:50:32 +00:00
Víctor Manuel Jáquez Leal
4a22cc8fb3 va: no need to provide a buffer size for VA pool
VA drivers allocate surfaces given their properties, so there's no need to
provide a buffer size to the VA pool.

Though, the buffer size is provided by the driver, or the canonical size
is used for single planed surfaces.

This patch removes the need to provide a size for the function
gst_va_pool_new_with_config() and adds a helper method to retrieve the surface
size, gst_va_pool_get_buffer_size(). Also change the callers accordingly.

Changes for custom VA pool creation will be addressed in the following commits.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5805>
2023-12-14 12:50:32 +00:00
He Junyan
5ae7bbf5fb va: h265dec: Add support for more -still and -intra profiles
They are actually compitable with the main and main-10 profiles.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5797>
2023-12-12 21:30:16 +08:00
He Junyan
5345652896 va: Add decoder compatible caps string field into profiles' map
Some profiles such as main or main-10 in HEVC can support more
compatible profiles such as main-still-picture or main-10-intra.
We should add them into decoder's sink caps.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5797>
2023-12-12 21:30:08 +08:00
He Junyan
354aceb9cd va: Add the entrypoint parameter to gst_va_profile_caps()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5797>
2023-12-12 20:41:54 +08:00
Víctor Manuel Jáquez Leal
9f5b2c4e25 va: use GstVideoInfoDmaDrm when importing buffers
In the case of encoders and filters when importing a DMABuf, use
GstVideoInfoDmaDrm to get the drm fourcc and modifier.

In both cases, instead of keeping the original GstVideoInfoDmaDrm from caps, the
GstVideoInfo part of the structure is converted as canonical one, given the
format from the fourcc. It's kept in the way to handle V4L2 linear DMABufs and
to avoid too many changes in the current code.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5264>
2023-11-09 17:36:06 +00:00
Víctor Manuel Jáquez Leal
7c0227145c vaallocator: use GstVideoInfoDmaDrm for dmabuf setup
Instead of guessing the DRM format and modifier, pass a DRM video info to
gst_va_dmabuf_memories_setup().

Still, it checks for the DRM parameters in DRM info, if they are not available,
as in the case of V4L2 buffers, the part of the video info is used.

This is an API breakage, but since the plugin is still in stage, it's still
allowed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5264>
2023-11-09 17:36:06 +00:00
Víctor Manuel Jáquez Leal
76115528ac vallocator: remove n_planes argument in dmabuf_memories_setup()
Instead of passing the number of planes to process, take that number from the
passed GstVideoInfo.

This is an API breakage, but since the plugin is still in stage, it's still
allowed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5264>
2023-11-09 17:36:06 +00:00
Víctor Manuel Jáquez Leal
d7b5b54eda vadisplay: only register elements of allowed drivers
Now that nvidia-vaapi-driver appeared and isn't yet supported by GstVA, we've to
add an allowed list of supported drivers.

This patch implements it adding a environment variable to disable this driver
check: GST_VA_ALL_DRIVERS

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5616>
2023-11-08 13:53:26 +00:00
David Rosca
8aac08506a va: Use vaMapBuffer2
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5467>
2023-10-23 19:40:16 +00:00
Seungha Yang
97fc02cfe3 av1decoder: Port to GstCodecPicture struct
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5285>
2023-09-08 11:51:23 +00:00
Seungha Yang
a73c6d7fb6 vp9decoder: Port to GstCodecPicture struct
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5285>
2023-09-08 11:51:23 +00:00
Seungha Yang
4571fac946 vp8decoder: Port to GstCodecPicture struct
... and remove unused "pts" variable from GstVp8Picture struct

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5285>
2023-09-08 11:51:23 +00:00
Seungha Yang
a5ddf7af3b mpeg2decoder: Port to GstCodecPicture struct
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5285>
2023-09-08 11:51:23 +00:00
Seungha Yang
6e7cab43be h265decoder: Port to GstCodecPicture struct
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5285>
2023-09-08 11:51:23 +00:00
Seungha Yang
ea3dfadbed h264decoder: Port to GstCodecPicture struct
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5285>
2023-09-08 11:51:23 +00:00
He Junyan
6b23f2c4be va: baseenc: use in_info rather than input_state->info
The in_info is correct video info which already considers the
DMA kind caps case.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5289>
2023-09-06 15:40:03 +08:00
Víctor Manuel Jáquez Leal
52971faf14 va: refactor caps convertion to va caps
To avoid code duplication in code related with buffer importation.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5257>
2023-08-31 12:41:48 +00:00
Víctor Manuel Jáquez Leal
89b0a6fa23 va: refactor buffer import
This patch removes the code duplication of input buffer importation, in all the
va elements that import video frames. It defines a synthetic object whose
members are required to create a new input buffer and do the importation of the
upstream buffer.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5257>
2023-08-31 12:41:48 +00:00
He Junyan
e81a40cb72 va: baseenc: Add the DMA buffer input support
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5189>
2023-08-29 15:31:09 +00:00
He Junyan
5e6c91579f va: encoder: Add in_info field to base encoder
When we consider the DMA kind caps as input, the input_state->info
only contains the video format of GST_VIDEO_FORMAT_DMA_DRM, which
is not enough for va plugins. The new info in base encoder contains
the correct video info after the DMA caps parsing.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5189>
2023-08-29 15:31:09 +00:00
Víctor Manuel Jáquez Leal
c1f99f4005 va: Fix in error logs functions mismatches
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5236>
2023-08-24 17:54:32 +00:00
Víctor Manuel Jáquez Leal
bcee96020f vabasedec: Remove assertion for resolution change in input state
This is reported from https://bugs.webkit.org/show_bug.cgi?id=259032

Though I couldn't reproduce the issue, it looks to me unneeded to assert for
resolution changes in old frames, since renegotiation is carried out.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5237>
2023-08-24 16:21:14 +00:00
He Junyan
c927159f21 va: compositor: Use va_get_surface_usage_hint() to get the usage hint
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5210>
2023-08-24 11:03:59 +00:00
He Junyan
1b43baf3c8 va: baseenc: Use va_get_surface_usage_hint() to get the usage hint
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5210>
2023-08-24 11:03:59 +00:00
He Junyan
696d81f6f8 va: Use va_get_surface_usage_hint() to detect the modifiers
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5210>
2023-08-24 11:03:59 +00:00
He Junyan
8399bc2521 va: basedec: Use va_get_surface_usage_hint() to get the usage hint
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5210>
2023-08-24 11:03:59 +00:00
He Junyan
bb350138af va: basetransform: Use va_get_surface_usage_hint() to get the usage hint
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5210>
2023-08-24 11:03:59 +00:00
Seungha Yang
9d89bad731 va: Update decoder ranks
Most software decoders are ranked as primary, so use primary + 1 for
all codecs except for jpeg.
But ranks should be demoted on Windows since it's still experimental

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5169>
2023-08-11 15:42:44 +00:00
Víctor Manuel Jáquez Leal
e1765c4ce8 va/vaapi: promote va ranks and demote vaapi ones
VA decoders implementation has been verified from 1.18 through 1.22
development cycles and also via the Fluster test framework. Similar
to other cases, we can prefer hardware over software in most cases.

At the same time, GStreamer-VAAPI decoders are demoted to NONE to
avoid collisions. The first step to their deprecation.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2312>
2023-08-09 12:13:12 +02:00
Víctor Manuel Jáquez Leal
4583d8c0e8 vajpegdec: simply fixup src caps for iHD
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4044>
2023-08-07 22:49:26 +00:00
He Junyan
64d821af24 va: jpegdec: Do not change the DMA template src caps
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4044>
2023-08-07 22:49:26 +00:00
He Junyan
72e4bcf4df va: Delete the usage hint hack when we support DRM modifier
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4044>
2023-08-07 22:49:26 +00:00
He Junyan
d0587cda74 va: Apply the new DMA format:modifier pair negotiation in vpp
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4044>
2023-08-07 22:49:26 +00:00
He Junyan
5df0bfa7cb va: Apply the new DMA format:modifier pair negotiation in decoder
We will consider the DMA modifier for negotiation, setting caps and
memory pool allocation.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4044>
2023-08-07 22:49:26 +00:00
He Junyan
b1909949cb va: Improve the template caps for DMA, use new drm-format kind caps
We should add the modifier information for each surface format when
we report the template caps.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4044>
2023-08-07 22:49:26 +00:00
He Junyan
d7d25de892 va: Use GstVideoInfoDmaDrm in DMA allocator's get/set_format() API
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4044>
2023-08-07 22:49:26 +00:00
Mengkejiergeli Ba
ebea1219a9 vah265enc: Correct the value of cu_qp_delta flag and depth
According to libva API description, cu_qp_delta in VAConfigAttribValEncHEVCFeatures
is supposed to be used as a flag not the value of depth. And if flag enabled,
diff_cu_qp_delta_depth should be decided by log2_diff_max_min_luma_coding_block_size.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5068>
2023-07-27 16:00:19 +00:00
He Junyan
6accb7a1f5 va: Only change video format in gst_va_video_info_from_dma_info()
The current way of using gst_video_info_set_format() will change all
fields of the GstVideoInfo. We only need to change its format, stride
and offset fields.

In order to keep the consistency with th common drm API, we rename the
gst_va_video_info_from_dma_info() into gst_va_dma_drm_info_to_video_info().

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4883>
2023-06-26 16:18:23 +00:00
Stéphane Cerveau
53e48ce14d va: use GstH264Level enum in _va_h264_level_limits
The 1B value has been changed to 9 instead of 11 in the list
of level limits.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4737>
2023-06-26 10:47:36 +00:00
He Junyan
83e307ac96 va: basedec: Select the best format of the whole caps
The current way only selects the best video format from the first
structure of the caps. The caps like:

  video/x-raw(memory:VAMemory),drm-format=(string)NV12;  \
  video/x-raw(memory:VAMemory),format=(string){ NV12, Y210 }

Will just choose NV12 as the result, even the bitstream is 10 bits.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4928>
2023-06-25 10:55:23 +00:00
He Junyan
759857c203 va: basetransform: Copy the interested meta data for importing
The current way of using parent's copy_metadata() virtual function will
selectively filter out some meta such as crop meta. That virtual function
should be used when copying input buffer's meta data into output buffer,
not suitable when importing the input buffer.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4887>
2023-06-21 21:12:23 +00:00
He Junyan
ff2a75a2dd va: basetransform: Check the crop meta when importing
When the input buffer has crop meta, and we need to do copy, we
should consider the uncropped video size and copy the full size
of video memory.
The video meta in this case should contain the full uncropped
resolution info. We can use it to create full size va buffers.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4887>
2023-06-21 21:12:23 +00:00
He Junyan
703ab45334 va: basetransform: Only need va pool for internal usage
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4887>
2023-06-21 21:12:23 +00:00
Víctor Manuel Jáquez Leal
9825cd8951 vapostproc: evaluate op_flags validations as boolean
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4910>
2023-06-21 13:19:46 +02:00
He Junyan
b59b77a02f va: Add helper functions to convert GstVideoInfoDmaDrm into va video info
The VA has its internal video format mapping(because different drivers may
have different interpretation for the same format), so we should convert the
info in GstVideoInfoDmaDrm into the according video info based on that mapping.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4821>
2023-06-14 01:08:37 +00:00
He Junyan
c72960b427 va: Replace the tabs into spaces in gstvacaps.h
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4821>
2023-06-14 01:08:37 +00:00