summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@collabora.co.uk>2009-10-21 11:30:40 -0400
committerWim Taymans <wim@metal.(none)>2009-10-27 14:40:07 +0100
commit6ac91915275f9040f51299f1583a318e0516d97d (patch)
tree0dceda23cd7a7f1ebaf1bbf858bc141870a9ce6c /plugins
parentb9d4f6e550bd59c6bbf9a766a86694d62ef3ad01 (diff)
multiqueue: hook up low/high percent
Hook up the low/high percent properties for the buffering mode.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/elements/gstmultiqueue.c45
-rw-r--r--plugins/elements/gstmultiqueue.h1
2 files changed, 46 insertions, 0 deletions
diff --git a/plugins/elements/gstmultiqueue.c b/plugins/elements/gstmultiqueue.c
index e59d5d5ffe..656b0357fd 100644
--- a/plugins/elements/gstmultiqueue.c
+++ b/plugins/elements/gstmultiqueue.c
@@ -218,6 +218,8 @@ enum
#define DEFAULT_EXTRA_SIZE_TIME 3 * GST_SECOND
#define DEFAULT_USE_BUFFERING FALSE
+#define DEFAULT_LOW_PERCENT 10
+#define DEFAULT_HIGH_PERCENT 99
enum
{
@@ -229,6 +231,8 @@ enum
PROP_MAX_SIZE_BUFFERS,
PROP_MAX_SIZE_TIME,
PROP_USE_BUFFERING,
+ PROP_LOW_PERCENT,
+ PROP_HIGH_PERCENT,
PROP_LAST
};
@@ -368,6 +372,33 @@ gst_multi_queue_class_init (GstMultiQueueClass * klass)
"Emit GST_MESSAGE_BUFFERING based on low-/high-percent thresholds"
" (not implemented yet)",
DEFAULT_USE_BUFFERING, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+ /**
+ * GstMultiQueue:low-percent
+ *
+ * Low threshold percent for buffering to start.
+ *
+ * Not implemented yet.
+ *
+ * Since: 0.10.26
+ */
+ g_object_class_install_property (gobject_class, PROP_LOW_PERCENT,
+ g_param_spec_int ("low-percent", "Low percent",
+ "Low threshold for buffering to start (not implemented)", 0, 100,
+ DEFAULT_LOW_PERCENT, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+ /**
+ * GstMultiQueue:high-percent
+ *
+ * High threshold percent for buffering to finish.
+ *
+ * Not implemented yet.
+ *
+ * Since: 0.10.26
+ */
+ g_object_class_install_property (gobject_class, PROP_HIGH_PERCENT,
+ g_param_spec_int ("high-percent", "High percent",
+ "High threshold for buffering to finish (not implemented)", 0, 100,
+ DEFAULT_HIGH_PERCENT, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+
gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_multi_queue_finalize);
@@ -392,6 +423,8 @@ gst_multi_queue_init (GstMultiQueue * mqueue, GstMultiQueueClass * klass)
mqueue->extra_size.time = DEFAULT_EXTRA_SIZE_TIME;
mqueue->use_buffering = DEFAULT_USE_BUFFERING;
+ mqueue->low_percent = DEFAULT_LOW_PERCENT;
+ mqueue->high_percent = DEFAULT_HIGH_PERCENT;
mqueue->counter = 1;
mqueue->highid = -1;
@@ -462,6 +495,12 @@ gst_multi_queue_set_property (GObject * object, guint prop_id,
case PROP_USE_BUFFERING:
mq->use_buffering = g_value_get_boolean (value);
break;
+ case PROP_LOW_PERCENT:
+ mq->low_percent = g_value_get_int (value);
+ break;
+ case PROP_HIGH_PERCENT:
+ mq->high_percent = g_value_get_int (value);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -498,6 +537,12 @@ gst_multi_queue_get_property (GObject * object, guint prop_id,
case PROP_USE_BUFFERING:
g_value_set_boolean (value, mq->use_buffering);
break;
+ case PROP_LOW_PERCENT:
+ g_value_set_int (value, mq->low_percent);
+ break;
+ case PROP_HIGH_PERCENT:
+ g_value_set_int (value, mq->high_percent);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
diff --git a/plugins/elements/gstmultiqueue.h b/plugins/elements/gstmultiqueue.h
index e90cf70280..1c8c191524 100644
--- a/plugins/elements/gstmultiqueue.h
+++ b/plugins/elements/gstmultiqueue.h
@@ -59,6 +59,7 @@ struct _GstMultiQueue {
GstDataQueueSize max_size, extra_size;
gboolean use_buffering;
+ gint low_percent, high_percent;
guint32 counter; /* incoming object counter, protected with STREAM_LOCK */
guint32 highid; /* contains highest id of last outputted object */