Commit graph

33 commits

Author SHA1 Message Date
Thibault Saunier 019971a3c7 Move files from gst-plugins-bad into the "subprojects/gst-plugins-bad/" subdir 2021-09-24 16:14:36 -03:00
Víctor Manuel Jáquez Leal 4f0b619023 va: Update vapostproc documentation.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2495>
2021-09-10 17:48:23 +02:00
Víctor Manuel Jáquez Leal b13fd4f15b va: filter: Add past and future frames in GstVaSample.
And add them in the pipeline structure if they are provided.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2495>
2021-09-10 17:48:23 +02:00
Víctor Manuel Jáquez Leal 419ef31d1e va: filter: Add gst_va_filter_add_deinterlace_buffer()
This function decorates gst_va_filter_add_filter_buffer() to get the
number of past and future frames to hold, given the method.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2495>
2021-09-10 17:48:22 +02:00
Víctor Manuel Jáquez Leal 101dcb55d9 va: filter: Add deinterlacing method parameter.
For exposing that gobject parameter a new helper function is added:

gst_va_filter_install_deinterlace_properties()

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2495>
2021-09-10 17:48:22 +02:00
Víctor Manuel Jáquez Leal 51dcba7b1e va: filter: Protect filters array of overwrite.
It's possible to modify the filters array from another GStremer
thread, and the post-processing operation is not atomic, so the filter
array is reffed while the VA pipeline is processed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2495>
2021-09-10 14:45:00 +02:00
Víctor Manuel Jáquez Leal cc91fd0956 va: filter: Add helper function to query pipeline caps.
This function is going to be shared for future deinterlace filter
processing.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2495>
2021-09-10 14:45:00 +02:00
Víctor Manuel Jáquez Leal 7f2e1e2eb3 va: filter: Shuffle _destroy_filters_unlocked().
In order to put it near to its caller.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2495>
2021-09-10 14:45:00 +02:00
He Junyan fbf6bfd4d8 va: Use GST_CAPS_FEATURE_MEMORY_VA to replace "memory:VAMemory".
"memory:VAMemory" is a commonly used string which notates our VA-kind
memory type. We now used a definition in va lib to replace the simply
string usage.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2466>
2021-08-16 16:25:15 +08:00
He Junyan d14e8055ad va: Use MEMORY_DMABUF definition to replace "memory:DMABuf" strings.
GST_CAPS_FEATURE_MEMORY_DMABUF is already a common definition, we should
just use it rather than use the "memory:DMABuf" strings by ourselves.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2466>
2021-08-16 16:24:14 +08:00
Víctor Manuel Jáquez Leal c27a01233d va: filter: refactor convert_surface() to process()
The idea of this change is to add, in the future,
process_with_generator(), when multiple input surfaces are processed,
for blending.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2431>
2021-07-27 09:13:39 +00:00
Víctor Manuel Jáquez Leal 9abeea49a0 va: filter: Refactor set_formats() to set_video_info().
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2431>
2021-07-27 09:13:39 +00:00
He Junyan cbb1096c52 va: vpp: Improve the color properties setting.
The current setting of color properties are not very correct and
we will get some kind of "unknown Color Standard for YUV format"
warnings printed out by drivers. The video-color already provides
some standard APIs for us, and we can use them directly.
We also change the logic to: Finding the exactly match or explicit
standard first. If not found, we continue to find the most similar
one.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2385>
2021-07-08 13:36:05 +00:00
He Junyan e0915ce982 libs: va: Move the VA common logic as a lib.
The VA acceleration now has more usages in linux-like platforms,
such as the MSDK. The different plugins based on the VA acceleration
need to share some common logic and types. We now move the display
related functions and types into a common va lib.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2196>
2021-05-18 12:15:30 +02:00
Víctor Manuel Jáquez Leal 7395057af3 va: filter: remove unsupported formats because driver's bugs
Add a way to filter out video formats from caps because of unresolved
bugs in drivers. In this case for media-driver (iHD) where some RGB32
formats are not handled correctly.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2129>
2021-04-07 11:06:59 +00:00
Víctor Manuel Jáquez Leal 2ba5854c6b va: postproc, filter: add disable-passthrough property
vapostproc tries to be in passthrough mode as much as possible. But
they might be situations where the user might force to process the
frames. For example, when upstream sets the crop meta and the user
wants VA do that cropping, rather than downstream.

For those situations this property will disable the passthrough mode,
if it's enabled.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2058>
2021-04-03 15:47:18 +02:00
Víctor Manuel Jáquez Leal c88abb9291 va: filter: add gst_va_filter_enable_cropping ()
This will toggle the cropping operation in the filter

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2058>
2021-04-03 15:47:18 +02:00
Víctor Manuel Jáquez Leal c770469a8a va: filter, vpp: add and use GstVaSample struct
This new struct describes the input and output GstBuffers to
post-process, including VA flags. It also contains the VASurfaceID and
VARectangle, but those are private, completed inside GstVaFilter.

It is used for pass arguments to gst_va_filter_convert_surface() function.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2058>
2021-04-03 15:47:18 +02:00
Víctor Manuel Jáquez Leal c74b230579 va: postproc: only drop filters if they change
Currently, at every frame the filters array is recreated. This is not
optimal, since it should be only rebuilt if the VA filter's related
properties change. This patches does that by using a flag.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2078>
2021-03-15 06:10:27 +00:00
Víctor Manuel Jáquez Leal 87fe2e321e va: vpp: implement GstColorBalance interface
And modify multiple-vpp example to use it with -r parameter.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2033>
2021-02-25 11:22:53 +00:00
Víctor Manuel Jáquez Leal 5b117045e0 va: filter: add controllable and mutable playing to GParamFlags
Add controllable and mutable playgin to common GParamFlags.

Also use this common flags to video-direction

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2033>
2021-02-25 11:22:53 +00:00
Víctor Manuel Jáquez Leal 2696a2795d va: filter, vpp: process colorimetry
A new filter method were added: gst_va_filter_set_formats(). In this
way the input & output GstVideoInfo are processed only once per stream
negotiation, and not per frame.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2023>
2021-02-20 17:03:43 +00:00
Víctor Manuel Jáquez Leal d4682fa136 va: filter: check if filter is open on set_orientation()
Because the method requires pipeline_caps is filled.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2023>
2021-02-20 17:03:43 +00:00
Víctor Manuel Jáquez Leal 812973fb6b va: filter: human readable background color
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2023>
2021-02-20 17:03:43 +00:00
Víctor Manuel Jáquez Leal c6c71c0c0c va: filter: fail immediately if vaBeginPicture() fails
There's no need to try vaRenderPicture() if vaBeginPicture() failed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2023>
2021-02-20 17:03:43 +00:00
Víctor Manuel Jáquez Leal b7988b4de8 va: filter: destroy pipeline buffer after destroying filters
In 6ae24948 the pipeline buffer destroy were removing assuming it
wasn't required. Nonetheless, debugging the code it looks like a
buffer leak in iHD driver since the ID of the buffer kept increasing.

The difference now is that first the filter buffers are destroy first
and later the pipeline buffer.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2023>
2021-02-20 17:03:43 +00:00
Víctor Manuel Jáquez Leal 532b20cf05 va: filter: use a common GParamFlags definition
Instead of repeating the same code along gst_va_filter_install_properties()

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1999>
2021-02-05 21:24:02 +01:00
Víctor Manuel Jáquez Leal 6ae2494887 va: filter: don't destroy pipeline buffer
This was only required by i915 driver before libva-2.0 because it didn't
conform.

Also changes the way _destroy_filters() is called, now inside a locked block, so
it must not lock in it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2006>
2021-02-05 16:54:07 +01:00
Víctor Manuel Jáquez Leal 599e16fde8 va: filter: lock member variables access
While gst_va_filter_open() and gst_va_filter_close() remain non-thread-safe, the
other API calls that modify member variables are locked.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2005>
2021-02-04 11:12:37 +01:00
Víctor Manuel Jáquez Leal 8a8688c639 va: filter: fix assignation to proper variable
Fix the result of a wrong copy&paste

Fixes: #1501
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1976>
2021-01-22 09:38:27 +01:00
Víctor Manuel Jáquez Leal 3653c19de3 va: filter: fix counter variable reuse
There was a bug reusing the counter variable i in nested loops. Also
the patch makes the code cleaner.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1643>
2020-10-04 16:05:03 +02:00
Víctor Manuel Jáquez Leal 990d1bfbce va: vpp: global lock to handle shared buffers
Add a global mutex to exclusive access to shared stream buffers, such
as DMABufs or VASurfaces after a tee:

LIBVA_DRIVER_NAME=iHD \
gst-launch-1.0 v4l2src ! tee name=t t. ! queue ! \
  vapostproc skin-tone=9 ! xvimagesink \
  t. ! queue ! vapostproc ! xvimagesink

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1529>
2020-09-23 18:19:22 +02:00
Víctor Manuel Jáquez Leal 9845ec68dc va: add vapostproc element
Video postprocessor for VA-API

Funcionalities: resize frames, change format, import buffers, apply
filters (such as denoise, sharpen, orientation, if driver offers them).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1529>
2020-09-23 18:19:22 +02:00