Commit graph

151 commits

Author SHA1 Message Date
He Junyan
65c8718f5e libs: display: Add a helper function to get profiles by codec.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/349>
2020-07-30 17:46:24 +08:00
Víctor Manuel Jáquez Leal
6022d97edf libs: display, context: handle broken jpeg decoder for i965 driver
JPEG decoding in i965 driver is pretty much broken, and the driver is
deprecated which mean authors only accept trivial fixes.

Surfaces for JPEG decoder context in i965 only handle IMC3[1] color
format which is not a common format in GStreamer. It can export it to
I420 at mapping raw bytes, but DMABuf exporting is problematic.

This patch artificially adds NV12 to the context format list when it's
JPEG decoder for i965 and force the usage of old VA-API for surface
creation without specifying color format. Also it artificially
disables the DMABuf announcement.

1. https://docs.microsoft.com/en-us/windows/win32/medfound/recommended-8-bit-yuv-formats-for-video-rendering#420-formats-16-bits-per-pixel

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/369>
2020-07-29 12:06:32 +02:00
Mathieu Duponchelle
e6e377c720 plugins: uddate gst_type_mark_as_plugin_api() calls 2020-06-06 00:42:46 +02:00
He Junyan
32db615685 libs: display: add a quirk for iHD driver tile encoding.
The iHD driver has a requirement that one slice can not span tiles
when tile is enabled, which is not required by hevc spec.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/294>
2020-06-05 19:28:06 +08:00
Thibault Saunier
31d85bfb65 Use gst_type_mark_as_plugin_api() for all non-element plugin types 2020-06-03 17:37:48 -04:00
Víctor Manuel Jáquez Leal
ab475c22d5 libs: use array_unref() rather than array_free()
It is more convinience and thread-safe.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/325>
2020-05-16 20:29:34 +00:00
Haihao Xiang
61516dd5e1 vaapijpegenc: Add a quantization quirk for iHD driver
iHD driver shifts the value by 50 when calculating quantization for JPEG
encoding, so we should add 50 in this plugin for iHD driver too.
2020-03-17 16:10:06 +00:00
Víctor Manuel Jáquez Leal
a8031bcb0e libs: display: force RGBA image format for i965 driver
Since commit 32bf6f1e GLTextureUpload is broken because i965
doesn't report properly RGBA support. It could be possible to use RGBx
but GLTextureUpload only regotiates RGBA.

The simplest fix to this regression is adding synthetically the RGBA
format in the internal format map.
2020-02-28 12:20:18 +01:00
Víctor Manuel Jáquez Leal
ae0261023a libs: display: iterate all quirks table
Instead of break at the fist foud quirk in the table, iterate all over
so it would be feasible to add several quirks for one driver per
element in array.
2020-02-28 12:10:25 +01:00
U. Artie Eoff
13601f4071 libs: display: add YUV to/from RGB color primary quirk
The intel-media-driver (iHD) can't convert output color
primaries when doing YUV to/from RGB CSC.
2020-02-28 11:09:11 +00:00
Víctor Manuel Jáquez Leal
96cdebf185 libs: remove crumbs of libva < 0.39
All these guarded code seem like leftovers of commit 920b1ec7a. This
patch completes that missing clean up.
2020-02-11 12:32:33 +01:00
U. Artie Eoff
c42938fd53 libs: display: add vpp color standard quirk for i965 driver
The i965 does not properly report supported vpp color
standards.
2020-02-04 13:59:59 -08:00
Víctor Manuel Jáquez Leal
67c0bf2cdb libs: display: log out vendor string when available
This is useful while asking for logs to know the used driver.
2020-01-29 18:27:50 +01:00
Víctor Manuel Jáquez Leal
ee3d4c3206 libs: display: driver quirks mechanism
This mechanism comes from ffmpeg vaapi implementation, where they have
their own quirks.

A specific driver is identified by a substring present in the vendor
string. If that substring is found, a set of bitwise flags are store.
These flags can be accessed through the function
gst_vaapi_display_has_driver_quirks().

The purpose for this first quirks is to disable the put image try for
AMD Gallium driver (see [1]).

1. https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/merge_requests/72
2020-01-24 12:21:59 +00:00
Víctor Manuel Jáquez Leal
9da5196b5a Remove all FEI related
FEI encoders are not actively mantained neither tested, and it is
using infrastructure that is changing and FEI is stopping this
effort.

Also it is required to rethink how FEI can be used in GStreamer.
2020-01-15 07:30:15 +00:00
Víctor Manuel Jáquez Leal
4da8dc2550 libs: display: code clean up 2019-12-20 08:40:54 +01:00
He Junyan
b2cabe2f5b libs: display: refine the profile/entrypoint map.
The old way make the one config for each profile/entrypoint pair,
which is not very convenient for description the relationship
between them. One profile may contain more than one entrypoints
to within it, so a set like data structure should be more suitable.
2019-12-20 07:39:43 +00:00
He Junyan
32bf6f1e09 libs: video-format: Refine the video format mapping.
Improve the mapping between va format and gst format. The new map
will be generated dynamically, based on the query result of image
format in VA driver. Also consider the ambiguity of RGB color
format in LSB mode.
2019-09-06 16:43:14 +00:00
Denis Nagorny
4aae03d3c1 libs: display: lock ensure_profile()
Thread safety patch for ensure_profile() function

Fixes #133
2019-02-11 16:14:27 +01:00
Haihao Xiang
920b1ec7a8 vaapi: bump the minimum vaapi version requirement to 0.39.0
And reduce unnecessary API version and structures check as well.

https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/issues/108
2019-01-07 17:46:42 +00:00
Víctor Manuel Jáquez Leal
ae2fbf951a libs: remove already include string.h
Since sysdeps.h includes string.h there's no need to include it again.
2018-09-25 18:22:35 +02:00
Jimmy Ohn
7b077cdcb9 libs: use g_clear_pointer() when possible
https://bugzilla.gnome.org/show_bug.cgi?id=797131
2018-09-13 11:35:27 +02:00
Víctor Manuel Jáquez Leal
1f0b2fb952 libs: display: lock at extracting available image formates
When running several vaapi elements at the concurrently, at
initialization, there is a race condition when extractin the avaible
formats for images and subpictures.

This patch add a lock when the those arrays are filled.

https://bugzilla.gnome.org/show_bug.cgi?id=797039
2018-08-31 13:41:58 +02:00
Víctor Manuel Jáquez Leal
6ccd5d6fb2 libs: display: remove gst_vaapi_display_ref()
Replace it with gst_object_ref()

https://bugzilla.gnome.org/show_bug.cgi?id=796470
2018-06-14 16:41:00 +02:00
Víctor Manuel Jáquez Leal
fb1c4c52cc libs: display: remove gst_vaapi_display_unref()
Use gst_object_unref() instead.

https://bugzilla.gnome.org/show_bug.cgi?id=796470
2018-06-14 16:41:00 +02:00
Hyunjun Ko
a6881b9b5e libs: display: replace gst_vaapi_display_new() with gst_vaapi_display_config()
Gobjectification for GstVaapiDisplay was almost done by the commit 185da3d1.
But still something breaking GObject code convention remains, which is
calling gst_vaapi_display_new() in each decendants.

This patch replaces it with gst_vaapi_display_config(), defined in private
header.

https://bugzilla.gnome.org/show_bug.cgi?id=796470
2018-06-14 16:41:00 +02:00
Víctor Manuel Jáquez Leal
8de7dcfe3c libs: display: redefine gst_vaapi_display_create()
The function name was gst_vaapi_display_create_unlocked(), nonetheless
it wasn't called unlocked. In order to keep the semantics this patch
renames the gst_vaapi_display_create_unlocked() as
gst_vaapi_display_create(), removing the previous function
gst_vaapi_display_create().

https://bugzilla.gnome.org/show_bug.cgi?id=796470
2018-06-14 16:41:00 +02:00
Víctor Manuel Jáquez Leal
b0bebebc01 libs: display: resurrect parent private member
This is, practically, a revert of commit dcf135e2.

The parent logic is useful for the EGL display, which is a decorator
of the real windowing subsystem (X11 or Wayland). Thus it is avoided
calling vaInitialize() and vaTerminate() twice.

https://bugzilla.gnome.org/show_bug.cgi?id=795391
2018-06-12 12:43:27 +02:00
Hyunjun Ko
aa77862b62 libs: display: remove unnecessary legacy code since gobjectification
https://bugzilla.gnome.org/show_bug.cgi?id=796470
2018-06-06 19:47:18 +02:00
Hyunjun Ko
3056f06e02 libs: display: remove unused code
https://bugzilla.gnome.org/show_bug.cgi?id=796470
2018-06-06 19:47:18 +02:00
Víctor Manuel Jáquez Leal
63a76c9dd0 libs: display: delay getting screen resolution
Instead of extracting the screen resolution at GstVaapiDisplay
creation, this patch delay it until the screen size is requested for
first time.

https://bugzilla.gnome.org/show_bug.cgi?id=782212
2017-10-03 13:14:55 +02:00
Víctor Manuel Jáquez Leal
494ac4e3a8 libs: display: remove display_type from display info
Since it's no required to pass the display type in the display info,
the structure member is removed.

https://bugzilla.gnome.org/show_bug.cgi?id=782212
2017-10-03 13:14:55 +02:00
Víctor Manuel Jáquez Leal
4e9de44ba2 libs: display: remove display_type member
It is not used any more since GstVaapiDisplay was ported as a
GstObject-based. This information is part of the class information.

https://bugzilla.gnome.org/show_bug.cgi?id=782212
2017-10-03 13:14:55 +02:00
Víctor Manuel Jáquez Leal
dcf135e2a5 libs: display: remove parent member
Parent was a crumb left from display cache.

https://bugzilla.gnome.org/show_bug.cgi?id=782212
2017-10-03 13:14:55 +02:00
Víctor Manuel Jáquez Leal
b23ccc69b0 libs: display: initialize value if they are not yet
This is a difference between the GObject API and the GstVaapi one: the
GValue passed to get a property value, in GObject has to be
initialized with g_value_init(), but in GstVaapi is has not.

In order to overcome this mismatch, this patch call g_value_init()
internally only in the passed one is not already initialized.

https://bugzilla.gnome.org/show_bug.cgi?id=788058
2017-09-22 20:06:42 +02:00
Víctor Manuel Jáquez Leal
6b35e00a28 libs: display: optimize properties setters and getters
Shuffled some code to avoid to find the properties descriptor in the
array twice, adding the internal functions _set_property() and
_get_property().

https://bugzilla.gnome.org/show_bug.cgi?id=788058
2017-09-22 20:06:42 +02:00
Víctor Manuel Jáquez Leal
0eeef92911 libs: display: install properties in class
Install the properties in the class as a normal GObject. Implement
set_property() and get_property() vmethods.

https://bugzilla.gnome.org/show_bug.cgi?id=788058
2017-09-22 20:06:42 +02:00
Víctor Manuel Jáquez Leal
9dcaa0d09f libs: display: remove gst_vaapi_display_properties_init()
Remove gst_vaapi_display_properties_init() since it can be unrolled in
gst_vaapi_display_class_init()

https://bugzilla.gnome.org/show_bug.cgi?id=788058
2017-09-22 20:06:42 +02:00
Víctor Manuel Jáquez Leal
9116ffb7b7 libs: display: remove libgstvaapi_init_once()
It is not required since it can be unrolled in
gst_vaapi_display_class_init()

https://bugzilla.gnome.org/show_bug.cgi?id=788058
2017-09-22 20:06:42 +02:00
Sreerenj Balachandran
6bbe79925c FEI: libs: Add FEI Entrypoint mapping
Define the new mapping GST_VAAPI_ENTRYPOINT_SLICE_ENCODE_FEI
for VAEntrypointFEI.

https://bugzilla.gnome.org/show_bug.cgi?id=785712
https://bugzilla.gnome.org/show_bug.cgi?id=784667
2017-09-01 11:27:28 +02:00
Tomas Rataj
c181308904 libs: display: when appending formats change pointers to indexes
Thus, it fixes an invalid read when YV12 or I420 are not supported by
the driver.

https://bugzilla.gnome.org/show_bug.cgi?id=785085
2017-08-01 16:23:22 +02:00
Hyunjun Ko
356212214b libs: display: pass display info when foreign display
When creating a GstVaapiDisplay using a foreign VADisplay, and render
with that display, it also requires native display of the backend.

https://bugzilla.gnome.org/show_bug.cgi?id=766704
2017-07-18 18:43:06 +02:00
Víctor Manuel Jáquez Leal
ec3e10f666 libs: display: remove cache
Remove a bunch of code that handles the VADisplay cache, since the
context sharing should be doing this correctly.

https://bugzilla.gnome.org/show_bug.cgi?id=747946
2017-07-18 18:20:21 +02:00
Scott D Phillips
3cc4eb7b81 make: remove gstvaapiversion.h generation
https://bugzilla.gnome.org/show_bug.cgi?id=778250
2017-02-09 11:27:44 +01:00
Víctor Manuel Jáquez Leal
65c16145a5 Revert "vaapidisplay: mark X11 display as compatible with EGL"
This reverts commit 200b1baabc.
2017-02-01 16:20:08 +01:00
Víctor Manuel Jáquez Leal
1e0b3c2f74 libs: display: redirect logging at initialize
Redirect libva's logs to GStreamer logging mechanism. This is
particularly useful when VA is initialized, because it always logs
out the drivers details.

In order to achieve this a new helper function was added as a wrapper
for the vaInitialize() function.

https://bugzilla.gnome.org/show_bug.cgi?id=777115
2017-01-11 16:11:30 +01:00
Víctor Manuel Jáquez Leal
b1f6da98de libs: fix code style for errors 2016-11-03 12:51:44 +01:00
Hyunjun Ko
185da3d1a4 libs: display: GstVaapiDisplay as GstObject descendant
This patch is to change the inheritance of GstVaapiDisplay to GstObject,
instead of GstVaapiMiniObject. In this way we can use all the available
infrastructure for GObject/GstObject such as GstTracer, GIR, etc.

In addition, a new debug category for GstVaapiDisplay is created to make it
easier to trace debug messages. It is named "vaapidisplay" and it transverse
all the VA display backends (DRM, GLX, EGL, Wayland, ...)

This patch is a step forward to expose GstVaapiDisplay for users in a future
library.

https://bugzilla.gnome.org/show_bug.cgi?id=768266

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
2016-11-03 08:24:59 +01:00
Hyunjun Ko
a80e10ac5c libs: display{egl,glx}: cache GstVaapiTextures
instances when created and reuse

This patch improves performance when glimagesink uploads a GL texture.

It caches the GStVaapiTexture instances in GstVaapiDisplay{GLX,EGL}, using an
instance of GstVaapiTextureMap, so our internal texture structure can be found
by matching the GL texture id for each frame upload process, avoiding the
internal texture structure creation and its following destruction.

https://bugzilla.gnome.org/show_bug.cgi?id=769293

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
2016-09-22 17:01:59 +02:00
Sreerenj Balachandran
c1abf37d0b gstvaapidisplay: Add VAEntrypointEncSliceLP support
https://bugzilla.gnome.org/show_bug.cgi?id=766050
2016-05-11 12:03:08 +03:00