Commit graph

287 commits

Author SHA1 Message Date
Víctor Manuel Jáquez Leal
9827ab0f3f vaapidecode: generate system allocated buffers
Generate system allocated output buffers when downstream doesn't
support GstVideoMeta.

The VA buffer content is copied to the new output buffer, and it
replaces the VA buffer.

https://bugzilla.gnome.org/show_bug.cgi?id=785054
2018-02-20 10:58:08 -06:00
Víctor Manuel Jáquez Leal
a4daa2a04a vaapidecode: drain pending frames before set format
Drain pending frames, if any, in the internal decoder before setting
the new negotiated format.

https://bugzilla.gnome.org/show_bug.cgi?id=786173
2017-09-26 10:48:20 +02:00
Orestis Floros
1ae42facc1 vaapidecode: force add h264 SVC profiles in caps
When vaapih264dec's base-only profile is set to TRUE, fake SVC profile
support in caps.

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

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
2017-08-28 17:34:50 -07:00
Hyunjun Ko
ee159b58ee vaapidecode: fix mismatch of the return type
https://bugzilla.gnome.org/show_bug.cgi?id=786307
2017-08-15 11:50:22 +03:00
Víctor Manuel Jáquez Leal
0b3ca62632 vaapidecode: initialize variable
Coverity scan bug:

The variable will contain an arbitrary value left from earlier
computations.

Variable base_only is fetched from base-only property, and it may be
not assigned. It needs to be initialized.
2017-08-08 17:34:12 +02:00
orestisf
3bb96eff14 vaapidecode: fix gst_caps_new_simple call
https://bugzilla.gnome.org/show_bug.cgi?id=732265
2017-08-03 23:28:59 +02:00
orestisf
d4b6459bb2 vaapidecode: force add h264 MVC profiles in caps
When vaapih264dec's base-only profile is set to TRUE, fake MVC profile
support in caps.

https://bugzilla.gnome.org/show_bug.cgi?id=732265
2017-08-03 17:07:22 +02:00
orestisf
66703a7835 vaapidecode: set h264 base-only to decoder
Set the base-only value when property is set and the internal
decoder is already instantiated or when the internal decoder
is created.

https://bugzilla.gnome.org/show_bug.cgi?id=732265
2017-08-03 17:07:14 +02:00
Víctor Manuel Jáquez Leal
551ae940a7 vaapidecode: set h264 low latency to decoder
https://bugzilla.gnome.org/show_bug.cgi?id=783588
2017-07-07 19:32:11 +02:00
Víctor Manuel Jáquez Leal
484033d039 vaapidecode_props: add skeleton for h264 decoder properties
https://bugzilla.gnome.org/show_bug.cgi?id=783588
2017-07-07 19:32:11 +02:00
Víctor Manuel Jáquez Leal
207486aa1f vaapidecode: properties callback in decoders map
https://bugzilla.gnome.org/show_bug.cgi?id=783588
2017-07-07 19:32:11 +02:00
Víctor Manuel Jáquez Leal
332cfe5626 vaapidecode: add support for DMABuf caps feature
https://bugzilla.gnome.org/show_bug.cgi?id=755072

Original-patch-by: Julien Isorce <j.isorce@samsung.com>
2017-06-23 18:44:42 +02:00
Jan Schmidt
ebca86dcc7 vaapidecode: Don't renegotiate on every flush
If caps don't actually change, don't update the
decoder and don't set the do_renego flag forcing
downstream renegotiation

https://bugzilla.gnome.org/show_bug.cgi?id=781142
2017-04-12 10:43:49 +10:00
Jan Schmidt
a7a9b33ad9 Implement decoder reset on flush, rather than recreating
Clear decoders out on a flush but keep the same instance,
rather than completely recreating them. That avoids
unecessarily freeing and recreating surface pools
and contexts, which can be quite expensive

https://bugzilla.gnome.org/show_bug.cgi?id=781142
2017-04-12 10:43:49 +10:00
Víctor Manuel Jáquez Leal
152217064f plugins: when debug disabled, default category is NULL
As in gstreamer-vaapi a common base class is used, the specific
default category is passed to the base-plugin initializator, thus
the log messages are categorized with the used plugin.

Nonetheless, when the gst-debug is disabled in compilation time,
it is needed to pass NULL to the base-plugin initializator. This
patch does that.

https://bugzilla.gnome.org/show_bug.cgi?id=780302
2017-03-20 19:15:39 +01:00
Víctor Manuel Jáquez Leal
bce6e1416b vaapidecode: texture upload if driver supports GL
When the allowed source pad caps are generated, the GLTextureUpload caps are
only inserted if the driver support OpenGL.

https://bugzilla.gnome.org/show_bug.cgi?id=772838
2017-03-03 20:01:09 +01:00
Scott D Phillips
884e0bece2 build: rename USE_HEVC_DECODER to USE_H265_DECODER
Rename to be consistent with H.264 and also H.265 encoder. The
meson build assumed this was already consistently named, and so
previously was not able to actually build the H.265 decoder.

https://bugzilla.gnome.org/show_bug.cgi?id=778576
2017-02-16 17:27:50 +01:00
Víctor Manuel Jáquez Leal
b0016e336b vaapidecode: don't GLTextureUpload if dmabuf
Do not add the meta:GstVideoGLTextureUploadMeta feature if the render
element can handle dmabuf-based buffers, avoiding its negotiation.
2017-02-03 17:11:56 +01:00
Julien Isorce
25e8309567 vaapidecode: make pool to export decoder's surface
Use new -base API gst_video_decoder_allocate_output_frame_full() to
pass the current proxy/surface to the pool.

The pool will will export thins given surface instead of exporting a
brand new surface that will never be filled in with meaningfull data.

https://bugzilla.gnome.org/show_bug.cgi?id=755072
2017-02-03 17:11:20 +01:00
Víctor Manuel Jáquez Leal
c9bd45f05d plugins: handle GL params through context query
If the element instantiated the GL display and context, they should
handle them too through the context query.

https://bugzilla.gnome.org/show_bug.cgi?id=777409
2017-01-27 13:35:40 +01:00
Víctor Manuel Jáquez Leal
8654829628 vaapidecode: update internal decoder sink caps
When a new sink caps arrive the internal decoder state is updated
and, if it is, request a downstream renegotiation.

Previously, when new caps arrived the whole decoder where destroyed
and recreated. Now, if the caps are compatible or has the same codec,
the internal decoder is kept, but a downstream renegotiation is
requested.

https://bugzilla.gnome.org/show_bug.cgi?id=776979
2017-01-18 11:30:49 +01:00
Víctor Manuel Jáquez Leal
daed911caf vaapidecode: lock stream when setting caps 2016-12-09 17:56:02 +01:00
Víctor Manuel Jáquez Leal
ba49dc9dd7 Revert "vaapidecode: implement negotiate() vmethod"
This reverts commit 3285121181.

videodecode's negotiate() vmethod is also called when events arrive,
but this would mean that the proper configuration of sink pad might
not be complete, thus we should not update the src pad.

Let's keep the old non-vmethod negotitate().
2016-12-09 17:42:42 +01:00
Víctor Manuel Jáquez Leal
3285121181 vaapidecode: implement negotiate() vmethod
Instead of decorating the negotiate() method, let us override it,
so the stream is locked while called.

https://bugzilla.gnome.org/show_bug.cgi?id=775040
2016-12-01 11:45:19 +01:00
Víctor Manuel Jáquez Leal
8555eaf079 vaapidecode: don't add video crop meta
Since the differentiation of negotiation caps and allocation caps,
there is no need to add a video crop meta with the negotiation caps.
Hence, removing it.

https://bugzilla.gnome.org/show_bug.cgi?id=773948
2016-11-24 18:32:34 +01:00
Víctor Manuel Jáquez Leal
f09d9ff2ab vaapidecode: negotiate after destroying allocator
This is related with bug 758907 when no vaapipostproc is used (no
vaapidecodebin). In order to negotiate downstream we need to destroy
the source pad allocator, otherwise the same allocated buffers are
used, failing the mapping.
2016-11-21 19:00:04 +01:00
Víctor Manuel Jáquez Leal
02cd120bc8 vaapidecode: unref allowed_sinkpad_caps at close()
The variable member allowed_sinkpad_caps is constructed querying the
current VA display. Bearing that in mind, the variable shall be freed
when the VA display changes or is removed.

This patch moves the freeing of allowed_sinkpad_caps to close(), when
the VA display is freed.
2016-11-11 10:48:43 +01:00
Víctor Manuel Jáquez Leal
d7231f66cc vaapidecode: guard GST_VAAPI_MAKE_GLTEXUPLOAD_CAPS
In commit 6d11a00 were introduced a regression when gstreamer-vaapi is
compiled with out EGL/GLX support: it shall not support
GST_VAAPI_MAKE_GLTEXUPLOAD_CAPS.

This patch guards the inclusion of GST_VAAPI_MAKE_GLTEXUPLOAD_CAPS in the
allowed src caps for vaapedecode if EGL/GLX.
2016-11-04 16:26:18 +01:00
Víctor Manuel Jáquez Leal
6d11a0098e vaapidecode: generate source pad caps
Just as vaapipostproc, VA decoder's context can be queried to get the possible
raw formats, so, the src caps can negotiate the exact caps that the context
supports.
2016-11-03 13:04:09 +01:00
Víctor Manuel Jáquez Leal
74a9f76d32 docs: replace vaapidecode with each codec
In the spirit of the codec split, this patch removes the documentation of
vaapidecode and adds a page per each possible decoder.

Nonetheless, only those available in the compilation system are going to be
instrospected, because the rest are not registered.
2016-10-27 13:04:37 +02:00
Víctor Manuel Jáquez Leal
c258343243 vaapidecode: rename member to allowed_sinkpad_caps
vaapidecode has a member named allowed_caps, but this name is not enough
explicit. This patch renames allowed_caps to allowed_sinkpad_caps.

No functional changes were included.

https://bugzilla.gnome.org/show_bug.cgi?id=773497
2016-10-25 19:38:26 +02:00
Víctor Manuel Jáquez Leal
039e8c0d56 vaapidecode: rename element description
So encoders and decoders have similar descriptions.

https://bugzilla.gnome.org/show_bug.cgi?id=773497
2016-10-25 19:36:07 +02:00
Vineeth TM
57313f3f70 vaapi: use new gst_element_class_add_static_pad_template()
https://bugzilla.gnome.org/show_bug.cgi?id=763083

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
2016-09-23 12:33:58 +02:00
Víctor Manuel Jáquez Leal
99d404f1df vaapidecode: reset decoder hard when set_format()
set_format() is called by upstream when the stream capabilites has changed.
Before, if the new stream is compatible with the old one the VA decoder was
not destroyed. Nonetheless, with this behavoir, the VA decoder ignores
when the upstreamer parsers gets more details of the stream, such as the
framerate. Hence, when the src caps are negotiates, the further sink caps
updates are ignored.

This patch forces the VA decoder destroying and recreation when set_format()
is called.

https://bugzilla.gnome.org/show_bug.cgi?id=770921
2016-09-15 10:38:08 +02:00
Víctor Manuel Jáquez Leal
5ed967088f vaapidecode: merge vc1 and wmv3 elements
This patch merges vaapivc1dec and vaapiwmv3dec into a single
vaapivc1dec. Also, removed the WMVA format, since it is not
supported by libva.

https://bugzilla.gnome.org/show_bug.cgi?id=734093
2016-09-06 12:39:22 +02:00
Víctor Manuel Jáquez Leal
5beccf5fa0 vaapidecode: register only the available decoders
In order to register only the available decoders, this patch queries the
created test VA display, which uses the currently used back-end (X11, Wayland,
DRM, …) on the used display device.

https://bugzilla.gnome.org/show_bug.cgi?id=724352
2016-07-22 17:23:23 +02:00
Víctor Manuel Jáquez Leal
55daedf514 vaapidecode: split all the codecs
Split the vaapidecode to all the supported codecs with the format
vaapi{codec}dec.

vaapidecode is stil registered as a GObject type, but not as a
GStreamer feature, so it can be used internally by vaapidecodebin without
changing its code too much.

https://bugzilla.gnome.org/show_bug.cgi?id=734093
2016-07-22 17:23:23 +02:00
Víctor Manuel Jáquez Leal
cc6c2d23ce vaapidecode: delay the GstVaapiDisplay instantiating
Delay the GstVaapiDisplay instantiating until when changing the state from
READY to PAUSE. In this way the element has more chances to find an already
created GstVaapiDisplay, or a GL context, in the pipeline.

https://bugzilla.gnome.org/show_bug.cgi?id=766206
2016-07-22 17:23:23 +02:00
Víctor Manuel Jáquez Leal
4a9b204652 vaapidecode: remove change_state() vmethod
Since the driver checkup is done at registering, there is no need to do it
when changing the element state from NULL to READY. This patch remove this
vmethod from vaapidecode.
2016-07-22 17:23:23 +02:00
Víctor Manuel Jáquez Leal
024d540195 vaapidecode: remove unneeded initializations
GObject's memory is set to zero, so there is no need to initialize to zero or
NULL it's class variables.
2016-07-22 17:18:16 +02:00
Hyunjun Ko
19c0c8a973 vaapidecode: drop non-keyframe in reverse playback
To avoid surface-exhausted situation during reverse playback,
drop frames except for key frame.

Also, to avoid the corruption of the parser state, flush() vmethod
doesn't destroy the VA decoder when playing in reverse.

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

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
2016-07-11 10:42:46 +02:00
Víctor Manuel Jáquez Leal
c9a5801c35 vaapidecode: unref output frame earlier
The queue in GstVaapiDecode adds an extra reference to the frames. This patch
unref that extra reference earlier making the code simpler to follow.

https://bugzilla.gnome.org/show_bug.cgi?id=768652
2016-07-11 10:40:15 +02:00
Víctor Manuel Jáquez Leal
cb0ec6b60c vaapidecode: remove gst_vaapidecode_internal_flush()
As gst_vaapidecode_finish() is the only callee of
gst_vaapidecode_internal_flush(), it is better to inline it.

https://bugzilla.gnome.org/show_bug.cgi?id=768652
2016-07-11 10:40:14 +02:00
Víctor Manuel Jáquez Leal
b392b4f064 vaapidecode: flush output adapter at drain()
Calling drain() vmethod means "decode any data it can at this point, but that
more data may arrive after". Hence, vaapidecode should check if there is data
in the output adapter and process them, without destroying the decoded picture
buffer (dpb).

Since this operation is done by gst_vaapidecode_internal_flush(), the operation
was refactored into a new function gst_vaapidecode_flush_output_adapter().

https://bugzilla.gnome.org/show_bug.cgi?id=768652
2016-07-11 10:40:14 +02:00
Víctor Manuel Jáquez Leal
03e85bbc0f vaapidecode: call purge at flush()
Calling flush() vmethod means "to flush all remaining data from the decoder
without pushing it downstream".

Nonetheless flush() is calling gst_vaapidecode_internal_flush(), which calls
gst_video_decoder_have_frame() if there is still something in the input
adapter, which may push buffers to downstream by calling handle_frame().

This patch changes this behavior by calling gst_vaapidecode_purge() rather
than gst_vaapidecode_internal_flush(), which does what we want: flushes the VA
decoder and releases all the rest of decoded frames.

https://bugzilla.gnome.org/show_bug.cgi?id=768652
2016-07-11 10:40:14 +02: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
Hyunjun Ko
1e52269b89 vaapidecode: remove chroma-site and colorimetry from src caps
https://bugzilla.gnome.org/show_bug.cgi?id=766596
2016-06-08 10:17:02 +02:00
Víctor Manuel Jáquez Leal
1f5ba28bd0 plugins: check for caps in query earlier
Check for caps as soon gst_query_parse_allocation() returns.
2016-05-24 10:33:18 +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