Skip to content
Commit 37fd8da1 authored by Daniel Calviño Sánchez's avatar Daniel Calviño Sánchez
Browse files

Do not calculate segmentation again if the previous one is not finished



Whenever a segmentation is calculated it is used to draw the input
stream to the output canvas with the background blurred. The
segmentation calculation was triggered at regular intervals, but it was
not taken into account whether a previous segmentation was still being
calculated. Now a new segmentation is calculated only if the previous
one finished already.

This prevents running outdated segmentations and thus should reduce the
load on low end devices in which calculating the segmentation for a
frame takes longer than the time elapsed between frames.

Besides that, if the input stream was changed the previous segmentation
could be processed when the new one had not finished loading yet, which
could led to visual glitches. This is also implicitly fixed by this
change, as the previous segmentation will be discarded if it does not
match the expected frame id.

Signed-off-by: default avatarDaniel Calviño Sánchez <danxuliu@gmail.com>
parent 2790ead5
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment