mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-10-19 17:03:55 +00:00
multiqueue: Update buffering status and maybe post buffering message right when enabling buffering
This commit is contained in:
parent
888cf0656d
commit
f53f4ddca4
1 changed files with 24 additions and 4 deletions
|
@ -198,6 +198,8 @@ static void compute_high_time (GstMultiQueue * mq);
|
||||||
static void single_queue_overrun_cb (GstDataQueue * dq, GstSingleQueue * sq);
|
static void single_queue_overrun_cb (GstDataQueue * dq, GstSingleQueue * sq);
|
||||||
static void single_queue_underrun_cb (GstDataQueue * dq, GstSingleQueue * sq);
|
static void single_queue_underrun_cb (GstDataQueue * dq, GstSingleQueue * sq);
|
||||||
|
|
||||||
|
static void update_buffering (GstMultiQueue * mq, GstSingleQueue * sq);
|
||||||
|
|
||||||
static void gst_single_queue_flush_queue (GstSingleQueue * sq, gboolean full);
|
static void gst_single_queue_flush_queue (GstSingleQueue * sq, gboolean full);
|
||||||
|
|
||||||
static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink_%u",
|
static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink_%u",
|
||||||
|
@ -477,6 +479,7 @@ gst_multi_queue_finalize (GObject * object)
|
||||||
while (tmp) { \
|
while (tmp) { \
|
||||||
GstSingleQueue *q = (GstSingleQueue*)tmp->data; \
|
GstSingleQueue *q = (GstSingleQueue*)tmp->data; \
|
||||||
q->max_size.format = mq->max_size.format; \
|
q->max_size.format = mq->max_size.format; \
|
||||||
|
update_buffering (mq, q); \
|
||||||
tmp = g_list_next(tmp); \
|
tmp = g_list_next(tmp); \
|
||||||
}; \
|
}; \
|
||||||
} G_STMT_END
|
} G_STMT_END
|
||||||
|
@ -501,6 +504,8 @@ gst_multi_queue_set_property (GObject * object, guint prop_id,
|
||||||
|
|
||||||
GST_MULTI_QUEUE_MUTEX_LOCK (mq);
|
GST_MULTI_QUEUE_MUTEX_LOCK (mq);
|
||||||
|
|
||||||
|
mq->max_size.visible = new_size;
|
||||||
|
|
||||||
tmp = mq->queues;
|
tmp = mq->queues;
|
||||||
while (tmp) {
|
while (tmp) {
|
||||||
GstDataQueueSize size;
|
GstDataQueueSize size;
|
||||||
|
@ -513,10 +518,9 @@ gst_multi_queue_set_property (GObject * object, guint prop_id,
|
||||||
} else if (new_size > size.visible) {
|
} else if (new_size > size.visible) {
|
||||||
q->max_size.visible = new_size;
|
q->max_size.visible = new_size;
|
||||||
}
|
}
|
||||||
|
update_buffering (mq, q);
|
||||||
tmp = g_list_next (tmp);
|
tmp = g_list_next (tmp);
|
||||||
};
|
}
|
||||||
|
|
||||||
mq->max_size.visible = new_size;
|
|
||||||
|
|
||||||
GST_MULTI_QUEUE_MUTEX_UNLOCK (mq);
|
GST_MULTI_QUEUE_MUTEX_UNLOCK (mq);
|
||||||
|
|
||||||
|
@ -547,7 +551,23 @@ gst_multi_queue_set_property (GObject * object, guint prop_id,
|
||||||
message = gst_message_new_buffering (GST_OBJECT_CAST (mq), 100);
|
message = gst_message_new_buffering (GST_OBJECT_CAST (mq), 100);
|
||||||
|
|
||||||
gst_element_post_message (GST_ELEMENT_CAST (mq), message);
|
gst_element_post_message (GST_ELEMENT_CAST (mq), message);
|
||||||
};
|
}
|
||||||
|
|
||||||
|
if (mq->use_buffering) {
|
||||||
|
GList *tmp;
|
||||||
|
|
||||||
|
GST_MULTI_QUEUE_MUTEX_LOCK (mq);
|
||||||
|
|
||||||
|
mq->buffering = TRUE;
|
||||||
|
tmp = mq->queues;
|
||||||
|
while (tmp) {
|
||||||
|
GstSingleQueue *q = (GstSingleQueue *) tmp->data;
|
||||||
|
update_buffering (mq, q);
|
||||||
|
tmp = g_list_next (tmp);
|
||||||
|
}
|
||||||
|
|
||||||
|
GST_MULTI_QUEUE_MUTEX_UNLOCK (mq);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case PROP_LOW_PERCENT:
|
case PROP_LOW_PERCENT:
|
||||||
mq->low_percent = g_value_get_int (value);
|
mq->low_percent = g_value_get_int (value);
|
||||||
|
|
Loading…
Reference in a new issue