platform/upstream/gstreamer.git
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

6 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

6 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

6 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

6 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

6 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

6 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()

6 years agolibs: decoder: mpeg4, vc1: remove unused header
Víctor Manuel Jáquez Leal [Fri, 18 May 2018 15:27:46 +0000 (17:27 +0200)]
libs: decoder: mpeg4, vc1: remove unused header

6 years agolibs: decoder: remove unused forward declaration
Víctor Manuel Jáquez Leal [Fri, 18 May 2018 09:09:58 +0000 (11:09 +0200)]
libs: decoder: remove unused forward declaration

6 years agofix configure.ac regression
U. Artie Eoff [Mon, 7 May 2018 14:59:25 +0000 (07:59 -0700)]
fix configure.ac regression

Fixes regression introduced by 77527d67abe

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

6 years agolibs: remove gstbitwriter
Víctor Manuel Jáquez Leal [Sat, 5 May 2018 15:57:49 +0000 (17:57 +0200)]
libs: remove gstbitwriter

Since it is deployed in gstreamer-core, there is no need to use
our custom version.

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

6 years agovaapih264dec: add constrained and progressive profiles
Wang,Fei [Sat, 28 Apr 2018 08:10:46 +0000 (16:10 +0800)]
vaapih264dec: add constrained and progressive profiles

Those profiles have been added in the version 2012-01
and 2011-06 of the AVC spec (A.2.4.1 and A.2.4.2).

Both are supported by VAProfileH264High

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

6 years agoplugin: remove custom GstGL context handling
Víctor Manuel Jáquez Leal [Thu, 26 Apr 2018 16:15:47 +0000 (18:15 +0200)]
plugin: remove custom GstGL context handling

Instead of using our own context handling for looking for GstGL
parameters (display, context and other context), this patch changes
the logic to use the utility function offered by GstGL.

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

6 years agoplugins: GstGL API must use the member variables
Víctor Manuel Jáquez Leal [Thu, 26 Apr 2018 13:03:23 +0000 (15:03 +0200)]
plugins: GstGL API must use the member variables

This commit basically is a revert of commits 8092537 and fc1c415

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

6 years agoplugins: pass members as parameters of gst_gl_ensure_element_data()
Hyunjun Ko [Wed, 25 Apr 2018 07:24:32 +0000 (16:24 +0900)]
plugins: pass members as parameters of gst_gl_ensure_element_data()

The parameters of gst_gl_ensure_element_data() have to be not
local variable since they are going to be used to see if they're
set in gst_element_set_context() inside the API.

This is basically a revert of commit 3d56306c

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

6 years agomeson: fix USE_GLES_VERSION_MASK
Víctor Manuel Jáquez Leal [Wed, 25 Apr 2018 15:50:14 +0000 (17:50 +0200)]
meson: fix USE_GLES_VERSION_MASK

1. The macro in the code is USE_GLES_VERSION_MASK
2. glesv3 is provided by glesv2 pkg-config, then it's required to
   check headers

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

6 years agolibs: egl: utils: mark context as wrapped when it is
Hyunjun Ko [Tue, 24 Apr 2018 09:12:44 +0000 (18:12 +0900)]
libs: egl: utils: mark context as wrapped when it is

The returning egl context may be null, so we should check the
return value.

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

6 years agolibs: egl: utils: fix usage of GstGL macros
Víctor Manuel Jáquez Leal [Tue, 24 Apr 2018 08:02:33 +0000 (10:02 +0200)]
libs: egl: utils: fix usage of GstGL macros

Include gl.h for the required GstGL symbols.

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

6 years agomeson: use -Wl,-Bsymbolic-functions where supported
Tim-Philipp Müller [Wed, 25 Apr 2018 10:01:45 +0000 (11:01 +0100)]
meson: use -Wl,-Bsymbolic-functions where supported

Just like the autotools build.

6 years agomeson: use get_pkgconfig_variable()
Víctor Manuel Jáquez Leal [Fri, 20 Apr 2018 14:01:29 +0000 (16:01 +0200)]
meson: use get_pkgconfig_variable()

Use get_pkgconfig_variable() method, of dependency class, rather
than using run_command().

6 years agomeson: fix miscellaneous meson warnings
Tim-Philipp Müller [Fri, 20 Apr 2018 10:50:55 +0000 (11:50 +0100)]
meson: fix miscellaneous meson warnings

WARNING: Passed invalid keyword argument "rqeuired".
gst-libs/gst/base/meson.build:11: WARNING: Passed invalid keyword argument "version".
gst-libs/gst/base/meson.build:11: WARNING: Passed invalid keyword argument "soversion".
gst-libs/gst/vaapi/meson.build:223: WARNING: Passed invalid keyword argument "version".
gst-libs/gst/vaapi/meson.build:223: WARNING: Passed invalid keyword argument "soversion".

6 years agodisplay: drm: Allow finding DRM paths out of the PCI subsystem
Paul Kocialkowski [Fri, 30 Mar 2018 11:41:39 +0000 (13:41 +0200)]
display: drm: Allow finding DRM paths out of the PCI subsystem

This removes hard-coded checks on the parent subsystem of potential DRM
devices. These checks were set to exlude devices that do not originate
from the PCI bus, which is only a valid approach on x86 devices.

Other devices may have a DRM device originating from the platform
subsystem, so the checks that were previously restricted to PCI are
extended to cover platform devices as well.

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

Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
6 years agovideocontext: support wl-display in "gst.vaapi.app.Display"
Hyunjun Ko [Wed, 8 Nov 2017 04:27:06 +0000 (13:27 +0900)]
videocontext: support wl-display in "gst.vaapi.app.Display"

Through "gst.vaapi.app.Display" context, users can set their own
VADisplay and native display of their backend.

So far we support only X11 display, from now we also support Wayland
display.

Attributes:
- wl-display : pointer of struct wl_display .

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

6 years agolibs: display: wayland: add gst_vaapi_display_wayland_new_with_va_display()
Hyunjun Ko [Wed, 8 Nov 2017 04:26:38 +0000 (13:26 +0900)]
libs: display: wayland: add gst_vaapi_display_wayland_new_with_va_display()

Implements new API function so that users could create GstVaapiDisplay
with their own VADisplay within a native display as backend.

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

6 years agowayland: don't poll if there are no pending frames
Michael Olbrich [Fri, 13 Apr 2018 07:28:53 +0000 (09:28 +0200)]
wayland: don't poll if there are no pending frames

Otherwise the following poll may not return for an arbitrary amount of
time. This can happen if another wayland event queue has flushed and read
our events.

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

6 years agolibs: encoder: h265: 16 bit rounding of picture width and height
Hyunjun Ko [Mon, 16 Oct 2017 03:09:08 +0000 (12:09 +0900)]
libs: encoder: h265: 16 bit rounding of picture width and height

pic_width_in_luma_samples/pic_height_in_luma_samples can be 16-bit rounded
instead of 32-bit.

In addition, codedbuf_size must be calculated according to this change.

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

6 years agoAutomatic update of common submodule
Tim-Philipp Müller [Mon, 16 Apr 2018 09:53:47 +0000 (10:53 +0100)]
Automatic update of common submodule

From 3fa2c9e to ed78bee

6 years agovaapiencode: h264: find best profile in those available
Víctor Manuel Jáquez Leal [Fri, 30 Mar 2018 18:39:18 +0000 (20:39 +0200)]
vaapiencode: h264: find best profile in those available

Instead to look for the best profile in the allowed profiles by
downstream, the encoder should look for the base profile in the
available profile in VA-API.

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

6 years agoBack to development
Tim-Philipp Müller [Tue, 20 Mar 2018 10:49:10 +0000 (10:49 +0000)]
Back to development

6 years agoRelease 1.14.0
Tim-Philipp Müller [Mon, 19 Mar 2018 20:30:28 +0000 (20:30 +0000)]
Release 1.14.0

6 years agolibs: decoder: h264: ensure num_ref_frames is greater than 0
Julien Isorce [Mon, 12 Mar 2018 16:59:01 +0000 (16:59 +0000)]
libs: decoder: h264: ensure num_ref_frames is greater than 0

Even if it is the h264parse fault or bad video file, vaapih264dec
should set a proper value for VAPictureParameterBufferH264.num_ref_frames
as the driver might use it.

Also see "info.ref_frames = dpb_size;" in
gstvaapidecoder_h264.c::ensure_context

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

6 years agoRelease 1.13.91
Tim-Philipp Müller [Tue, 13 Mar 2018 19:32:05 +0000 (19:32 +0000)]
Release 1.13.91

6 years agoRelease 1.13.90
Tim-Philipp Müller [Sat, 3 Mar 2018 22:59:30 +0000 (22:59 +0000)]
Release 1.13.90

6 years agovaapipostproc: change how the metadata is copied
Víctor Manuel Jáquez Leal [Thu, 1 Mar 2018 13:33:27 +0000 (07:33 -0600)]
vaapipostproc: change how the metadata is copied

Instead of copying the metada in prepare_output_buffer() vmethod,
it is done in append_output_buffer_metadata() thus deinterlaced
buffers could also have the proper metas.

GstVideoCropMeta now it is copied internally and it is decided via
transform_meta() vmethod.

A new internal method, copy_metadata() was added to handle VPP
transformation where non-GstVideoVaapiMeta metas were lost.

6 years agopostproc: Copy meta data from input to output
Nicolas Dufresne [Tue, 27 Feb 2018 21:20:15 +0000 (16:20 -0500)]
postproc: Copy meta data from input to output

This will ensure that meta data without memory tags will be copied. This
was noticed when testing ROI.

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

6 years agotests: element: rewrite ROI test
Víctor Manuel Jáquez Leal [Fri, 23 Feb 2018 16:48:36 +0000 (10:48 -0600)]
tests: element: rewrite ROI test

Rewrote the ROI test to use GstVideoRegionOfInterest meta rather
than injecting GstEvents. These meta are added as a pad probe in
the queue src pad.

Also

* Use of navigation messages to control de test
* Use signal watch for processing messages
* Change to H265 rather than H264 since current intel-vaapi-driver
  only supports ROI on kabylake.
  TODO: add a parameter to change the encoder/decoder to test.

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

6 years agolibs: encoder: reimplement ROI using meta
Víctor Manuel Jáquez Leal [Thu, 22 Feb 2018 20:20:42 +0000 (14:20 -0600)]
libs: encoder: reimplement ROI using meta

Check input buffers for ROI metas and pass them to VA. Also added a
new "default-roi-delta-qp" property in order to tell the encoder what
delta QP should be applied to ROI by default.

Enabled it for H264 and H265 encoders.

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

6 years agoRevert "libs: encoder: add api gst_vaapi_encoder_add/del_roi"
Víctor Manuel Jáquez Leal [Thu, 22 Feb 2018 14:22:35 +0000 (08:22 -0600)]
Revert "libs: encoder: add api gst_vaapi_encoder_add/del_roi"

This reverts commit 7a6f690340dcb3b82c59efa777d4453227851de8.

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

6 years agoRevert "tests: simple-encoder: add an option to set ROI"
Víctor Manuel Jáquez Leal [Thu, 22 Feb 2018 20:29:19 +0000 (14:29 -0600)]
Revert "tests: simple-encoder: add an option to set ROI"

This reverts commit c21345c4787bb6342adddea1190f53fe62abff04.

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

6 years agoRevert "vaapiencode: handle custom event GstVaapiEncoderRegionOfInterest"
Víctor Manuel Jáquez Leal [Wed, 21 Feb 2018 16:56:47 +0000 (10:56 -0600)]
Revert "vaapiencode: handle custom event GstVaapiEncoderRegionOfInterest"

This reverts commit 8f1b88dac0e64a211325cdcb2cda693b80229bd1.

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

6 years agoplugins: copy input buffer metas
Víctor Manuel Jáquez Leal [Fri, 23 Feb 2018 15:25:51 +0000 (09:25 -0600)]
plugins: copy input buffer metas

When importing buffers to a VA-base buffer, it is required to copy
the metas in the original buffer, otherwise information will be
lost, such as GstVideoRegionOfInterestMeta.

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

6 years agolibs: surface: cast to uintptr_t pointer
Víctor Manuel Jáquez Leal [Tue, 27 Feb 2018 12:10:09 +0000 (06:10 -0600)]
libs: surface: cast to uintptr_t pointer

According to Debian package auto-building, uintptr_t is not an
unsigned long in i386 arch, raising an "incompatible pointer type"
error.

This patch adds a casting for compiler's satisfaction in i386.

6 years agolibs: encoder: add zero as valid value for periodic keyframe.
Matteo Valdina [Mon, 26 Feb 2018 02:46:56 +0000 (20:46 -0600)]
libs: encoder: add zero as valid value for periodic keyframe.

Enabled zero as valid value for keyframe-period property.

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

6 years agolibs: encoder: code-style fix
Víctor Manuel Jáquez Leal [Thu, 22 Feb 2018 14:24:12 +0000 (08:24 -0600)]
libs: encoder: code-style fix

6 years agovaapidecode: generate system allocated buffers
Víctor Manuel Jáquez Leal [Sat, 17 Feb 2018 17:32:11 +0000 (18:32 +0100)]
vaapidecode: generate system allocated buffers

Generate system allocated output buffers when downstream doesn't
support GstVideoMeta.

The VA buffer content is copied to the new output buffer, and it
replaces the VA buffer.

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

6 years agovaapipostproc: handle system allocated buffers when required
Víctor Manuel Jáquez Leal [Thu, 15 Feb 2018 18:32:37 +0000 (19:32 +0100)]
vaapipostproc: handle system allocated buffers when required

When downstream can't handle GstVideoMeta it is required to send
system allocated buffers.

The system allocated buffers are produced in prepare_output_buffer()
vmethod if downstream can't handl GstVideoMeta.

At transform() vmethod if the buffer is a system allocated buffer,
a VA buffer is instanciated and replaces the out buffer. Later
the VA buffer is copied to the system allocate buffer and it
replaces the output buffer.

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

6 years agoplugins: add gst_vaapi_copy_va_buffer()
Víctor Manuel Jáquez Leal [Thu, 15 Feb 2018 18:32:19 +0000 (19:32 +0100)]
plugins: add gst_vaapi_copy_va_buffer()

This helper function aims to copy buffers with VA memory to dumb
buffers, when GstVideoMeta is not available dowstream.

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

6 years agoplugins: add COPY_OUTPUT_FRAME flag
Víctor Manuel Jáquez Leal [Thu, 15 Feb 2018 18:29:51 +0000 (19:29 +0100)]
plugins: add COPY_OUTPUT_FRAME flag

This patch add the member copy_output_frame and set it TRUE when
when downstream didn't request GstVideoMeta API, the caps are raw
and the internal allocator is the VA-API one.

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

6 years agoplugins: store the first downstream allocator if available
Víctor Manuel Jáquez Leal [Thu, 15 Feb 2018 18:28:33 +0000 (19:28 +0100)]
plugins: store the first downstream allocator if available

The allocator will be required if we need to allocate a buffer
to store the frame with the expected strides.

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

6 years agovaapibufferpool: add gst_vaapi_video_buffer_pool_copy_buffer()
Víctor Manuel Jáquez Leal [Tue, 20 Feb 2018 01:25:13 +0000 (02:25 +0100)]
vaapibufferpool: add gst_vaapi_video_buffer_pool_copy_buffer()

This function will inform the element if it shall copy the generated
buffer by the pool to a system allocated buffer before pushing it
to downstream.

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

6 years agovaapibufferpool: don't change config when forcing video meta
Víctor Manuel Jáquez Leal [Thu, 15 Feb 2018 18:22:08 +0000 (19:22 +0100)]
vaapibufferpool: don't change config when forcing video meta

VA-API based buffer might need a video meta because of different
strides. But when donwstream doesn't support video meta we need to
force the usage of video meta.

Before we changed the buffer pool configuration, but actually this
is a hack and we cannot rely on that for downstream.

This patch add a check fo raw video caps and allocator is VA-API,
then the option is enabled without changing the pool configuration.
In this case the element is responsible to copy the frame to a
simple buffer with the expected strides.

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

6 years agovaapipostproc: set discont flag at vpp deinterlacing
Víctor Manuel Jáquez Leal [Tue, 20 Feb 2018 15:15:05 +0000 (09:15 -0600)]
vaapipostproc: set discont flag at vpp deinterlacing

When deinterlacing with VPP the discont flag was not forwarded to
the new created buffer. This patch sets the discont flag if input
buffer has it.

6 years agovaapibufferpool: remove wrong gcc annotation
Víctor Manuel Jáquez Leal [Tue, 20 Feb 2018 01:14:37 +0000 (02:14 +0100)]
vaapibufferpool: remove wrong gcc annotation

6 years agolibs: encoder: h264,h265: extend max periodic keyframe.
Matteo Valdina [Thu, 15 Feb 2018 20:55:42 +0000 (14:55 -0600)]
libs: encoder: h264,h265: extend max periodic keyframe.

Increased max values of periodic key frame for h26x codecs.
This allow more fine tunning of encoder that in certian scenario
want higher periodic key frame.

For example: it doesn't want a key frame each 10 seconds but
each 120 seconds.

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

6 years agoBack to development
Tim-Philipp Müller [Thu, 15 Feb 2018 19:44:35 +0000 (19:44 +0000)]
Back to development

6 years agoRelease 1.13.1
Tim-Philipp Müller [Thu, 15 Feb 2018 17:39:16 +0000 (17:39 +0000)]
Release 1.13.1

6 years agovaapi: dist new header
Tim-Philipp Müller [Thu, 15 Feb 2018 18:15:33 +0000 (18:15 +0000)]
vaapi: dist new header

6 years agovaapi: register vaapisink as marginal on wayland
Víctor Manuel Jáquez Leal [Mon, 12 Feb 2018 16:53:58 +0000 (17:53 +0100)]
vaapi: register vaapisink as marginal on wayland

vaapsink, when used with the Intel VA-API driver, tries to display
surfaces with format NV12, which are handled correctly by
Weston. Nonetheless, COGL cannot display YUV surfaces, making fail
pipelines on mutter.

This shall be solved either by COGL or by making the driver to paint
RGB surfaces. In the meanwhile, let's just demote vaapisink as
marginal when the Wayland environment is detected, no matter if it is
Weston.

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

6 years agoplugins: update mesa's vendor string in whitelist
Víctor Manuel Jáquez Leal [Mon, 12 Feb 2018 18:00:36 +0000 (19:00 +0100)]
plugins: update mesa's vendor string in whitelist

Mesa has updated its VA-API Gallium driver vendor string:

https://cgit.freedesktop.org/mesa/mesa/commit/?id=5db29d62ce1fefa3f2ee6e4a4688576fde4bde4a

This patch tries to cover both, the old and the new one.

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

6 years agomeson: make version numbers ints and fix int/string comparison
Tim-Philipp Müller [Thu, 8 Feb 2018 19:22:17 +0000 (19:22 +0000)]
meson: make version numbers ints and fix int/string comparison

WARNING: Trying to compare values of different types (str, int).
The result of this is undefined and will become a hard error
in a future Meson release.

6 years agoplugins: handle vaapi allocator in allocation query
Víctor Manuel Jáquez Leal [Wed, 7 Feb 2018 08:13:26 +0000 (09:13 +0100)]
plugins: handle vaapi allocator in allocation query

In propose_allocation() if the numer of allocation params is zero, the
system's allocator is added first, and lastly the native VA-API
allocator.

In decide_allocation(), the allocations params in query are travered,
looking for a native VA-API allocator. If it is found, it is reused as
src pad allocator. Otherwise, a new allocator is instantiated and
appended in the query.

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

6 years agovaapivideomemory: remove unused macro
Víctor Manuel Jáquez Leal [Wed, 7 Feb 2018 08:06:46 +0000 (09:06 +0100)]
vaapivideomemory: remove unused macro

GST_VAAPI_VIDEO_ALLOCATOR_NAME was added in commit 5b11b8332 but it
was never used, since the native VA-API allocator name has been
GST_VAAPI_VIDEO_MEMORY_NAME.

This patch removes GST_VAAPI_VIDEO_ALLOCATOR_NAME macro.

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

6 years agovaapisink: don't mask button events for foreign windows
VaL Doroshchuk [Fri, 2 Feb 2018 08:54:00 +0000 (08:54 +0000)]
vaapisink: don't mask button events for foreign windows

Don't subscribe to button press events when using a foreing window,
because the user created window would trap those events, preveting the
show of frames.

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

6 years agoautotools: use -fno-strict-aliasing where supported
Tim-Philipp Müller [Mon, 5 Feb 2018 07:51:56 +0000 (08:51 +0100)]
autotools: use -fno-strict-aliasing where supported

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

6 years agomeson: use -fno-strict-aliasing where supported
Tim-Philipp Müller [Tue, 30 Jan 2018 20:38:37 +0000 (20:38 +0000)]
meson: use -fno-strict-aliasing where supported

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

6 years agovaapi: add NULL-sentinel to kernel_names
Philippe Normand [Tue, 30 Jan 2018 12:56:49 +0000 (12:56 +0000)]
vaapi: add NULL-sentinel to kernel_names

The array needs to be NULL-terminated according to the
gst_plugin_add_dependency() documentation.

6 years agovaapipostproc: remove spurious code
Víctor Manuel Jáquez Leal [Thu, 18 Jan 2018 17:53:29 +0000 (18:53 +0100)]
vaapipostproc: remove spurious code

This assignation is dead code, since gst_video_info_from_caps() set
to 1 by default.

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