Commit graph

145 commits

Author SHA1 Message Date
Víctor Manuel Jáquez Leal
6cbb607ec9 vaapipostproc: update filters at color balance
This is a fix for a regression of previous commit, which updates the filters
only when the property is set, because it is also required to update the
filter when the color balance interface change its values.
2016-07-22 16:55:59 +02:00
Hyunjun Ko
73d4da2e79 vaapipostproc: make it enable/disable pass-through mode
In case that sink caps and src caps are same, and no filtering parameter set,
pass-through mode is enabled.
If new filtering parameter is set during playback, it makes it reconfiguring,
so that pass-through mode is changed

In addition, updating filter is performed during reconfiguration, if needed.

https://bugzilla.gnome.org/show_bug.cgi?id=751876
2016-07-22 12:08:20 +02:00
Hyunjun Ko
cc6df605a1 vaapipostproc: checking and updating filter parameter only when it's set
This patch is to avoid checking filter value at every frame.

https://bugzilla.gnome.org/show_bug.cgi?id=751876
2016-07-22 12:08:20 +02:00
Víctor Manuel Jáquez Leal
649c00d3c7 vaapipostproc: return caps template if no display
This patch is a fix for my bad review of commit 6d73ca8d. The element should
be able to return the available raw caps handled by the VA display, but that
only should happen when there a VA display. If there's none, the element
should use the caps template.

https://bugzilla.gnome.org/show_bug.cgi?id=768161
2016-06-29 14:05:18 +02:00
Matthew Waters
6d73ca8da2 vaapipostproc: don't require a vaapi display for all caps queries
This delays the requirement of having a GstVaapiDisplay until later

https://bugzilla.gnome.org/show_bug.cgi?id=768161
2016-06-29 21:35:06 +10:00
Hyunjun Ko
2fb05613a0 vaapi: fix minor leaks
https://bugzilla.gnome.org/show_bug.cgi?id=767868
2016-06-21 11:08:48 +03:00
Víctor Manuel Jáquez Leal
2562cd51be pluginutil: add gst_video_info_changed() helper
This function is shared among different elements, so let factorized it.

https://bugzilla.gnome.org/show_bug.cgi?id=765435
2016-06-08 10:19:01 +02:00
Scott D Phillips
4791e9f2ea vaapipostproc: add postproc_lock to protect data members
Add a mutex to postproc to protect concurrent access to data members.
Previously set_caps() could release the allowed_srcpad_caps while
transform_caps was in the middle of using it.

Signed-off-by: Scott D Phillips <scott.d.phillips@intel.com>

https://bugzilla.gnome.org/show_bug.cgi?id=766940
2016-06-08 10:03:59 +02:00
Víctor Manuel Jáquez Leal
9da69fa3a2 vaapipostproc: handle if gst_video_info_from_caps() fails
Return FALSE is the received caps cannot be transformed into a GstVideoInfo
structure.
2016-05-23 18:04:47 +02:00
Víctor Manuel Jáquez Leal
d69917ecca remove spurious gst_video_info_init()
gst_video_info_set_format() and gst_video_info_from_caps() call, internally,
gst_video_info_init(), hence it is not required to call it before them. This
patch removes these spurious calls.
2016-05-20 19:33:39 +02:00
Víctor Manuel Jáquez Leal
1901e2231b vaapipostproc: move gst_vaapipostproc_fixate_srccaps()
Move gst_vaapipostproc_fixate_srccaps() to gstvaapiposptprocutil.

No functional changes.

https://bugzilla.gnome.org/show_bug.cgi?id=758548
2016-05-09 16:56:10 +02:00
Víctor Manuel Jáquez Leal
d9b09b623e vaapipostproc: simplify code
Change a convoluted snippet to find the preferred color format in the peer
caps.

https://bugzilla.gnome.org/show_bug.cgi?id=758548
2016-05-09 16:56:10 +02:00
Víctor Manuel Jáquez Leal
bde3b072da vaapipostproc: use othercaps for preferred caps
Instead of the allowed_srcpad_caps variable, this patch uses the othercaps
from fixate_caps() vmethod to find the preferred caps feature and color
format.

https://bugzilla.gnome.org/show_bug.cgi?id=758548
2016-05-09 16:56:10 +02:00
Scott D Phillips
8de7faafdc vaapipostproc: add fixate_caps() vmethod
Instead of fixating the srcpad caps in transform_caps() vmethod, this patch
implements the fixate_caps() vmethod and moves code around.

https://bugzilla.gnome.org/show_bug.cgi?id=758548
2016-05-09 16:55:53 +02:00
Víctor Manuel Jáquez Leal
606d166b56 vaapipostproc: set early properties restrictions
When running transform_caps() vmethod, returning the srcpad caps, the caps are
early restricted to the element properties set: width, height, format and
force keep aspect.

A new file was added gstvaapipostprocutil.{c,h} where the utilities functions
are stored.

https://bugzilla.gnome.org/show_bug.cgi?id=758548
2016-05-09 14:56:03 +02:00
Víctor Manuel Jáquez Leal
54a2d9fb77 vaapipostproc: log the caps transformation
https://bugzilla.gnome.org/show_bug.cgi?id=758548
2016-05-09 14:56:03 +02:00
Víctor Manuel Jáquez Leal
ebf0d94534 vaapipostproc: no GLTextureUpload in sinkpad
As the vaapipostproc does not process frames with the VideoGLTextureUpload
meta, the feature is removed from the sink pad template.

https://bugzilla.gnome.org/show_bug.cgi?id=765931
2016-05-09 14:55:38 +02:00
Julien Isorce
910bacc55c vaapipostproc: already have a surface proxy if dmabuf
https://bugzilla.gnome.org/show_bug.cgi?id=755072
2016-04-26 16:05:50 +01:00
Julien Isorce
8a443f0a18 various gst-indent 2016-04-25 22:22:56 +02:00
Víctor Manuel Jáquez Leal
bccdda84b7 plugins: rework set_context() vmethod definition
In bug 757598 was added the set_context() vmethod chain up in
GstVaapiPluginBase. But it is buggy, since the parent_class address is
assigned to the last element which called gst_vaapi_plugin_base_class_init().

No error has shown up since none of the element's base classes redefined
set_context() vmethod from GstElement, so always the correct function was
called. Still this code is wrong and this patch make it right.

Since set_context() is the same code, a macro is used to implement that code
in all the gst-vaapi elements.

https://bugzilla.gnome.org/show_bug.cgi?id=765368
2016-04-22 17:18:18 +02:00
Víctor Manuel Jáquez Leal
e519f2ea79 vaapipostproc: resize if negotiated and allocation caps are different
Since commit 859a2b2, in vaapidecode, allocation query can be different from
the negotiated caps.

When connecting the vaapidecoder to the vaapipostprocessor, the last one will
resize the frame to the negotiated, if and only if, some other parameter is
activated to avoid the passthrough. If it is not, the surface won't be mapped
into a image. If not, the image won't be resized and the output buffer would be
mapped.

This patch will break the passthrough if the allocation query is different
from the negotiation caps, forcing the resizing.

https://bugzilla.gnome.org/show_bug.cgi?id=765095
2016-04-22 17:07:53 +02:00
Víctor Manuel Jáquez Leal
c5c60e2a33 plugins: remove param in gst_vaapi_plugin_base_decide_allocation() 2016-04-18 19:07:55 +02:00
Víctor Manuel Jáquez Leal
8d42c95b0f plugin: use allowed caps filter from element
Instead of using the srcpad template caps for filtering the peer caps, the
function gst_vaapi_find_preferred_caps_feature(), now receives a new parameter
for the element's allowed caps.

With this modification, the vaapipostproc element simplifies a bit its code.

https://bugzilla.gnome.org/show_bug.cgi?id=765223
2016-04-18 18:28:43 +02:00
Víctor Manuel Jáquez Leal
2d7d38cb9c plugin: remove function parameter
The native format parameter in gst_vaapi_find_preferred_caps_feature() can be
saved if the out format is used for both: in and out. Thus the code is more
readable.

https://bugzilla.gnome.org/show_bug.cgi?id=765223
2016-04-18 18:28:43 +02:00
Víctor Manuel Jáquez Leal
8169c6afb1 remove custom allocation query
When resolving bug 753914, a custom allocation query was added, overlapping
the responsibilities of GstVideoDecoder.

But with the merge of the patches from bug 764421 this overlapping was not
required anymore. This patch restores this situation setting the
allocation_caps in the GstVideoCodecState when needed.

https://bugzilla.gnome.org/show_bug.cgi?id=764316
2016-04-18 11:14:04 +02:00
Víctor Manuel Jáquez Leal
6ec2a09729 plugins: disable GL_TEXTURE_UPLOAD if no EGL/GLX
The plugins should not expose the feature meta:GstVideoGLTextureUploadMeta in
their caps templates if they were not compiled either with GLX or EGL support.
2016-04-13 20:35:59 +02:00
Sreerenj Balachandran
859a2b2f4f Make vaapidecode to advertise the cropped values in srcpad, but negotiate pool only if needed
-- Maintaing decoded surface resoluton and actual display resoultion separately
-- Before pushing every frames downstream, check for the requirement of pool negoation and
output_state negotiation: This is needed to avoid multiple issuses with cropping,
multi-resoluton video handling, more complex multi resolution decode scenarios for vp9decode,
possible wrong behaviour from upstream element to report uncropped values etc. Due to these reasons,
We can't just reliably use the resolution change notification from libgstvaapi for pool renegotiation too.
This is slight overhead, but safe enough. Optimization could be possible though.

https://bugzilla.gnome.org/show_bug.cgi?id=753914
2016-03-24 15:08:50 +02:00
Víctor Manuel Jáquez Leal
9b8fb25b8c docs: update plugin documentation
Update all the documentation of elements of the vaapi plugin.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
2016-02-03 20:03:47 +01:00
Tim-Philipp Müller
24168a2093 vaapi: fix 'ISO C90 forbids mixed declarations and code' compiler warnings
Declare variables at the beginning of a code block, which
is how it's done in GStreamer.

https://bugzilla.gnome.org/show_bug.cgi?id=759192
2016-02-02 16:17:43 +01:00
Víctor Manuel Jáquez Leal
b8da44bdea vaapipostproc: check ANY caps at transform_caps()
When transforming downstream caps we should check for ANY caps from peer pad,
otherwise we get a segmentation fault.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>

https://bugzilla.gnome.org/show_bug.cgi?id=759893
2016-01-14 17:40:12 +01:00
Sreerenj Balachandran
0f3e813956 vaapipostproc: Correctly detect the caps change
This is a quick fix for regression introuduced by the
commit 757833230b

With out this, the gst_vaapipostproc_create() will
never get invoked.

https://bugzilla.gnome.org/show_bug.cgi?id=758543
2015-11-23 17:21:23 +02:00
Víctor Manuel Jáquez Leal
757833230b vaapipostproc: don't set caps change at first set
When the source caps change, the filter is destroyed and recreated.
Nonetheless, this happens every time the vaapipostproc starts, since the caps
change detection algorithm does not take in consideration when the caps are
set by first time.

This patch intents to be an optimization, to avoid a useless filter
destroy-creation cycle when the sources caps are set for first time.

The new helper function video_info_update() is a refactorization to avoid
duplicated code.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>

https://bugzilla.gnome.org/show_bug.cgi?id=758007
2015-11-19 12:23:22 +01:00
Víctor Manuel Jáquez Leal
fc958520c3 vaapipostproc: params video_info_changed() callers
The signature is video_info_changed(old_vip, new_vip). Nonetheless the callers
swapped the the order. This didn't raise problems since the comparison of both
structures were not affected by its semantics.

But still it would be better to fix this to keep the coherence of the code.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>

https://bugzilla.gnome.org/show_bug.cgi?id=758007
2015-11-19 12:23:22 +01:00
Víctor Manuel Jáquez Leal
b2707c8eec plugins: fix context query handling
The current context query handling design is flawed: the function
gst_vaapi_reply_to_query() returns FALSE either if the query is not a
GST_CONTEXT_QUERY of if the query could not be handled correctly. But the
pad query function should handle differently each case.

This patch changes the gst_vaapi_reply_to_query() for
gst_vaapi_handle_context_query() and changes it usage in all the vaapi plugins
to match the correct context query handling.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>

https://bugzilla.gnome.org/show_bug.cgi?id=757598
2015-11-09 16:18:19 +01:00
Víctor Manuel Jáquez Leal
66f05af288 refactor vaapi caps strings for pad templates
Refactor the main vaapi caps strings into three macros:
GST_VAAPI_MAKE_SURFACE_CAPS, GST_VAAPI_MAKE_ENC_SURFACE_CAPS and
GST_VAAPI_MAKE_GLTEXUPLOAD_CAPS.

Those are in gstvaapipluginutil.h so all the elements could use them, instead
of re-declaring them every time.

No functional changes.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
2015-08-05 14:26:37 +02:00
Víctor Manuel Jáquez Leal
343739e281 gstvaapipostproc: fix code style
Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
2015-08-05 14:26:00 +02:00
Víctor Manuel Jáquez Leal
954037cd24 vaapipostroc: GLTextureUploadMeta in sink template
Advertise GLTextureUploadMeta in sink caps template.

https://bugzilla.gnome.org/show_bug.cgi?id=752130
2015-08-04 19:37:33 +02:00
Víctor Manuel Jáquez Leal
001a5c637d remove gstvaapiuploader
Working on bug #744042 I realized that the gstvaapiuploader is practically not
used.

This patch removes the gstvaapiuploader and add the method
gst_vaapi_plugin_base_get_allowed_raw_caps () that returns the raw caps that
the system can handle, which is used by vaapisink and vaapipostproc.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>

https://bugzilla.gnome.org/show_bug.cgi?id=752777
2015-08-04 19:32:40 +02:00
Víctor Manuel Jáquez Leal
9984678398 vaapipostproc: no format convert on GL tex upload meta
When GL texture upload meta is negotiated, vaapipostproc shall not modify the
color format of the buffer.

https://bugzilla.gnome.org/show_bug.cgi?id=748184
2015-07-03 13:31:47 +02:00
Sreerenj Balachandran
b4154ac85c gst/vaapi: Switch to upstreram like indentation.
gst-indent for all gst/vaapi/*.c source files
2015-06-30 09:44:18 +03:00
Sreerenj Balachandran
d14a201699 vaapipostproc: Fix wrong selection of passthrough mode.
The Current code path is falling back to passthorugh mode if there is no
vpp property set by the user explictily. But we should not use the
passthrough mode if the negotiated src pad caps have a differnt color space
format than sink pad caps (Even though the user didn't set the format property
explicitly).

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

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
2015-06-29 13:35:59 +03:00
Sreerenj Balachandran
a1eef1c355 vaapipostproc: prevent advanced-deinterlacing of non-native video formats.
This is a workaround to deal with the va-intel-driver for non-native
formats while doing advanced deinterlacing. The format of reference surfaces must
be same as the format used by the driver internally for motion adaptive
deinterlacing and motion compensated deinterlacing.

A permanent solution could be to do the color space conversion internally
for reference surfaces.

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

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
2015-06-29 13:20:28 +03:00
Víctor Manuel Jáquez Leal
eb510e23ce vaapipostproc: log negotiated caps 2015-06-22 17:15:50 +02:00
Víctor Manuel Jáquez Leal
700f010766 vaapipostproc: remove useless debug message 2015-06-22 17:13:00 +02:00
Víctor Manuel Jáquez Leal
cbc2d15bec vaapipostproc: add color balance interface
https://bugzilla.gnome.org/show_bug.cgi?id=720376
2015-06-12 19:22:01 +02:00
Víctor Manuel Jáquez Leal
1ef8c10aa8 vaapipostproc: add skin tone enhancement
Added the 'skin-tone-enhancement' property to vaapostproc.

https://bugzilla.gnome.org/show_bug.cgi?id=744088
2015-06-08 18:00:05 +02:00
Víctor Manuel Jáquez Leal
28b4fc4dd9 vaapipostproc: tune up a couple of log messages
In order to reduce the noise, the query type log was downgrade from INFO to
DEBUG, and the shared display address log message is assigned to the object.
2015-04-29 12:39:50 +02:00
Olivier Crete
6f298f6182 vaapipostproc: Don't create filter on caps query
The problem with this is that creating the filter causes the display to
be selected, and the caps query happens while linking the element. So,
if the downstream or upstream element is using a specific display
object, it won't be propagated correctly to the postproc as it already
has a display at this point.

https://bugzilla.gnome.org/show_bug.cgi?id=747945
2015-04-16 12:36:28 +02:00
Víctor Manuel Jáquez Leal
8b36e25f47 Removal of gstreamer-1.0 support
The support for GStreamer 1.0 has been obsoleted in 0.5.10 release.
GStreamer 1.2 is the a minimal requirement for building the gstreamer-vaapi.

This patch removes all the pre-processor conditional code compilation guarded
for gstreamer-1.0.

Thus, all the video converters were removed too.

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

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
2015-04-03 17:09:08 +03:00
Víctor Manuel Jáquez Leal
c561b8da8a update and move gstcompat.h
The purpose of gstcompat.h is to couple the API differences among
gstreamer-1.0 and gstreamer-0.10. Since gstreamer-0.10 is obsolete, the code
in this compatibility layer shall be removed.

Nevertheless, the gstcompat.h header should be kept, if new incompatibilites
appear in the future, but it shall live in gst/vaapi, not in gst-libs.

This patch removes the crumbs defined gstcompat.h and moves it to gst/vaapi.
In order to avoid layer violations, gstcompat.h includes sysdeps.h and all
the includes in gst/vaapi of sysdeps.h are replaced with gstcompat.h

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

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
2015-04-03 17:08:30 +03:00