Commit graph

982 commits

Author SHA1 Message Date
Sebastian Dröge
a8f2309595 vaapidecodebin: Register element if no VPP support is available too
VPP support is only needed for advanced deinterlacing, which is not
enabled by default either. Error out if it is selected but VPP is not
supported, and otherwise just work without VPP support.

https://bugzilla.gnome.org/show_bug.cgi?id=788758
2017-10-20 12:59:10 +02:00
Thibault Saunier
a6e191e09c Avoid infinite loop when vaapi_create_display fails
Which might be the case when using, for example, xvfb.
2017-10-16 11:59:11 +02:00
Víctor Manuel Jáquez Leal
68aca503ce plugins: try to create test display in order
When creating the test display for querying capabilites, it try in
certain order: DRM, Wayland and finally X11. GLX nor EGL are tried
since they are either composited with X11 or Wayland.

The reason for this is to reduce the posibility of failure that could
blacklist the plugin.

https://bugzilla.gnome.org/show_bug.cgi?id=782212
2017-10-03 13:14:55 +02:00
Sebastian Dröge
8a0e22a5bb vaapi: Also register vaapipostproc without VPP support
It can still do simple deinterlacing then.
2017-10-03 13:06:33 +02:00
Sebastian Dröge
76e9ad8646 vaapipostproc: Allow running without VPP support
We returned FALSE from ::start() if VPP support is not available, but it
is only really needed for complex filters and during transform we check
for that. For simple deinterlacing it is not needed.
2017-10-03 12:04:42 +02:00
Víctor Manuel Jáquez Leal
bedaa13d7c vaapipostproc: use scoped variable for return value
Instead of reusing a parameter variable for the return value of
gst_vaapipostproc_transform_caps(), this patch uses the function
scoped pointer. Thus, the code is cleaner.

https://bugzilla.gnome.org/show_bug.cgi?id=785706
2017-09-28 13:56:13 +02:00
Víctor Manuel Jáquez Leal
d3732a7cf8 vaapipostproc: removed unused parameter
Removed caps parameter from gst_vaapipostproc_transform_caps_impl()
helper function since the it is not used.

https://bugzilla.gnome.org/show_bug.cgi?id=785706
2017-09-28 13:56:13 +02:00
Víctor Manuel Jáquez Leal
f6fc1774b9 vaapipostproc: use scoped variable for return value
Instead of reusing a parameter variable for the return value of
gst_vaapipostproc_fixate_caps(), this patch uses the function scoped
pointer. Thus, the code is cleaner.

https://bugzilla.gnome.org/show_bug.cgi?id=785706
2017-09-28 13:56:13 +02:00
Víctor Manuel Jáquez Leal
8fee85ecaa plugins: memory:DMABuf only handles planar formats
When glimagesink negotiates the caps feature memory:DMABuf the
exported dmabufs buffers with NV12 format are not well rendered, thus
setting only planar.

https://bugzilla.gnome.org/show_bug.cgi?id=788229
2017-09-27 11:46:33 +02:00
Víctor Manuel Jáquez Leal
9f4a5762d5 vaapiencode: flush pending frames before set format
Flush pending frames, if any, in the internal encorder, before setting
the new negotiated format.

https://bugzilla.gnome.org/show_bug.cgi?id=786173
2017-09-26 11:34:20 +02: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
Víctor Manuel Jáquez Leal
b063511c05 vaapisink: use GObject setter and getter
Instead of using gst_vaapi_display_set_property() or
gst_vaapi_display_get_property(), this patch set replace it usage
with g_object_set() or g_object_get().

Also the internal helper cb_set_value() is removed since it is not
used anymore.

https://bugzilla.gnome.org/show_bug.cgi?id=788058
2017-09-22 20:06:42 +02:00
Hyunjun Ko
148f867c12 vaapiencode/libs: encoder: fix leaks of properties
https://bugzilla.gnome.org/show_bug.cgi?id=786321
2017-09-15 11:07:55 +02:00
Nicolas Dufresne
2039eb882e Request minimum buffer even if need_pool is FALSE
When tee is used, it will not request a pool, but still it wants to
know how many buffers are required.

https://bugzilla.gnome.org/show_bug.cgi?id=730758
2017-09-06 14:21:31 -04:00
Sreerenj Balachandran
782184e781 vaapisink: Fix rendering in drm display
Make sure vaapisink create a va surface backed buffer pool and all
required attributes get assigned correctly for drm display type.

This is needed to make the below pipeline working:
gst-launch-1.0 filesrc location= raw_video.mov ! videoparse format=uyvy
width=320 height=240 framerate=30/1 ! vaapisink display=drm

https://bugzilla.gnome.org/show_bug.cgi?id=786954
2017-09-01 13:48:01 -07:00
Sreerenj Balachandran
5750bd7850 FEI: plugin: Add vaapih264feienc element
A new FEI based encoder element for h264 is added: vaapih264feienc

FEI is a an extension to VA-API which is providing low level
advanced control over different stages of encoding.
Extending vaapih264enc with fei support is possible, but it will
make the code too much complicated and will be difficult
to debug. So adding the new encoder element, but keeping
the rank as 0 , vaapih264enc will stay as the primary
encoder for normal use cases.

The vaaih264feienc is mainly useful for customers who want to play
with MotionVectors and Macroblock Predictions. Also user can
do one stage of encoding(eg: only the Motion Vector Calculation)
in software and offload trasformation/entroy-coding etc to
Hardware (which is what PAK module is doing) using FEI element.

vaapih264feienc can work in  different modes using fei-mode properoty

eg: gst-launch-1.0 videotestsrc ! vaapih264feienc fei-mode=ENC+PAK ! filesink location=sample.264

Important Note: ENC only mode won't produce any encoded data which is expected.
But ENC alwys requires the output of PAK in order to do the inter-prediction
over reconstructed frames.
Similary PAK mode alway requires MV and MBCode as input, so unless there is an
upstream element providing those buffers, PAK only won't work as expected.

In a nutshell, ENC_PAK and the ENC+PAK modes are the only options we can verify
with vaapih264feienc. But ideally, EN+PAK mode verification is enough to make sure
that ENC and PAK are working as expected since ENC+PAK mode always invoke ENC and PAK
separately in vaapih264feienc.

People contributed:
        Wang, Yi <yi.a.wang@intel.com>
        Leilei <leilei.shang@intel.com>
        Zhong, Xiaoxia <xiaoxia.zhong@intel.com>
        xiaominc <xiaomin.chen@intel.com>
        Li, Jing B <jing.b.li@intel.com>

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

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
2017-09-01 13:15:05 +02:00
Yi A Wang
a46ad6b5be FEI: plugin: Add virtual methods to base encode
Two new virtual methods are added to gstvaapiencode.

load_control_data():  load the FEI input buffers set by the upstream elements
save_stats_to_meta(): save the FEI output buffers to Meta for downnstream elements

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

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
2017-09-01 11:36:49 +02:00
Yi A Wang
0fdef0e349 FEI: plugin: Add fei specific video meta
GstVaapiFeiVideoMeta holds the below fei codec objects:
  GstVaapiEncFeiMbCode
  GstVaapiEncFeiMv
  GstVaapiEncFeiMvPredictor
  GstVaapiEncFeiMbControl
  GstVaapiEncFeiQp
  GstVaapiEncFeiDistortion

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

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
2017-09-01 11:36:49 +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
Víctor Manuel Jáquez Leal
466c0548dc plugins: include main gstgl header
Instead including particular gstgl header files in a header file
that doesn't export a gstgl symbol, the main gstgl header file is
included in gstvaapipluginutil.c where the symbols are used.

https://bugzilla.gnome.org/show_bug.cgi?id=786597
2017-08-22 11:41:21 +02: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
9578fd1f7b vaapiencode: h264: remove spurious code
Coverity scan bug:

An unsigned value can never be negative, so this test will always
evaluate the same way.

As len is guint32, there is no need to check it if it is equal or
bigger than zero.
2017-08-08 17:38:51 +02: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
orestisf
bd040adb9c vaapidecode_props: h264: add base-only property
https://bugzilla.gnome.org/show_bug.cgi?id=732265
2017-08-03 17:07:01 +02:00
Víctor Manuel Jáquez Leal
7d6a80e13d vaapiencode: h265: compare an unsigned int if not zero
An unsigned value can never be negative, so this test (greater than
zero) will always evaluate the same way. Thus change it to just if
it's not zero.
2017-08-01 18:38:40 +02:00
Víctor Manuel Jáquez Leal
5f64d6df6c plugins: check gst_gl_ensure_element_data() return value
Refactor gst_vaapi_plugin_base_create_gl_context() in order to check
the return value of gst_gl_ensure_element_data(). The result is a code
bit cleaner.
2017-08-01 18:10:50 +02:00
Víctor Manuel Jáquez Leal
02e48ad8dc plugins: avoid dead code detection
By using #elif macro, the static code analysis would stop to detect
these lines as dead code. Also it is inforced the mutually exclusive
environments.
2017-08-01 17:59:38 +02:00
Víctor Manuel Jáquez Leal
de0f8936f8 vaapivideobufferpool: don't shift by negative since it's undefined
The function g_bit_nth_lsf() may return -1 if the request bit position
is not avaible. Thus, this patch check if the return value is not -1
in order to continue.
2017-08-01 17:39:04 +02:00
Víctor Manuel Jáquez Leal
19444ce184 vaapisink: fix memory leak 2017-08-01 17:29:40 +02:00
Víctor Manuel Jáquez Leal
ce03fa8ed0 vaapipostproc: fix memory leaks 2017-08-01 17:23:48 +02:00
Hyunjun Ko
736478d2a7 vaapisink: fail if surface display is different
Replacing GstVaapiDisplay during rendering might be hiding problems
at some cases, even though it's safe currently since we use cache
of GstVaapidisplay.

Play safe by failing if this happens.

https://bugzilla.gnome.org/show_bug.cgi?id=766704
2017-07-26 14:21:54 +02:00
Hyunjun Ko
b8265db260 videocontext: support "gst.vaapi.app.Display" context
Through "gst.vaapi.app.Display" context, users can set their own VADisplay
and native display of their backend.

Attributes:
- display : pointer of VADisplay
- x11-display : pointer of X11 display (Display *), if they're using.

This patch creates GstVaapidisplayX11 if information provided through
"gst.vaapi.app.Display"

https://bugzilla.gnome.org/show_bug.cgi?id=766704
2017-07-18 18:51:41 +02:00
Hyunjun Ko
8a04f390c8 postproc: reconfigure when width or height changes
https://bugzilla.gnome.org/show_bug.cgi?id=754885
2017-07-18 17:17:11 +02:00
Víctor Manuel Jáquez Leal
e9fd571214 vaapiencode: h264: add plugin documentation
Comment how the profile is set and other parameters.
2017-07-13 16:43:34 +02:00
Víctor Manuel Jáquez Leal
11f461fb10 vaapidecode_props: h264: set low-latency in decoder
Set the low-latency property if the H264 decoder is already
instantiated, thus you could change the behavior in run-time.

https://bugzilla.gnome.org/show_bug.cgi?id=783588
2017-07-10 19:30:46 +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
f39b7e97ce vaapidecode_props: h264: add low latency property
Adding support for private data.

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
Hyunjun Ko
d018f64cbd vaapiencode: h264: set profile to src caps
So far vaapi encoder does not set profile to src caps. This patch makes it
setting profile to src caps, which is determined by itself.

In addition, if encoder chose different profile, which is not negotiated with
downstream, we should set compatible profile to make negotiation working.

https://bugzilla.gnome.org/show_bug.cgi?id=757941
2017-07-03 18:36:29 +02:00
Víctor Manuel Jáquez Leal
39b36f7d14 vaapiencode: h264: verify if requested profile is supported
Check if the requested profile in source caps, is supported by the
VA driver. If it is not, an info log message is send saying that
another (compatible?) profile will be used.

https://bugzilla.gnome.org/show_bug.cgi?id=757941
2017-07-03 15:33:20 +02:00
Víctor Manuel Jáquez Leal
322fe98936 vaapiencode: h264: improve set_config() vmethod
First check if downstream requests ANY caps. If so, byte-stream is
used and the profile will be choose by the encoder. If dowstream
requests EMPTY caps, the negotiation will fail.

Lately, byte-stream and profile are looked in the allowed caps.

https://bugzilla.gnome.org/show_bug.cgi?id=757941
2017-07-03 15:33:20 +02:00
Víctor Manuel Jáquez Leal
b713af42a1 vaapiencode: h264: check for avc in set_config()
The check for avc stream format was done in the vaapi encoder's
vmethod get_caps(), but that is wrong since it has to be check
when encoder set_format().

https://bugzilla.gnome.org/show_bug.cgi?id=757941
2017-07-03 15:33:20 +02:00
Hyunjun Ko
e7bba345de vaapipostproc: set multivew-mode flags to src caps
vaapipostproc didn't negotiate the proper multiview caps losing
downstream information.

This patch enables the playing of MVC encoded stream by setting
the proper multiview mode/flags and views to src caps, according
to sink caps.

https://bugzilla.gnome.org/show_bug.cgi?id=784320
2017-07-03 13:37:21 +02:00
Julien Isorce
e7dd25ffc1 vaapipostproc: add support for DMABuf caps feature
https://bugzilla.gnome.org/show_bug.cgi?id=755072

Signed-off-by: Julien Isorce <j.isorce@samsung.com>
2017-06-23 18:44:42 +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
Víctor Manuel Jáquez Leal
b6863e64b5 vaapipluginbase: force dmabuf allocator if DMABuf caps feature
Instantiate all dmabuf allocator for src pad buffer pool if the
src caps ask for memory:DMABuf feature.

https://bugzilla.gnome.org/show_bug.cgi?id=755072
2017-06-23 18:44:42 +02:00