multiqueue: Rename percent/percent_changed to buffering_percent(_changed)

This is a prerequisite for subsequent commits, and makes queue2 and
multiqueue code a little more consistent.

https://bugzilla.gnome.org/show_bug.cgi?id=770628
This commit is contained in:
Carlos Rafael Giani 2016-08-31 09:48:38 +02:00 committed by Sebastian Dröge
parent 3117525cb6
commit e83412b4fd
2 changed files with 12 additions and 12 deletions

View file

@ -396,9 +396,9 @@ gst_multiqueue_pad_init (GstMultiQueuePad * pad)
} G_STMT_END } G_STMT_END
#define SET_PERCENT(mq, perc) G_STMT_START { \ #define SET_PERCENT(mq, perc) G_STMT_START { \
if (perc != mq->percent) { \ if (perc != mq->buffering_percent) { \
mq->percent = perc; \ mq->buffering_percent = perc; \
mq->percent_changed = TRUE; \ mq->buffering_percent_changed = TRUE; \
GST_DEBUG_OBJECT (mq, "buffering %d percent", perc); \ GST_DEBUG_OBJECT (mq, "buffering %d percent", perc); \
} \ } \
} G_STMT_END } G_STMT_END
@ -1089,7 +1089,7 @@ update_buffering (GstMultiQueue * mq, GstSingleQueue * sq)
mq->buffering = FALSE; mq->buffering = FALSE;
} }
/* make sure it increases */ /* make sure it increases */
percent = MAX (mq->percent, percent); percent = MAX (mq->buffering_percent, percent);
SET_PERCENT (mq, percent); SET_PERCENT (mq, percent);
} else { } else {
@ -1120,10 +1120,10 @@ gst_multi_queue_post_buffering (GstMultiQueue * mq)
g_mutex_lock (&mq->buffering_post_lock); g_mutex_lock (&mq->buffering_post_lock);
GST_MULTI_QUEUE_MUTEX_LOCK (mq); GST_MULTI_QUEUE_MUTEX_LOCK (mq);
if (mq->percent_changed) { if (mq->buffering_percent_changed) {
gint percent = mq->percent; gint percent = mq->buffering_percent;
mq->percent_changed = FALSE; mq->buffering_percent_changed = FALSE;
percent = percent * 100 / mq->high_percent; percent = percent * 100 / mq->high_percent;
/* clip */ /* clip */
@ -1160,8 +1160,8 @@ recheck_buffering_status (GstMultiQueue * mq)
GST_MULTI_QUEUE_MUTEX_LOCK (mq); GST_MULTI_QUEUE_MUTEX_LOCK (mq);
/* force fill level percentage to be recalculated */ /* force fill level percentage to be recalculated */
old_perc = mq->percent; old_perc = mq->buffering_percent;
mq->percent = 0; mq->buffering_percent = 0;
tmp = mq->queues; tmp = mq->queues;
while (tmp) { while (tmp) {
@ -1172,7 +1172,7 @@ recheck_buffering_status (GstMultiQueue * mq)
} }
GST_DEBUG_OBJECT (mq, "Recalculated fill level: old: %d%% new: %d%%", GST_DEBUG_OBJECT (mq, "Recalculated fill level: old: %d%% new: %d%%",
old_perc, mq->percent); old_perc, mq->buffering_percent);
GST_MULTI_QUEUE_MUTEX_UNLOCK (mq); GST_MULTI_QUEUE_MUTEX_UNLOCK (mq);
} }

View file

@ -67,7 +67,7 @@ struct _GstMultiQueue {
gboolean use_buffering; gboolean use_buffering;
gint low_percent, high_percent; gint low_percent, high_percent;
gboolean buffering; gboolean buffering;
gint percent; gint buffering_percent;
guint counter; /* incoming object counter, use atomic accesses */ guint counter; /* incoming object counter, use atomic accesses */
guint32 highid; /* contains highest id of last outputted object */ guint32 highid; /* contains highest id of last outputted object */
@ -79,7 +79,7 @@ struct _GstMultiQueue {
gint numwaiting; /* number of not-linked pads waiting */ gint numwaiting; /* number of not-linked pads waiting */
gboolean percent_changed; gboolean buffering_percent_changed;
GMutex buffering_post_lock; /* assures only one posted at a time */ GMutex buffering_post_lock; /* assures only one posted at a time */
GstClockTime interleave; /* Input interleave */ GstClockTime interleave; /* Input interleave */