platform/upstream/gstreamer.git
4 years agovaapipostproc: check for filter before appending caps
Víctor Manuel Jáquez Leal [Thu, 29 Aug 2019 10:11:36 +0000 (12:11 +0200)]
vaapipostproc: check for filter before appending caps

While ensuring the allowed sink pad caps, the filter attributes set
the frame size restriction, but it is not ensured, at that moment,
that the filter is already instantiaded.

In order to silence the glib logs, this patch add only calls
gst_vaapi_filter_append_caps() if the filter is instantiated.

4 years agoClassify vaapidecodebin as a hardware decoder
Thibault Saunier [Wed, 28 Aug 2019 16:49:03 +0000 (12:49 -0400)]
Classify vaapidecodebin as a hardware decoder

4 years agolibs: postproc: fix a memory leak point.
He Junyan [Tue, 27 Aug 2019 10:12:45 +0000 (18:12 +0800)]
libs: postproc: fix a memory leak point.

filter_ops and filter_formats should already have valid value when
the function gst_vaapipostproc_ensure_filter_caps re-enter

4 years agolibs: util: Fix a memory leak in config_surface_attributes_get
He Junyan [Mon, 26 Aug 2019 17:30:36 +0000 (01:30 +0800)]
libs: util: Fix a memory leak in config_surface_attributes_get

4 years agovaapidecode: support transform ROI meta
Wangfei [Thu, 22 Aug 2019 06:33:54 +0000 (14:33 +0800)]
vaapidecode: support transform ROI meta

This will benefit the use case like:

src --->   encode    ---> decode ---> circle ROI ---> sink
     |                |
     --> analyse to -->
         get ROI

4 years agodocstrings: port ulinks to markdown links
Mathieu Duponchelle [Fri, 23 Aug 2019 17:10:15 +0000 (19:10 +0200)]
docstrings: port ulinks to markdown links

4 years agolibs: remove context's overlay
Víctor Manuel Jáquez Leal [Tue, 20 Aug 2019 15:05:14 +0000 (17:05 +0200)]
libs: remove context's overlay

The context overlay was an optimization to apply a video composition
to all the surfaces bound to a context.

But since commit 18031dc6 this optimization was disabled, so it is
better just get rid of it.

4 years agolibs: remove surface's parent context
Víctor Manuel Jáquez Leal [Tue, 20 Aug 2019 14:50:46 +0000 (16:50 +0200)]
libs: remove surface's parent context

In commit 18031dc6 surface's parent context is not assigned because of
circular references. Since then (2013), there's has no issue with
subpictures attached to a context, the current only users of this API.

This patch cleans up all of related code with the unused surface's
parent context.

4 years agovaapidecode: guard if no structure is available in caps
Víctor Manuel Jáquez Leal [Sun, 18 Aug 2019 11:53:53 +0000 (13:53 +0200)]
vaapidecode: guard if no structure is available in caps

4 years agovaapipostproc: append frame size restrictions in caps
Víctor Manuel Jáquez Leal [Sun, 18 Aug 2019 11:53:19 +0000 (13:53 +0200)]
vaapipostproc: append frame size restrictions in caps

4 years agolibs: profilecaps: refactor common code
Víctor Manuel Jáquez Leal [Sun, 18 Aug 2019 11:09:58 +0000 (13:09 +0200)]
libs: profilecaps: refactor common code

4 years agovaapiencode: set frame size restrictions in caps
Víctor Manuel Jáquez Leal [Fri, 16 Aug 2019 17:35:58 +0000 (19:35 +0200)]
vaapiencode: set frame size restrictions in caps

Fixes: #12

4 years agovaapiencode: enhance how the profile is defined
Víctor Manuel Jáquez Leal [Fri, 16 Aug 2019 17:28:27 +0000 (19:28 +0200)]
vaapiencode: enhance how the profile is defined

This code doesn't define the profile used by the internal encoder, but
it used to "predict" which is going to be used and to get the caps
restrictions.

Before the profile was predicted by checking the donwstream caps, but
sometimes they are not defined, setting an unknown profile. In order
to enhances this situation, the encoder asks to internal encoder if it
has one. If so, it is used.

To ask the internal encoder's profile a new accessor function was
added: gst_vaapi_encoder_get_profile()

4 years agolibs: profilecaps: defines gst_vaapi_profile_caps_append_encoder()
Víctor Manuel Jáquez Leal [Fri, 16 Aug 2019 17:26:36 +0000 (19:26 +0200)]
libs: profilecaps: defines gst_vaapi_profile_caps_append_encoder()

Previously it was just a boilerplate. Now it is real implementation.

4 years agolibs: utils: treat va_rt_format as bitwise flag
Víctor Manuel Jáquez Leal [Fri, 16 Aug 2019 17:17:48 +0000 (19:17 +0200)]
libs: utils: treat va_rt_format as bitwise flag

The return value of vaGetConfigAttributes() of VAConfigAttribRTFormat
is a bitwise flag with *all* the supported chroma types.

Previously it was assumed that the return value was a single value,
thus when returning the GST_VAAPI_CHROMA_TYPE_XXX the code was a
simple case. But it is wrong.

This patch changes the case block with a sequence of ifs testing the
bitwise. For now we assume a "priority" list in the testing sequence.

4 years agolibs: profile: add gst_vaapi_profile_get_va_name()
Víctor Manuel Jáquez Leal [Fri, 16 Aug 2019 16:07:43 +0000 (18:07 +0200)]
libs: profile: add gst_vaapi_profile_get_va_name()

gst_vaapi_profile_get_name() returns a proper name for
GstCaps. Nonetheless, there are many profiles which don't have a name
representation for that realm.

gst_vaapi_profile_get_va_name() returns the name of the profile
according to its VAProfile name.

This new funtion is used in the encoder error message.

4 years agolibs: profilecaps: move caps config into a new file
Víctor Manuel Jáquez Leal [Mon, 5 Aug 2019 17:47:30 +0000 (19:47 +0200)]
libs: profilecaps: move caps config into a new file

Implement all the appending of frame size restrictions in caps, for
encoders and decoders, in a new source file.

4 years agolibs: decoder: ref the caps as property
Víctor Manuel Jáquez Leal [Mon, 5 Aug 2019 17:45:49 +0000 (19:45 +0200)]
libs: decoder: ref the caps as property

4 years agolibs: context: add gst_vaapi_context_get_surface_attributes()
Víctor Manuel Jáquez Leal [Fri, 2 Aug 2019 14:56:17 +0000 (16:56 +0200)]
libs: context: add gst_vaapi_context_get_surface_attributes()

This function copies the surface attributes from the context's object
to the caller.

4 years agolibs: move memory types conversions to gstvaapiutils
Víctor Manuel Jáquez Leal [Fri, 2 Aug 2019 10:46:55 +0000 (12:46 +0200)]
libs: move memory types conversions to gstvaapiutils

And add more supported memory types by current VA.

4 years agolibs: utils: remove unused function gst_vaapi_get_surface_formats()
Víctor Manuel Jáquez Leal [Thu, 1 Aug 2019 17:48:21 +0000 (19:48 +0200)]
libs: utils: remove unused function gst_vaapi_get_surface_formats()

4 years agolibs: context, filter: use new surface attributes API
Víctor Manuel Jáquez Leal [Thu, 1 Aug 2019 17:46:17 +0000 (19:46 +0200)]
libs: context, filter: use new surface attributes API

4 years agolibs: utils: add gst_vaapi_config_surface_attributes_get()
Víctor Manuel Jáquez Leal [Thu, 1 Aug 2019 17:13:39 +0000 (19:13 +0200)]
libs: utils: add gst_vaapi_config_surface_attributes_get()

To extract the surface restrictions per config using a new structure:
GstVaapiConfigSurfaceAttributes

4 years agoSplit the surface attribute retrieval
Víctor Manuel Jáquez Leal [Wed, 31 Jul 2019 11:08:43 +0000 (13:08 +0200)]
Split the surface attribute retrieval

4 years agovaapipostproc: handle navigation downstream event
Víctor Manuel Jáquez Leal [Mon, 15 Jul 2019 19:51:46 +0000 (21:51 +0200)]
vaapipostproc: handle navigation downstream event

When navigation events contains coordiantes those have to be mapped
to the new size and/or orientation.

4 years agotest-vaapisink: also use vaapipostproc to change orientation
Víctor Manuel Jáquez Leal [Mon, 15 Jul 2019 19:23:21 +0000 (21:23 +0200)]
test-vaapisink: also use vaapipostproc to change orientation

4 years agovaapipostproc: handle image-orientation upstream event
Víctor Manuel Jáquez Leal [Mon, 15 Jul 2019 19:27:20 +0000 (21:27 +0200)]
vaapipostproc: handle image-orientation upstream event

Now that vaapipostproc can possible handle video-direction, it
should also handle the image-orientation event from upstream if
video-direction property is set to auto.

4 years agovaapipostproc: add missing locks when adding flags
Víctor Manuel Jáquez Leal [Fri, 26 Jul 2019 20:09:37 +0000 (22:09 +0200)]
vaapipostproc: add missing locks when adding flags

4 years agovaapipostproc: update filter before fixate caps
Víctor Manuel Jáquez Leal [Fri, 26 Jul 2019 20:05:29 +0000 (22:05 +0200)]
vaapipostproc: update filter before fixate caps

It is requiered to know if postproc is capable to change the video
direction before fixating the source caps.

In order to do it, it'ss required to know if there's a functional VPP,
but that's checked at create() vmethod, which occurs after caps
fixating.

This patch checks for a functional VPP at fixate caps and, if so,
checks for the enabled filtes and later do the caps fixations.

4 years agovaapipostproc: element warning if video direction is unsupported
Víctor Manuel Jáquez Leal [Fri, 26 Jul 2019 17:46:09 +0000 (19:46 +0200)]
vaapipostproc: element warning if video direction is unsupported

If the video direction is unsupported by the driver, an element
warning is posted in the bus to notify the application.

gst_vaapi_enum_type_get_nick() was added in the library thus it can
be used elsewhere. It retrives the nick from an enum gtype.

4 years agolibs: filter: check mirror and rotation caps only once
Víctor Manuel Jáquez Leal [Fri, 26 Jul 2019 17:09:54 +0000 (19:09 +0200)]
libs: filter: check mirror and rotation caps only once

This patch locks the display before querying the pipeline caps and
stores the mirror and rotation capabilities, thus they are not queried
every time the video direction is set.

4 years agolibs: encoder: vp9: set VP9_0 profile as default
Víctor Manuel Jáquez Leal [Fri, 16 Aug 2019 17:51:29 +0000 (19:51 +0200)]
libs: encoder: vp9: set VP9_0 profile as default

Commit 0afc8131 introduced a regression and only NV12 format were
admitted, failing in any other valid color format.

This patch sets the profile to GST_VAAPI_PROFILE_VP9_0 by default.

4 years agolibs: filter: fail if first color balance value is invalid
Víctor Manuel Jáquez Leal [Fri, 16 Aug 2019 11:25:06 +0000 (13:25 +0200)]
libs: filter: fail if first color balance value is invalid

4 years agolibs: filter: set all color balance values
Yan Wang [Tue, 6 Aug 2019 11:24:08 +0000 (19:24 +0800)]
libs: filter: set all color balance values

When set multiple settings of color balance like hue, saturation,
brightness and contrast for vaapipostproc, they should be set as
parameters of color balance filter, at the same color balance
filter calling.

Otherwise, multiple color balance filter calling will cause
previous setting get reset by the last calling with default value.

Fixes #182.

Signed-off-by: Yan Wang <yan.wang@linux.intel.com>
4 years agolibs: h265dec: remove limitation of get iq matrix
Wangfei [Fri, 16 Aug 2019 03:02:08 +0000 (11:02 +0800)]
libs: h265dec: remove limitation of get iq matrix

According hevc spec, scaling_list_data is not related
to chroma_format_idc.

4 years agolibs: videopool: fix undocumented behavior and counting
He Junyan [Thu, 30 May 2019 15:52:51 +0000 (23:52 +0800)]
libs: videopool: fix undocumented behavior and counting

gst_vaapi_video_pool_reserve_unlocked() hit an undocumented behavoir
because it locks twice the same mutex.

Also, n had different meanings in the current code: as an increase
value and as a new total of allocated surfaces.

This patche removes the undocumented behavoir (usually a deadlock) and
fixes the meaning of n as the new total of allocated surfaces.

Signed-off-by: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
4 years agolibs: utils: Add missing entries for string_of_VAEntrypoint.
He Junyan [Wed, 17 Jul 2019 03:56:45 +0000 (11:56 +0800)]
libs: utils: Add missing entries for string_of_VAEntrypoint.

4 years agolibs: encoder: Consider vp9 profiles based on input format.
He Junyan [Thu, 18 Jul 2019 14:01:01 +0000 (22:01 +0800)]
libs: encoder: Consider vp9 profiles based on input format.

Only support GST_VAAPI_PROFILE_VP9_0 and GST_VAAPI_PROFILE_VP9_2 now.

Fix: #184

4 years agovaapivideomemory: demote error message to info
Víctor Manuel Jáquez Leal [Mon, 12 Aug 2019 16:41:52 +0000 (18:41 +0200)]
vaapivideomemory: demote error message to info

The main reason to demote the message's level is because it is not an
error, it's a possible output of the trial and there's a code path
that handles it.

Secondly, it's very annoying when using gallium driver for radeon.

4 years agolibs: encoder: h264: support ICQ/QVBR bitrate control mode
Wangfei [Thu, 18 Jul 2019 05:32:46 +0000 (13:32 +0800)]
libs: encoder: h264: support ICQ/QVBR bitrate control mode

ICQ is Intelligent Constant Quality. It will use the initial QP
vaule of icq-quality-factor to adjust QP at MB level intelligently
to improve subjective quality.

QVBR is Quality defined VBR. It will use qvbr-quality-factor to
adjust QP for each MB to get enough quality picture without waste
of bits.

4 years agolibs: Let GST_VAAPI_RATECONTROL_MASK return unsigned int
Wangfei [Mon, 5 Aug 2019 02:51:24 +0000 (10:51 +0800)]
libs: Let GST_VAAPI_RATECONTROL_MASK return unsigned int

The value return from GST_VAAPI_RATECONTROL_MASK will be used by
GST_VAAPI_POPCOUNT32 as its inpput. GST_VAAPI_POPCOUNT32 can only
deal with unsigned int. Otherwise there may be an error of out of
range of integer if we define few more rate-control mode.

5 years agovaapidecodebin: set queue's max size buffers to 1
Víctor Manuel Jáquez Leal [Fri, 7 Jun 2019 07:54:12 +0000 (09:54 +0200)]
vaapidecodebin: set queue's max size buffers to 1

Otherwise the queue will swallow all the available decoder's surfaces
reaching a dead-lock.

This setting might impact the bin's peformance, but it's a trade-off.

5 years agovaapidecodebin: set properties default values
Víctor Manuel Jáquez Leal [Fri, 7 Jun 2019 07:53:08 +0000 (09:53 +0200)]
vaapidecodebin: set properties default values

5 years agovaapidecode: don't error if can't push buffers downtream
Víctor Manuel Jáquez Leal [Fri, 31 May 2019 11:12:35 +0000 (13:12 +0200)]
vaapidecode: don't error if can't push buffers downtream

When the code path goes to push buffers downstream when no surface
available in decoder context, and it fails the code bails out with a
fatal error.

That behavior is wrong, since it shouldn't be fatal. The use case is
when the video stream is disabled.

This patch just ignores the errors in this situation and demotes the
level of a log message.

5 years agolibs: encoder: h264,h265: add new property "max-qp"
Wangfei [Sat, 18 May 2019 05:24:35 +0000 (13:24 +0800)]
libs: encoder: h264,h265: add new property "max-qp"

Add new property "max-qp" to allow set the maximum quantisation
parameter values.

5 years agolibs: encoder: vp9: add low power mode encode
Wangfei [Thu, 23 May 2019 14:18:52 +0000 (10:18 -0400)]
libs: encoder: vp9: add low power mode encode

By now, this feature only support by media-driver on Ice Lake
platform, more information you can reference:
https://github.com/intel/media-driver

5 years agovaapipostproc: update PAR when rotating
U. Artie Eoff [Mon, 15 Jul 2019 22:33:07 +0000 (15:33 -0700)]
vaapipostproc: update PAR when rotating

When rotating, swap pixel-aspect-ratio during
negotiation.

Fixes #181

5 years agovaapipostproc: add rotation support
U. Artie Eoff [Mon, 1 Jul 2019 22:26:18 +0000 (15:26 -0700)]
vaapipostproc: add rotation support

Adds vpp rotation support to vaapipostproc.  Uses
property video-direction. Default is identity (no
rotation).

Closes #104

5 years agolibs: encoder: h265: pass diff_cu_qp_delta_depth flag to driver
Wangfei [Wed, 22 May 2019 14:47:30 +0000 (10:47 -0400)]
libs: encoder: h265: pass diff_cu_qp_delta_depth flag to driver

Intel media-driver requires enablement of diff_cu_qp_delta_depth when
cu_qp_delta_enabled_flag enabled.

Fixes: #177

5 years agolibs: encoder: Add MB ratecontrol mode to get its string
Wangfei [Mon, 1 Jul 2019 09:02:33 +0000 (17:02 +0800)]
libs: encoder: Add MB ratecontrol mode to get its string

5 years agolibs: encoder: refine guard of bitrate control mode
Wangfei [Mon, 1 Jul 2019 08:52:00 +0000 (16:52 +0800)]
libs: encoder: refine guard of bitrate control mode

Remove useless guard of all bitrate control mode's guard except MB
which is define in VA-API version 0.39.1.

5 years agoh264: Update for parse_vui_params parameter removal.
Jan Schmidt [Fri, 28 Jun 2019 14:08:40 +0000 (00:08 +1000)]
h264: Update for parse_vui_params parameter removal.

Update calls to the h264 parser lib for removal of the
parse_vui_params parameter.

5 years agolibs: dec: vp9: do not use display size as decoded size
Wang Zhanjun [Mon, 24 Jun 2019 20:26:56 +0000 (16:26 -0400)]
libs: dec: vp9: do not use display size as decoded size

If display size is smaller than current frame size, then the crop size
will be set as display size, which either crashes the pipeline or the
output MD5 does not match. Rather it should use the actual decoded size.

This patch removes the cropping set. For rendering we can use aspect
ratio to set display size.

Fixes #175

Signed-off-by: Wang Zhanjun <zhanjunx.wang@intel.com>
Signed-off-by: Xu Guangxin <guangxin.xu@intel.com>
5 years agoUpdate README
Víctor Manuel Jáquez Leal [Fri, 28 Jun 2019 14:32:51 +0000 (16:32 +0200)]
Update README

5 years agolibs: dec: h265: Consider chroma_bit_depth to choose chrome type
He Junyan [Tue, 25 Jun 2019 11:11:12 +0000 (19:11 +0800)]
libs: dec: h265: Consider chroma_bit_depth to choose chrome type

For some main-10 stream, sometime the luma is 8 bits while chrome is more
than 8 bits, which cause using the wrong NV12 surface as the render target
and decoding error.

Fix #176

5 years agovaapidecode: set initial decode format according surface chroma type
Wangfei [Tue, 25 Jun 2019 02:31:20 +0000 (10:31 +0800)]
vaapidecode: set initial decode format according surface chroma type

For surfaces with different chroma type, it is prefer to initialize
a format which chroma type should be same with surface chroma type
instead of using fixed NV12.

5 years agolibs: decoder: jpeg: add support 400/411/422/444 chroma type
Wangfei [Thu, 30 May 2019 13:48:51 +0000 (09:48 -0400)]
libs: decoder: jpeg: add support 400/411/422/444 chroma type

When create vaapi surface, it is better to use the chroma type get
from jpeg file instead of using fixed 420 format. And the correct
chroma type can be determined by horizontal_factor/vertical_factor
flags that get from jpegparse.

5 years agolibs: dec: h265: Fix profile_idc mapping.
He Junyan [Fri, 21 Jun 2019 16:05:24 +0000 (00:05 +0800)]
libs: dec: h265: Fix profile_idc mapping.

The old mapping values return by gst_vaapi_utils_h265_get_profile_idc is
wrong, though GST_H265_PROFILE_IDC_MAIN and GST_H265_PROFILE_IDC_MAIN_10
happened to be the correct value.

We only support Annex A profile_idc (1-4).

5 years agoplugins: remove last negotiated video info if caps are same
U. Artie Eoff [Tue, 11 Jun 2019 03:46:30 +0000 (20:46 -0700)]
plugins: remove last negotiated video info if caps are same

If the allocation caps and negotiated caps are the same,
then ensure any previously negotiated video info is also
removed.  This can occur when multi-resolution video
decoding returns to it's original resolution.

Fixes #170

5 years agovaapivideomemory: allow negotiated info to be removed
U. Artie Eoff [Tue, 11 Jun 2019 03:39:28 +0000 (20:39 -0700)]
vaapivideomemory: allow negotiated info to be removed

Allow NULL negotiated_vinfo to be passed into
gst_allocator_set_vaapi_negotiated_video_info to allow
any previously set info to be removed.

5 years agolibs: encoder: vp8,vp9: reset frame_counter when input frame's format changes
Freyr [Thu, 6 Jun 2019 14:24:30 +0000 (17:24 +0300)]
libs: encoder: vp8,vp9: reset frame_counter when input frame's format changes

When input frame's formate changes, vp{8,9} encoders don't reset their frame
counter, hence the newly created frame could become a P-frame, leading to some
major troubles (sigabrt in libdrm in case of vp9). This patch adds some frame
prediction-related reset logic to the `flush' methods of GstVaapiEncoderVP8 and
GstVaapiEncoderVP9 implementations.

5 years agolibs: encoder: increase bitrate prop max value
U. Artie Eoff [Fri, 31 May 2019 19:30:03 +0000 (12:30 -0700)]
libs: encoder: increase bitrate prop max value

There are many profile levels that can support
more than 102400 kbps.  Thus, increase the max
allowed bitrate property value from 102400 kbps
to 2048000 kbps (same as msdk encoder plugins).

5 years agolibs: mpeg2 encoder: No packed header for SPS and PPS
He Junyan [Tue, 4 Jun 2019 05:27:50 +0000 (13:27 +0800)]
libs: mpeg2 encoder: No packed header for SPS and PPS

Dislable passing down packed PPS and PPS to driver if driver does
not want it.

Fix: #168

5 years agomeson: Bump minimal GLib version to 2.44
Niels De Graef [Fri, 31 May 2019 21:10:33 +0000 (23:10 +0200)]
meson: Bump minimal GLib version to 2.44

This means we can use some newer features and get rid of some
boilerplate code using the G_DECLARE_* macros.

As discussed on IRC, 2.44 is old enough by now to start depending on it.

5 years agolibs: dec: vp9: clear parser pointer after release
Víctor Manuel Jáquez Leal [Fri, 31 May 2019 11:08:39 +0000 (13:08 +0200)]
libs: dec: vp9: clear parser pointer after release

Fix an use-after-release of the parser pointer in VP9 decoder.

5 years agovaapiencode: Fixes deadlock in gst_vaapiencode_change_state function
Freyr666 [Tue, 28 May 2019 09:09:36 +0000 (12:09 +0300)]
vaapiencode: Fixes deadlock in gst_vaapiencode_change_state function

This fixes a deadlock in gst_vaapiencode_change_state, which was due to
srcpad's chain function was locked waiting for available buffers. Since the
coded buffers in codedbuf_queue become available after sinkpad consume the
encoded frames, Paused -> Ready state change leads to deadlock. Coded buffers
are never consumed and marked free, hence gst_vaapiencode_handle_frame waits for
available buffers and holds the stream_lock of the srcpad.

5 years agodoc: remove xml from comments
Mathieu Duponchelle [Wed, 29 May 2019 21:08:22 +0000 (23:08 +0200)]
doc: remove xml from comments

5 years agovaapipostproc: add mirror support
U. Artie Eoff [Mon, 13 May 2019 23:39:33 +0000 (16:39 -0700)]
vaapipostproc: add mirror support

Adds vpp mirroring support to vaapipostproc.  Use
property video-direction.  Valid values are identity,
horiz or vert.  Default is identity (no mirror).

Closes #89

v2: Use GstVideoOrientationMethod enum
v3: Don't warn for VA_MIRROR_NONE.
    Use GST_TYPE_VIDEO_ORIENTATION_METHOD type.
v4: Query VAAPI caps when setting mirror value
    instead of during per-frame processing.
v5: Return TRUE in warning cases when setting mirror value.

5 years agodoc: fix some incorrect gtk-doc links
Mathieu Duponchelle [Tue, 28 May 2019 23:35:17 +0000 (01:35 +0200)]
doc: fix some incorrect gtk-doc links

5 years agodocs: Update plugin cache
Thibault Saunier [Thu, 16 May 2019 13:22:42 +0000 (09:22 -0400)]
docs: Update plugin cache

Fixes https://gitlab.freedesktop.org/gstreamer/gst-docs/issues/36

5 years agolibs: surface: fix documentation format
Víctor Manuel Jáquez Leal [Thu, 16 May 2019 14:46:43 +0000 (16:46 +0200)]
libs: surface: fix documentation format

5 years agolibs: enc: h265: reset num_ref_idx_l1_active_minus1 when low delay B.
Wangfei [Thu, 16 May 2019 02:05:17 +0000 (10:05 +0800)]
libs: enc: h265: reset num_ref_idx_l1_active_minus1 when low delay B.

When enable low delay B, the reference list 1 will be same with
reference list 0, so need reset the num_ref_idx_l1_active_minus1
to num_ref_idx_l0_active_minus1.

Fixes: #160

5 years agomeson: Fix call to wrong function
Thibault Saunier [Mon, 13 May 2019 23:05:43 +0000 (19:05 -0400)]
meson: Fix call to wrong function

5 years agodocs: Port to hotdoc
Thibault Saunier [Mon, 22 Oct 2018 09:48:29 +0000 (11:48 +0200)]
docs: Port to hotdoc

5 years agolibs: encoder: not call ensure_num_slices inside g_assert
He Junyan [Fri, 10 May 2019 10:29:10 +0000 (18:29 +0800)]
libs: encoder: not call ensure_num_slices inside g_assert

g_assert will take no effect when glib's G_DISABLE_ASSERT macro is
defined. The function inside the g_assert will take no effect and
we will fail to set the correct slice number.

5 years agolibs: h265: dec: Add extension flags setting.
Wangfei [Mon, 29 Apr 2019 01:52:39 +0000 (09:52 +0800)]
libs: h265: dec: Add extension flags setting.

Use VAPictureParameterBufferHEVCExtension&
VASliceParameterBufferHEVCExtension to pass extension setting from
some extension profile clips which may include these information.
The hevc extension setting only supported after libva release 2.2.0
(API 1.2.0).

5 years agolibs: encoder: add target-percentage property
U. Artie Eoff [Wed, 1 May 2019 19:56:55 +0000 (12:56 -0700)]
libs: encoder: add target-percentage property

Allow users to set the target-percentage for
variable rate controls.  The default value is
70 (as hard-coded prior).

v2: minimum allowed value changed from 0 to 1
v3: target-percentage unchanged if CBR used

Resolves #129

5 years agolibs: encoder: Add a missing comment for DEFAULT_ROI_VALUE property.
He Junyan [Wed, 8 May 2019 16:09:21 +0000 (00:09 +0800)]
libs: encoder: Add a missing comment for DEFAULT_ROI_VALUE property.

5 years agolibs: encoder: Enable trellis quantization method.
He Junyan [Wed, 8 May 2019 15:39:20 +0000 (23:39 +0800)]
libs: encoder: Enable trellis quantization method.

The advanced trellis algorithm is supported in VA driver. We add
its support as a property named "trellis" of encoder.
It only works for H264 now, should be more in future.

5 years agolibs: decoder: vp9: support 422/444 8bit/10bit chroma type.
Wangfei [Tue, 7 May 2019 03:03:51 +0000 (11:03 +0800)]
libs: decoder: vp9: support 422/444 8bit/10bit chroma type.

According to the vp9 sepc, profile 1/3 support 422/440/444 chroma
type, so we need to add subsampling_x&subsampling_y to fix it.

Here is the relationship between chroma type and profile and
subsampling_x&subsampling_y according to vp9 spec:
------------------------------------------
Profile | Bit depth | Chroma subsampling |
------------------------------------------
 0      | 8         | 420                |
------------------------------------------
 1      | 8         | 422,440,444        |
------------------------------------------
 2      | 10, 12    | 420                |
------------------------------------------
 3      | 10, 12    | 422,440,444        |
------------------------------------------

-----------------------------------------------
Subsampling_x | Subsampling_y | Chroma format |
-----------------------------------------------
 0            | 0             | 444           |
-----------------------------------------------
 0            | 1             | 440           |
-----------------------------------------------
 1            | 0             | 422           |
-----------------------------------------------
 1            | 1             | 420           |
-----------------------------------------------

5 years agolibs: Add packed 24 RGB format support.
He Junyan [Tue, 16 Apr 2019 10:33:54 +0000 (18:33 +0800)]
libs: Add packed 24 RGB format support.

Can not find a suitable chrome_type for this GST_VIDEO_FORMAT_RGB
packed 24 format. Just use GST_VAAPI_CHROMA_TYPE_RGB32 as its chrome
type. This kind of surface will just be created by new API with fourcc
and no old style chrome based creation is available.

fixes: #151

5 years agovaapiencode: handle DMABuf caps feature in sink pad
Wangfei [Fri, 15 Mar 2019 06:29:41 +0000 (14:29 +0800)]
vaapiencode: handle DMABuf caps feature in sink pad

Add DMABuff caps features in all encoders' sink pad.

5 years agolibs: encoder: continue if roi meta is NULL
Víctor Manuel Jáquez Leal [Fri, 3 May 2019 08:31:52 +0000 (10:31 +0200)]
libs: encoder: continue if roi meta is NULL

Coverity scan bug:

If the function actually returns a null value, a null pointer
dereference will occur.

In gst_vaapi_encoder_ensure_param_roi_regions(): Return value of
function which returns null is dereferenced without checking

5 years agolib: decoder: vp9: Set chroma_type by VP9 bit_depth
He Junyan [Mon, 15 Apr 2019 11:58:14 +0000 (19:58 +0800)]
lib: decoder: vp9: Set chroma_type by VP9 bit_depth

The decoder's surface chroma type should depend on the bit depth
of VP9's parser. For 10bits VP9 stream, we need to use P10LE kind
10 bits surface as the decoder result.

Fixes #155

5 years agovaapipostproc: don't do any color conversion when GL_TEXTURE_UPLOAD
Víctor Manuel Jáquez Leal [Thu, 2 May 2019 14:00:57 +0000 (16:00 +0200)]
vaapipostproc: don't do any color conversion when GL_TEXTURE_UPLOAD

https://bugzilla.gnome.org/show_bug.cgi?id=748184 has resurrected
with commit 3e992d8a

Since gst_vaapi_find_preferred_caps_feature() returns a color format
from caps negotiation, different from the default one (NV12), the
postproc enables the color transformation. But when GL_TEXTURE_UPLOAD
feature is negotiated, no color transformation shall be done.

Nonetheless, with commit 3e992d8a the requested format changes
firstly, because there's no video sink yet, so ANY caps are
negotiated; but later, when there's a video sink and a caps
renegotiation, the GL_TEXTURE_UPLOAD is negotiated though the color
format conversion still ongoing. It is required to reset that
conversion.

This patch force default color format when GL_TEXTURE_UPLOAD is
selected as preferred, thus avoiding the color conversion.

Fixes: #157

5 years agolibs: surface: fix double free when dmabuf export fails
Julien Isorce [Fri, 19 Apr 2019 22:49:37 +0000 (15:49 -0700)]
libs: surface: fix double free when dmabuf export fails

Happens if vaAcquireBufferHandle fails.

5 years agolibs: h264encoder: fix a typo of GstVaapiEncoderH264PredictionType
He Junyan [Mon, 29 Apr 2019 12:10:39 +0000 (20:10 +0800)]
libs: h264encoder: fix a typo of GstVaapiEncoderH264PredictionType

5 years agoBack to development
Tim-Philipp Müller [Fri, 19 Apr 2019 09:43:35 +0000 (10:43 +0100)]
Back to development

5 years agoRelease 1.16.0
Tim-Philipp Müller [Thu, 18 Apr 2019 23:38:12 +0000 (00:38 +0100)]
Release 1.16.0

5 years agoUpdate docs
Tim-Philipp Müller [Thu, 18 Apr 2019 23:38:12 +0000 (00:38 +0100)]
Update docs

5 years agolibs: encoder: h264,h265: guard VA version for max_qp property
Víctor Manuel Jáquez Leal [Mon, 15 Apr 2019 17:34:05 +0000 (19:34 +0200)]
libs: encoder: h264,h265: guard VA version for max_qp property

This patch fixes a regression from commit 5b1fe9c6.

max_qp, in rate control configuration, appeared in libva release
2.1 (API 1.1), thus it is required to guard the VA API version.

Fixes: #150

5 years agolibs: Add RGB565 image format support.
He Junyan [Mon, 8 Apr 2019 10:29:35 +0000 (18:29 +0800)]
libs: Add RGB565 image format support.

5 years agobuild: configure: delay USE_GTK conditional until check libva-x11
Víctor Manuel Jáquez Leal [Wed, 10 Apr 2019 11:59:05 +0000 (13:59 +0200)]
build: configure: delay USE_GTK conditional until check libva-x11

libva-x11 is used for X11 applications, so it is required to build
any GTK application.

Later, when Wayland test is added, we should change this.

5 years agobuild: configure: disable GLX if libva-x11 is not found
Víctor Manuel Jáquez Leal [Wed, 10 Apr 2019 11:25:10 +0000 (13:25 +0200)]
build: configure: disable GLX if libva-x11 is not found

5 years agolibs: utils: avoid macro evaluation when stringify
He Junyan [Mon, 15 Apr 2019 11:55:26 +0000 (13:55 +0200)]
libs: utils: avoid macro evaluation when stringify

string_of_va_chroma_format() gets a wrong string format description.
For example, the YUV420_10BPP get a string of 0x00000100 as output.

It's because VA_RT_FORMAT_xxx values are macro definitions. And
STRINGIFY(VA_RT_FORMAT_xxx) will expand to its real value
0x00000XXX.

To avoid the macro evaluation, it is changed to show only the color
format without VA_RT_FORMAT_ prefix.

5 years agolibs: utils: use glib's macros
Víctor Manuel Jáquez Leal [Mon, 15 Apr 2019 11:54:15 +0000 (13:54 +0200)]
libs: utils: use glib's macros

Don't reinvent the wheel.

5 years agoplugins: find the preferred format from right caps.
Wangfei [Thu, 11 Apr 2019 07:05:02 +0000 (15:05 +0800)]
plugins: find the preferred format from right caps.

When the downstream has any caps, then raw video feature will
be used. At this situation, the preferred format should be chose
from caps which contains "vide/x-raw" feature instead of from
the fist allowed caps.

Fixes #142

5 years agolibs: encoder: h265: fill tier in va seq param buf
U. Artie Eoff [Wed, 10 Apr 2019 18:43:33 +0000 (11:43 -0700)]
libs: encoder: h265: fill tier in va seq param buf

Now that tier is calculated in commit 58e74f9440fe (!68),
ensure we fill in the general_tier_flag in the
VAEncSequenceParameterBufferHEVC.

5 years agoRelease 1.15.90
Tim-Philipp Müller [Wed, 10 Apr 2019 23:40:03 +0000 (00:40 +0100)]
Release 1.15.90

5 years agoUpdate docs
Tim-Philipp Müller [Wed, 10 Apr 2019 23:40:03 +0000 (00:40 +0100)]
Update docs