Commit graph

3288 commits

Author SHA1 Message Date
Víctor Manuel Jáquez Leal
6c364cb9a7 libs: window: refactor as gobject
This is another step in the gobjectification of the internal library
of gstreamer-vaapi. Now it is the turn of GstVaapiWindow and its
derivates.

The idea is to minimize the changeset keeping the same design as
much as possible.

GstVaapiWindow is defined as an abstract class with two properties:
the GstVaapiDisplay and the native ID. Thus, many of the
GstVaapiObject macros were copied as GstVaapiWindow macros.

The function gst_vaapi_window_new_internal() is kept as a decorator
of for calling gst_vaapi_window_create() and the possibility of
failure.

The descendant classes, such as glx, still use the private
structures, but through the gobject mechanism.
2018-12-24 12:20:00 +00:00
Víctor Manuel Jáquez Leal
7b782be5dd libs: filter: use its own debug category 2018-12-24 12:20:00 +00:00
He Junyan
7663fa263c plugins: Add more check for allowed raw caps.
The gst_vaapi_plugin_base_get_allowed_raw_caps is used for both sink
pad and src pad, which cause some bugs. For sink pad, we need to verify
vaPutImage() while for the src pad we need to verify vaGetImage().
For vaapidecoderXXX kind of plugins, the case is more complex. We need
to verify whether the decoded result(in some surface, NV12 format most
of the time) can be vaGetImage to some raw image format. Add more check
to fix all these problems.

https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/issues/123

Signed-off-by: He Junyan <junyan.he@hotmail.com>
2018-12-24 10:46:23 +00:00
Wangfei
63ea81a983 vaapipostproc: fix csc fail when only change width or height. 2018-12-18 10:47:15 +08:00
Wonchul Lee
70d6b4002c meson: Add gtk guard 2018-12-15 09:49:18 +09:00
Wangfei
1513cf774d libs: enc: h264: set max profile idc with correct profile.
Use the highest rank of available profile as the max profile to
set max idc value.

https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/issues/124
2018-12-15 14:48:03 +08:00
Niels De Graef
e73e69a480 Use G_DEFINE_TYPE_WITH_PRIVATE if applicable
This gets rid of the strange `do_init` macro and makes the intent a bit
more clear.
2018-12-10 10:54:53 +01:00
Thibault Saunier
2b016fdde9 Automatic update of common submodule
From ed78bee to 59cb678
2018-12-05 17:24:53 -03:00
Wangfei
5e7988b2d8 libs: dec: h265: support decode for main-444 10bit streams.
Add 444 10bit yuv format Y410, which can be used to decode
main-444 10bit streams. Currently, this feature is only
supported by media-driver in Icelake.
2018-12-04 13:25:59 +08:00
Jordan Petridis
d8b3c0495f
Run gst-indent through the files
This is required before we enabled an indent test in the CI.

https://gitlab.freedesktop.org/gstreamer/gstreamer-project/issues/33
2018-11-28 05:56:44 +02:00
He Junyan
176bbce975 plugins: modify image check of extract_allowed_surface_formats.
The extract_allowed_surface_formats function just check whether
we can support some kind of surface/image format pair. We just
need to create a surface, create an image with the same video-format
and putImage from image to surface. All these operations success,
that kind of video-format is supported.
The old manner do not work for some kind of video-format. For example,
the RGBA kind of format will create a NV12 surface and RGBA image,
and the putImage will fail because the format is not same. And so
the RGBA format is not supported but actually it is supported.
2018-11-27 15:11:51 +00:00
Michael Olbrich
c1de41b841 vaapipostproc: add some missing locking
gst_vaapi_plugin_base_close() removed the raw caps that are used indirectly
in gst_vaapipostproc_transform_caps(). The usage is already protected by
the mutex.
This is needed when the pipeline is stopped during startup.
2018-11-27 07:13:20 +01:00
Xiang, Haihao
c728fb4ff6 Close dmabuf_fd
Otherwise it will result in resource leak when failed to create
dmabuf memory
2018-11-20 16:18:58 +08:00
Michael Olbrich
072f49cdcf vaapiencode: don't start src pad task in set_format
Otherwise the task may be restarted during shutdown. Start the task in
gst_vaapiencode_handle_frame() instead.
2018-11-14 12:55:49 +01:00
Wangfei
5d0878b48a libs: dec: h265: support decode for main-444 8bit streams.
Add 444 8bit yuv format AYUV, which can be used to decode
main-444 8bit streams. Currently, this feature is only
supported by media-driver in Icelake.

https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/issues/119
2018-11-14 02:29:54 +00:00
Víctor Manuel Jáquez Leal
b67fc3a518 Add Gitlab CI configuration
This commit adds a .gitlab-ci.yml file, which uses a feature
to fetch the config from a centralized repository. The intent is
to have all the gstreamer modules use the same configuration.

The configuration is currently hosted at the gst-ci repository
under the gitlab/ci_template.yml path.

Part of https://gitlab.freedesktop.org/gstreamer/gstreamer-project/issues/29
2018-11-12 17:43:54 +01:00
He Junyan
90d8350820 libs: Sync the GstVaapiChromaType to VA header file.
Add more kinds of chrometype which will be used to describe
new video formats. Sync it with 1.4.0 version header file.
Alse delete useless GST_VAAPI_CHROMA_TYPE_YUV410 chrome type.

Signed-off-by: He Junyan <junyan.he@hotmail.com>
2018-11-10 19:57:40 +01:00
Tim-Philipp Müller
de6883f6d0 meson: link with -lm
Fixes #117 hopefully.
2018-11-09 23:55:05 +00:00
Tim-Philipp Müller
3f87cc2fff meson: bump meson required to 0.47 for feature options 2018-11-09 23:46:53 +00:00
Junyan He
14c283f891 libs: Modify the video format of endianness.
We lack some video format because endianness declare.
The video format should not directly relate to endianness. For example,
ARGB on big endian should not be simplely seen as BGRA on little endian
machine. We should provide endianess convert or format convert help
functions if endianness does not match.

https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/issues/112

Signed-off-by: Junyan He <junyan.he@intel.com>
2018-11-07 13:29:15 +01:00
Junyan He
f25a80bf05 plugins: Fix build error when GL is enabled while EGL is disabled.
gl_platform_type in gst_vaapi_get_display_type_from_gl_env generate
unused-variable warning and may block build when Werror enabled.
Several functions like gst_vaapi_display_egl_new_with_native_display
have no prototype warning and link error when GL is enabled but EGL
is disabled. Fix all these warning and link error.

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

Signed-off-by: Junyan He <junyan.he@intel.com>
2018-11-05 14:28:01 +01:00
Wangfei
b26f3d989d libs: encoder: h264/h264fei: remove unuseless code.
The variable are set twice, remove previous one.

https://bugzilla.gnome.org/show_bug.cgi?id=797365
2018-11-05 14:11:27 +01:00
Wangfei
2cdcca7aba tests: check return value when using gst_buffer_map.
https://bugzilla.gnome.org/show_bug.cgi?id=797366
2018-11-05 14:06:47 +01:00
Víctor Manuel Jáquez Leal
254eb9507f build: meson: build examples 2018-11-05 13:46:17 +01:00
Víctor Manuel Jáquez Leal
5171a3d5b1 build: meson: declare headers for libgstvaapi
Thus handling its recompilation if needed.
2018-11-05 13:46:17 +01:00
Matthew Waters
f68f45f687 Update common submodule location
Remove the git directory
2018-11-05 05:41:13 +00:00
Haihao Xiang
d38d65f009 Clone the code from gitlab
This fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/issues/116
2018-11-05 13:00:28 +08:00
Wangfei
638004875b libs: dec: h265: support decode for main-10-422 10bit streams.
Add 422 10bit yuv format Y210, which can be used to decode
main-10-422 10bit streams. Currently, this feature is only
supported by media-driver in Icelake.

https://bugzilla.gnome.org/show_bug.cgi?id=797264
2018-11-01 14:03:23 +01:00
Wangfei
d8442e479e libs: context: roi_rc_qp_delta_support should not be checked when CQP.
VA_ROI_RC_QP_DELTA_SUPPORT return value will be ignored when the
rate control mode is set as CQP. In CQP mode, it shouldn't check
roi_rc_qp_delta_support return value from driver backend.

https://bugzilla.gnome.org/show_bug.cgi?id=797087
2018-10-16 13:23:41 +02:00
Víctor Manuel Jáquez Leal
ce96f2d1fa vaapipostproc: fix classification string
The classification string is splitted by '/' and then looks for the
components.

This patch removes the ';' by unifying all the components.
2018-10-15 17:55:24 +02:00
Philippe Normand
8914ace06a vaapipostproc: Add Hardware classifier to metadata 2018-10-15 16:06:31 +01:00
Wangfei
ecdfc623fd libs: context: create context first before using it to create surface.
In gst_vaapi_context_reset(), if the context has to be destroyed, make
sure to create it first before allocating its associated surfaces.

This patch fixes a regression introduced in commit 82872f4 because
the formats available in the current context now are ensured before
creating the context's surfaces.

https://bugzilla.gnome.org/show_bug.cgi?id=797277
2018-10-15 16:54:02 +02:00
Philippe Normand
70726aef00 gst: Advertise elements interacting with hardware devices 2018-10-12 15:39:53 +01:00
Wangfei
82872f4234 libs: context: query surface format before context to create surface.
Before using context to create surface, the supported surface format
should be checked first.

https://bugzilla.gnome.org/show_bug.cgi?id=797222
2018-10-10 20:13:01 +02:00
Víctor Manuel Jáquez Leal
bcd63f8021 libs: replace g_error with GST_ERROR
And handle those errors rather than halting.
2018-10-09 17:23:55 +02:00
Víctor Manuel Jáquez Leal
9132090182 libs: replace g_warning with GST_WARNING 2018-10-09 17:23:30 +02:00
Matteo Valdina
5567a3d2cd libs: Move from g_debug to GST_DEBUG.
https://bugzilla.gnome.org/show_bug.cgi?id=797202
2018-10-09 16:58:43 +02:00
Soon, Thean Siew
ee27377cb3 vaapipostproc: change the way of handling deinterlace
The current vaapipostproc calls driver's video processing
pipeline for deinterlacing only if it is Advance deinterlacing.
Modify in the way that it always tries with driver's video
processing pipeline for deinterlacing, and falls back to software
method of appending picture structure meta data only if it fails
with driver's method.

https://bugzilla.gnome.org/show_bug.cgi?id=797095
2018-10-09 16:19:52 +02:00
Matteo Valdina
b1b36a44a4 libs: h264: Update level table to "Recommendation H.264 (04/17)".
Added level 6, 6.1 and 6.2. Reference Table A-1 – Level limits
from T-REC-H.264-201704.

https://bugzilla.gnome.org/show_bug.cgi?id=797202
2018-09-27 12:29:10 +02:00
Wangfei
619abbdeb4 libs: dec: h265: add 422 chroma format support.
Add main-422-10 profile which support 422 chroma format stream.
Currently, this feature is only supported by media-driver in Icelake.

https://bugzilla.gnome.org/show_bug.cgi?id=797143
2018-09-27 11:55:04 +02:00
U. Artie Eoff
37a756fd91 tests: include sysdeps.h in compilation unit
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=797204

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2018-09-26 19:34:47 +02:00
Víctor Manuel Jáquez Leal
fbc5ed1651 tests: fix compilation
https://bugzilla.gnome.org/show_bug.cgi?id=797204
2018-09-26 18:28:02 +02:00
Víctor Manuel Jáquez Leal
00f5fe9ccf tests: don's use sysdeps.h in header 2018-09-25 20:36:06 +02:00
Víctor Manuel Jáquez Leal
cfbe7cbc44 libs: utils: no need of include config.h 2018-09-25 18:22:51 +02:00
Víctor Manuel Jáquez Leal
e1557fff78 tests: remove already include string.h
Since sysdeps.h includes string.h there's no need to include it again.
2018-09-25 18:22:45 +02: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
Víctor Manuel Jáquez Leal
0152410c97 libs: object: separation of internal API and plugins
Removed exposed macros GST_VAAPI_OBJECT_DISPLAY() and
GST_VAAPI_OBJECT_ID() to plugins, keeping them only for internal
library usage.

The purpose is readability.

https://bugzilla.gnome.org/show_bug.cgi?id=797139
2018-09-25 17:41:55 +02:00
Víctor Manuel Jáquez Leal
9970e15f67 libs: parser_frame: change macros for inlined functions
https://bugzilla.gnome.org/show_bug.cgi?id=797139
2018-09-25 17:41:55 +02:00
Víctor Manuel Jáquez Leal
0e16691b09 libs: videopool: remove unneeded code
The removed code comes frome the bad practice of copy&paste. Better
move it as internal function.

https://bugzilla.gnome.org/show_bug.cgi?id=797139
2018-09-25 17:41:55 +02:00
Víctor Manuel Jáquez Leal
4505acc522 libs: remove dependency on IN_LIBGSTVAAPI_CORE
This conditional code was when libgstvaapi was intended to be library
used outside GStreamer. This not the case anymore, thus removing it.

https://bugzilla.gnome.org/show_bug.cgi?id=797139
2018-09-25 17:41:55 +02:00