multiqueue: Distinguish between buffering percentage and buffering level
authorCarlos Rafael Giani <dv@pseudoterminal.org>
Wed, 31 Aug 2016 07:48:53 +0000 (09:48 +0200)
committerSebastian Dröge <sebastian@centricular.com>
Wed, 31 Aug 2016 09:56:19 +0000 (12:56 +0300)
commit67874ea86d3eaa1197d34477c41d18f82e15d790
treefe6a318642d06be1e8d829e5274b6f61177afb10
parente83412b4fd9fe486ba48b7e89f600b68544e2dbc
multiqueue: 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_percentage() is renamed to get_buffering_level(). Also,
low/high_percent are renamed to low/high_watermark to avoid confusion.
mq->buffering_percent values are now normalized in the 0..100 range for
buffering messages inside update_buffering(), and not just before sending
the buffering message. Finally the buffering level range is parameterized
by adding a new constant called MAX_BUFFERING_LEVEL.

https://bugzilla.gnome.org/show_bug.cgi?id=770628
plugins/elements/gstmultiqueue.c
plugins/elements/gstmultiqueue.h