Commit graph

12 commits

Author SHA1 Message Date
Matthew Waters
0236fa8b9e compositor: fix YUY2/UYVY/VYUY blending
Don't overead memory.

Fixup for https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/755

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/823>
2020-09-21 23:51:31 +10:00
Matthew Waters
d7abf832af compositor: blend with multiple threads
Increases the throughput of compositing by using more CPU cycles across
multiple threads.  Simple cases (the output contains one pixel from at
most one input) can have up to a 70% increase in throughput.  Not so
simple cases are limited by the region with the most number of
composite operations.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/755>
2020-09-14 14:00:58 +10:00
Sebastian Dröge
d5ee11fb36 compositor: Create a square checkerboard for UYVY/YUY2/YVYU too
Previously the "squares" were twice as wide.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/732
2020-03-09 21:51:32 +00:00
Sebastian Dröge
0227d0ca60 compositor: Define a separate checker fill function for BGRx/RGBx than for xBGR/xRGB
Otherwise we'll create a cyan or yellow checkerboard.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/736
2020-03-09 21:51:32 +00:00
Sebastian Dröge
1c147208cc compositor: memcpy() lines directly for alpha formats with SOURCE operator and alpha=1.0 2020-01-08 16:20:30 +02:00
Seungha Yang
dc274ea9ca compositor: Add support for VUYA format
Reversed order of AYUV format. Most of core methods are prepared
already.
2019-11-04 14:50:28 +00:00
Nirbheek Chauhan
65615a841d compositor: Don't log per-frame under GST_INFO 2019-06-13 20:31:50 +05:30
Sebastian Dröge
e87fa73e60 compositor: Implement different operators via per-pad property
This removes the crossfade-ratio property and replaces it with an
operator property. Currently this implements the following operators:

- SOURCE: Copy over the source and don't look at the destination
- OVER: Default blending of the source over the destination
- ADD: Like OVER but simply adding the alpha instead

See the example for how to implement crossfading with this.

https://bugzilla.gnome.org/show_bug.cgi?id=797169
2018-10-28 17:13:26 +00:00
Sebastian Dröge
aa3e64c71d compositor: Use 255 as maximum alpha instead of 256
255 will easily become 0 in the blending function as they expect
the maximum value to be 255.

Can be reproduce with

gst-launch-1.0 videotestsrc pattern=ball ! c.sink_0 \
               videotestsrc pattern=snow ! c.sink_1 \
               compositor name=c \
                 sink_0::zorder=0 sink_1::zorder=1 sink_0::crossfade-ratio=0.5 \
                 background=black ! \
               videoconvert ! xvimagesink

crossfade-ratio +/- 0.001 makes it work correctly and the same happens
at e.g. 0.25, 0.75, N*0.0625

https://bugzilla.gnome.org/show_bug.cgi?id=796846
2018-07-23 18:59:33 +03:00
Thibault Saunier
effb593a93 compositor: Add support for crossfade blending
Crossfading is a bit more complex than just having two pads with the
right keyframes as the blending is not exactly the same.

The difference is in the way we compute the alpha channel, in the case
of crossfading, we have to compute an additive operation between
the destination and the source (factored by the alpha property of both
the input pad alpha property and the crossfading ratio) basically so
that the crossfade result of 2 opaque frames is also fully opaque at any
time in the crossfading process, avoid bleeding through the layer
blending.

Some rationnal can be found in https://phabricator.freedesktop.org/T7773.

https://bugzilla.gnome.org/show_bug.cgi?id=784827
2017-08-03 12:59:43 -04:00
Vincent Penquerc'h
6b2f694455 compositor: fix illegal memory access in blend function with negative ypos
https://bugzilla.gnome.org/show_bug.cgi?id=741115
2015-01-19 12:38:13 +00:00
Mathieu Duponchelle
75c71741a2 compositor: Add a new compositor based on the new GstVideoAggregator base class
It is a replacement for videomixer with a similare API

Co-Authored by: Thibault Saunier <tsaunier@gnome.org>

https://bugzilla.gnome.org/show_bug.cgi?id=731919
2014-06-20 19:53:33 +02:00