From e83412b4fd9fe486ba48b7e89f600b68544e2dbc Mon Sep 17 00:00:00 2001 From: Carlos Rafael Giani Date: Wed, 31 Aug 2016 09:48:38 +0200 Subject: 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 --- plugins/elements/gstmultiqueue.c | 20 ++++++++++---------- plugins/elements/gstmultiqueue.h | 4 ++-- 2 files changed, 12 insertions(+), 12 deletions(-) (limited to 'plugins/elements') diff --git a/plugins/elements/gstmultiqueue.c b/plugins/elements/gstmultiqueue.c index e382ba24c..c9ef20919 100644 --- a/plugins/elements/gstmultiqueue.c +++ b/plugins/elements/gstmultiqueue.c @@ -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); } diff --git a/plugins/elements/gstmultiqueue.h b/plugins/elements/gstmultiqueue.h index b8ca0a26b..63efba5ca 100644 --- a/plugins/elements/gstmultiqueue.h +++ b/plugins/elements/gstmultiqueue.h @@ -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 */ -- cgit v1.2.3