Commit graph

2729 commits

Author SHA1 Message Date
Víctor Manuel Jáquez Leal
b2815a376b vaapiencode: h265: add main-10 in caps template
This patch adds h265's main-10 profile in encoder src caps template.

https://bugzilla.gnome.org/show_bug.cgi?id=771291
2017-04-07 12:04:57 +02:00
Víctor Manuel Jáquez Leal
3532dca16a libs: encoder: h265: chroma and luma with format
If the profile is main-10 the bit_depth_luma_minus8, in the sequence
parameter buffer, shall be the color format bit depth minus 8, 10-8
which is 2. Also for bit_depth_chroma_minus8.

This patch gets the negotiated sink caps format and queries its
luma's depth and uses that value to fill the mentioned parameters.

https://bugzilla.gnome.org/show_bug.cgi?id=771291
2017-04-07 12:04:51 +02:00
Víctor Manuel Jáquez Leal
d744aeb5fa libs: encoder: admit YUV420_10BPP as valid chroma
Accepts as supported the GST_VAAPI_CHROMA_TYPE_YUV420_10BPP chroma
type.

https://bugzilla.gnome.org/show_bug.cgi?id=771291
2017-04-06 22:00:05 +02:00
Víctor Manuel Jáquez Leal
48e21d6ba8 libs: encoder: h265: ensures profile given format
Set the VA profile as GST_VAAPI_PROFILE_H265_MAIN10 if the
configured color format is P010_10LE.

Otherwise, keep GST_VAAPI_PROFILE_H265_MAIN

https://bugzilla.gnome.org/show_bug.cgi?id=771291
2017-04-06 22:00:05 +02:00
Víctor Manuel Jáquez Leal
e534ff5609 libs: encode: merge all possible surface formats
When the function gst_vaapi_encoder_get_surface_formats() was added
it was under the assumption that any VA profile of the specific codec
supported the same format colors. But it is not, for example the
profiles that support 10bit formats.

In other words, different VA profiles of a same codec may support
different color formats in their upload surfaces.

In order to expose all the possible color formats, if no profile is
specified via source caps, or if the encoder doesn't have yet a
context, all the possible VA profiles for the specific codec are
iterated and their color formats are merged.

https://bugzilla.gnome.org/show_bug.cgi?id=771291
2017-04-06 22:00:05 +02:00
Víctor Manuel Jáquez Leal
5ccadd6e9c vaapiencode: add get_profile() vmethod
This new virtual method, get_profile(), if implemented by specific
encoders, will return the VA profile potentially determined by the
source caps.

Also it is implemented by h264 and h265 encoders, which are the main
users of this vmethod.

https://bugzilla.gnome.org/show_bug.cgi?id=771291
2017-04-06 22:00:05 +02:00
Víctor Manuel Jáquez Leal
7153b4597d libs: encoder: pass profile to get_surface_formats()
In order to get the supported surface formats within a specific
profile this patch adds the GstVaapiProfile as property to
gst_vaapi_encoder_get_surface_formats().

Currently the extracted formats are only those related with the
default profile of the element's codec.

https://bugzilla.gnome.org/show_bug.cgi?id=771291
2017-04-06 22:00:05 +02:00
Víctor Manuel Jáquez Leal
9aa63e4595 libs: encoder: dummy context for get_surface_formats()
Instead of creating (if it doesn't exist, yet) the encoder's context
the method gst_vaapi_encoder_get_surface_formats() now it creates
dummy contexts, unless the encoder has it already created.

The purpose of this is to avoid setting a encoder's context with a
wrong profile.

https://bugzilla.gnome.org/show_bug.cgi?id=771291
2017-04-06 22:00:05 +02:00
Víctor Manuel Jáquez Leal
31d326c9ee libs: encoder: refactor init_context_info()
In order to generate vaapi contexts iterative, the function
init_context_info() is refactored to pass, as parameters the
GstVaapiContextInfo and the GstVaapiProfile.

https://bugzilla.gnome.org/show_bug.cgi?id=771291
2017-04-06 22:00:05 +02:00
Víctor Manuel Jáquez Leal
db7268117d libs: encoder: initialize chroma_type
Instead of initialize the chroma_type with a undefined value, which
will be converted to GST_VAAPI_CHROMA_TYPE_YUV420 by GstVaapiContext,
this patch queries the VA config, given the received
GstVaapiContextInfo's parameters, and gets the first response.

In order to get the GstVaapiChromaType value, also it was needed to
add a new utility function: to_GstVaapiChromaType(), which, given a
VA_RT_FORMAT_* will return the associated GstVaapiChromaType.

https://bugzilla.gnome.org/show_bug.cgi?id=771291
2017-04-06 22:00:05 +02:00
Víctor Manuel Jáquez Leal
914a4712d9 vaapiencode: enhance logs of negotiated caps
https://bugzilla.gnome.org/show_bug.cgi?id=771291
2017-04-06 22:00:05 +02:00
Scott D Phillips
123672a9bd libs: encoder: vp9: Fix initialization of ref_list
gcc 7.0.1 gives a memset-elt-size warning in gst_vaapi_encoder_vp9_init:

 'memset' used with length equal to number of elements without
 multiplication by element size [-Werror=memset-elt-size]

https://bugzilla.gnome.org/show_bug.cgi?id=780947
2017-04-06 11:03:12 +02:00
Sreerenj Balachandran
be990f5ed4 encoder: h264: Fix Backward ReferencePicture flag setting
This is a regression introduced by e829b62 which
override the reference flags and caused issues with
latest intel-vaapi-driver.
2017-03-31 14:14:08 -07:00
Víctor Manuel Jáquez Leal
834557d5b6 libs: encoder: h265: fix code style
Trivial patch to remove a double ';' as end of instruction.
2017-03-29 13:24:41 +02:00
Sreerenj Balachandran
dbbe340906 encoder: h264: Fix B frame encoding artifacts
The current implementation is updating the POC values only
in Slice parameter Buffer.But we are not filling the
picture order count and reference flags in VAPictureH264
while populating VA Picture/Slice structures.The latest
intel-vaapi-driver is directly accessing the above fields
from VAPicutreH264 provided as RefPicLists, which resulted
some wrong maths and prediction errors in driver.

https://bugzilla.gnome.org/show_bug.cgi?id=780620
2017-03-28 10:53:20 -07:00
Víctor Manuel Jáquez Leal
7f8b325450 libs: encoder: h265: remove unused macro definition
Since the h265 encoder doesn't use GValueArray, there is no need to
disable the Glib deprecation warnings, thus removing the macro
definition.
2017-03-21 16:13:56 +01: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
Hyunjun Ko
9ed6ac1f76 libs: h26x: adds gst_vaapi_utils_h26x_write_nal_unit()
Implements gst_vaapi_utils_h26x_write_nal_unit(), which writes NAL
unit length and data to a bitwriter.

Note that this helper function applies EPB (Emulation Prevention
Bytes), since otherwise produced codec_data might be broken when
decoder/parser considering EPB, starts parsing.

See sections 7.3 and 7.4 of the H264 and H264 specifications, which
describes the emulation_prevention_three_byte.

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

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
2017-03-20 19:02:04 +01:00
Hyunjun Ko
49b370ed60 libs: utils: h26x: create vaapiutils_h26x
Since there is duplicated code in h264/265 encoder, we could
refactor it to avoid duplicated code.

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

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
2017-03-20 18:11:00 +01:00
Hyunjun Ko
257cfb61fe libs: encoder: h264/5: fix wrong return value
https://bugzilla.gnome.org/show_bug.cgi?id=778750
2017-03-17 12:54:27 +01:00
Hyunjun Ko
e65d916f0d docs: h264/h265: put parser to the example pipeline
https://bugzilla.gnome.org/show_bug.cgi?id=778749
2017-03-14 16:54:39 +01:00
Hyunjun Ko
7f38b3b9f2 libs: encoder: h265: fix reserved length of bits
Fix reserved length of bits for bit_depth_luma_minus8 and bit_depth_chroma_minus8

https://bugzilla.gnome.org/show_bug.cgi?id=778749
2017-03-14 16:54:39 +01:00
Thomas Petazzoni
159e3c3f08 O_CLOEXEC needs _GNU_SOURCE defined
From man open(2):

    The O_CLOEXEC, O_DIRECTORY, and O_NOFOLLOW flags are not specified
    in POSIX.1-2001, but are specified in POSIX.1-2008.  Since glibc
    2.12, one can obtain their definitions by defining either
    _POSIX_C_SOURCE with a value greater than or equal to 200809L or
    _XOPEN_SOURCE with a value greater than or equal to 700.  In glibc
    2.11 and earlier, one obtains the definitions by defining
    _GNU_SOURCE.

And indeed, with the uClibc C library, O_CLOEXEC is not exposed if
_GNU_SOURCE is not defined. Therefore, this commit fixes the build of
gstreamer-vaapi with the uClibc C library.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

https://bugzilla.gnome.org/show_bug.cgi?id=779953
2017-03-14 16:12:27 +01:00
Víctor Manuel Jáquez Leal
7b64cec70f README: fix "Sources" section
Update the URL where the release source tarballs can be downloaded.
2017-03-14 16:07:08 +01:00
Thomas Petazzoni
bcd0887140 README: fix "Reporting bugs" section
The "Reporting bugs" section gives
https://bugzilla.gnome.org/enter_bug.cgi?product=gstreamer-vaapi as the
link to report a bug, but this link says "Sorry, entering a bug into the
product gstreamer-vaapi has been disabled.".

This commit fixes the URL to point to the proper location, and also
removes the following paragraph that is no longer correct.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

https://bugzilla.gnome.org/show_bug.cgi?id=779954
2017-03-14 16:02:51 +01:00
Víctor Manuel Jáquez Leal
3723d2051a plugins: retry to create the VA display
Particularly in GNOME Wayland, the negotiated or created GL context
defines a GLX environment, but VAAPI fails to create a GLX VA
display because there is no a DRI2 connection.

This patch retries to create the VA display if VA cannot create one
with the GL context parameters. Now using the old list of display
types.

This should also work in the case of systems with two GPU, when the
non-VAAPI has the graphics environment, and the VAAPI-enabled one
shall work headless.

https://bugzilla.gnome.org/show_bug.cgi?id=772838
2017-03-03 22:40:12 +01:00
Julien Isorce
8d86b3f40a vaapipostproc: texture upload if driver supports GL
Removes GstVideoGLTextureUploadMeta caps feature if the driver
doesn't support opengl.

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

https://bugzilla.gnome.org/show_bug.cgi?id=772838
2017-03-03 20:01:33 +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
Sreerenj Balachandran
e0891d93ce configure: Add missing compiler flags
The AC_CHECK_HEADERS macro was failing to locate some headers, in
particular the va_enc_* headers due to missing compiler flags.

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

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
2017-03-02 02:44:38 +01:00
Hyunjun Ko
c4ef779931 libs: window: wayland: handle more VAStatus to use vpp
Since the commit landed https://github.com/01org/intel-vaapi-driver/pull/55,
we should consider more returned VAStatus to use vpp.

https://bugzilla.gnome.org/show_bug.cgi?id=779400
2017-03-02 02:22:26 +01:00
Hyunjun Ko
6468bf2ddf libs: encoder: ensure profile when context initialization
We can't be sure that encoder's profile is assgined already or not
at context initialization.

https://bugzilla.gnome.org/show_bug.cgi?id=779120
2017-02-28 18:26:44 +01:00
Hyunjun Ko
04a844ced0 libs: encoder: set rate control info only when query succeed
Currently, it set rate control information even when query fails.
In addition, it doesn't update any more since the flag
got_rate_control_mask is set to TRUE.

https://bugzilla.gnome.org/show_bug.cgi?id=779120
2017-02-28 18:26:44 +01:00
Sebastian Dröge
98b41956e1 meson: Update version 2017-02-24 16:00:23 +02:00
Sebastian Dröge
20af04baa0 Back to development 2017-02-24 15:38:22 +02:00
Sebastian Dröge
c40f6af547 Release 1.11.2 2017-02-24 15:10:21 +02:00
Víctor Manuel Jáquez Leal
5905970917 vaapiencode: merge tags for downstream's info
Add encoder and codec name and the bitrate into the output for
informational purposes. Some muxers or application use it as
media metadata.

https://bugzilla.gnome.org/show_bug.cgi?id=778781
2017-02-22 05:19:06 +01:00
Víctor Manuel Jáquez Leal
a0a2f7bfe8 libs: encoder: caps can change at any time
The encoder should be able to change its caps even it is already
processing a stream.

This is suppose to happen after a flush so the codedbuf_queue should
be empty.

https://bugzilla.gnome.org/show_bug.cgi?id=775490
2017-02-22 05:19:06 +01:00
Víctor Manuel Jáquez Leal
7b3a51f145 libs: encoder: h265: bail if nal unit type fails
Bail out if the NAL unit type is not recognized.

https://bugzilla.gnome.org/show_bug.cgi?id=778782
2017-02-22 05:19:06 +01:00
Víctor Manuel Jáquez Leal
d6738f3f93 libs: decoder: h264,h265 avoid uninitialized variable
Configuring GCC to verify possible usage of uninitialized variables,
shows that found_index might be used without previous assignation.

This patch assigns a initial value to found_index, also avoid a
branching when returning the result value.

https://bugzilla.gnome.org/show_bug.cgi?id=778782
2017-02-16 18:46:35 +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
Tim-Philipp Müller
015e261708 meson: gstreamer-codecparsers is a required dep
Just like in configure.ac.
2017-02-15 19:14:59 +00:00
Tim-Philipp Müller
91a8688fa1 meson: dist meson build files
Ship meson build files in tarballs, so people who use tarballs
in their builds can start playing with meson already.
2017-02-15 00:26:21 +00:00
Hyunjun Ko
b6a3e88059 libs: encoder: vp8: add CBR encoding mode
This patch enables the Constant BitRate encoding mode in VP8 encoder.
Basically it adds the configuration parameters required by libva to
CBR enconding.

Original-Patch-By: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>

https://bugzilla.gnome.org/show_bug.cgi?id=749950
2017-02-10 13:11:21 +01:00
Hyunjun Ko
ffc5b43da7 libs: encoder: vp8: fix bitrate calculation
Base encoder's unit of bitrate is in Kbps. We should honor it so
we use the value of bitrate in VA, in which is expressed in bps.

https://bugzilla.gnome.org/show_bug.cgi?id=749950
2017-02-10 13:10:10 +01:00
Víctor Manuel Jáquez Leal
025d5ce33e plugins: fix build when gcc
In commit a8e482f9 we added a function without parameters, but gcc
doesn't like that.
2017-02-09 12:49:44 +01:00
Scott D Phillips
412dd13e86 vaapi: add meson build
https://bugzilla.gnome.org/show_bug.cgi?id=778250
2017-02-09 11:27:44 +01:00
Scott D Phillips
3cc4eb7b81 make: remove gstvaapiversion.h generation
https://bugzilla.gnome.org/show_bug.cgi?id=778250
2017-02-09 11:27:44 +01:00
Julien Isorce
a8e482f93f plugins: use linear storage if not the same device
When dmabuf is negotiated downstream and decoding and rendering are
not done on the same device, the layout has to be linear in order for
the memory to be shared accross devices, since each device has its
own way to do tiling.

Right now this code is rather just a to-do comment, since we are not
fetching the device ids.

https://bugzilla.gnome.org/show_bug.cgi?id=755072
2017-02-09 11:24:08 +01:00
Hyunjun Ko
2d463f79f2 libs: utils: add HEVC profiles representation
https://bugzilla.gnome.org/show_bug.cgi?id=778318
2017-02-08 10:42:28 +01:00
Hyunjun Ko
d89a3bd258 libs: decoder: h264: reduce frame number of gaps
Reduce frame num gaps so that we don't have to create unnecessary
dummy pictures, just throw them away.

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

https://bugzilla.gnome.org/show_bug.cgi?id=777506
2017-02-07 11:30:02 +01:00