Commit graph

49 commits

Author SHA1 Message Date
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 63c854c64b vadisplay_win32: Query profiles and entry points on init
Depending on driver, display can be initialized but
fails on query calls.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4149>
2023-03-15 01:37:03 +00:00
Seungha Yang 8fc77e5b3d va: Add Win32 backend GstVaDisplay implementation
... and disable derived image on Windows which does not seem to
work

Closes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1750
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4114>
2023-03-10 13:57:47 +00:00
Mengkejiergeli Ba 7278c31ea8 vaallocator: Check return value from va_sync_surface
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3919>
2023-02-20 16:02:38 +00:00
Tim-Philipp Müller e214be79de libs: va: drop use of GSlice
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3695>
2023-01-24 15:25:07 +00:00
Víctor Manuel Jáquez Leal 20b207bf8f vaallocator: Fix gi annotations.
Remove spurious types and skip functions that returns VASurfaceID
which isn't exposed to introspection.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3557>
2022-12-11 20:42:54 +00:00
He Junyan 3875c420f7 libs: va: Add API to peek the va buffer's display.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3322>
2022-11-05 13:39:34 +08:00
He Junyan 464650a5d0 libs: va: Add API to peek the va memory's display.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3322>
2022-11-05 13:39:34 +08:00
He Junyan b1a98433f8 libs: va: Add API to peek the allocator's display.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3322>
2022-11-05 13:39:34 +08:00
He Junyan 028920cfc4 libs: va: Fix code style in gstvaallocator.h
Replace all tabs with spaces.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3322>
2022-11-05 13:39:34 +08:00
Sebastian Dröge 366893e9ac Fix various warnings from gobject-introspection
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3261>
2022-10-25 09:45:25 +03:00
Víctor Manuel Jáquez Leal de7cfa92e3 va: allocator: Fix parameter name to match signature.
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 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 38491e25a3 docs: Generate libgstva GI and pkg-config.
Currently libgstva is only exposed internally to gst-plugins-bad. No
headers are installed, no documentation generated, pkgconfig file,
neither gobject-introspection files.

This patch turn on all that.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1025>
2022-09-13 14:52:39 +02:00
Thibault Saunier bc9c1e3956 meson: Namespace the plugins_doc_dep/libraries variables
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2970>
2022-09-01 21:17:35 +00:00
Víctor Manuel Jáquez Leal 074bdad21f va: libs: Add Y42B format.
Enable 4:2:2 JPEG decoding in iHD.

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 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 ffd94a98be va: Add RGBP format definition.
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 8a2660dc7f va: allocator: Use always lseek to get dmabuf size.
Gallium drivers historically have reported strange dmabuf sizes, from always
zero to the whole frame (multiple fds). The simplest solution is to use lseek
SEEK_END to get the prime descriptor size.

Also the allocator raises a warning if both values differ in order to report
it to driver.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2574>
2022-06-24 15:24:09 +02:00
Nicolas Dufresne 83c51c9812 va: allocator: Fix translation of VADRMPRIMESurfaceDescriptor
VADRMPRIMESurfaceDescriptor structure describes the offsets from the
point of view of the specific handle (DMABuf). While GstVideoInfo
(and the meta) describes offsets from the point of the view of the
GstBuffer, an aggregate of all the GstMemory (1 per handle).

This changes combined with [Mesa Fix](https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16813)
fixes decoding failure with AMD driver.

Fixes #1223

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2574>
2022-06-24 14:14:03 +02: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 13fbcde1e7 libs: va: Add O_CLOEXEC flag at opening drm device.
So any other potential subprocess won't have access to it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2386>
2022-05-07 09:55:36 +00:00
He Junyan 163cbd5892 va: pool: Replace all tabs with spaces in header file.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2282>
2022-04-26 20:26:06 +08:00
He Junyan fac57fcb8d va: pool: Delete the GST_BUFFER_POOL_OPTION_VIDEO_ALIGNMENT.
The va pool is used for GPU side surface/image, its alignment should
not be changed arbitrarily by others. So we decide not to expose the
GST_BUFFER_POOL_OPTION_VIDEO_ALIGNMENT flag anymore.
Instead, user can call gst_buffer_pool_config_set_va_alignment() to
set its surface/image alignment.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2282>
2022-04-26 20:26:02 +08:00
He Junyan fd81cb2ad4 va: pool: Add set_va_alignment() API.
We want to use gst_buffer_pool_config_set_va_alignment() to replace
gst_buffer_pool_config_get_video_alignment(). The later one is specific
for GST_BUFFER_POOL_OPTION_VIDEO_ALIGNMENT option.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2282>
2022-04-26 20:25:57 +08:00
Víctor Manuel Jáquez Leal e207ff905b va: Expose a couple va surface/buffer methods.
And use them in va plugin.

Also, set as default logging category the vadisplay one.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2077>
2022-04-20 15:15:56 +00:00
Tim-Philipp Müller 296094508e libs: va: make sure va-enumtypes.h is generated before it's used
Need to add a dep for the generated header file to the dependency()
so that it gets generated before anyone tries to #include files
from it (which may happen before the actual lib is built because
that's only needed when stuff is linked together later).

See https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2057#note_1323236
and CI build failures in https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2096

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2103>
2022-04-02 18:58:52 +00:00
Nicolas Dufresne 8d9e649570 va: Fix printf format modifier for drm modifiers
DRM modifiers are 64bit, the printf modifier is platform dependant. Use
the G_GINT64_MODIFIER macro to make this printf portable.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2102>
2022-04-01 20:09:36 +00:00
Víctor Manuel Jáquez Leal 6d2f57b6c7 libs: va: add VA allocator parameter for derived images usage.
Added GstVaFeature enum type, and new parameter for VA allocator's
set_format() and get_format(). Also added a new parameter in VA pool
gst_va_pool_new_with_config() and
gst_buffer_pool_config_set_va_allocation_params().

This new parameter will define if derived images will by used for
buffer mapping.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2057>
2022-03-31 14:14:45 +00:00
Seungha Yang 6451a13b0b vadisplay: Add description readonly property
Expose description of vendor for user information, similar to
the description property of d3d11device.
Also, set description and DRM device path on GstContext structure
so that user can read them and it will be printed on terminal
when gst-launch-1.0 is used

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2064>
2022-03-30 21:41:27 +00:00
Víctor Manuel Jáquez Leal 602d249847 va: Don't expose internal classes.
VA allocators and pools classes don't need to be exposed as external
symbols.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2070>
2022-03-30 11:36:03 +02:00
Víctor Manuel Jáquez Leal 400faf7361 va: Set <gst/va/gstva.h> as library single point entry header.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2048>
2022-03-29 19:48:30 +00:00
He Junyan 990fbb3b52 va: Move allocators and pool objects into gstva library.
In order to other plugins use gstva objects, such as allocators and buffer
pools, this merge request move them from the va plugin to the gstva library.

This objects are not exposed in <gst/va/gstva.h> since they are not expected
to be used by users, only by plugin implementators.

Because of the surface copy design, which is used to implement allocator's
mem_copy() virtual function, depends on the vafilter, which is kept inside
the plugin, memory copy through VAPosproc is disabled and removed temporarly.

Also added some missing parameter validation.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2048>
2022-03-29 19:48:30 +00:00
He Junyan 53783eab6c va: Move the video format functions into gstlibva.
Untabifying header file.

The logging category was moved from the plugin generic category to
the display category. It can argue that video formats hacks are
display dependant.

Added validations for input parameters.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2048>
2022-03-29 19:48:30 +00:00
He Junyan 24c3e0fcfa va: Delete the display lock/unlock when we call VA-API.
According to the VA-API's description, they are MT-safe, we do not
need to care about that in our middleware layer. The lock/unlock
operations have overhead and make the performance lower.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1333>
2022-02-15 10:02:08 +00:00
He Junyan 58d594df44 meson: va: Remove va option check from gst-libs
Building libgstva-1.0 unconditionally for the va implementation can be
 used by non-va plugins such as MSDK even when va plugin is disabled

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1685>
2022-02-14 06:30:56 +00:00
Víctor Manuel Jáquez Leal 0e7dade55a build: Add libva dependency fallback.
Then libva can be subproject and used by either gstreamer-vaapi,
va and msdk in gst-plugins-bad.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1397>
2022-02-09 09:45:04 +00:00
Víctor Manuel Jáquez Leal 4455d908eb va: Fix and simplify build recipe.
1. Use api_version variable rather than static string.
2. Remove pkgconfig generation since currently the library
   is not installed, only used internally.
3. Rely on dependency "required" to abort compilation.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1650>
2022-02-08 16:22:42 +00:00
Víctor Manuel Jáquez Leal 5e4c152de4 va: Remove libgudev crumbs in library.
In commit e699aaeb we moved linking of libgudev to the plugin rather
the library, because it's only used in the plugin. But the dependency
check is still done in library.

This patch removes the dependency check in library, and updates the
dependency check in plugin.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1650>
2022-02-08 16:22:42 +00:00
He Junyan ea9b350240 va: Add a gstva.h to include all va lib header files.
And replacing all va lib headers with this new header files
when including.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1256>
2022-02-07 10:12:36 +00:00
He Junyan d5c535744b va: Move the vautils into the gst va lib.
The context query and handle are common logic for all va related
elements. So we move it from va plugins to the common gst va lib.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1256>
2022-02-07 10:12:36 +00:00
Víctor Manuel Jáquez Leal ccc4dc2d83 va: libs: Avoid noisy registry when no VA device.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1550>
2022-01-21 10:55:55 +01:00
Tim-Philipp Müller be3b71d6c9 gst-plugins-bad: define G_LOG_DOMAIN for all libraries
Fixes #634

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1009>
2021-10-19 00:12:25 +00:00
Thibault Saunier 6e79932ad9 meson: List libraries and their corresponding gir definition
Introduces a `libraries` variable that contains all libraries in a
list with the following format:

``` meson
libraries = [
    [pkg_name, {
        'lib': library_object
        'gir': [ {full gir definition in a dict } ]
    ],
    ....
]
```

It therefore refactors the way we build the gir so that we can reuse the
same information to build them against 'gstreamer-full' in gst-build
when linking statically

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1093>
2021-10-15 19:27:30 -03:00
Mengkejiergeli Ba 8f678c95d6 va:display: Don't close an fd with negative value
Cannot pass negative parameter to close() and thus no need to apply
close() when fd < 0.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1131>
2021-10-14 11:12:41 +00:00
Víctor Manuel Jáquez Leal e699aaeb16 va: meson: Move back libgudev dependency to plugin.
When move the libgstva, libgudev dependency was moved as part of the
library, though it's not use by the library but the plugin. This patch
moves back libgudev dependency to the plugin.

Also HAVE_LIBDRM is move to the library which is the one who use it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1027>
2021-10-04 10:19:36 +00:00
Thibault Saunier 019971a3c7 Move files from gst-plugins-bad into the "subprojects/gst-plugins-bad/" subdir 2021-09-24 16:14:36 -03:00