Commit graph

67 commits

Author SHA1 Message Date
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
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
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
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
Sreerenj Balachandran
4464d81b6a Add vp9 encode element to "vaapi" plugin
https://bugzilla.gnome.org/show_bug.cgi?id=766048
2016-05-30 11:24:14 +03:00
Víctor Manuel Jáquez Leal
606d166b56 vaapipostproc: set early properties restrictions
When running transform_caps() vmethod, returning the srcpad caps, the caps are
early restricted to the element properties set: width, height, format and
force keep aspect.

A new file was added gstvaapipostprocutil.{c,h} where the utilities functions
are stored.

https://bugzilla.gnome.org/show_bug.cgi?id=758548
2016-05-09 14:56:03 +02: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
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
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
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
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
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
Alban Browaeys
22f4d8b768 build: don't compile HEVC encoder if not supported
Fix:
(gst-plugin-scanner:16681): GStreamer-WARNING **: Failed to load plugin '/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstvaapi.so': /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstvaapi.so: undefined symbol: gst_vaapi_encoder_h265_get_default_properties

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

Signed-off-by: Alban Browaeys <prahal@yahoo.com>
Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
2015-05-27 23:49:18 +03:00
Sreerenj Balachandran
eaf57cc90b HEVC_Encode: Add HEVC(h265) Encoder plugin
https://bugzilla.gnome.org/show_bug.cgi?id=748874

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
2015-05-25 11:58:20 +03:00
Víctor Manuel Jáquez Leal
89e41fc8e3 build: use git.mk
This patch handles dinamically the gitignore files with git.mk[1].

Removed the automake variable MAINTAINERCLANFILES in most of the
Makefile.am files since now it is handled by the top one.

1. https://github.com/behdad/git.mk/blob/master/git.mk

https://bugzilla.gnome.org/show_bug.cgi?id=749321
2015-05-18 16:14:46 +02:00
Víctor Manuel Jáquez Leal
ef7dc4eaf6 build: fix make distcheck
This patch fixes several issues found when running the `make distcheck`
target:

- In commit c561b8da, the update of gstcompat.h in Makefile.am was
  forgotten.
- In commit c5756a91 add the simple_encoder_source_h in EXTRA_DIST was
  forgotten.
- vpx.build.stamp is not generated at all, only vpx.configure.stamp.
- The make target distcleancheck failed because some autogenerated files
  were not handled with the DISTCLEANFILES variable.

Note: `make distcheck -jXX` is not currently supported.
2015-05-13 15:21:07 +02:00
Sreerenj Balachandran
8c7bc7dff8 plugins: Add h265 videoparser element "vaapiparse_h265"
This is a mirror of h265parse element in upstream gst-plugins-bad.
There could be additional patches but all should go to upstream.
This is for making development faster.

Note: vaapiparse_h265 will get build only for GStreamer version >= 1.4
2015-04-17 17:09:30 +03:00
Víctor Manuel Jáquez Leal
1256ce613a autotools: remove gstreamer-1.0 support
This patch only removes the support of gstreamer-1.0 in the autotools
scripts. No other files are touched.

In the automake file all the converters were deprecated.

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

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
2015-04-03 17:05:45 +03:00
Víctor Manuel Jáquez Leal
f5d3c2d85d Remove libgstvaapi-videoutils.so
This library was intended to add the base classes for video decoders which
where not included in gstreamer-0.10.

Since the support of gstreamer-0.10 is deprecated those classes are not
required, thus the whole library is removed.

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

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2015-04-03 17:01:45 +03:00
Víctor Manuel Jáquez Leal
0311c7c8af autotools: remove gstreamer-0.10 support
This patch only removes the support of gstreamer-0.10 in the autotools
scripts. No other files are touched.

The configuration parameter --gstreamer-api was deleted since now it is always
auto-detected.

The verification of vmethod query in GstBaseSinkClass was removed since it was
added in gstreamer 0.10.35. The same case for GstVideoOverlayComposition and
its format flags.

The precious variable GST_PLUGIN_PATH was removed, while GST_PLUGIN_PATH_1_0
remained.

The automake files were changed accordingly.

Removed, in debian/control, the vaapiupload and vaapidownload descriptions.

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

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2015-04-03 16:54:54 +03:00
Sreerenj Balachandran
8eabe9f377 plugins: Add a vaapidecodebin element
Add a "vaapidecodebin" element to vaapi plugins.

Child Elements: "vaapidecode ! queue ! vaapipostproc"

The Reasons for implementing a new bin element:

-- Help to Autoplug Hardware Accelerated Video Postprocessing element in playbin
with out any dependency to upstream gstreamer.
This is to overcome the *unacceptable* delay in upstream gstreamer to get new
features in. Eg: https://bugzilla.gnome.org/show_bug.cgi?id=687182.
Also customers using older gstreamer versions (1.2 and 1.4) will get the
benefit of autoplugging, hardware accelerated deinterlacing support etc.

-- Help to maintain a single thread implementation in vaapidecode.
This will result a dead-lock free vaapidecode in most of the cases.
More details here: https://bugzilla.gnome.org/show_bug.cgi?id=742605

https://bugzilla.gnome.org/show_bug.cgi?id=745216
2015-03-02 16:51:55 +02:00
Gwenole Beauchesne
60e96e80cc plugins: add initial support for EGL.
Add initial support for EGL through GstVideoGLTextureUploadMeta.

Fix gst_vaapi_ensure_display() to allocate a GstVaapiDisplay off the
downstream supplied GstGLContext configuration, i.e. use its native
display handle to create a GstVaapiDisplay of type X11 or Wayland ;
and use the desired OpenGL API to allocate the GstVaapiDisplayEGL
wrapper.

https://bugzilla.gnome.org/show_bug.cgi?id=741079
2015-02-24 15:20:03 +01:00
Gwenole Beauchesne
d9c082168b plugins: record downstream GstGLContext.
Record GL context supplied by downstream elements. This can be useful,
and further needed, to enforce run-time check that the GL context is
compatible for use by libgstvaapi. e.g. check that we don't create a
VA/GLX display for EGL/X11 contexts.

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

Original-path-by: Matthew Waters <ystreet00@gmail.com>
2015-02-24 15:20:03 +01:00
Sreerenj Balachandran
a664a479a8 plugins: Add VP8 Encoder 2015-02-13 13:45:32 +02:00
Sreerenj Balachandran
004968f506 build: fix make dist when certain conditionals not met.
Fix typo which was preventing the inclusion of jpeg encoder
source files from make dist (when there is no jpeg encoder
API support in libva).
2015-02-06 12:10:51 +02:00
Sreerenj Balachandran
d2e2784a78 plugins: Add JPEG encoder element 2015-02-04 11:18:29 +02:00
Wind Yuan
667749c67e plugins: add support for dma_buf imports.
Allow imports of v4l2 buffers into VA surfaces for further operation
with vaapi plugins, e.g. vaapipostproc or vaapiencode_* elements.

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

[fixed memory leaks, ported to new dma_buf infrastructure, cleanups]
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2015-01-28 17:35:16 +01:00
Gwenole Beauchesne
7ac501d026 build: fix with --no-undefined linker flags.
https://bugzilla.gnome.org/show_bug.cgi?id=729352
2014-08-01 11:05:01 +02:00
Gwenole Beauchesne
3af6b0b8a0 plugins: add built-in video parsers as "vaapiparse" element.
The built-in video parsers elements are built into a single DSO named
libgstvaapi_parse.so. The various video parsers could be accessed as
vaapiparse_CODEC.

For now, this only includes a modified version of h264parse so that to
support H.264 MVC encoded streams.
2014-06-13 17:17:07 +02:00
Gwenole Beauchesne
de02a5c190 build: fix make dist with certain conditionals not met.
Fix generation of source tarballs when certain conditionals are not
met. e.g. always include all buildable codecparsers sources in the
distribution tarball, fix plug-in element sources set to include X11
and encoder bits.
2014-04-21 18:02:21 +02:00
Gwenole Beauchesne
7e58d60854 plugins: add new base object, store display in there.
Introduce a new GstVaapiPluginBase object that will contain all common
data structures and perform all common tasks. First step is to have a
single place to hold VA displays.

While we are at it, also make sure to store and subsequently release
the appropriate debug category for the subclasses.
2013-12-18 16:38:57 +01:00
XuGuangxin
2e356b0f7e plugins: add mpeg2 encoder element.
Add GstVaapiEncodeMPEG2 element object. The actual plug-in element
is called "vaapiencode_mpeg2".

Valid properties:
- rate-control: rate control mode (default: cqp - constant QP)
- bitrate: desired bitrate in kbps (default: auto-calculated)
- key-period: maximal distance between two key frames (default: 30)
- max-bframes: number of B-frames between I and P (default: 2)
- quantizer: constant quantizer (default: 8)

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2013-11-24 16:52:05 +01:00
Wind Yuan
f1c33feef9 plugins: add h264 encoder element.
Add GstVaapiEncodeH264 element object. The actual plug-in element
is called "vaapiencode_h264".

Valid properties:
- rate-control: rate control mode (default: none)
- bitrate: desired bitrate in kbps (default: auto-calculated)
- key-period: maximal distance between two key frames (default: 30)
- num-slices: number of slices per frame (default: 1)
- max-bframes: number of B-frames between I and P (default: 0)
- min-qp: minimal quantizer (default: 1)
- init-qp: initial quantizer (default: 26)

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2013-11-24 16:52:05 +01:00
Wind Yuan
06ea8ba92b plugins: add base encoder element.
vaapiencode element is based on GstVideoEncoder APIs.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2013-11-24 16:52:05 +01:00
Gwenole Beauchesne
e713d43379 build: fix for Wayland headers not in standard include dirs.
Fix build when Wayland headers don't live in plain system include dirs
like /usr/include but rather in /usr/include/wayland for instance.

Original patch written by Dominique Leuenberger <dimstar@opensuse.org>

https://bugzilla.gnome.org/show_bug.cgi?id=712282
2013-11-22 11:28:09 +01:00
Gwenole Beauchesne
9968661ffd vaapipostproc: add initial support for GStreamer 1.2.
Port vaapipostproc element to GStreamer 1.2. Support is quite minimal
right now so that to cope with auto-plugging issues/regressions. e.g.
this happens when the correct set of expected caps are being exposed.
This means that, currently, the proposed caps are not fully accurate.
2013-11-21 23:08:02 +01:00
Víctor Manuel Jáquez Leal
41c4da5571 plugins: add support for GstVideoGLTextureUploadMeta.
If the allocation meta GST_VIDEO_GL_TEXTURE_UPLOAD_META_API_TYPE is
requested, and more specifically under a GLX configuration, then add
the GstVideoGLTextureUploadMeta to the output buffer.

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

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2013-09-27 14:17:20 +02:00
Víctor Manuel Jáquez Leal
c67b783275 plugins: add compat layer for GstVideoContext.
Add thin compatibility layer for the deprecated GstVideoContext API.
For GStreamer API >= 1.2, this involves the following two functions:
- gst_vaapi_video_context_prepare(): queries if a context is already
  set in the pipeline ;
- gst_vaapi_video_context_propagate(): propagates the newly-created
  context to the rest of the pipeline.

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

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2013-09-27 14:16:52 +02:00
Víctor Manuel Jáquez Leal
f75762d910 plugins: initial port to GStreamer 1.2.
Port vaapidecode and vaapisink plugins to GStreamer API >= 1.2. This
is rather minimalistic so that to test the basic functionality.

Disable vaapipostproc plugin for now as further polishing is needed.
Also disable GstVideoContext interface support since this API is now
gone in 1.2.x. This is preparatory work for GstContext support.

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

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2013-09-27 14:15:51 +02:00
Gwenole Beauchesne
6f04a52905 plugins: add support for "x11-pixmap" video converter type.
Install a new video converter that supports X11 pixmap targets for X11
backends only, or make the GLX converter creation function chain up to
the X11 converter whenever requested.
2013-07-22 15:45:10 +02:00
Gwenole Beauchesne
945516c9c7 vaapipostproc: port to GStreamer 1.0.
Add support for interlaced streams with GStreamer 1.0 too. Basically,
this enables vaapipostproc, though it is not auto-plugged yet. We also
make sure to reply to CAPS queries, and happily handle CAPS events.
2013-04-17 10:18:45 +02:00
Gwenole Beauchesne
aedef381b2 Fix make dist to include all source files, in any case.
Fix make dist to allow build for either GStreamer 0.10 or 1.0. i.e. make
sure to include all source files in either case while generating source
tarballs.
2013-04-10 15:43:28 +02:00
Gwenole Beauchesne
1b500dee54 Allow build against either GStreamer API (0.10 or 1.0).
Introduce a new configure option --with-gstreamer-api that determines
the desired GStreamer API to use. By default, GStreamer 1.0 is selected.
Also integrate more compatibility glue into gstcompat.h and plugins.
2013-04-10 14:58:17 +02:00
Sreerenj Balachandran
5b11b83321 plugins: add GstVaapiVideoMemory and GstVaapiVideoBufferPool objects.
Add initial support for GstVaapiVideoMemory backed buffer pool. The memory
object currently holds a reference to GstVaapiVideoMeta.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2013-04-10 14:58:16 +02:00
Sreerenj Balachandran
38d84d968e plugins: initial port to GStreamer 1.0.
Port vaapidecode and vaapisink plugins to GStreamer API >= 1.0. This
is rather minimalistic so that to test the basic functionality.

Disable vaapiupload, vaapidownload and vaapipostproc plugins. The latter
needs polishing wrt. to GStreamer 1.x functionality and the former are
totally phased out in favor of GstVaapiVideoMemory map/unmap facilities,
which are yet to be implemented.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2013-04-10 14:58:16 +02:00
Gwenole Beauchesne
140fa66be3 plugins: integrate GstVaapiVideoMeta from libgstvaapi.
Move GstVaapiVideoMeta from core libgstvaapi decoding library to the
actual plugin elements. That's only useful there. Also inline reference
counting code from GstVaapiMiniObject.
2013-03-26 10:33:27 +01:00