summaryrefslogtreecommitdiff
path: root/plugins/elements
diff options
context:
space:
mode:
authorCarlos Rafael Giani <dv@pseudoterminal.org>2016-08-31 09:48:38 +0200
committerSebastian Dröge <sebastian@centricular.com>2016-08-31 12:56:19 +0300
commite83412b4fd9fe486ba48b7e89f600b68544e2dbc (patch)
tree736b10afbca65705f5c54312b03af26485ada77a /plugins/elements
parent3117525cb66c817f3bd38dbe5896c1288adeb060 (diff)
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
Diffstat (limited to 'plugins/elements')
-rw-r--r--plugins/elements/gstmultiqueue.c20
-rw-r--r--plugins/elements/gstmultiqueue.h4
2 files changed, 12 insertions, 12 deletions
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 */