compositor: Use 255 as maximum alpha instead of 256
authorSebastian Dröge <sebastian@centricular.com>
Fri, 20 Jul 2018 13:25:02 +0000 (16:25 +0300)
committerSebastian Dröge <sebastian@centricular.com>
Mon, 23 Jul 2018 15:59:33 +0000 (18:59 +0300)
commitaa3e64c71de7b072f421866c3c9c34b8969c1bd0
tree5c58127f5dd72207ac460f697d9d953b2754a82d
parent4380d5777980b7dd29e037a40d8dffa33dc89bec
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
gst/compositor/blend.c