Commit graph

301 commits

Author SHA1 Message Date
Haihao Xiang
920b1ec7a8 vaapi: bump the minimum vaapi version requirement to 0.39.0
And reduce unnecessary API version and structures check as well.

https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/issues/108
2019-01-07 17:46:42 +00:00
He Junyan
7663fa263c plugins: Add more check for allowed raw caps.
The gst_vaapi_plugin_base_get_allowed_raw_caps is used for both sink
pad and src pad, which cause some bugs. For sink pad, we need to verify
vaPutImage() while for the src pad we need to verify vaGetImage().
For vaapidecoderXXX kind of plugins, the case is more complex. We need
to verify whether the decoded result(in some surface, NV12 format most
of the time) can be vaGetImage to some raw image format. Add more check
to fix all these problems.

https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/issues/123

Signed-off-by: He Junyan <junyan.he@hotmail.com>
2018-12-24 10:46:23 +00:00
Wangfei
5e7988b2d8 libs: dec: h265: support decode for main-444 10bit streams.
Add 444 10bit yuv format Y410, which can be used to decode
main-444 10bit streams. Currently, this feature is only
supported by media-driver in Icelake.
2018-12-04 13:25:59 +08:00
Jordan Petridis
d8b3c0495f
Run gst-indent through the files
This is required before we enabled an indent test in the CI.

https://gitlab.freedesktop.org/gstreamer/gstreamer-project/issues/33
2018-11-28 05:56:44 +02:00
Wangfei
5d0878b48a libs: dec: h265: support decode for main-444 8bit streams.
Add 444 8bit yuv format AYUV, which can be used to decode
main-444 8bit streams. Currently, this feature is only
supported by media-driver in Icelake.

https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/issues/119
2018-11-14 02:29:54 +00:00
Wangfei
638004875b libs: dec: h265: support decode for main-10-422 10bit streams.
Add 422 10bit yuv format Y210, which can be used to decode
main-10-422 10bit streams. Currently, this feature is only
supported by media-driver in Icelake.

https://bugzilla.gnome.org/show_bug.cgi?id=797264
2018-11-01 14:03:23 +01:00
Philippe Normand
70726aef00 gst: Advertise elements interacting with hardware devices 2018-10-12 15:39:53 +01:00
Wangfei
619abbdeb4 libs: dec: h265: add 422 chroma format support.
Add main-422-10 profile which support 422 chroma format stream.
Currently, this feature is only supported by media-driver in Icelake.

https://bugzilla.gnome.org/show_bug.cgi?id=797143
2018-09-27 11:55:04 +02:00
Matteo Valdina
7872d12695 vaapidecode: Requests upstream a key unit at parse or decode error.
This is done to resume decoding after a parse error or decode error.

Bugzilla: https://bugzilla.gnome.org/show_bug.cgi?id=797006
2018-09-03 16:11:13 +02:00
Matteo Valdina
2cb795fc77 vaapidecode: sets return value in failure case.
In gst_vaapidecode_handle_frame, when there is a decode error
there is a code path the returns an uninitialized value.

Bugzilla: https://bugzilla.gnome.org/show_bug.cgi?id=797006
2018-09-03 15:38:33 +02:00
Nicolas Dufresne
06aa82f989 vaapidecode: Skip unparsable units from adapter
If the unit could not be parsed, just skip this nal and keep parsing
what is left in the adapter. We need to flush the broken unit in the
decoder specific parser because the generic code does not know about
units boundary. This increases error resilliance.

Before this, the broken unit would stay in the adapter and EOS would be
returned. Which stopped the streaming. Just removing the EOS would have
lead to the adapter size growing indefinitely.

https://bugzilla.gnome.org/show_bug.cgi?id=796863
2018-07-25 15:52:54 -04:00
Nicolas Dufresne
d07bffb578 vaapidecoder: Don't error out on decode errors
This is problematic on live pipeline where loosing network can
cause an important amount of errors.

https://bugzilla.gnome.org/show_bug.cgi?id=796832
2018-07-25 15:52:54 -04:00
Víctor Manuel Jáquez Leal
fb1c4c52cc libs: display: remove gst_vaapi_display_unref()
Use gst_object_unref() instead.

https://bugzilla.gnome.org/show_bug.cgi?id=796470
2018-06-14 16:41:00 +02:00
Wang,Fei
2d95089a8d vaapih264dec: add constrained and progressive profiles
Those profiles have been added in the version 2012-01
and 2011-06 of the AVC spec (A.2.4.1 and A.2.4.2).

Both are supported by VAProfileH264High

https://bugzilla.gnome.org/show_bug.cgi?id=795624
2018-04-30 12:48:26 +02:00
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