After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 784827 - compositor: Add support for crossfade blending
compositor: Add support for crossfade blending
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
unspecified
Other All
: Normal normal
: 1.13.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks: 795836
 
 
Reported: 2017-07-12 01:20 UTC by Thibault Saunier
Modified: 2018-09-19 08:34 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
compositor: Add support for crossfade blending (30.12 KB, patch)
2017-07-12 01:21 UTC, Thibault Saunier
none Details | Review
video-transition: Make use of the new `compositor::crossfade-ratio` property (6.20 KB, patch)
2017-07-12 01:22 UTC, Thibault Saunier
accepted-commit_now Details | Review
compositor: Add support for crossfade blending (30.25 KB, patch)
2017-07-12 02:34 UTC, Thibault Saunier
committed Details | Review
tests: examples: Add a simple crossfade example (6.12 KB, patch)
2017-07-12 02:34 UTC, Thibault Saunier
committed Details | Review

Description Thibault Saunier 2017-07-12 01:20:59 UTC
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.
Comment 1 Thibault Saunier 2017-07-12 01:21:04 UTC
Created attachment 355370 [details] [review]
compositor: Add support for crossfade blending
Comment 2 Thibault Saunier 2017-07-12 01:22:39 UTC
Created attachment 355371 [details] [review]
video-transition: Make use of the new `compositor::crossfade-ratio` property

To achieve a real transition about to handle several level of layers.
Comment 3 Thibault Saunier 2017-07-12 02:34:44 UTC
Created attachment 355378 [details] [review]
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.
Comment 4 Thibault Saunier 2017-07-12 02:34:51 UTC
Created attachment 355379 [details] [review]
tests: examples: Add a simple crossfade example
Comment 5 Mathieu Duponchelle 2017-08-01 15:42:33 UTC
Review of attachment 355378 [details] [review]:

Looking good to me apart from these comments :)

::: gst-libs/gst/video/gstvideoaggregatorpad.h
@@ +71,3 @@
   /* < private > */
   GstVideoAggregatorPadPrivate *priv;
+  union {

Need a comment to explain why a pad may have this set to true.

::: gst/compositor/blend.c
@@ +1032,3 @@
       "video compositor blending functions");
 
+  gst_compositor_blend_argb = GST_DEBUG_FUNCPTR (blend_argb);

I would suggest making this a separate commit, it's a pretty large unrelated diff :)

::: gst/compositor/blend.h
@@ +27,3 @@
+ * GstCompositorBlendMode:
+ * @COMPOSITOR_BLEND_MODE_NORMAL: Normal blending
+ * @COMPOSITOR_BLEND_MODE_ADDITION: Alphas are simply added,

I'd call the mode "additive" rather
Comment 6 Mathieu Duponchelle 2017-08-01 15:43:44 UTC
Review of attachment 355371 [details] [review]:

lgtm
Comment 7 Mathieu Duponchelle 2017-08-01 15:44:55 UTC
Review of attachment 355379 [details] [review]:

lgtm
Comment 8 Thibault Saunier 2017-08-03 17:15:47 UTC
Attachment 355378 [details] pushed as 806ff70 - compositor: Add support for crossfade blending
Attachment 355379 [details] pushed as 9c57524 - tests: examples: Add a simple crossfade example