GNOME Bugzilla – Bug 627780
GstClockOverlay re-renders string even if it hasn't changed, resulting in very high CPU usage.
Last modified: 2010-08-24 07:30:45 UTC
Created attachment 168597 [details] [review] clockoverlay: only rerender text if time string has changed [PATCH] 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%.
commit 6bd90dc0cc742390c2f1e842e1f026a3503ded63 Author: Chris Shoemaker <chris.shoemaker@cox.net> Date: Mon Aug 23 18:51:18 2010 -0400 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.