Commit graph

736 commits

Author SHA1 Message Date
Víctor Manuel Jáquez Leal
861ef4d218 vaapidecode: intersect with filter in getcaps()
In commit 6034734d I forgot to add the caps filter intersection in the
getcaps() vmethod generating a regression when a capsfilter is set in the
pipeline.

This commit adds the caps filter intersection.
2016-03-01 11:35:49 +01:00
Víctor Manuel Jáquez Leal
6034734d73 vaapidecode: use video decoder getcaps()
The usage of getcaps() vmethod is preferred than to handle manually the sink's
caps query.

In order to avoid function declarations, this patch moves the class_init()
method to the end of the file.
2016-02-22 18:01:07 +01:00
Víctor Manuel Jáquez Leal
5b5ebc0a15 plugins: remove deprecated code
Since we are only supporting current GStreamer version, since 1.3
gst_buffer_pool_config_add_option() checks if the option to add is
already set. There is no need to do it ourselves.
2016-02-22 17:43:13 +01:00
Vineeth TM
24bc53456c vaapisink: Fix event,pad,structure memory leaks
https://bugzilla.gnome.org/show_bug.cgi?id=762229
2016-02-18 04:02:53 -03:00
Lim Siew Hoon
ce1ab4673c Add icamerasrc as dmabuf capable peer element
icamerasrc is another gstreamer plugin using to capture RAW
frames from camera device. It is based on libcamhal library.
There are some properties available to control icamera behavior.

Signed-off-by: Lim Siew Hoon <siew.hoon.lim@intel.com>
Tested & Reviewed: Zhu Haiyang <haiyang.zhu@intel.com>

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

Fixme: This is the similar workaround we done for v4l2src.
The workaround will be removed once we fix #755072
2016-02-17 15:40:54 +02:00
Vineeth TM
733c9b6fba vaapipluginbase: Fix structure memory leak
config structure is not being freed in all cases

https://bugzilla.gnome.org/show_bug.cgi?id=762172
2016-02-17 10:45:29 +02:00
Vineeth TM
ac01304cec vaapidecode: Fix videocodec state memory leak
When state is not NULL and either width/height of video info is 0, then state leaks

https://bugzilla.gnome.org/show_bug.cgi?id=762173
2016-02-17 10:45:29 +02:00
Tim-Philipp Müller
38fbe58999 vaapisink: post message for application for unhandled keyboard/mouse events
Makes (most) keyboard shortcuts work in gst-play-1.0 when
the video window has focus.
2016-02-16 15:44:48 +00:00
Vineeth TM
26abec3e26 vaapidecode: Fix capsfeature memory leak
https://bugzilla.gnome.org/show_bug.cgi?id=762116
2016-02-16 15:10:26 +02:00
Vineeth TM
b54ac96c27 vaapisink: Fix capsfeature memory leak
caps feature allocated is not being freeing in some cases

https://bugzilla.gnome.org/show_bug.cgi?id=762111
2016-02-16 15:10:11 +02:00
Sebastian Dröge
734b8bad8f vaapi: Fix various compiler warnings and disable -Wredundant-decls for now 2016-02-16 15:09:01 +02:00
Sreerenj Balachandran
1f6d29641d vaapisink: Fix wrong caps advertising
The get_caps() should only report the supported formats.

https://bugzilla.gnome.org/show_bug.cgi?id=761147
2016-02-09 12:18:27 +01:00
Víctor Manuel Jáquez Leal
77ddde41d9 rename encoders to vaapi{codec}enc
Trying to comply with GStreamer's element names, this patch renames the
encoders using the name format vaapi{codec}enc.

In this way, the plugin documentation is linked correctly.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
2016-02-03 20:23:31 +01: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
Víctor Manuel Jáquez Leal
4b5be5973e libs: small refactors to enhance the code style
As gst-indent generated ugly code in these cases, this patch changes the used
idiomatic into other one.

No functional changes were introduced.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
2016-02-03 20:03:47 +01:00
Víctor Manuel Jáquez Leal
bb2248ab66 plugins: fix code style
Minor code style changes by executing gst-indent in gst/vaapi directory.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
2016-02-03 12:17:59 +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
Sreerenj Balachandran
0a9ce66ec7 vaapidecode: Fix renegotiation for resolution change
Always renegotiate the pool if the immediate frame which going
to be pushed has a different un-cropped resolution than the already
configured one.
2016-02-02 16:17:43 +01:00
Víctor Manuel Jáquez Leal
d83ffd1231 plugins: use the same pre-processor macro
In gstvaapipluginbase.c we are using the macro USE_GST_GL_HELPERS to guard the
code related with GstGL. Nonetheless, in gstvaapipluginbase.h we are using
HAVE_GST_GL_GL_H macro in order to include the GstGLContext's header.

We should use only one to be homogeneous. This patch sets USE_GST_GL_HELPERS
in the header file.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
2016-02-02 16:17:43 +01:00
Víctor Manuel Jáquez Leal
3c6eb032fa build: add gstreamer-pbutils dependency
This dependency was added in gstvaapidecodebin with the call
gst_missing_element_message_new().

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
2016-02-01 12:21:57 +01:00
Víctor Manuel Jáquez Leal
ba91bf4c56 build: remove unused EGL specific sources
These Makefile variables are not used at all.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
2016-02-01 12:21:57 +01:00
Víctor Manuel Jáquez Leal
14662eeec1 build: remove check for GStreamer 1.2
Since we are working for current stable GStreamer 1.6

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
2016-02-01 12:21:57 +01:00
Víctor Manuel Jáquez Leal
e387ad5388 Remove more video parser crufts
This header is not used anymore since it declares parsers that are
already in GStreamer 1.6

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
2016-02-01 12:21:56 +01:00
Víctor Manuel Jáquez Leal
1c722efe54 Remove old gst version guards
As gstreamer-vaapi now only supports from GStreamer 1.6, this patch removes
all the old GStreamer version guards.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
2016-01-25 12:09:40 +00:00
Víctor Manuel Jáquez Leal
28caa20167 Remove video parser crufts
We forgot to remove gstvaapiparse.c when we removed all the videoparser
machinery.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
2016-01-25 12:09:25 +00:00
Víctor Manuel Jáquez Leal
fa6144545f libs: remove versioning
Since we don't install libraries anymore, it makes no sense to keep
versioning them according to the gstreamer's version.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
2016-01-20 10:19:07 +01:00
Víctor Manuel Jáquez Leal
56fab31c00 Remove codecparsers submodule
Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
2016-01-19 12:49:11 +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
Víctor Manuel Jáquez Leal
8f77d54103 vaapisink: ignore frame if its upload failed
When gst_vaapi_plugin_base_get_input_buffer() fail to copy the input buffer
into a VAAPI buffer, the return value is GST_FLOW_NOT_SUPPORTED, and it was
ignored by the vaapisink, leading to a segmentation fault.

This patch ignores the frame that generated the GST_FLOW_NOT_SUPPORTED
returned by gst_vaapi_plugin_base_get_input_buffer(), avoiding the
segmentation fault, but doing and effort to continue rendering. This is
the same behavior of ximagesink.

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

https://bugzilla.gnome.org/show_bug.cgi?id=759332
2016-01-14 11:31:17 +01:00
Víctor Manuel Jáquez Leal
fd73557d2c build: add gsth265parse patches conditionally
As gsth265parse was added in GStreamer 1.4, and gstreamer-vaapi still support
GStreamer 1.2, the patching of gsth265parse must be conditional to the target
GStreamer version.

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

https://bugzilla.gnome.org/show_bug.cgi?id=755525
2015-11-25 15:12:53 +02:00
Víctor Manuel Jáquez Leal
d38d4c617c build: declare correctly parse lib built files
This is a continuation of commit fc8a0d12

When declaring BUILT_SOURCES, those files should not be distributed. This
patch avoids the distribution of the generated source code.

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

https://bugzilla.gnome.org/show_bug.cgi?id=755525
2015-11-25 15:11:28 +02: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
fc8a0d121c build: declare real built files
When runnig the `make dist` target from a clean tree, it fails because
if could not find the copied files from codecparsers submodule.

They weren't copied because they weren't declared as built sources.

This patch removes the stamp mechanism and use the actual file list to copy
as the built sources. Also it fixes the duplication of the parser files.

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

https://bugzilla.gnome.org/show_bug.cgi?id=755525
2015-11-18 20:56:44 +01:00
Víctor Manuel Jáquez Leal
ac8d19dab4 vaapidecodebin: add me as element co-author
Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>

https://bugzilla.gnome.org/show_bug.cgi?id=757957
2015-11-16 16:07:07 +01:00
Víctor Manuel Jáquez Leal
7c71ffccc0 vaapidecodebin: try to get display from decoder
Rather than create a dummy display, if none has propagated as a context, we
should try to get the one from vaapidecode.

As the bin is already in READY state, the vaapidecode should be also in that
state. That means that the contexts have been negotiated, and it should have
already a display.

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

https://bugzilla.gnome.org/show_bug.cgi?id=757957
2015-11-16 16:07:07 +01:00
Víctor Manuel Jáquez Leal
bd4395ce9f vaapidecodebin: add postprocessor dynamically
The former approach to left the bin unfinished has some problems: the context
cannot be shared because the vaapidecode is unlinked in many cases, leading to
creating a VADisplay twice.

Initially the bin is fully functional, constructed as

(-----------------------------------)
|            vaapidecodebin         |
|   (-------------)    (-------)    |
|<--| vaapidecode |--->| queue |--->|
|   (-------------)    (-------)    |
(-----------------------------------)

When the context is shared and the VADisplay has VPP capabilities, before
changing to READY state, the bin is reconfigured dynamically, adding the
vaapipostproc element afeter the queue:

(--------------------------------------------------------)
|                       vaapidecodebin                   |
|   (-------------)    (-------)    (---------------)    |
|<--| vaapidecode |--->| queue |--->| vaapipostproc |--->|
|   (-------------)    (-------)    (---------------)    |
(--------------------------------------------------------)

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

https://bugzilla.gnome.org/show_bug.cgi?id=757957
2015-11-16 16:07:07 +01:00
Víctor Manuel Jáquez Leal
ce3d1a6203 vaapidecodebin: delay the bin configuration
Delay the bin configuration until changing to READY state. This is because we
should add the vaapipostproc element until the vaapidecode has emitted the
HAVE_CONTEXT message, so de gst_bin_add() could set the context set to
vaapipostproc.

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

https://bugzilla.gnome.org/show_bug.cgi?id=757957
2015-11-16 16:07:07 +01:00
Sreerenj Balachandran
b9feff206f vaapidecode: Add comments for corner case fixes and fix couple of indentations. 2015-11-13 18:51:27 +02:00
Víctor Manuel Jáquez Leal
1efe569639 plugin: guard pointers to pad query functions
Since gstreamer 1.4 is not required to have pad query functions if the query
vmethods are used.

This patch guards out the pad query functions for gstreamer < 1.4

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

https://bugzilla.gnome.org/show_bug.cgi?id=757629
2015-11-09 16:18:44 +01:00
Víctor Manuel Jáquez Leal
ea802072d1 vaapiencode: use pad query vmethods
GstVideoEncoder, the base class of vaapiencode, added support for pad queries
as virtual methods since gstreamer 1.4. This patch enables those vmethods,
while keeps support for previous versions of gstreamer.

This patch is relevant since GstVideoEncoder takes care of other queries that
we are currently ignoring.

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

https://bugzilla.gnome.org/show_bug.cgi?id=757629
2015-11-09 16:18:44 +01:00
Víctor Manuel Jáquez Leal
75e7a0a36c vaapidecode: return pad's template caps if no display
A caps query can occur before the element has a display. In that case, the
element can return its pad's template. But when the element already has a
display, and the caps probe fails, the element shall return an empty caps, so
the auto-plug could try with another decoder.

If the element has a display and the caps probe works, then the computed caps
should be returned.

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
d69f747d09 plugins: don't create display at caps query
Caps query can happen before the element has a bus. The display creation should
be should occur on the context negotiation, when the bus is already configured.
Then at caps query no display should be created.

Instead of force the display creation, we graciously fail the allowed_caps()
creation.

This change only applies for vaapidecode and vaapisink. The vaapipostroc, as a
basetransform descendant, seems to be not affected by this, nor the encoders.

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
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
28c366a003 plugin: don't lose previous context at query
When processing the GST_CONTEXT_QUERY we should not lose the previous
context in the query, we should only add our display structure.

This patch copies the old context, if it is there, and stamp our display on
it. Otherwise, a new context is created.

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
ed280f5b84 vaapivideocontext: add gst_vaapi_video_context_set_display()
This function set the display to an already created context. This function is
going to be used later.

Also, gst_vaapi_video_context_new_with_display() now uses this function.

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
ef3fb4afaf plugins: check if display is set in sync
Since the context messages are sync'ed, the display assignation happens in the
same thread, hence we can know if the display was found or not as soon we call
for it.

In order to take advantage of it, gst_vaapi_video_context_prepare() receives,
as a new parameter, the address of the plugin's display, and reports back if
the display was found and set.

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
b45089f0f7 plugins: set display through context
Instead of setting the display to the plugin directly after its creation, do
it through the gstreamer's context mechanism, avoiding double assignations.

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
959c13933d vaapivideocontext: rename context structure
The context structure is named "display" which is too generic. The contrary
happens, for example, with GstGL, what uses the same name as the context, and
its logs make more sense.

This patch renames the context structure with the same name as the
context, thus GST_PTR_FORMAT can pretty print it.

https://bugzilla.gnome.org/show_bug.cgi?id=757598
2015-11-09 16:18:19 +01:00
Víctor Manuel Jáquez Leal
5d0ab36924 vaapivideocontext: refactor gst_vaapi_video_context_prepare()
First, refactorized run_context_query() into _gst_context_run_query(), adding
a new parameter: the pad direction, in order to simplify the code.

Second, added a new helper function: _gst_context_query(), which is a generic
context query function.  It isolates the operation of running the query and
sets the context if found, also it enhances the logs.

_gst_context_query() is similar to the one used in GstGL. Perhaps, in the
future this helper function will be merged into the core libraries of
GStreamer.

Finally, gst_vaapi_video_context_prepare() was rewritten to use
_gst_context_query().

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
7e9ee7f66d vaapivideocontext: refactor context category debug
Refactor the extraction GST_CAT_CONTEXT logging using a only once
initializator, so we could get the debug category from different code
paths, safely.

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
c20318d198 gstvaapivideocontext: fix indentation
gst-indent does not handle correctly some expression like function
declaration with attributes, breaking the following expressions.

This patch makes gst-indent to ignore the attributed function
declartion so the followed function definition is not mangled, such
as happened in commit b4154a

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
1e96fae94c plugin: chain up set_context() vmethod
Since Gstreamer 1.7, set_context() vmethod needs to be chained up with
the parent class in order to broadcast all its contexts when the element
is added into a bin:

http://cgit.freedesktop.org/gstreamer/gstreamer/commit/?id=d5ded1588920c4471eefe055d09095d9e5e989b5

There is no need to guard the call, because before GStreamer 1.7, the
set_context() vmethod was NULL in the element class, hence the conditional
call make it safe.

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
a2611b7f35 vaapidecodebin: fix a leaked display instance
The display returned by gst_vaapi_video_context_get_display() increments the
references. Thus, we have to unref the returned display.

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

https://bugzilla.gnome.org/show_bug.cgi?id=757595
2015-11-09 15:50:14 +01:00
Sreerenj Balachandran
6722c541a1 VP9: plugins: Add VP9 decoder 2015-11-06 15:19:38 +02:00
Víctor Manuel Jáquez Leal
b76f4825c5 vaapidecode: relax guards for memory:VASurface capsfeature
Though caps features are supported since GStreamer 1.2, there are some
issues with the features caps negotiation in that version. Nonetheless,
those issues are fixed in GStreamer 1.4. So, the memoy:VASurface caps
feature negotiation is relaxed for GStreamer 1.4.

The guard is the same as in vaapisink's caps template.

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

https://bugzilla.gnome.org/show_bug.cgi?id=756686
2015-10-20 12:32:44 +02:00
Víctor Manuel Jáquez Leal
361f55be31 vaapidecode: decide allocation doesn't update srccaps
The received caps query will bring the already negotiated caps, so they are
not expected to change.

This patch removes this verification which is dead code path.

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

https://bugzilla.gnome.org/show_bug.cgi?id=756686
2015-10-20 12:32:44 +02:00
Víctor Manuel Jáquez Leal
6d9f31e305 vaapidecode: use caps to check the features
Instead of calling gst_vaapi_find_preferred_caps_feature(), which is
expensive, we check the caps from the allocation query, to check the
negotiated feature.

In order to do this verification a new utility function has been implemented:
gst_vaapi_caps_feature_contains().

As this new function shared its logic with gst_caps_has_vaapi_surface(), both
have been refactorized.

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

https://bugzilla.gnome.org/show_bug.cgi?id=756686
2015-10-20 12:32:44 +02:00
Víctor Manuel Jáquez Leal
45487fe87c vaapidecode: set format before decide allocation
There is a regression from commit 3d8e5e. It was expected the buffer pool
allocation occur before the caps negotiation, but it is not.

This patch fixes this regression: the caps negotiation is done regardless the
allocation query from downstream.

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

https://bugzilla.gnome.org/show_bug.cgi?id=756686
2015-10-20 12:32:44 +02:00
Sreerenj Balachandran
087e549c1e vaapidecode: Fix buffer copy assertion
Don't try to copy the NULL buffer-codec_data.
2015-10-12 14:13:03 +03:00
Víctor Manuel Jáquez Leal
52b94556ed gstcompat: add gst_buffer_copy_deep() if gst < 1.5
gst_buffer_copy_deep() was added in GStreamer 1.5. If want to use it we should
add an implementation if gstreamer-vaapi is linked to previous versions.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
2015-09-23 17:11:21 +02:00
Víctor Manuel Jáquez Leal
5ab4c15754 vaapidecode: simplify copy of GstVideoCodecState
Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
2015-09-23 12:13:41 +02:00
Víctor Manuel Jáquez Leal
2aaafe96b7 build: link libgstvaapi_parse against codec parser
GST_CODEC_PARSER_* variables are defined if builtin codec parsers are disabled
when running configure.

Right now, libgstcodecparsers links only to libgstvaapi, but libgstvaapi_parse
need it if builtin codec parsers are disabled.

This patch adds GST_CODEC_PARSER_* variables to libgstvaapi_parse
compilation. If builtin codec parsers are enable, this variable is null, so it
should work using libgstvaapi, as normal.

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

https://bugzilla.gnome.org/show_bug.cgi?id=754845
2015-09-15 19:36:37 +02:00
Mark Nauwelaerts
6d0c2a8e23 vaapidecode: proper numerator and denominator for forced latency framerate
https://bugzilla.gnome.org/show_bug.cgi?id=755040
2015-09-15 11:01:29 +03:00
Jan Schmidt
b0194a1dc5 multiview: initial attempt at stereo/multiview support
Add support for marking caps and buffers for multiview or
stereoscopic output.

https://bugzilla.gnome.org/show_bug.cgi?id=750835
2015-08-31 17:51:56 +02:00
Víctor Manuel Jáquez Leal
dbedad66df vaapidecode: remove (another) unused variable
Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
2015-08-31 13:13:11 +02:00
Víctor Manuel Jáquez Leal
9d8a014423 vaapidecode: remove unused variable
Thus silence the compilation warnings.
2015-08-28 17:10:40 +02:00
Víctor Manuel Jáquez Leal
b8068874d5 vaapidecode: compilation fix
gst_vaapi_decoder_state_changed() returns void. This patch fixes the
compilation where the toolchain uses restrictive flags as clang.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
2015-08-28 16:07:31 +02:00
Víctor Manuel Jáquez Leal
32d1c5adff vaapidecode: renegotiate if caps are not equal
The use of gst_caps_is_always_compatible() for this optimization may lead to
false positives. It is better to stick to gst_caps_is_strictly_equal() to know
if it is required a re-negotiation.

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

https://bugzilla.gnome.org/show_bug.cgi?id=750835
2015-08-29 00:27:05 +03:00
Sreerenj Balachandran
6eba201f32 vaapidecode: Rework the re-negotiation code to handle multi resoultion videos
Delaying the pool re-negotiation untill we push all decoded (and queued)
frames downstream. Otherwise for the multi-resolution videos, the
GstVideoVideoMemory will be having wrong resolution and which leads
to nasty behaviours, especially when using software renderers.

sample media file: RAP_B_Bossen_1.bin
case explained:
The first SPS Nal will report resoultion of 448x256 and having crop rectangles to
get the final resoultion 416x240.
Starting from 25 th frame, the resolution will change to 416x240. But parser
elements won't report this since the effective croped resolution is same in
both cases. Here the core libgstvaapi will detect this through it's internal
parsing and do all context/pool destory/reset stuffs. Also it will notify this
change to plugins in advance. But if the plugin try to do re-negotiaion of pool
immediately, this will not sync with the resolution of already decoded and queued
frames and which will lead to failure in gst_video_frame_map() in downstream(if we use the
software renderer). So we have to delay the pool renegotiation in vaapidecode,
untill we push all decoded frames downstream.

https://bugzilla.gnome.org/show_bug.cgi?id=753914
2015-08-29 00:18:57 +03:00
Sreerenj Balachandran
ba8fcf5435 vaapidecode: Always keep a copy of input codec state
Currently we are sharing the input GstVideoCodecState with
GstVaapiDecoder(gst-libs/gst/vaapi) by just doing ref and unref for
each caps change. This is troublesome in many cases, for eg: if
resoultion changes with in a singe stream. Because, when ever there
is a resolution change, GstVideoDecoder will first change the Codec_state->caps
fields with new resolution, but since we are using the same codecstate (ref)
in gstvaapidecode.c, the caps check for input caps change will always fail.

https://bugzilla.gnome.org/show_bug.cgi?id=753914
2015-08-28 23:43:47 +03:00
Víctor Manuel Jáquez Leal
18a8b87975 Revert "Marking rank of vaapidecodebin as GST_RANK_MARGINAL for now."
This reverts commit 3ccb198b51.
2015-08-13 17:34:42 +02:00
Víctor Manuel Jáquez Leal
7f34c6e17d vaapidecodebin: check for postproc instance
If the VPP's deinterlace-method is set, first we should check if the postproc
is already instanced to set it. Otherwise we just store it until the VPP is
added into the bin.

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

https://bugzilla.gnome.org/show_bug.cgi?id=749554
2015-08-13 17:34:42 +02:00
Víctor Manuel Jáquez Leal
ee5d8ee202 vaapidecodebin: ensure VPP before going to READY
There are sometimes that the VA-API display context is not shared among the
pipeline, but it is important to know it before going to READY state (when the
pipeline is already linked).

One instance of this case is this:

gst-launch-1.0 filesrc location=media ! decodebin ! vaapipostproc ! vaapisink

This patch adds a new function in gstvaapipluginutil called
gst_vaapi_create_test_display(). Its purpose is to create a disposable VA-API
display, which only will be used for verify if the VAEntrypointVideoProc is
available by the hardware. Afterwards, it should be unrefed.

If the vaapidecodebin is going to READY state, and the element still doesn't
know if VPP is available, the last resort is to create a new instance of the
VA-API display and test for it.

https://bugzilla.gnome.org/show_bug.cgi?id=749554
2015-08-13 17:34:42 +02:00
Víctor Manuel Jáquez Leal
1e061c54e1 vaapidecodebin: post an error message if fails
If the construction of the bin fails, post an error message in the bus.

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

https://bugzilla.gnome.org/show_bug.cgi?id=749554
2015-08-13 17:34:42 +02:00
Víctor Manuel Jáquez Leal
0004301714 vaapidecodebin: has_vpp as a tri-state variable
has_vpp can be UNKNOWN while the context message hasn't being received.

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

https://bugzilla.gnome.org/show_bug.cgi?id=749554
2015-08-13 17:34:42 +02:00
Víctor Manuel Jáquez Leal
f0d6b0ac3f gstvaapivideomemory: native format with no derived image
If USE_NATIVE_FORMATS is defined we bail out before configuring the surface
info based on the derived image configuration.

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

https://bugzilla.gnome.org/show_bug.cgi?id=744042
2015-08-13 17:20:19 +02:00
Víctor Manuel Jáquez Leal
ceb70c3ca6 surface pool config based on video info
First added the function gst_vaapi_video_format_get_best_native(), which
returns the best native format that matches a particular chroma type:

YUV 4:2:0 -> NV12, YUV 4:2:2 -> YUY2, YUV 4:0:0 -> Y800

RGB32 chroma and encoded format map to NV12 too.

That format is used to configure, initially, the surface's pool for the
allocator.

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

https://bugzilla.gnome.org/show_bug.cgi?id=744042
2015-08-13 17:20:19 +02:00
Víctor Manuel Jáquez Leal
940dc1a18e gstvaapivideomemory: refactor gst_vaapi_video_allocator_new()
Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>

https://bugzilla.gnome.org/show_bug.cgi?id=744042
2015-08-13 17:20:19 +02:00
Víctor Manuel Jáquez Leal
de1bc55ceb gstvaapivideocontext: remove unused parameter
gst_vaapi_video_context_prepare() received an unused parameter. This patch
removes it and the structure passed by the caller.

This a left over of "Removal of gstreamer-1.0 support" (commit 8b36e25f).

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
2015-08-06 19:07:13 +02: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
Victor Jaquez
9bdf43a843 plugins: reduce the noise of warnings
Those messagse should be attached to the object, also the lack of
caps is not an error, in particular in the case of JPEG encoding.

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

https://bugzilla.gnome.org/show_bug.cgi?id=744042
2015-08-04 19:42:48 +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
b601bf0df6 vaapidecode: don't lost GLTextureUpload on seek
When seeking, the decoder is reset, but the buffer pool is not
re-negotiated, but in reset_full() the code forgets if the negotiated buffer
pool has the GLTextureUpload meta.

The decoder knows that GLTextureUpload meta was negotiated in
decide_allocation(), but this method is not called when seeking.

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

https://bugzilla.gnome.org/show_bug.cgi?id=752929
2015-08-04 19:20:48 +02:00
Víctor Manuel Jáquez Leal
c76fe74297 plugins: don't use gst_pad_get_allowed_caps()
gst_pad_get_allowed_caps() query the pad and the peer pad. In the case
decoders, that is OK, but in the case of the postproc might lead loops,
since the gst_base_transform_query_caps() forwards the query upstream
and forth.

Instead of gst_pad_get_allowed_caps() we only query the peer with
gst_pad_peer_query_caps() using the pad's template as filter.

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

https://bugzilla.gnome.org/show_bug.cgi?id=752558
2015-08-04 19:05:25 +02:00
Gwenole Beauchesne
939bdb08a5 decoder: add initial infrastructure for marking corrupted output.
Add initial infrastructure in core codec library and vaapidecode to mark
corrupted frames as such. A corrupted frame is such a frame that was
reconstructed from invalid references for instance.

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

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2015-07-20 15:25:46 +02:00
Sreerenj Balachandran
3ccb198b51 Marking rank of vaapidecodebin as GST_RANK_MARGINAL for now.
Unfortunately vaapidecodebin element is not seems to be stable
enough for autoplugging ahead of vaapidecode.
Lowering the rank for now (cosidering the immediate 0.6 release).

See this: https://bugzilla.gnome.org/show_bug.cgi?id=749554

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
2015-07-07 20:57:20 +03: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
Víctor Manuel Jáquez Leal
b4d9c0a79a vaapidecodebin: notify if vpp is disabled
When the system is aware that VPP is not available by the VA driver,
it would be useful to notify to the user that the disable-vpp property
has changed.

https://bugzilla.gnome.org/show_bug.cgi?id=749554
2015-07-02 12:29:35 +02:00
Víctor Manuel Jáquez Leal
5c799b35f7 vaapidecodebin: enable vpp if it is available
Instead of creating and adding VPP into the bin at setup, we wait until
we are sure the VA driver supports it. We know that when the VA video
context is received by the bin. Afterwards, it is decided to instanciate
and link the VPP or not.

This is more efficient and safer than waiting the VPP to fail and then
disable it.

https://bugzilla.gnome.org/show_bug.cgi?id=749554
2015-07-02 12:29:35 +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
f1bc4f8461 vaapidecodebin: Add property to disable VPP
Adding a new propery "disable-vpp", enabling it will prevent
the insertion of vaapipostproc child element.

This is helpful in debugging, specifically to narrow-down the
vaapidecodebin/vaapipostproc related negotiation issues.

No support for run-time disabling for now.

https://bugzilla.gnome.org/show_bug.cgi?id=745901
2015-06-30 09:35:37 +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
Simon Farnsworth
d946e7972e Work around ABBA deadlock between vaapisink and vaapipostproc
vaapisink takes the display lock, then does a gst_buffer_replace which can
take the lock on the gst_vaapi_video_pool.

vaapipostproc asks the gst_vaapi_video_pool for a new surface. This takes
the lock on the gst_vaapi_video_pool; if you're unlucky, there are no free
surfaces, which means that gst_vaapi_surface_create is
called. gst_vaapi_surface_create takes the display lock.

If vaapisink and vaapipostproc are in different threads, and this happens,
you get a deadlock. vaapisink holds the display lock, and wants the
gst_vaapi_video_pool lock. vaapipostproc holds the gst_vaapi_video_pool lock
and wants the display lock.

Work around this by releasing the display lock in vaapisink around the
gst_buffer_replace.

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

Signed-off-by: Simon Farnsworth <simon.farnsworth@onelan.co.uk>
Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
2015-06-29 13:10:15 +03:00
Jacobo Aragunde Pérez
76060c9542 vaapidecodebin: expose deinterlace-method property from inner vaapipostproc
https://bugzilla.gnome.org/show_bug.cgi?id=745901
2015-06-25 16:16:45 +02:00
Víctor Manuel Jáquez Leal
eb510e23ce vaapipostproc: log negotiated caps 2015-06-22 17:15:50 +02:00