renatofilho@787: /* GStreamer renatofilho@787: * Copyright (C) 2006 Edward Hervey renatofilho@787: * renatofilho@787: * gstmultiqueue.h: renatofilho@787: * renatofilho@787: * This library is free software; you can redistribute it and/or renatofilho@787: * modify it under the terms of the GNU Library General Public renatofilho@787: * License as published by the Free Software Foundation; either renatofilho@787: * version 2 of the License, or (at your option) any later version. renatofilho@787: * renatofilho@787: * This library is distributed in the hope that it will be useful, renatofilho@787: * but WITHOUT ANY WARRANTY; without even the implied warranty of renatofilho@787: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU renatofilho@787: * Library General Public License for more details. renatofilho@787: * renatofilho@787: * You should have received a copy of the GNU Library General Public renatofilho@787: * License along with this library; if not, write to the renatofilho@787: * Free Software Foundation, Inc., 59 Temple Place - Suite 330, renatofilho@787: * Boston, MA 02111-1307, USA. renatofilho@787: */ renatofilho@787: renatofilho@787: renatofilho@787: #ifndef __GST_MULTI_QUEUE_H__ renatofilho@787: #define __GST_MULTI_QUEUE_H__ renatofilho@787: renatofilho@787: #include renatofilho@787: #include "gstdataqueue.h" renatofilho@787: renatofilho@787: G_BEGIN_DECLS renatofilho@787: renatofilho@787: #define GST_TYPE_MULTI_QUEUE \ renatofilho@787: (gst_multi_queue_get_type()) renatofilho@787: #define GST_MULTI_QUEUE(obj) \ renatofilho@787: (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_MULTI_QUEUE,GstMultiQueue)) renatofilho@787: #define GST_MULTI_QUEUE_CLASS(klass) \ renatofilho@787: (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_MULTI_QUEUE,GstMultiQueueClass)) renatofilho@787: #define GST_IS_MULTI_QUEUE(obj) \ renatofilho@787: (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_MULTI_QUEUE)) renatofilho@787: #define GST_IS_MULTI_QUEUE_CLASS(obj) \ renatofilho@787: (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_MULTI_QUEUE)) renatofilho@787: renatofilho@787: typedef struct _GstMultiQueue GstMultiQueue; renatofilho@787: typedef struct _GstMultiQueueClass GstMultiQueueClass; renatofilho@787: renatofilho@787: /** renatofilho@787: * GstMultiQueue: renatofilho@787: * renatofilho@787: * Opaque #GstMultiQueue structure. renatofilho@787: */ renatofilho@787: struct _GstMultiQueue { renatofilho@787: GstElement element; renatofilho@787: renatofilho@787: /* number of queues */ renatofilho@787: guint nbqueues; renatofilho@787: renatofilho@787: /* The list of individual queues */ renatofilho@787: GList *queues; renatofilho@787: renatofilho@787: GstDataQueueSize max_size, extra_size; renatofilho@787: renatofilho@787: guint32 counter; /* incoming object counter */ renatofilho@787: guint32 highid; /* contains highest id of last outputted object */ renatofilho@787: renatofilho@787: GMutex * qlock; /* Global queue lock (vs object lock or individual */ renatofilho@787: /* queues lock). Protects nbqueues, queues, global */ renatofilho@787: /* GstMultiQueueSize, counter and highid */ renatofilho@787: renatofilho@787: gint nextnotlinked; /* ID of the next queue not linked (-1 : none) */ renatofilho@787: renatofilho@787: gint numwaiting; /* number of not-linked pads waiting */ renatofilho@787: }; renatofilho@787: renatofilho@787: struct _GstMultiQueueClass { renatofilho@787: GstElementClass parent_class; renatofilho@787: renatofilho@787: /* signals emitted when ALL queues are either full or empty */ renatofilho@787: void (*underrun) (GstMultiQueue *queue); renatofilho@787: void (*overrun) (GstMultiQueue *queue); renatofilho@787: }; renatofilho@787: renatofilho@787: GType gst_multi_queue_get_type (void); renatofilho@787: renatofilho@787: G_END_DECLS renatofilho@787: renatofilho@787: renatofilho@787: #endif /* __GST_MULTI_QUEUE_H__ */