clockoverlay: only rerender text if time string has changed
authorChris Shoemaker <chris.shoemaker@cox.net>
Mon, 23 Aug 2010 22:51:18 +0000 (18:51 -0400)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Tue, 24 Aug 2010 07:29:33 +0000 (09:29 +0200)
commit6bd90dc0cc742390c2f1e842e1f026a3503ded63
tree1e918e0f2e82a37d2af4583258ca962ef4b01e18
parent1b6918709c4bb843a6dbd932f292d45519d15dcf
clockoverlay: only rerender text if time string has changed

The textoverlay element will rerender the text string whenever
overlay sets the 'need_render' flag to TRUE.  Previously, we
lazily set the flag to TRUE every time the time string was requested.
Now, we save a copy of the previously given string, and only set
'need_render' to TRUE if the string has changed.

In my tests with a 30fps video stream, and a time string including
a seconds field, this change reduced the CPU usage of the clockoverlay
element from 60% to 5%.

Fixes bug #627780.
ext/pango/gstclockoverlay.c
ext/pango/gstclockoverlay.h