Commit graph

785 commits

Author SHA1 Message Date
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
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
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
Víctor Manuel Jáquez Leal
ce6275020e plugin: simplify caps feature selection
This patch simplifies the function gst_vaapi_find_preferred_caps_feature().

Instead of intersecting custom caps to find the preferred feature, the peer
caps are traversed in order to find the preferred feature, according to an
ordered feature priority list.

In the case of GLTextureUploadMeta, the colour format is computed using
GstVideoInfo of the selected fixed caps.

https://bugzilla.gnome.org/show_bug.cgi?id=765223
2016-04-18 18:28:43 +02:00
Víctor Manuel Jáquez Leal
8c26070151 vaapidecode: use macros for GstVideoInfo
Instead of accessing directly to the members of the structure, use the macros.
2016-04-18 16:55:01 +02:00
Víctor Manuel Jáquez Leal
aa16804121 vaapidecode: refactor is_display_resolution_changed()
Make the comparisons more readable and simple.

https://bugzilla.gnome.org/show_bug.cgi?id=764316
2016-04-18 11:14:04 +02:00
Víctor Manuel Jáquez Leal
49a59f00eb vaapidecode: keep only display_{width,height}
Instead of keeping the structure GstVideoInfo when we are using its width and
height, we only keep these two guints.

https://bugzilla.gnome.org/show_bug.cgi?id=764316
2016-04-18 11:14:04 +02:00
Víctor Manuel Jáquez Leal
737fca4ddf vaapidecode: decoded_info is valid at src caps update
As decoded_info is assured to be valid when gst_vaapidecode_update_src_caps()
is called, then we don't need to verify or replace it with the sinkpad info
(reference state).

https://bugzilla.gnome.org/show_bug.cgi?id=764316
2016-04-18 11:14:04 +02:00
Víctor Manuel Jáquez Leal
3e97d71935 vaapidecode: always a valid format in decoded_info
Always set a valid format in decoded_info class variable.

https://bugzilla.gnome.org/show_bug.cgi?id=764316
2016-04-18 11:14:04 +02:00
Víctor Manuel Jáquez Leal
ade0c7bb43 vaapidecode: code style fixes
No functional changes.

https://bugzilla.gnome.org/show_bug.cgi?id=764316
2016-04-18 11:14:04 +02:00
Víctor Manuel Jáquez Leal
80eb682b64 vaapidecode: init {decoded,display}_info at open()
It is required to initialize {decoded,display}_info variables when the decoder
is open, not only at instance initialization.

https://bugzilla.gnome.org/show_bug.cgi?id=764316
2016-04-18 11:14:04 +02:00
Víctor Manuel Jáquez Leal
3478b27c92 vaapidecode: remove spurious class variables
active, do_pool_renego and do_outstate_renego class variables were used to
indicate when negotiate downstream once, but now that each time a new surface
resolution is pop out a renegotation verified, these variable are not required
anymore.

https://bugzilla.gnome.org/show_bug.cgi?id=764316
2016-04-18 11:14:04 +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
Víctor Manuel Jáquez Leal
f61b728ae1 plugins: fix compilation when EGL/GLX is disabled
The compiler might complain of gst_vaapi_create_display_from_handle() being
unused if both EGL and GLX are disabled. This patch avoid that compilation
error.
2016-04-13 20:35:59 +02:00
Thiago Santos
506c9e2b5b vaapidecode: add stop function
Clear any status on the current stream:

stored frames, caps and decoder configuration

https://bugzilla.gnome.org/show_bug.cgi?id=763460
2016-04-01 09:53:24 -03:00
Víctor Manuel Jáquez Leal
d4f00383ed unify caps template for VAAPI encoders and decoders
There is no difference in VAAPI surface caps between encoders and decoders.
Thus, the patch makes a simplification by removing encoders specific caps and
shares the same definition of VAAPI surfaces caps for all the elements.
2016-03-30 16:55:26 +02:00
Víctor Manuel Jáquez Leal
fe08f7ecdc vaapidecode: move gst_vaapidecode_negotiate() code
With it we can remove a function declaration, making the code a bit
more readable.

https://bugzilla.gnome.org/show_bug.cgi?id=764316
2016-03-30 16:22:51 +02:00
Víctor Manuel Jáquez Leal
aac0f50500 docs: generate vaapijpegdec documentation
https://bugzilla.gnome.org/show_bug.cgi?id=764314
2016-03-30 15:07:43 +02:00
Sreerenj Balachandran
fd04a7c046 gst/vaapi: keep precedence for NV12 over I420
Use NV12 as default "assumption" format all over.
NV12 is the default high priority format used my most of the
vaapi-drivers.
2016-03-29 15:02:46 +03:00
Sreerenj Balachandran
75a20deab4 vaapidecode: Use video format derived from decoded surface as default src pad format
Use the surface format derived from first decoded surface
to negotiate the downstream video format capabilities.

https://bugzilla.gnome.org/show_bug.cgi?id=759181
2016-03-29 14:34:37 +03:00
Scott D Phillips
eea3f0cdb2 Add P010 video format support
The P010 video format is the native format used by the vaapi intel driver
for HEVCMain10 decode . Add support for planes and images of this video format.

https://bugzilla.gnome.org/show_bug.cgi?id=759181
2016-03-29 14:34:00 +03:00
Víctor Manuel Jáquez Leal
ddddb0415b gltextureupload: use an array for texture type
Instead of using a single value for the texture type, use an array with 4
elements, just as the GstVideoGLTextureUploadMeta, avoiding a buffer
overflow.

https://bugzilla.gnome.org/show_bug.cgi?id=764231
2016-03-28 15:32:47 +02:00
Sreerenj Balachandran
959d14ce8a vaapidecode: Fix decide_allocation handling
Set the already configured pool in decide_allocation query
in cases where pool renegotiation is not required.

https://bugzilla.gnome.org/show_bug.cgi?id=753914
2016-03-24 15:09:43 +02:00
Sreerenj Balachandran
6b17ed9060 vaapidecode: Derive and save the decoded surface format
After the decoding of first frame, try to extract the exact
decoded surface format using vaDeriveImage and keep this
as the format in decoded_info.

https://bugzilla.gnome.org/show_bug.cgi?id=753914
2016-03-24 15:09:15 +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
Sreerenj Balachandran
c2aa405a3e vaapidecode: Delay the output format setting until we have a decoded surface
This will help to consoidate the out caps negotiation to a single place,
which will make the code simpler, allows to get the exact decoded format
if needed and the selected chroma type too.

https://bugzilla.gnome.org/show_bug.cgi?id=753914
2016-03-24 15:08:27 +02:00
Víctor Manuel Jáquez Leal
3ec9286728 vaapidecode: GST_VAAPIDECODE macro is a cast
This patch is the continuation of commit 1e1d3b1d because the function
gst_vaapidecode_get_type() got undefined since then.

Now, the macro GST_VAAPIDECODE is a simple cast to the GstVaapiDecode
structure. The rest of the GObject handling macros were deleted too.
2016-03-24 13:36:24 +01:00
Víctor Manuel Jáquez Leal
1b11e357d8 vaapidecodebin: don't handle jpeg decoding
As JPEG decoder has been split and demoted, it cannot be handled by
vaapidecodebin

Added a fixme comment regarding the future removal of vaapidecode.

https://bugzilla.gnome.org/show_bug.cgi?id=734093
2016-03-11 10:23:39 +01:00
Víctor Manuel Jáquez Leal
1e1d3b1d09 vaapidecode: split out jpeg decoder
Split, as a different element, the JPEG decoder.

https://bugzilla.gnome.org/show_bug.cgi?id=734093
2016-03-11 10:23:08 +01:00
Víctor Manuel Jáquez Leal
96ac9bee8e vaapidecode: register decoder with internal GType
Don't expose the the vaapidecode GType, instead expose a function
which will register element.

This is the first step to split the decoder by codecs.

https://bugzilla.gnome.org/show_bug.cgi?id=734093
2016-03-11 09:42:37 +01:00
Víctor Manuel Jáquez Leal
8aa880786d vaapidecode: remove unused function declaration
There is no need to pre-declare gst_vaapidecode_update_sink_caps(). And fixed
code-style of the other pre-declared functions.
2016-03-10 12:54:39 +01:00
Vineeth TM
1608eff3e5 plugins: fix gstgl and vaapi memory leaks
1\ Unref gl_display and gl_window as soon they are not needed.
2\ Remove an unneeded display type check, since is handled by
   gst_vaapi_created_display_from_handle()
3\ Unref vaapi's display if the display cannot be bind to a GL API.

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

https://bugzilla.gnome.org/show_bug.cgi?id=763354
2016-03-09 15:39:31 +01:00
Víctor Manuel Jáquez Leal
548528c817 plugins: proxy information from downstream caps
Propagate to upstream the downstream information, such as fps, par, etc.

This will fix several "getcaps" critical warnings in gst-validate.

https://bugzilla.gnome.org/show_bug.cgi?id=763300
2016-03-08 10:54:04 +01:00
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