1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/gst-gmyth/multiqueue/gstmultiqueue.h Wed Aug 22 14:07:49 2007 +0100
1.3 @@ -0,0 +1,86 @@
1.4 +/* GStreamer
1.5 + * Copyright (C) 2006 Edward Hervey <edward@fluendo.com>
1.6 + *
1.7 + * gstmultiqueue.h:
1.8 + *
1.9 + * This library is free software; you can redistribute it and/or
1.10 + * modify it under the terms of the GNU Library General Public
1.11 + * License as published by the Free Software Foundation; either
1.12 + * version 2 of the License, or (at your option) any later version.
1.13 + *
1.14 + * This library is distributed in the hope that it will be useful,
1.15 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1.16 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1.17 + * Library General Public License for more details.
1.18 + *
1.19 + * You should have received a copy of the GNU Library General Public
1.20 + * License along with this library; if not, write to the
1.21 + * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
1.22 + * Boston, MA 02111-1307, USA.
1.23 + */
1.24 +
1.25 +
1.26 +#ifndef __GST_MULTI_QUEUE_H__
1.27 +#define __GST_MULTI_QUEUE_H__
1.28 +
1.29 +#include <gst/gst.h>
1.30 +#include "gstdataqueue.h"
1.31 +
1.32 +G_BEGIN_DECLS
1.33 +
1.34 +#define GST_TYPE_MULTI_QUEUE \
1.35 + (gst_multi_queue_get_type())
1.36 +#define GST_MULTI_QUEUE(obj) \
1.37 + (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_MULTI_QUEUE,GstMultiQueue))
1.38 +#define GST_MULTI_QUEUE_CLASS(klass) \
1.39 + (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_MULTI_QUEUE,GstMultiQueueClass))
1.40 +#define GST_IS_MULTI_QUEUE(obj) \
1.41 + (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_MULTI_QUEUE))
1.42 +#define GST_IS_MULTI_QUEUE_CLASS(obj) \
1.43 + (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_MULTI_QUEUE))
1.44 +
1.45 +typedef struct _GstMultiQueue GstMultiQueue;
1.46 +typedef struct _GstMultiQueueClass GstMultiQueueClass;
1.47 +
1.48 +/**
1.49 + * GstMultiQueue:
1.50 + *
1.51 + * Opaque #GstMultiQueue structure.
1.52 + */
1.53 +struct _GstMultiQueue {
1.54 + GstElement element;
1.55 +
1.56 + /* number of queues */
1.57 + guint nbqueues;
1.58 +
1.59 + /* The list of individual queues */
1.60 + GList *queues;
1.61 +
1.62 + GstDataQueueSize max_size, extra_size;
1.63 +
1.64 + guint32 counter; /* incoming object counter */
1.65 + guint32 highid; /* contains highest id of last outputted object */
1.66 +
1.67 + GMutex * qlock; /* Global queue lock (vs object lock or individual */
1.68 + /* queues lock). Protects nbqueues, queues, global */
1.69 + /* GstMultiQueueSize, counter and highid */
1.70 +
1.71 + gint nextnotlinked; /* ID of the next queue not linked (-1 : none) */
1.72 +
1.73 + gint numwaiting; /* number of not-linked pads waiting */
1.74 +};
1.75 +
1.76 +struct _GstMultiQueueClass {
1.77 + GstElementClass parent_class;
1.78 +
1.79 + /* signals emitted when ALL queues are either full or empty */
1.80 + void (*underrun) (GstMultiQueue *queue);
1.81 + void (*overrun) (GstMultiQueue *queue);
1.82 +};
1.83 +
1.84 +GType gst_multi_queue_get_type (void);
1.85 +
1.86 +G_END_DECLS
1.87 +
1.88 +
1.89 +#endif /* __GST_MULTI_QUEUE_H__ */