Commit graph

1065 commits

Author SHA1 Message Date
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
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
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
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
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
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
Philippe Normand
70726aef00 gst: Advertise elements interacting with hardware devices 2018-10-12 15:39:53 +01: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
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
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
Matteo Valdina
7872d12695 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
2018-09-03 16:11:13 +02:00
Matteo Valdina
2cb795fc77 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
2018-09-03 15:38:33 +02:00
Nicolas Dufresne
06aa82f989 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
2018-07-25 15:52:54 -04:00
Nicolas Dufresne
d07bffb578 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
2018-07-25 15:52:54 -04:00
Mathieu Duponchelle
b4d6a3b113 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
2018-06-26 14:45:10 +02:00
Tim-Philipp Müller
4f32a72675 Update for g_type_class_add_private() deprecation in recent GLib 2018-06-24 13:07:20 +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
Víctor Manuel Jáquez Leal
b1d8c68921 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
2018-06-14 16:41:00 +02:00
Víctor Manuel Jáquez Leal
19e4769501 plugins: fix compilation
gstvaapipluginutil.c:171:1: error: old-style function definition [-Werror=old-style-definition]
2018-06-12 15:45:44 +02:00
Víctor Manuel Jáquez Leal
94709d49c6 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
2018-06-12 12:55:15 +02:00
Víctor Manuel Jáquez Leal
e62f3d75cf 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
2018-06-12 12:42:11 +02:00
Hyunjun Ko
50470ae89f 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
2018-06-12 12:35:04 +02:00
Michael Olbrich
d79bda3153 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
2018-06-07 11:55:06 +02:00
Víctor Manuel Jáquez Leal
28952f534b vaapiencode: h264: log output caps 2018-06-06 11:04:02 +02:00
Víctor Manuel Jáquez Leal
af3e6a8d16 vaapiencode: h264: find profile in available and allowed caps
The commit 67e33d3de2 ("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
2018-06-06 11:04:02 +02:00
Víctor Manuel Jáquez Leal
705b37844e plugins: guard GstGL code 2018-05-21 13:57:08 +02:00
Wang,Fei
2d95089a8d 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
2018-04-30 12:48:26 +02:00
Víctor Manuel Jáquez Leal
59579a9cb3 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
2018-04-26 19:37:54 +02:00
Víctor Manuel Jáquez Leal
86bf89d16d 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
2018-04-26 19:37:54 +02:00
Hyunjun Ko
b9c38a295b 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
2018-04-26 19:35:49 +02:00
Hyunjun Ko
bfac678e9a 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
2018-04-18 18:01:06 +02:00
Víctor Manuel Jáquez Leal
fa77b2bf60 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
2018-03-30 20:44:25 +02:00
Víctor Manuel Jáquez Leal
940afd2900 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.
2018-03-01 09:48:38 -06:00
Nicolas Dufresne
fde55003ca 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
2018-02-27 17:51:02 -05:00
Víctor Manuel Jáquez Leal
25c2a0d353 Revert "vaapiencode: handle custom event GstVaapiEncoderRegionOfInterest"
This reverts commit 8f1b88dac0.

https://bugzilla.gnome.org/show_bug.cgi?id=768248
2018-02-27 17:51:02 -05:00
Víctor Manuel Jáquez Leal
ba28c6cff2 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
2018-02-27 10:02:14 -06:00
Víctor Manuel Jáquez Leal
9827ab0f3f 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
2018-02-20 10:58:08 -06:00
Víctor Manuel Jáquez Leal
188434f251 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
2018-02-20 10:58:08 -06:00
Víctor Manuel Jáquez Leal
2c36610748 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
2018-02-20 10:57:12 -06:00
Víctor Manuel Jáquez Leal
5842e9cf87 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
2018-02-20 10:57:12 -06:00
Víctor Manuel Jáquez Leal
f0fd2aeb04 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
2018-02-20 10:57:12 -06:00