2 * Copyright (C) 2006 Edward Hervey <edward@fluendo.com>
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
16 * You should have received a copy of the GNU Library General Public
17 * License along with this library; if not, write to the
18 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 * Boston, MA 02111-1307, USA.
23 #ifndef __GST_MULTI_QUEUE_H__
24 #define __GST_MULTI_QUEUE_H__
27 #include "gstdataqueue.h"
31 #define GST_TYPE_MULTI_QUEUE \
32 (gst_multi_queue_get_type())
33 #define GST_MULTI_QUEUE(obj) \
34 (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_MULTI_QUEUE,GstMultiQueue))
35 #define GST_MULTI_QUEUE_CLASS(klass) \
36 (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_MULTI_QUEUE,GstMultiQueueClass))
37 #define GST_IS_MULTI_QUEUE(obj) \
38 (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_MULTI_QUEUE))
39 #define GST_IS_MULTI_QUEUE_CLASS(obj) \
40 (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_MULTI_QUEUE))
42 typedef struct _GstMultiQueue GstMultiQueue;
43 typedef struct _GstMultiQueueClass GstMultiQueueClass;
48 * Opaque #GstMultiQueue structure.
50 struct _GstMultiQueue {
53 /* number of queues */
56 /* The list of individual queues */
59 GstDataQueueSize max_size, extra_size;
61 guint32 counter; /* incoming object counter */
62 guint32 highid; /* contains highest id of last outputted object */
64 GMutex * qlock; /* Global queue lock (vs object lock or individual */
65 /* queues lock). Protects nbqueues, queues, global */
66 /* GstMultiQueueSize, counter and highid */
68 gint nextnotlinked; /* ID of the next queue not linked (-1 : none) */
70 gint numwaiting; /* number of not-linked pads waiting */
73 struct _GstMultiQueueClass {
74 GstElementClass parent_class;
76 /* signals emitted when ALL queues are either full or empty */
77 void (*underrun) (GstMultiQueue *queue);
78 void (*overrun) (GstMultiQueue *queue);
81 GType gst_multi_queue_get_type (void);
86 #endif /* __GST_MULTI_QUEUE_H__ */