queue->cur_level.time, \
queue->min_threshold.time, \
queue->max_size.time, \
- queue->queue->length)
+ queue->queue.length)
/* Queue signals and args */
enum
g_cond_init (&queue->item_add);
g_cond_init (&queue->item_del);
- queue->queue = gst_queue_array_new (DEFAULT_MAX_SIZE_BUFFERS * 3 / 2);
+ gst_queue_array_init (&queue->queue, DEFAULT_MAX_SIZE_BUFFERS * 3 / 2);
queue->sinktime = GST_CLOCK_TIME_NONE;
queue->srctime = GST_CLOCK_TIME_NONE;
GST_DEBUG_OBJECT (queue, "finalizing queue");
- while (!gst_queue_array_is_empty (queue->queue)) {
- data = gst_queue_array_pop_head (queue->queue);
+ while (!gst_queue_array_is_empty (&queue->queue)) {
+ data = gst_queue_array_pop_head (&queue->queue);
+ /* FIXME: if it's a query, shouldn't we unref that too? */
if (!GST_IS_QUERY (data))
gst_mini_object_unref (data);
}
- gst_queue_array_free (queue->queue);
+ gst_queue_array_clear (&queue->queue);
g_mutex_clear (&queue->qlock);
g_cond_clear (&queue->item_add);
{
GstMiniObject *data;
- while (!gst_queue_array_is_empty (queue->queue)) {
- data = gst_queue_array_pop_head (queue->queue);
+ while (!gst_queue_array_is_empty (&queue->queue)) {
+ data = gst_queue_array_pop_head (&queue->queue);
/* Then lose another reference because we are supposed to destroy that
data when flushing */
if (!GST_IS_QUERY (data))
apply_buffer (queue, buffer, &queue->sink_segment, TRUE, TRUE);
if (item)
- gst_queue_array_push_tail (queue->queue, item);
+ gst_queue_array_push_tail (&queue->queue, item);
GST_QUEUE_SIGNAL_ADD (queue);
}
case GST_EVENT_SEGMENT:
apply_segment (queue, event, &queue->sink_segment, TRUE);
/* if the queue is empty, apply sink segment on the source */
- if (queue->queue->length == 0) {
+ if (queue->queue.length == 0) {
GST_CAT_LOG_OBJECT (queue_dataflow, queue, "Apply segment on srcpad");
apply_segment (queue, event, &queue->src_segment, FALSE);
queue->newseg_applied_to_src = TRUE;
}
if (item)
- gst_queue_array_push_tail (queue->queue, item);
+ gst_queue_array_push_tail (&queue->queue, item);
GST_QUEUE_SIGNAL_ADD (queue);
}
{
GstMiniObject *item;
- item = gst_queue_array_pop_head (queue->queue);
+ item = gst_queue_array_pop_head (&queue->queue);
if (item == NULL)
goto no_item;
GST_QUEUE_MUTEX_LOCK_CHECK (queue, out_flushing);
GST_LOG_OBJECT (queue, "queuing query %p (%s)", query,
GST_QUERY_TYPE_NAME (query));
- gst_queue_array_push_tail (queue->queue, query);
+ gst_queue_array_push_tail (&queue->queue, query);
GST_QUEUE_SIGNAL_ADD (queue);
- while (queue->queue->length != 0) {
+ while (queue->queue.length != 0) {
/* for as long as the queue has items, we know the query is
* not handled yet */
GST_QUEUE_WAIT_DEL_CHECK (queue, out_flushing);
{
GstMiniObject *head;
- if (queue->queue->length == 0)
+ if (queue->queue.length == 0)
return TRUE;
/* Only consider the queue empty if the minimum thresholds
* are not reached and data is at the queue head. Otherwise
* we would block forever on serialized queries.
*/
- head = queue->queue->array[queue->queue->head];
+ head = queue->queue.array[queue->queue.head];
if (!GST_IS_BUFFER (head) && !GST_IS_BUFFER_LIST (head))
return FALSE;