queue2: Distinguish between buffering percentage and buffering level
authorCarlos Rafael Giani <dv@pseudoterminal.org>
Wed, 3 Aug 2016 13:27:40 +0000 (15:27 +0200)
committerSebastian Dröge <sebastian@centricular.com>
Thu, 25 Aug 2016 08:54:33 +0000 (11:54 +0300)
commite0f1a9e618e16e887d1d2b94e52ba02ae316fd78
tree9c22b1198986d454411af5739f8bbe5a272d7b8b
parent1e1ea38b8eabedc97a9a6629246c9371fc1d7858
queue2: Distinguish between buffering percentage and buffering level

To make the code clearer, and to facilitate future improvements, introduce
a distinction between the buffering level and the buffering percentage.

Buffering level: the queue's current fill level. The low/high watermarks
are in this range.

Buffering percentage: percentage relative to the low/high watermarks
(0% = low watermark, 100% = high watermark).

To that end, get_buffering_percent() is renamed to get_buffering_level(),
and the code at the end that transforms to the buffering percentage is
factored out into a new convert_to_buffering_percent() function. Also,
the buffering level range is parameterized by adding a new constant called
MAX_BUFFERING_LEVEL.

https://bugzilla.gnome.org/show_bug.cgi?id=769449
plugins/elements/gstqueue2.c