Commit graph

1134 commits

Author SHA1 Message Date
U. Artie Eoff
a6dfb6e5be plugins: remove last negotiated video info if caps are same
If the allocation caps and negotiated caps are the same,
then ensure any previously negotiated video info is also
removed.  This can occur when multi-resolution video
decoding returns to it's original resolution.

Fixes #170
2019-06-10 21:28:13 -07:00
U. Artie Eoff
5f41422215 vaapivideomemory: allow negotiated info to be removed
Allow NULL negotiated_vinfo to be passed into
gst_allocator_set_vaapi_negotiated_video_info to allow
any previously set info to be removed.
2019-06-10 20:39:28 -07:00
Freyr666
53d86ff519 vaapiencode: Fixes deadlock in gst_vaapiencode_change_state function
This fixes a deadlock in gst_vaapiencode_change_state, which was due to
srcpad's chain function was locked waiting for available buffers. Since the
coded buffers in codedbuf_queue become available after sinkpad consume the
encoded frames, Paused -> Ready state change leads to deadlock. Coded buffers
are never consumed and marked free, hence gst_vaapiencode_handle_frame waits for
available buffers and holds the stream_lock of the srcpad.
2019-05-30 07:08:35 +00:00
Mathieu Duponchelle
df3989865e doc: remove xml from comments 2019-05-29 23:08:22 +02:00
U. Artie Eoff
3ccf3f3334 vaapipostproc: add mirror support
Adds vpp mirroring support to vaapipostproc.  Use
property video-direction.  Valid values are identity,
horiz or vert.  Default is identity (no mirror).

Closes #89

v2: Use GstVideoOrientationMethod enum
v3: Don't warn for VA_MIRROR_NONE.
    Use GST_TYPE_VIDEO_ORIENTATION_METHOD type.
v4: Query VAAPI caps when setting mirror value
    instead of during per-frame processing.
v5: Return TRUE in warning cases when setting mirror value.
2019-05-29 09:06:27 +00:00
Mathieu Duponchelle
38d25c65c3 doc: fix some incorrect gtk-doc links 2019-05-29 01:41:37 +02:00
Thibault Saunier
b0f5a59760 docs: Port to hotdoc 2019-05-13 17:00:00 -04:00
Wangfei
2ee518a988 vaapiencode: handle DMABuf caps feature in sink pad
Add DMABuff caps features in all encoders' sink pad.
2019-05-06 16:54:00 +02:00
Víctor Manuel Jáquez Leal
838045b9e2 vaapipostproc: don't do any color conversion when GL_TEXTURE_UPLOAD
https://bugzilla.gnome.org/show_bug.cgi?id=748184 has resurrected
with commit 3e992d8a

Since gst_vaapi_find_preferred_caps_feature() returns a color format
from caps negotiation, different from the default one (NV12), the
postproc enables the color transformation. But when GL_TEXTURE_UPLOAD
feature is negotiated, no color transformation shall be done.

Nonetheless, with commit 3e992d8a the requested format changes
firstly, because there's no video sink yet, so ANY caps are
negotiated; but later, when there's a video sink and a caps
renegotiation, the GL_TEXTURE_UPLOAD is negotiated though the color
format conversion still ongoing. It is required to reset that
conversion.

This patch force default color format when GL_TEXTURE_UPLOAD is
selected as preferred, thus avoiding the color conversion.

Fixes: #157
2019-05-02 16:47:28 +02:00
Wangfei
e88f349c6f plugins: find the preferred format from right caps.
When the downstream has any caps, then raw video feature will
be used. At this situation, the preferred format should be chose
from caps which contains "vide/x-raw" feature instead of from
the fist allowed caps.

Fixes #142
2019-04-11 08:40:38 +00:00
Danilo Spinella
f91046bad3 vaapipluginutil: Fix #endif for USE_X11 2019-03-30 18:29:31 +01:00
He Junyan
acf10ce164 vaapiencode: gobject's prop_id differ from vaapi encoder
The vaapi internal encoder's property id are negative, thus they are
different from GObject's property ids.

gst_vaapi_encoder_set_property() should map to the internal encoder
property id, assigned in gst_vaapiencode_default_set_property().
2019-03-25 19:15:38 +01:00
Víctor Manuel Jáquez Leal
3e992d8adb plugin: if any caps in downstream, negotiate raw video
When downstream has any caps, vaapi should not shovel vaapi featured
buffers, but rather plain raw video, assuming always the worst case
scenario (downstream cannot handle featured video memory but raw
system memory buffers).

This patch query the peer caps without any filter, to know if
donwstream just ask for any caps, if so jump to the color space
checking, otherwise do the caps intersection and continue with the
feature selection algorithm.

Fixes: #139
2019-02-27 13:13:14 +01:00
He Junyan
ee21fd9053 vaapivideomemory: Prefer same format for surface and image
We prefer to use the same format between image and surface for gst
vaapi allocator. The old way may choose different formats between
image and surface. For example, the RGBA image may have a NV12 surface.

So we need to do format conversion when we put/get image to surface.

Some drivers such as iHD can not support such conversion and always
cause a data flow error. There may also have some performance cost
for format conversion when put/get images.

So we prefer to use the same format for image and surface in the
allocator. If the surface can not support that format, we then
fallback to find a best one as the surface format.

Co-authored-by: Víctor Jáquez <vjaquez@igalia.com>
2019-02-21 13:41:46 +01:00
Niels De Graef
f84394fa49 libs: wayland: add support for XDG-shell protocol
[wl_shell] is officially [deprecated], so provide support for the
XDG-shell protocol should be provided by all desktop-like compositors.
(In case they don't, we can of course fall back to wl_shell).

Note that the XML file is directly provided by the `wayland-protocols`
dependency and generates the protocol marshalling code.

[wl_shell]: https://people.freedesktop.org/~whot/wayland-doxygen/wayland/Client/group__iface__wl__shell.html
[deprecated]: 698dde1958
2019-02-16 23:55:42 +01:00
Víctor Manuel Jáquez Leal
7afe5311cc vaapisink: x11: trap WM_DELETE_WINDOW message
Register the WM_DELETE_WINDOW message from window manager and
trap it to stop the pipeline cleanly.

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/issues/130
2019-01-24 21:11:54 +01:00
Wangfei
98c32df830 vaapipostproc: before set surface proxy, check if it already been created and exist.
Fix the deinterlace black frame when playing with glimagesink:
gst-launch-1.0 filesrc location=test.264 ! h264parse ! vaapih264dec \
! vaapipostproc deinterlace-mode=1 deinterlace-method=1 ! glimagesink
2019-01-15 14:48:19 +08:00
Haihao Xiang
5b447753da meson: build h264 fei encoder if possible 2019-01-07 17:46:42 +00:00
Haihao Xiang
920b1ec7a8 vaapi: bump the minimum vaapi version requirement to 0.39.0
And reduce unnecessary API version and structures check as well.

https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/issues/108
2019-01-07 17:46:42 +00:00
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
Víctor Manuel Jáquez Leal
bcc480b70e 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
2018-02-20 10:57:12 -06:00
Víctor Manuel Jáquez Leal
ad705cc5a3 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
2018-02-20 10:57:12 -06:00
Víctor Manuel Jáquez Leal
516d6bb3e2 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.
2018-02-20 10:55:49 -06:00
Víctor Manuel Jáquez Leal
1ca2c78c7a vaapibufferpool: remove wrong gcc annotation 2018-02-20 06:27:30 -06:00
Tim-Philipp Müller
a0b0728b6b vaapi: dist new header 2018-02-15 18:29:04 +00:00
Víctor Manuel Jáquez Leal
c653cb55f9 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
2018-02-13 17:13:20 +01:00
Víctor Manuel Jáquez Leal
19fe5c4d07 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
2018-02-13 16:57:57 +01:00
Víctor Manuel Jáquez Leal
448105578b 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
2018-02-08 09:57:28 +01:00
Víctor Manuel Jáquez Leal
8855a926be 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
2018-02-07 09:22:29 +01:00
VaL Doroshchuk
76dbc3e971 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
2018-02-05 11:36:35 +01:00
Philippe Normand
d897de9738 vaapi: add NULL-sentinel to kernel_names
The array needs to be NULL-terminated according to the
gst_plugin_add_dependency() documentation.
2018-01-30 12:56:49 +00:00
Víctor Manuel Jáquez Leal
da77fd5e2e 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
2018-01-18 20:46:22 +01:00
Víctor Manuel Jáquez Leal
ea9c52ea8f vaapipostproc: if no p-a-r in out caps define a range
Instead of copying the pixel-aspect-ratio from the sink caps, define
an open range for the src caps pixel-aspect-ratio. Later it will be
defined.

https://bugzilla.gnome.org/show_bug.cgi?id=790149
2018-01-18 20:46:22 +01:00
Víctor Manuel Jáquez Leal
f3650381c3 vaapisink: check for display's color-balance properties
Check for display's color-balance properties, available by the VA-API
driver, before setting them.

Also logs an info message of those unavailable properties.

https://bugzilla.gnome.org/show_bug.cgi?id=792638
2018-01-18 13:18:27 +01:00
Víctor Manuel Jáquez Leal
6efce291f6 plugins: re-using buffer pool breaks renegotiation
at propose_allocation() we should not reuse the proposed buffer,
because it could break renegotiation.

https://bugzilla.gnome.org/show_bug.cgi?id=792620
2018-01-17 22:07:36 +01:00
Víctor Manuel Jáquez Leal
9933dcb218 plugins: use g_clear_object() to unref sinkpad_buffer_pool
https://bugzilla.gnome.org/show_bug.cgi?id=792620
2018-01-17 22:07:35 +01:00
Víctor Manuel Jáquez Leal
8688e81d42 plugins: remove dmabuf-import hack
Remove the hack to check if an upstream element has enabled the
property io-mode enabled as dmabuf-import.

https://bugzilla.gnome.org/show_bug.cgi?id=792034
2018-01-16 19:27:27 +01:00
Michael Tretter
aed4088967 vaapipostproc: lock ensure_filter with postproc_lock
gst_vaapipostproc_ensure_filter might free the allowed_srcpad_caps
and allowed_sinkpad_caps. This can race with copying these caps in
gst_vaapipostproc_transform_caps and lead to segfaults.

The gst_vaapipostproc_transform_caps function already locks
postproc_lock before copying the caps. Make sure that calls to
gst_vaapipostproc_ensure_filter also acquire this lock.

https://bugzilla.gnome.org/show_bug.cgi?id=791404
2018-01-12 19:10:35 +01:00
Nicolas Dufresne
b0d41c5db8 videoconvert: gst_element_post_message() is transfer full on msg
For this reson we need not to unref the message, even if it failed.
2017-12-06 16:11:46 -05:00
Nicolas Dufresne
f9a57ccece Revert "vaapivideocontext: possible memleak when no bus attached"
This reverts commit 0438a3e626.
2017-12-06 16:11:25 -05:00
Víctor Manuel Jáquez Leal
8f5933cd80 vaapivideocontext: only vaapisink process app context
gst.vaapi.app.Display context is made for applications that will
provide the VA display and the native display to used by the
pipeline, when are using vaapisink as overlay. There are no use
case for encoders, decoders, neither for the postprocessor.

In the case of the vaapisink, it shall query for gst.vaapi.Display
upstream first, and then, if there is no reply,
gst.vaapi.app.Display context will be posted in the bus for the
application. If the application replies, a GstVaapiDisplay object
is instantiated given the context info, otherwise a
GstVaapiDisplay is created with the normal algorithm to guess the
graphics platform. Either way, the instantiated GstVaapiDisplay
is propagated among the pipeline and the have-message bus message.

Also only vaapisink will process the gst.vaapi.app.Display, if
and only if, it doesn't have a display already set. This is
caused because if vaapisink is in a bin (playsink, for example)
the need-context is posted twice, leading to an error state.

https://bugzilla.gnome.org/show_bug.cgi?id=790999
2017-12-01 23:11:11 +01:00
Víctor Manuel Jáquez Leal
466c839990 vaapivideocontext: log the name of GstVaapiDisplay
https://bugzilla.gnome.org/show_bug.cgi?id=790999
2017-12-01 23:11:11 +01:00
Víctor Manuel Jáquez Leal
0438a3e626 vaapivideocontext: possible memleak when no bus attached
https://bugzilla.gnome.org/show_bug.cgi?id=790999
2017-12-01 23:11:11 +01:00
Víctor Manuel Jáquez Leal
8092537763 plugins: centralize assignation of GL objects
Add plugin_set_gst_gl() where the GstGL objects are assigned.

https://bugzilla.gnome.org/show_bug.cgi?id=773453
2017-11-01 11:27:36 +01:00
Víctor Manuel Jáquez Leal
3d56306c37 plugins: set GL objects if ensured
Only set the GL display and GL other context if they are ensured.

https://bugzilla.gnome.org/show_bug.cgi?id=773453
2017-11-01 11:27:36 +01:00
Víctor Manuel Jáquez Leal
fc1c415515 plugins: set GL objects if context is handled
Only set the GL display and GL other context if they are extracted
correctly from the gstreamer's context.

https://bugzilla.gnome.org/show_bug.cgi?id=773453
2017-11-01 11:27:36 +01:00
Víctor Manuel Jáquez Leal
4866e4c452 plugins: fix memory leak when GL context is created
When the GL display and context are created inside an VAAPI element
the created GL context is leaked.

https://bugzilla.gnome.org/show_bug.cgi?id=773453
2017-11-01 11:27:36 +01:00
Víctor Manuel Jáquez Leal
72362e1063 plugins: direct rendering on memory:VASurface
As buffers negotiated with memory:VASurface caps feature can also be
mapped, they can also be configured to use VA derived images, in other
words "direct rendering".

Also, because of the changes in dmabuf allocator as default allocator,
the code for configuring the direct rendering was not clear.

This patch cleans up the code and enables direct rendering when the
environment variable GST_VAAPI_ENABLE_DIRECT_RENDERING is defined,
even then the memory:VASurface cap feature is negotiated.

https://bugzilla.gnome.org/show_bug.cgi?id=786054
2017-10-31 18:26:42 +01:00
Víctor Manuel Jáquez Leal
0a36a707ba plugins: only dmabuf on srcpad if downstream
Set if source pad can handle dmabuf only if the GstGL context comes
from downstream.

It is possible to know that at two moments:

1\ In the case of GstGLTextureUpload caps feature is negotiated and
   downstream pool reports back gst.gl.GstGLContext.

2\ When GstGLContext is found as GstContext from dowstream.

https://bugzilla.gnome.org/show_bug.cgi?id=788503
2017-10-20 16:36:04 +02:00
Víctor Manuel Jáquez Leal
1135e8bd31 vaapivideocontext: add inline documentation
Document function gst_vaapi_find_gl_local_context().

https://bugzilla.gnome.org/show_bug.cgi?id=788503
2017-10-20 16:36:04 +02:00
Víctor Manuel Jáquez Leal
6b2b1294f8 vaapivideocontext: return the direction of gl context
In function gst_vaapi_find_gl_context() add a direction parameter to
return back the direction where the GstGL context was found.

This is going to be useful when checking if downstream can import
dmabuf-based buffers.

https://bugzilla.gnome.org/show_bug.cgi?id=788503
2017-10-20 16:36:04 +02:00