Commit graph

37 commits

Author SHA1 Message Date
U. Artie Eoff
4913d2b595 vaapipostproc: enable HDR10 tone mapping 2020-04-03 09:23:32 -07:00
Yan Wang
4c87644914 vaapipostproc: Use level value for skin-tone-enhancement filter.
Currently the parameter of skin-tone-enhancement filter is forced
to zero. In fact it could be set different value by the user.
So create a new property named as "skin-tone-enhancement-level"
for accepting the used defined parameter value.
At the same time, skin-tone-enhancement is marked as deprecated.
When skin-tone-enhancement-level is set, skin-tone-enhancement
will be ignored.
2019-09-30 18:14:53 +00:00
U. Artie Eoff
2f0f5e1ef9 vaapipostproc: allow cropping via properties
Add crop-left, crop-right, crop-top and crop-bottom
properties to vaapipostproc.
2019-09-05 10:42:28 -07:00
U. Artie Eoff
6700f642fc vaapipostproc: advertise crop meta is handled
Advertise to upstream that vaapipostproc can handle
crop meta.

When used in conjunction with videocrop plugin, the
videocrop plugin will only do in-place transform on the
crop meta when vaapipostproc advertises the ability to
handle it.  This allows vaapipostproc to apply the crop
meta on the output buffer using vaapi acceleration.
Without this advertisement, the videocrop plugin will
crop the output buffer directly via software methods,
which is not what we desire.

vaapipostproc will not apply the crop meta if downstream
advertises crop meta handling; vaapipostproc will just
forward the crop meta to downstream.  If crop meta is
not advertised by downstream, then vaapipostproc will
apply the crop meta.

Examples:

1. vaapipostproc will forward crop meta to vaapisink
 gst-launch-1.0 videotestsrc \
  ! videocrop left=10 \
  ! vaapipostproc \
  ! vaapisink

2. vaapipostproc will do the cropping
 gst-launch-1.0 videotestsrc \
  ! videocrop left=10 \
  ! vaapipostproc \
  ! identity drop-allocation=1 \
  ! vaapisink
2019-08-30 17:01:55 +00:00
Víctor Manuel Jáquez Leal
bcb29e8399 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.
2019-08-19 16:48:50 +00:00
U. Artie Eoff
3ccf3f3334 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.
2019-05-29 09:06:27 +00:00
Hyunjun Ko
73d4da2e79 vaapipostproc: make it enable/disable pass-through mode
In case that sink caps and src caps are same, and no filtering parameter set,
pass-through mode is enabled.
If new filtering parameter is set during playback, it makes it reconfiguring,
so that pass-through mode is changed

In addition, updating filter is performed during reconfiguration, if needed.

https://bugzilla.gnome.org/show_bug.cgi?id=751876
2016-07-22 12:08:20 +02:00
Scott D Phillips
4791e9f2ea vaapipostproc: add postproc_lock to protect data members
Add a mutex to postproc to protect concurrent access to data members.
Previously set_caps() could release the allowed_srcpad_caps while
transform_caps was in the middle of using it.

Signed-off-by: Scott D Phillips <scott.d.phillips@intel.com>

https://bugzilla.gnome.org/show_bug.cgi?id=766940
2016-06-08 10:03:59 +02:00
Víctor Manuel Jáquez Leal
cbc2d15bec vaapipostproc: add color balance interface
https://bugzilla.gnome.org/show_bug.cgi?id=720376
2015-06-12 19:22:01 +02:00
Víctor Manuel Jáquez Leal
1ef8c10aa8 vaapipostproc: add skin tone enhancement
Added the 'skin-tone-enhancement' property to vaapostproc.

https://bugzilla.gnome.org/show_bug.cgi?id=744088
2015-06-08 18:00:05 +02:00
Víctor Manuel Jáquez Leal
98655a195f vaapipostproc: always activate buffer pool
The vaapipostproc has a proxy flag to know if the the buffer pool is
already active. But this fails in some situations where it is needed
to renegotiate the buffer pool.

This patch removes that flag so the renegotiation is done whenever is
required.

https://bugzilla.gnome.org/show_bug.cgi?id=745535
2015-03-06 12:16:17 +02:00
Gwenole Beauchesne
9c888b8b8e plugins: re-indent all video processing related source code. 2014-11-24 14:11:35 +01:00
Gwenole Beauchesne
eeb43989c1 vaapipostproc: allow user defined scaling mode.
Add new "scale-method" property to expose the scaling mode to use during
video processing. Note that this is only a hint, and the actual behaviour
may differ from implementation (VA driver) to implementation.
2014-10-29 17:33:48 +01:00
Gwenole Beauchesne
9ee46ab32e vaapipostproc: use pooled vaapi video meta.
Use pooled GstVaapiVideoMeta information, i.e. always allocate that on
video buffer allocation. Also optimize copy of additional metadata info
into the resulting video buffer: only copy the video cropping info and
the source surface proxy.

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

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
[fixed proxy leak, fixed double free on error, optimized meta copy]
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2014-08-22 18:15:31 +02:00
Sreerenj Balachandran
db111fe72a vaapipostproc: fix output buffer to have a GstVaapiVideoMemory.
https://bugzilla.gnome.org/show_bug.cgi?id=720311

[used new infrastructure through base decide_allocation() impl]
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2014-08-22 15:54:32 +02:00
Gwenole Beauchesne
d82e6a8866 vaapipostproc: improve heuristics for detecting native VA surfaces.
Use the new gst_caps_has_vaapi_surface() helper function to detect
whether the sink pad caps contain native VA surfaces, or not, i.e.
no raw video caps.

Also rename is_raw_yuv to get_va_surfaces to make the variable more
explicit as we just want a way to differentiate raw video caps from
VA surfaces actually.
2014-08-21 09:39:09 +02:00
Gwenole Beauchesne
6bf3c1863c legal: update copyright notice dates. 2014-01-22 19:02:35 +01:00
Zhao, Halley
467bf95c09 vaapipostproc: add support for colorbalance filters.
Add support for hue, saturation, brightness and constrat adjustments.
Also fix cap info local copy to match the really expected cap subtype
of interest.

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

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2014-01-15 11:49:49 +01:00
Gwenole Beauchesne
690e85ff8e plugins: fix permissions for certain files.
Drop the execute bit for gstvaapiuploader.c and gstvaapipostproc.[ch]
files.
2013-12-20 17:16:12 +01:00
Gwenole Beauchesne
e3dcd33114 plugins: factor out support for raw YUV buffers on sink pads.
Factor out propose_allocation() hooks, creation of video buffer pool
for the sink pad, conversion from raw YUV buffers to VA surface backed
buffers. Update vaapidecode, vaapiencode and vaapipostproc to cope
with the new GstVaapiPluginBase abilities.
2013-12-18 16:38:57 +01:00
Gwenole Beauchesne
b324fc6add plugins: factor out pad caps. 2013-12-18 16:38:57 +01: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
Gwenole Beauchesne
7a464ba015 vaapipostproc: fix and optimize advanced deinterlacing mode.
Fix advanced deinterlacing modes with VPP to track only up to 2 past
reference buffers. This used to be 3 past reference buffers but this
doesn't fit with the existing decode pipeline that only has 4 extra
scratch surfaces.

Also optimize references tracking to be only enabled when needed, i.e.
when advanced deinterlacing mode is used. This means that we don't
need to track past references for basic bob or weave deinterlacing.
2013-11-22 10:27:19 +01:00
Gwenole Beauchesne
c516311a1a legal: update copyright notice dates. 2013-11-22 06:39:20 +01:00
Gwenole Beauchesne
15519ebe3d legal: add per-file authorship information.
Credit original authors on a per-file basis as we cannot expect people
to know all country-specific rules, or bother browsing through the git
history.
2013-11-22 06:39:15 +01:00
Halley Zhao
ef8f5defd2 vaapipostproc: add support for denoise and sharpen filters.
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2013-11-21 23:08:02 +01:00
Gwenole Beauchesne
c8bea66d33 vaapipostproc: add support for advanced deinterlacing.
Add initial support for advanced deinterlacing. The history buffer
size is arbitrarily set to 3 references for now.
2013-11-21 23:08:02 +01:00
Gwenole Beauchesne
e7544dc57e vaapipostproc: add initial support for scaling.
Add initial support for basic scaling with size specified through the
"width" and "height" properties. If either user-provided dimension is
zero and "force-aspect-ratio" is set to true (the default), then the
other dimension is scaled to preserve the aspect ratio.
2013-11-15 19:36:50 +01:00
Gwenole Beauchesne
cf69e7269c vaapipostproc: add initial support for color conversion.
If VPP is available, we always try to implicitly convert the source
buffer to the "native" surface format for the underlying accelerator.
This means that no optimization is performed yet to propagate raw YUV
buffers to the downstream element as is, if VPP is available. i.e. it
will always cause a color conversion.
2013-11-15 19:36:50 +01:00
Gwenole Beauchesne
d71008210d vaapipostproc: factor out operations to be applied into flags.
Even if we only support deinterlacing for now, use flags to specify
which filters are to be applied to each frame we receive in transform().
This is preparatory work for integrating new filters.
2013-11-15 19:36:50 +01:00
Gwenole Beauchesne
ae5e5be80b vaapipostproc: add support for raw YUV video source buffers.
Allow video processing from raw YUV buffers coming from the sink pad,
while still producing a VA surface for the downstream elements.
2013-10-09 18:30:06 +02:00
Gwenole Beauchesne
f6f24bfc55 vaapipostproc: rework plug-in element.
Rewrite the vaapipostproc plug-in element so that it derives from
GstBaseTransform, thus simplifying the caps negotiation process.
2013-10-09 18:30:06 +02:00
Zhao Halley
944a7bd077 filter: add initial support for deinterlacing.
Add basic deinterlacing support, i.e. bob-deinterlacing whereby only
the selected field from the input surface is kept for the target surface.
Setting gst_vaapi_filter_set_deinterlacing() method argument to
GST_VAAPI_DEINTERLACE_METHOD_NONE means to disable deinterlacing.

Also move GstVaapiDeinterlaceMethod definition from vaapipostproc plug-in
to libgstvaapi core library.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2013-08-23 19:00:38 +02:00
Gwenole Beauchesne
4cf44e3ad2 plugins: integrate GstVaapiVideoBuffer from libgstvaapi.
Move GstVaapiVideoBuffer from core libgstvaapi decoding library to the
actual plugin elements. That's only useful there.
2013-03-21 18:16:14 +01:00
Philip Lorenz
79b45a43d1 Do not forward declare enums.
Forward declaring enums is not allowed by the C standard and aborts
compilation if the header file is included in a C++ project.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2012-09-07 11:54:09 +02:00
Javier Jardón
ba3ae60613 plugins: declare _get_type() functions as const.
Declaring a function as const enables better optimization of calls to
the function.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2012-07-19 15:19:17 +02:00
Gwenole Beauchesne
894d65b81a vaapipostproc: add new element for video postprocessing.
Add vaapipostproc element for video postprocessing. So far, only basic
bob deinterlacing is implemented. Interlaced mode is automatically
detected based on sink caps ("interlaced" field).
2012-03-26 14:37:24 +02:00