[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gstreamer-cvs
Subject:    gstreamer: multiqueue: Rename percent/percent_changed to buffering_percent (_changed)
From:       slomo () kemper ! freedesktop ! org (Sebastian Dröge)
Date:       2016-08-31 9:56:38
Message-ID: 20160831095638.64C34761A3 () kemper ! freedesktop ! org
[Download RAW message or body]

Module: gstreamer
Branch: master
Commit: e83412b4fd9fe486ba48b7e89f600b68544e2dbc
URL:    http://cgit.freedesktop.org/gstreamer/gstreamer/commit/?id=e83412b4fd9fe486ba48b7e89f600b68544e2dbc


Author: Carlos Rafael Giani <dv@pseudoterminal.org>
Date:   Wed Aug 31 09:48:38 2016 +0200

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(-)

diff --git a/plugins/elements/gstmultiqueue.c b/plugins/elements/gstmultiqueue.c
index e382ba2..c9ef209 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 b8ca0a2..63efba5 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 */

_______________________________________________
gstreamer-commits mailing list
gstreamer-commits@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/gstreamer-commits


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic