Commit graph

2401 commits

Author SHA1 Message Date
Víctor Manuel Jáquez Leal
4800f48980 plugins: fix potential memleak from commit 9159328
If gst_video_info_from_caps() fails it is required to unref the instantiated
pool.
2016-05-23 18:47:46 +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
9159328434 plugins: handle if gst_video_info_from_caps() fails
Let's play safe and return error if, somehow, the received caps are wrong.
2016-05-23 17:55:35 +02:00
Víctor Manuel Jáquez Leal
6d8b7056cc plugins: relate errors to instance
Use GST_{ERROR,WARNING}_OBJECT instead of GST_{ERROR,WARNING}, thus the logs
will show the name of the vaapipluginbase instance that failed.

Also, the code-style is fixed, where some error labels need to be surrounded
by braces.
2016-05-23 17:47:36 +02:00
Víctor Manuel Jáquez Leal
4dd2464060 plugins: use GstVideoInfo accessors
Instead of access to GstVideInfo members directly, use their accessors
macros. This patch makes more resistance to future changes in GStreamer core.
2016-05-20 21:01:02 +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
35f6ce964d vaapipluginbase: code-style: rename goto label
The error labels have error_ prefix, but this one.
2016-05-20 19:22:41 +02:00
Víctor Manuel Jáquez Leal
3f61394cb0 vaapivideomemory: use allocator custom alloc flag
Instead of a dummy alloc() vmethod, the allocator instance set the flag
GST_ALLOCATOR_FLAG_CUSTOM_ALLOC, which is used by the framework to avoid call
gst_allocator_alloc() on the allocator.
2016-05-19 16:38:40 +02:00
Víctor Manuel Jáquez Leal
1769da4957 vaapivideobufferpool: relate errors to instance
Use GST_ERROR_OBJECT instead of GST_ERROR, thus the logs will show the name of
the vaapivideobufferpool instance that failed.
2016-05-19 13:21:37 +02:00
Víctor Manuel Jáquez Leal
5341d9ae9f plugins: remove gst_vaapi_plugin_base_set_pool_config()
This function helper make sense for GStreamer 1.2, but it is not helpful for
greater version since the validation is already done in the API implementation.
Thus, it is removed.
2016-05-19 12:54:38 +02:00
Sreerenj Balachandran
36e2346fc7 gstvaapipluginbase: Fix typo in doc 2016-05-18 17:05:03 +03:00
Sreerenj Balachandran
c91de2398a encoder : h264: Disable b-frame encode in low-power mode
This is a workaround since vaapi-intel-driver doesn't have
support for B-frame encode when utilizing low-power-enc
hardware block.

Fixme :We should query the VAConfigAttribEncMaxRefFrames
instead of blindly disabling b-frame support and set b/p frame count,
buffer pool size etc based on the query result.

https://bugzilla.gnome.org/show_bug.cgi?id=766050
2016-05-13 11:45:20 +03:00
Sreerenj Balachandran
43af7c362c encoder: h264 : Use "tune=low-power" for enabling lowpower encode
Remove the duplicate property "low-power-enc" and use the
tune property for enabling low power encoding mode.

https://bugzilla.gnome.org/show_bug.cgi?id=766050
2016-05-13 11:44:57 +03:00
Sreerenj Balachandran
d446013ae4 gstvaapiencoder:Use internal api to dervie configured VAEntrypoint
https://bugzilla.gnome.org/show_bug.cgi?id=766050
2016-05-11 12:06:38 +03:00
Sreerenj Balachandran
32ee78bc52 encoder: h264: Add support of low power/high performance encoding mode
Added a new property "low-power-enc" for enabling low power
encoding mode. Certain encoding tools may not be available
with the VAEntrypointEncSliceLP.

https://bugzilla.gnome.org/show_bug.cgi?id=766050
2016-05-11 12:05:36 +03:00
Sreerenj Balachandran
8c1cfbaa1e Add mapping for Macroblock level rate control (VA_RC_MB) 2016-05-11 12:04:46 +03:00
Sreerenj Balachandran
c1abf37d0b gstvaapidisplay: Add VAEntrypointEncSliceLP support
https://bugzilla.gnome.org/show_bug.cgi?id=766050
2016-05-11 12:03:08 +03:00
Sreerenj Balachandran
7e4e597c6d gstvaapiprofile : Add VAEntrypointEncSliceLP definitions
This is for implementations that supports low_power/high_performance
variant for slice level encode.

https://bugzilla.gnome.org/show_bug.cgi?id=766050
2016-05-11 12:02:44 +03:00
Víctor Manuel Jáquez Leal
7baacda91c vaapipostproc: negotiate frame size fixation
Refactor _fixate_frame_size(). Now, instead of fixating the frame size only
using the sink caps, also it use the next capsfilter.

This code is a shameless copy of gst_video_scale_fixate_caps() from
https://cgit.freedesktop.org/gstreamer/gst-plugins-base/tree/gst/videoscale/gstvideoscale.c?id=1.8.1#n634

https://bugzilla.gnome.org/show_bug.cgi?id=758548
2016-05-09 16:57:17 +02:00
Scott D Phillips
4d1b11ed03 vaapipostproc: don't use GstVideoInfo for src caps
Instead of using gst_video_info_to_caps () to generated the fixed src caps,
this patch enables the first step for caps negotiation with a possible
following caps filter.

_get_preferred_caps() will traverse the possible src caps looking for the one
wit the preferred feature and the preferred color format. Then the color
format, the frame size and the frame rate are fixated.

https://bugzilla.gnome.org/show_bug.cgi?id=758548
2016-05-09 16:57:02 +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
240fc0f726 vaapibufferpool: do not create texture upload meta if dmabuf
https://bugzilla.gnome.org/show_bug.cgi?id=755072
2016-05-09 12:53:21 +01:00
Víctor Manuel Jáquez Leal
6a6ea75016 build: update git.mk 2016-05-06 12:16:44 +02:00
Víctor Manuel Jáquez Leal
4f30d28ff0 plugin: fix macro processor check
Instead of #ifdef it should be used #if becasuse USE_GST_GL_HELPERS is always
defined in config.h, but it would be 0 or 1 depending on the configure output.

https://bugzilla.gnome.org/show_bug.cgi?id=765702
2016-04-29 13:15:01 +02:00
Víctor Manuel Jáquez Leal
3fcfd40fb5 tests: display: guard possible unused variables
https://bugzilla.gnome.org/show_bug.cgi?id=765702
2016-04-29 13:14:46 +02:00
Víctor Manuel Jáquez Leal
74ebee5339 tests: inforce gstreamer code-style 2016-04-29 12:48:44 +02:00
Sreerenj Balachandran
018ea8b2fc encoder: h265: Enable cu_qp_delta_enabled_flag for CBR
It seems driver requires enablement of cu_qp_delta_enabled_flag
for modifying QP values to controll the CBR mode bitrate.

https://bugzilla.gnome.org/show_bug.cgi?id=749852
2016-04-27 17:10:26 +03:00
Sreerenj Balachandran
7ddc7ea0bc encoder: h265: Add CBR Encoding support
https://bugzilla.gnome.org/show_bug.cgi?id=749852
2016-04-27 17:06:09 +03:00
Julien Isorce
8e7ebaa505 gstvaapisurface: explicitely clear TILING flag if dmabuf
https://bugzilla.gnome.org/show_bug.cgi?id=755072
2016-04-26 16:10:45 +01:00
Julien Isorce
1dbcc8a0e1 gstvaapisurface_drm: release image when done
Otherwise intel-vaapi-driver will fail to process the exported surface because
it will find it is currently derived, so considered as busy.

https://bugzilla.gnome.org/show_bug.cgi?id=755072
2016-04-26 16:06:12 +01: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
53851b0e73 vaapidecode: search driver in whitelist
If the backend driver vendor string is not in a white-list, and the
environment variable GST_VAAPI_ALL_DRIVERS is not set either, the decoder will
change it state from NULL to READY, hence the auto-plug mechanism will look
for another decoder.

This patch assumes the GstContext has already being shared along the pipeline
and the element has a valid GstVaapiDisplay instance.

https://bugzilla.gnome.org/show_bug.cgi?id=764673
2016-04-22 17:25:00 +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
23a9a7291a vaapidecode: improve code readability
No functional changes.
2016-04-18 19:07:55 +02:00
Víctor Manuel Jáquez Leal
eb911e9eab vaapidecode: move GstCapsFeatures near to its use
Move the handling of the GstCapsFeatures just after it is used, in order to
avoid handling its memory.
2016-04-18 19:07:55 +02:00
Víctor Manuel Jáquez Leal
3531dfa35e vaapidecode: caps negotiation checks
Check that GLUploadTexture is not negotatiated if gstreamer-vaapi is not
compiled with GL support.
2016-04-18 19:07:55 +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
7f0bf08728 vaapidecode: bail early if not caps in 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
79ec3d00ef vaapidecode: warns if driver will do color conversions
If the downstream feature is system memory, the surface has to be mapped,
hence a warning message is logged saying that the driver has to do color
conversions. This might be troublesome because not all the color conversion
combinations are supported by the VA-API drivers, and there is not a reliable
way to know them before hand.

https://bugzilla.gnome.org/show_bug.cgi?id=765223
2016-04-18 18:28:43 +02:00
Víctor Manuel Jáquez Leal
b41db95c4e plugin: honour negotiated format
Instead of setting the requested format by the caller, the function
gst_vaapi_find_preferred_caps_feature() now returns, in the output parameter,
the negotiated format.

A new helper function was added: gst_vaapi_find_preferred_format(), which,
given the format list from the negotiated caps, will choose the best one, if
possible, given the native format.

https://bugzilla.gnome.org/show_bug.cgi?id=765223
2016-04-18 18:28:43 +02:00