platform/upstream/gstreamer.git
5 years agovaapipostproc: add some missing locking
Michael Olbrich [Wed, 14 Nov 2018 10:34:20 +0000 (11:34 +0100)]
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.

5 years agoClose dmabuf_fd
Xiang, Haihao [Tue, 20 Nov 2018 08:07:44 +0000 (16:07 +0800)]
Close dmabuf_fd

Otherwise it will result in resource leak when failed to create
dmabuf memory

5 years agovaapiencode: don't start src pad task in set_format
Michael Olbrich [Mon, 12 Nov 2018 12:39:51 +0000 (13:39 +0100)]
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.

5 years agolibs: dec: h265: support decode for main-444 8bit streams.
Wangfei [Wed, 14 Nov 2018 05:52:48 +0000 (13:52 +0800)]
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

5 years agoAdd Gitlab CI configuration
Víctor Manuel Jáquez Leal [Mon, 12 Nov 2018 16:43:54 +0000 (17:43 +0100)]
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

5 years agolibs: Sync the GstVaapiChromaType to VA header file.
He Junyan [Fri, 9 Nov 2018 14:03:43 +0000 (22:03 +0800)]
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>
5 years agomeson: link with -lm
Tim-Philipp Müller [Fri, 9 Nov 2018 23:55:05 +0000 (23:55 +0000)]
meson: link with -lm

Fixes #117 hopefully.

5 years agomeson: bump meson required to 0.47 for feature options
Tim-Philipp Müller [Fri, 9 Nov 2018 23:46:53 +0000 (23:46 +0000)]
meson: bump meson required to 0.47 for feature options

5 years agolibs: Modify the video format of endianness.
Junyan He [Tue, 6 Nov 2018 06:38:08 +0000 (14:38 +0800)]
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>
5 years agoplugins: Fix build error when GL is enabled while EGL is disabled.
Junyan He [Wed, 17 Oct 2018 10:36:52 +0000 (18:36 +0800)]
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>
5 years agolibs: encoder: h264/h264fei: remove unuseless code.
Wangfei [Sat, 3 Nov 2018 07:06:09 +0000 (15:06 +0800)]
libs: encoder: h264/h264fei: remove unuseless code.

The variable are set twice, remove previous one.

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

5 years agotests: check return value when using gst_buffer_map.
Wangfei [Sat, 3 Nov 2018 07:28:35 +0000 (15:28 +0800)]
tests: check return value when using gst_buffer_map.

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

5 years agobuild: meson: build examples
Víctor Manuel Jáquez Leal [Fri, 2 Nov 2018 15:50:47 +0000 (16:50 +0100)]
build: meson: build examples

5 years agobuild: meson: declare headers for libgstvaapi
Víctor Manuel Jáquez Leal [Fri, 2 Nov 2018 15:50:00 +0000 (16:50 +0100)]
build: meson: declare headers for libgstvaapi

Thus handling its recompilation if needed.

5 years agoUpdate common submodule location
Matthew Waters [Mon, 5 Nov 2018 05:41:13 +0000 (05:41 +0000)]
Update common submodule location

Remove the git directory

5 years agoClone the code from gitlab
Haihao Xiang [Mon, 5 Nov 2018 05:00:28 +0000 (13:00 +0800)]
Clone the code from gitlab

This fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/issues/116

5 years agolibs: dec: h265: support decode for main-10-422 10bit streams.
Wangfei [Wed, 24 Oct 2018 18:18:37 +0000 (14:18 -0400)]
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

5 years agolibs: context: roi_rc_qp_delta_support should not be checked when CQP.
Wangfei [Sat, 13 Oct 2018 07:00:32 +0000 (15:00 +0800)]
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

5 years agovaapipostproc: fix classification string
Víctor Manuel Jáquez Leal [Mon, 15 Oct 2018 15:55:24 +0000 (17:55 +0200)]
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.

5 years agovaapipostproc: Add Hardware classifier to metadata
Philippe Normand [Mon, 15 Oct 2018 15:05:02 +0000 (16:05 +0100)]
vaapipostproc: Add Hardware classifier to metadata

5 years agolibs: context: create context first before using it to create surface.
Wangfei [Fri, 12 Oct 2018 08:37:34 +0000 (16:37 +0800)]
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

5 years agogst: Advertise elements interacting with hardware devices
Philippe Normand [Fri, 12 Oct 2018 14:39:53 +0000 (15:39 +0100)]
gst: Advertise elements interacting with hardware devices

5 years agolibs: context: query surface format before context to create surface.
Wangfei [Mon, 1 Oct 2018 01:26:05 +0000 (09:26 +0800)]
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

5 years agolibs: replace g_error with GST_ERROR
Víctor Manuel Jáquez Leal [Tue, 9 Oct 2018 15:23:55 +0000 (17:23 +0200)]
libs: replace g_error with GST_ERROR

And handle those errors rather than halting.

5 years agolibs: replace g_warning with GST_WARNING
Víctor Manuel Jáquez Leal [Tue, 9 Oct 2018 15:23:30 +0000 (17:23 +0200)]
libs: replace g_warning with GST_WARNING

5 years agolibs: Move from g_debug to GST_DEBUG.
Matteo Valdina [Wed, 26 Sep 2018 19:55:32 +0000 (14:55 -0500)]
libs: Move from g_debug to GST_DEBUG.

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

5 years agovaapipostproc: change the way of handling deinterlace
Soon, Thean Siew [Wed, 3 Oct 2018 18:20:10 +0000 (02:20 +0800)]
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

5 years agolibs: h264: Update level table to "Recommendation H.264 (04/17)".
Matteo Valdina [Mon, 24 Sep 2018 21:54:29 +0000 (16:54 -0500)]
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

5 years agolibs: dec: h265: add 422 chroma format support.
Wangfei [Thu, 20 Sep 2018 01:57:33 +0000 (09:57 +0800)]
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

5 years agotests: include sysdeps.h in compilation unit
U. Artie Eoff [Wed, 26 Sep 2018 17:34:06 +0000 (19:34 +0200)]
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>
5 years agotests: fix compilation
Víctor Manuel Jáquez Leal [Wed, 26 Sep 2018 16:04:53 +0000 (18:04 +0200)]
tests: fix compilation

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

5 years agotests: don's use sysdeps.h in header
Víctor Manuel Jáquez Leal [Tue, 25 Sep 2018 18:28:02 +0000 (20:28 +0200)]
tests: don's use sysdeps.h in header

5 years agolibs: utils: no need of include config.h
Víctor Manuel Jáquez Leal [Fri, 14 Sep 2018 17:30:56 +0000 (19:30 +0200)]
libs: utils: no need of include config.h

5 years agotests: remove already include string.h
Víctor Manuel Jáquez Leal [Thu, 13 Sep 2018 16:12:02 +0000 (18:12 +0200)]
tests: remove already include string.h

Since sysdeps.h includes string.h there's no need to include it again.

5 years agolibs: remove already include string.h
Víctor Manuel Jáquez Leal [Thu, 13 Sep 2018 16:11:25 +0000 (18:11 +0200)]
libs: remove already include string.h

Since sysdeps.h includes string.h there's no need to include it again.

5 years agolibs: object: separation of internal API and plugins
Víctor Manuel Jáquez Leal [Thu, 13 Sep 2018 16:26:27 +0000 (18:26 +0200)]
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

5 years agolibs: parser_frame: change macros for inlined functions
Víctor Manuel Jáquez Leal [Thu, 13 Sep 2018 14:34:54 +0000 (16:34 +0200)]
libs: parser_frame: change macros for inlined functions

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

5 years agolibs: videopool: remove unneeded code
Víctor Manuel Jáquez Leal [Thu, 13 Sep 2018 14:10:13 +0000 (16:10 +0200)]
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

5 years agolibs: remove dependency on IN_LIBGSTVAAPI_CORE
Víctor Manuel Jáquez Leal [Thu, 13 Sep 2018 10:22:42 +0000 (12:22 +0200)]
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

5 years agolibs: dec: h265: fix the macros used for IDC profile
Wangfei [Wed, 19 Sep 2018 02:16:36 +0000 (10:16 +0800)]
libs: dec: h265: fix the macros used for IDC profile

profile_idc flag in SPS only indicate the IDC profile, which may
need some other flags together to get the real profile.

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

5 years agolibs: use g_clear_pointer() when possible
Jimmy Ohn [Wed, 12 Sep 2018 10:06:22 +0000 (19:06 +0900)]
libs: use g_clear_pointer() when possible

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

5 years agolibs: filter: add gobject's cleanup function
Víctor Manuel Jáquez Leal [Mon, 3 Sep 2018 11:56:52 +0000 (13:56 +0200)]
libs: filter: add gobject's cleanup function

5 years agolibs: filter: remove custom ref() and unref()
Víctor Manuel Jáquez Leal [Tue, 22 May 2018 12:28:40 +0000 (14:28 +0200)]
libs: filter: remove custom ref() and unref()

Replacing them by gst_object_ref() and gst_object_unref()

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

5 years agolibs: filter: refactor filter as gobject
Víctor Manuel Jáquez Leal [Tue, 22 May 2018 12:26:48 +0000 (14:26 +0200)]
libs: filter: refactor filter as gobject

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

5 years agolibs: decoder: remove destoy() and create() callbacks
Víctor Manuel Jáquez Leal [Mon, 21 May 2018 11:38:00 +0000 (13:38 +0200)]
libs: decoder: remove destoy() and create() callbacks

They were all replaced by reset()

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

5 years agolibs: decoder: vp9: implement reset() callback
Víctor Manuel Jáquez Leal [Mon, 21 May 2018 11:26:01 +0000 (13:26 +0200)]
libs: decoder: vp9: implement reset() callback

remove destroy() and create() callback

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

5 years agolibs: decoder: vp8: implement reset() callback
Víctor Manuel Jáquez Leal [Mon, 21 May 2018 11:25:37 +0000 (13:25 +0200)]
libs: decoder: vp8: implement reset() callback

remove create() and destroy() callbacks

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

5 years agolibs: decoder: vc1: implement reset() callback
Víctor Manuel Jáquez Leal [Mon, 21 May 2018 11:24:39 +0000 (13:24 +0200)]
libs: decoder: vc1: implement reset() callback

remove destroy() and create() callbacks

use g_clear_pointer for rbdu_buffer

no cast for enum

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

5 years agolibs: decoder: mpeg4: implement reset() callback
Víctor Manuel Jáquez Leal [Mon, 21 May 2018 11:24:13 +0000 (13:24 +0200)]
libs: decoder: mpeg4: implement reset() callback

remove destroy() and create() callback

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

5 years agolibs: decoder: mpeg2: implement reset() callback
Víctor Manuel Jáquez Leal [Mon, 21 May 2018 11:22:45 +0000 (13:22 +0200)]
libs: decoder: mpeg2: implement reset() callback

remove create() and destroy() callbacks

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

5 years agolibs: decoder: jpeg: implement reset() callback
Víctor Manuel Jáquez Leal [Mon, 21 May 2018 11:22:07 +0000 (13:22 +0200)]
libs: decoder: jpeg: implement reset() callback

and remove create() and destroy() callbacks.

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

5 years agolibs: decoder: h265: implement reset() callback
Víctor Manuel Jáquez Leal [Mon, 21 May 2018 11:13:31 +0000 (13:13 +0200)]
libs: decoder: h265: implement reset() callback

and remove create() and destroy()
and use g_clear_pointer for dpb structure

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

5 years agolibs: decoder: h264: remove create() and destroy() callbacks
Víctor Manuel Jáquez Leal [Mon, 21 May 2018 11:11:41 +0000 (13:11 +0200)]
libs: decoder: h264: remove create() and destroy() callbacks

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

5 years agolibs: decoder: remove gst_vaapi_decoder_unref()
Víctor Manuel Jáquez Leal [Mon, 21 May 2018 09:56:11 +0000 (11:56 +0200)]
libs: decoder: remove gst_vaapi_decoder_unref()

Replaced by gst_object_unref() in tests

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

5 years agolibs: decoder: remove gst_vaapi_decoder_ref()
Víctor Manuel Jáquez Leal [Mon, 21 May 2018 09:51:14 +0000 (11:51 +0200)]
libs: decoder: remove gst_vaapi_decoder_ref()

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

5 years agolibs: decoder: remove gst_vaapi_decoder_new()
Víctor Manuel Jáquez Leal [Mon, 21 May 2018 09:50:17 +0000 (11:50 +0200)]
libs: decoder: remove gst_vaapi_decoder_new()

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

5 years agolibs: decoder: refactor decoders as gobject
Víctor Manuel Jáquez Leal [Fri, 18 May 2018 14:09:31 +0000 (16:09 +0200)]
libs: decoder: refactor decoders as gobject

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

5 years agovaapidecode: Requests upstream a key unit at parse or decode error.
Matteo Valdina [Sat, 1 Sep 2018 01:56:13 +0000 (20:56 -0500)]
vaapidecode: Requests upstream a key unit at parse or decode error.

This is done to resume decoding after a parse error or decode error.

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

5 years agovaapidecode: sets return value in failure case.
Matteo Valdina [Sat, 1 Sep 2018 01:48:13 +0000 (20:48 -0500)]
vaapidecode: sets return value in failure case.

In gst_vaapidecode_handle_frame, when there is a decode error
there is a code path the returns an uninitialized value.

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

5 years agolibs: display: lock at extracting available image formates
Víctor Manuel Jáquez Leal [Thu, 30 Aug 2018 16:56:40 +0000 (18:56 +0200)]
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

5 years agomeson: Sync libversion and osxversion code from other repos
Nirbheek Chauhan [Fri, 31 Aug 2018 09:17:55 +0000 (14:47 +0530)]
meson: Sync libversion and osxversion code from other repos

gstreamer-vaapi does not build any libraries, only plugins, so this is
not used, but sync it just in case someone does add it in the future.

5 years agolibs: encoder: h265: trivial documentation fix
Víctor Manuel Jáquez Leal [Wed, 29 Aug 2018 11:44:44 +0000 (13:44 +0200)]
libs: encoder: h265: trivial documentation fix

5 years agolibs: encoder: h265: add low delay B frame support.
Wangfei [Thu, 30 Aug 2018 03:08:07 +0000 (11:08 +0800)]
libs: encoder: h265: add low delay B frame support.

Low delay B frame provide the function of transforming
P frame into low delay B frame which frame type is B, but
only reference predictive frames. This can be used when P
frame unsupported. Especially for P and B both unsupported,
in this case, I and low delay B frame can be encoded in a
stream.

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

5 years agolibs: decoder: h264: Avoid using picture after it has been free
Nicolas Dufresne [Tue, 28 Aug 2018 00:42:15 +0000 (20:42 -0400)]
libs: decoder: h264: Avoid using picture after it has been free

In some cases, the found_picture ended up being evicted and freed, which
would lead to a use after free when accessing picture->base.poc. In this
fix, we take a ref on the picture before calling dpb_evict.

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

5 years agoh264decoder: Fail decoding slice with missing inter-view reference
Nicolas Dufresne [Wed, 25 Jul 2018 21:03:19 +0000 (17:03 -0400)]
h264decoder: Fail decoding slice with missing inter-view reference

Similarly to previous patch, we have no error concealment. As a side
effect, it's better to skip slices with missing references then passing
NULL pointers to the accelerator. Passing NULL pointer would lead to
major visual artifact, a behaviour that is likely undefined.

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

5 years agolibs: decoder: h264: reset context when the number of view is increased
Hyunjun Ko [Thu, 14 Sep 2017 05:25:41 +0000 (14:25 +0900)]
libs: decoder: h264: reset context when the number of view is increased

Usually in case of MVC decoding, dpb size is increasedi if subset sps.
That's why it resets context without this patch.
But for some media it doesn't increase dpb size. Even in this case we
should reset context to deal with MVC decoding.
Otherwise, it leads to assert.

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

5 years agovaapidecode: Skip unparsable units from adapter
Nicolas Dufresne [Wed, 25 Jul 2018 17:50:23 +0000 (13:50 -0400)]
vaapidecode: Skip unparsable units from adapter

If the unit could not be parsed, just skip this nal and keep parsing
what is left in the adapter. We need to flush the broken unit in the
decoder specific parser because the generic code does not know about
units boundary. This increases error resilliance.

Before this, the broken unit would stay in the adapter and EOS would be
returned. Which stopped the streaming. Just removing the EOS would have
lead to the adapter size growing indefinitely.

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

5 years agovaapidecoder: Don't error out on decode errors
Nicolas Dufresne [Tue, 24 Jul 2018 16:40:00 +0000 (12:40 -0400)]
vaapidecoder: Don't error out on decode errors

This is problematic on live pipeline where loosing network can
cause an important amount of errors.

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

5 years agoh265decoder: Don't scan empty buffer
Nicolas Dufresne [Wed, 25 Jul 2018 19:47:49 +0000 (15:47 -0400)]
h265decoder: Don't scan empty buffer

Same as what we did for H264 decoder, this is to avoid an assertion
in the adapter.

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

5 years agolibs: h264: renable the vaapi category for logging
Víctor Manuel Jáquez Leal [Wed, 25 Jul 2018 18:21:51 +0000 (20:21 +0200)]
libs: h264: renable the vaapi category for logging

h264 log messages were logged in default category because a regression
in code. This patch renable the usage of vaapi logging category.

This regression was introduced in commit 7c365bdd.

6 years agoh264decoder: Fail decoding slice if modification process failed
Nicolas Dufresne [Wed, 18 Jul 2018 17:09:42 +0000 (13:09 -0400)]
h264decoder: Fail decoding slice if modification process failed

This patch chains up failure to executing the modification process. The
end result is that we now fail decoding the slice if this process fails.
This avoid sending a corrupted state to the accelerator. In some special
cases, this could lead to unrecoverable errors.

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

6 years agoh264decoder: Don't scan empty buffer
Nicolas Dufresne [Wed, 18 Jul 2018 17:07:51 +0000 (13:07 -0400)]
h264decoder: Don't scan empty buffer

gst_adapter_masked_scan_uint32_peek() asserts if size is 0. Don't
try and scan in that case. This fixes assertion that would some times
happen when the stream is corrupted.

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

6 years agolibs: encoder: jpeg: set component id and Tqi
Tianhao Liu [Wed, 4 Jul 2018 04:51:10 +0000 (12:51 +0800)]
libs: encoder: jpeg: set component id and Tqi

This change is due a problem encoding JPEGs with Intel's
media-driver: green/black image when playback jpeg

This patch sets component identifier and quantization table
destination selector in frame header to support packing headers
by Intel's media-driver that does not accept packed header
in AP level.

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

6 years agopluginutil: downgrade unsupported driver logging
Mathieu Duponchelle [Mon, 25 Jun 2018 12:20:32 +0000 (14:20 +0200)]
pluginutil: downgrade unsupported driver logging

On systems with an Nvidia card, this error is output each time
the registry is rebuilt, which happens pretty often when
using gst-build as a development environment.

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

6 years agoUpdate for g_type_class_add_private() deprecation in recent GLib
Tim-Philipp Müller [Sun, 24 Jun 2018 11:07:20 +0000 (13:07 +0200)]
Update for g_type_class_add_private() deprecation in recent GLib

6 years agoh264dec: Remove false assumption about parity order
Nicolas Dufresne [Wed, 30 May 2018 20:01:36 +0000 (16:01 -0400)]
h264dec: Remove false assumption about parity order

The decoder was trying to detect earlier that a field was lost base
on guessing the parity order. This breaks in streams were the parity
order changes.

This patch reverts the field order prediction code added by commit
8dd93e9c8.

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

6 years agoh264dec: Properly set sentinel in ref frame list
Nicolas Dufresne [Fri, 18 May 2018 21:03:57 +0000 (17:03 -0400)]
h264dec: Properly set sentinel in ref frame list

This ensure that we always have sentinels set in the reference
pictures arrays. The code wasn't unsafe, this simply improve the
tracing, so instead of printing 32 lines of zeros, va tracer
prints proper empty lists.

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

6 years agolibs: display: remove gst_vaapi_display_ref()
Víctor Manuel Jáquez Leal [Wed, 13 Jun 2018 16:00:18 +0000 (18:00 +0200)]
libs: display: remove gst_vaapi_display_ref()

Replace it with gst_object_ref()

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

6 years agolibs: display: remove gst_vaapi_display_unref()
Víctor Manuel Jáquez Leal [Wed, 13 Jun 2018 15:54:23 +0000 (17:54 +0200)]
libs: display: remove gst_vaapi_display_unref()

Use gst_object_unref() instead.

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

6 years agovaapibufferpool: declare parameter display as object
Víctor Manuel Jáquez Leal [Wed, 13 Jun 2018 16:10:28 +0000 (18:10 +0200)]
vaapibufferpool: declare parameter display as object

We have neglected to update this code since GstVaapiDisplay turned
into a GstObject descendant.

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

6 years agolibs: display: replace gst_vaapi_display_new() with gst_vaapi_display_config()
Hyunjun Ko [Fri, 1 Jun 2018 03:36:51 +0000 (12:36 +0900)]
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

6 years agolibs: display: redefine gst_vaapi_display_create()
Víctor Manuel Jáquez Leal [Wed, 13 Jun 2018 15:05:40 +0000 (17:05 +0200)]
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

6 years agoRevert "build: meson: libva gst-uninstall friendly"
Víctor Manuel Jáquez Leal [Tue, 12 Jun 2018 13:53:04 +0000 (15:53 +0200)]
Revert "build: meson: libva gst-uninstall friendly"

This reverts commit fc3eef9c432c1628cb92ab56e74924cf1182da30.

6 years agoplugins: fix compilation
Víctor Manuel Jáquez Leal [Tue, 12 Jun 2018 13:13:33 +0000 (15:13 +0200)]
plugins: fix compilation

gstvaapipluginutil.c:171:1: error: old-style function definition [-Werror=old-style-definition]

6 years agobuild: meson: libva gst-uninstall friendly
Víctor Manuel Jáquez Leal [Fri, 20 Apr 2018 16:05:30 +0000 (18:05 +0200)]
build: meson: libva gst-uninstall friendly

Make gstreamer-vaapi to use libva uninstalled.

6 years agoplugins: refactor gst_vaapi_create_display_from_gl_context()
Víctor Manuel Jáquez Leal [Sun, 10 Jun 2018 08:44:35 +0000 (10:44 +0200)]
plugins: refactor gst_vaapi_create_display_from_gl_context()

gst_vaapi_create_display_from_gl_context() was a spaghetti mess.

This path refactors it, in order to make the code readable and
easy to follow.

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

6 years agolibs: display: resurrect parent private member
Víctor Manuel Jáquez Leal [Fri, 25 May 2018 10:17:21 +0000 (12:17 +0200)]
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

6 years agolibs: display: egl: initialize params structure
Víctor Manuel Jáquez Leal [Fri, 27 Apr 2018 16:35:30 +0000 (18:35 +0200)]
libs: display: egl: initialize params structure

Statically initialise the internal params structure.

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

6 years agoplugins: handle EGL when creating VAAPI display from gl
Víctor Manuel Jáquez Leal [Fri, 27 Apr 2018 16:34:37 +0000 (18:34 +0200)]
plugins: handle EGL when creating VAAPI display from gl

If GstGL reports a EGL platform force to create a EGL display using
the native EGL display.

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

6 years agodisplay: egl: create VaapiDisplayEGL with native EGL display
Hyunjun Ko [Tue, 24 Apr 2018 09:17:24 +0000 (18:17 +0900)]
display: egl: create VaapiDisplayEGL with native EGL display

gst_vaapi_display_egl_new_with_native_display() has been broken since
it wasn't used.

Currently it's needed to call this API to create a display providing
the EGL display, so it could avoid duplicated calls to the native
display (eg. eglTerminate).

Signed-off-by: Victor Jaquez <vjaquez@igalia.com>
https://bugzilla.gnome.org/show_bug.cgi?id=795391

6 years agolibs: decoder: release VA buffers after vaEndPicture
Tianhao Liu [Thu, 7 Jun 2018 01:34:11 +0000 (09:34 +0800)]
libs: decoder: release VA buffers after vaEndPicture

This change is due a problem decoding JPEGs with Intel's media-driver:
no image was generated.

This patch relases the VA buffers after vaEndPicture() is called,
and not before (after vaRenderPicture()).

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

6 years agomeson: fix build when xrender or xrandr are not available
Tim-Philipp Müller [Thu, 7 Jun 2018 18:49:02 +0000 (19:49 +0100)]
meson: fix build when xrender or xrandr are not available

HAVE_XRENDER are defined to 1 or 0, not defined or undefined.

6 years agovaapipostproc: don't copy the GstParentBufferMeta if use_vpp
Michael Olbrich [Fri, 25 May 2018 14:47:00 +0000 (16:47 +0200)]
vaapipostproc: don't copy the GstParentBufferMeta if use_vpp

Otherwise a reference to a DMABuf input buffer is kept until the output
buffer is deleted.

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

6 years agolibs: display: remove unnecessary legacy code since gobjectification
Hyunjun Ko [Tue, 22 May 2018 12:13:08 +0000 (21:13 +0900)]
libs: display: remove unnecessary legacy code since gobjectification

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

6 years agolibs: display: remove unused code
Hyunjun Ko [Tue, 22 May 2018 12:05:54 +0000 (21:05 +0900)]
libs: display: remove unused code

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

6 years agovaapiencode: h264: log output caps
Víctor Manuel Jáquez Leal [Tue, 5 Jun 2018 13:16:53 +0000 (15:16 +0200)]
vaapiencode: h264: log output caps

6 years agovaapiencode: h264: find profile in available and allowed caps
Víctor Manuel Jáquez Leal [Tue, 5 Jun 2018 20:38:37 +0000 (22:38 +0200)]
vaapiencode: h264: find profile in available and allowed caps

The commit 67e33d3de225d0e006d7bf606e7abb20d4544eab ("vaapiencode: h264:
find best profile in those available") changed the code to pick a profile
that is actually supported by the hardware. Unfortunately it dropped the
downstream constraints. This can cause negotiation failures under certain
circumstances.

The fix is split in two cases:

1\ the available VA-API caps doesn't intersect with pipeline's allowed
caps:
 * The best allowed profile (pipeline's caps) is set as the encoding
   target profile (it will be adjusted later by the available profiles
   and properties)

2\ the available VA-API caps does intersect with pipeline's allowed
caps:
 * The intersected caps are fixed, and its profile is set as the
   encoding target profile. In this case the is not the best profile,
   but the minimal one (if VA-API reports the profiles in order).
   Setting the minimal profile of the intersected caps is better for
   compatibility.

This patch fixes other tests related with caps negotiation, for
example, it handles baseline profile, even when VA only supports
constrained-baseline.

Original-patch-by: Michael Olbrich <m.olbrich@pengutronix.de>
https://bugzilla.gnome.org/show_bug.cgi?id=794306

6 years agolibs: encoder: h265: increase log2_max_pic_order_cnt range according to spec
Hyunjun Ko [Fri, 1 Jun 2018 06:27:25 +0000 (15:27 +0900)]
libs: encoder: h265: increase log2_max_pic_order_cnt range according to spec

The specification says,
"log2_max_pic_order_cnt_lsb_minus4 shall be in the range of 0 to 12, inclusive."

This patch changes the upper limit from 6 to 12.

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

6 years agoplugins: guard GstGL code
Víctor Manuel Jáquez Leal [Mon, 21 May 2018 11:27:14 +0000 (13:27 +0200)]
plugins: guard GstGL code

6 years agolibs: decoder: h264: use g_clear_pointer()
Víctor Manuel Jáquez Leal [Fri, 18 May 2018 16:23:18 +0000 (18:23 +0200)]
libs: decoder: h264: use g_clear_pointer()