mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-25 11:11:08 +00:00
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:
parent
3117525cb6
commit
e83412b4fd
2 changed files with 12 additions and 12 deletions
|
@ -396,9 +396,9 @@ gst_multiqueue_pad_init (GstMultiQueuePad * pad)
|
|||
} G_STMT_END
|
||||
|
||||
#define SET_PERCENT(mq, perc) G_STMT_START { \
|
||||
if (perc != mq->percent) { \
|
||||
mq->percent = perc; \
|
||||
mq->percent_changed = TRUE; \
|
||||
if (perc != mq->buffering_percent) { \
|
||||
mq->buffering_percent = perc; \
|
||||
mq->buffering_percent_changed = TRUE; \
|
||||
GST_DEBUG_OBJECT (mq, "buffering %d percent", perc); \
|
||||
} \
|
||||
} G_STMT_END
|
||||
|
@ -1089,7 +1089,7 @@ update_buffering (GstMultiQueue * mq, GstSingleQueue * sq)
|
|||
mq->buffering = FALSE;
|
||||
}
|
||||
/* make sure it increases */
|
||||
percent = MAX (mq->percent, percent);
|
||||
percent = MAX (mq->buffering_percent, percent);
|
||||
|
||||
SET_PERCENT (mq, percent);
|
||||
} else {
|
||||
|
@ -1120,10 +1120,10 @@ gst_multi_queue_post_buffering (GstMultiQueue * mq)
|
|||
|
||||
g_mutex_lock (&mq->buffering_post_lock);
|
||||
GST_MULTI_QUEUE_MUTEX_LOCK (mq);
|
||||
if (mq->percent_changed) {
|
||||
gint percent = mq->percent;
|
||||
if (mq->buffering_percent_changed) {
|
||||
gint percent = mq->buffering_percent;
|
||||
|
||||
mq->percent_changed = FALSE;
|
||||
mq->buffering_percent_changed = FALSE;
|
||||
|
||||
percent = percent * 100 / mq->high_percent;
|
||||
/* clip */
|
||||
|
@ -1160,8 +1160,8 @@ recheck_buffering_status (GstMultiQueue * mq)
|
|||
GST_MULTI_QUEUE_MUTEX_LOCK (mq);
|
||||
|
||||
/* force fill level percentage to be recalculated */
|
||||
old_perc = mq->percent;
|
||||
mq->percent = 0;
|
||||
old_perc = mq->buffering_percent;
|
||||
mq->buffering_percent = 0;
|
||||
|
||||
tmp = mq->queues;
|
||||
while (tmp) {
|
||||
|
@ -1172,7 +1172,7 @@ recheck_buffering_status (GstMultiQueue * mq)
|
|||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
|
|
@ -67,7 +67,7 @@ struct _GstMultiQueue {
|
|||
gboolean use_buffering;
|
||||
gint low_percent, high_percent;
|
||||
gboolean buffering;
|
||||
gint percent;
|
||||
gint buffering_percent;
|
||||
|
||||
guint counter; /* incoming object counter, use atomic accesses */
|
||||
guint32 highid; /* contains highest id of last outputted object */
|
||||
|
@ -79,7 +79,7 @@ struct _GstMultiQueue {
|
|||
|
||||
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 */
|
||||
|
||||
GstClockTime interleave; /* Input interleave */
|
||||
|
|
Loading…
Reference in a new issue