gst-gmyth/multiqueue/gstmultiqueue.h
author melunko
Fri Sep 14 21:35:12 2007 +0100 (2007-09-14)
branchtrunk
changeset 844 8081f181cba6
permissions -rw-r--r--
[svn r850] nuvdemux package changelog updated
renatofilho@787
     1
/* GStreamer
renatofilho@787
     2
 * Copyright (C) 2006 Edward Hervey <edward@fluendo.com>
renatofilho@787
     3
 *
renatofilho@787
     4
 * gstmultiqueue.h:
renatofilho@787
     5
 *
renatofilho@787
     6
 * This library is free software; you can redistribute it and/or
renatofilho@787
     7
 * modify it under the terms of the GNU Library General Public
renatofilho@787
     8
 * License as published by the Free Software Foundation; either
renatofilho@787
     9
 * version 2 of the License, or (at your option) any later version.
renatofilho@787
    10
 *
renatofilho@787
    11
 * This library is distributed in the hope that it will be useful,
renatofilho@787
    12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
renatofilho@787
    13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
renatofilho@787
    14
 * Library General Public License for more details.
renatofilho@787
    15
 *
renatofilho@787
    16
 * You should have received a copy of the GNU Library General Public
renatofilho@787
    17
 * License along with this library; if not, write to the
renatofilho@787
    18
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
renatofilho@787
    19
 * Boston, MA 02111-1307, USA.
renatofilho@787
    20
 */
renatofilho@787
    21
renatofilho@787
    22
renatofilho@787
    23
#ifndef __GST_MULTI_QUEUE_H__
renatofilho@787
    24
#define __GST_MULTI_QUEUE_H__
renatofilho@787
    25
renatofilho@787
    26
#include <gst/gst.h>
renatofilho@787
    27
#include "gstdataqueue.h"
renatofilho@787
    28
renatofilho@787
    29
G_BEGIN_DECLS
renatofilho@787
    30
renatofilho@787
    31
#define GST_TYPE_MULTI_QUEUE \
renatofilho@787
    32
  (gst_multi_queue_get_type())
renatofilho@787
    33
#define GST_MULTI_QUEUE(obj) \
renatofilho@787
    34
  (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_MULTI_QUEUE,GstMultiQueue))
renatofilho@787
    35
#define GST_MULTI_QUEUE_CLASS(klass) \
renatofilho@787
    36
  (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_MULTI_QUEUE,GstMultiQueueClass))
renatofilho@787
    37
#define GST_IS_MULTI_QUEUE(obj) \
renatofilho@787
    38
  (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_MULTI_QUEUE))
renatofilho@787
    39
#define GST_IS_MULTI_QUEUE_CLASS(obj) \
renatofilho@787
    40
  (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_MULTI_QUEUE))
renatofilho@787
    41
renatofilho@787
    42
typedef struct _GstMultiQueue GstMultiQueue;
renatofilho@787
    43
typedef struct _GstMultiQueueClass GstMultiQueueClass;
renatofilho@787
    44
renatofilho@787
    45
/**
renatofilho@787
    46
 * GstMultiQueue:
renatofilho@787
    47
 *
renatofilho@787
    48
 * Opaque #GstMultiQueue structure.
renatofilho@787
    49
 */
renatofilho@787
    50
struct _GstMultiQueue {
renatofilho@787
    51
  GstElement element;
renatofilho@787
    52
renatofilho@787
    53
  /* number of queues */
renatofilho@787
    54
  guint	nbqueues;
renatofilho@787
    55
renatofilho@787
    56
  /* The list of individual queues */
renatofilho@787
    57
  GList *queues;
renatofilho@787
    58
renatofilho@787
    59
  GstDataQueueSize  max_size, extra_size;
renatofilho@787
    60
renatofilho@787
    61
  guint32  counter;	/* incoming object counter */
renatofilho@787
    62
  guint32  highid;	/* contains highest id of last outputted object */
renatofilho@787
    63
renatofilho@787
    64
  GMutex * qlock;	/* Global queue lock (vs object lock or individual */
renatofilho@787
    65
			/* queues lock). Protects nbqueues, queues, global */
renatofilho@787
    66
			/* GstMultiQueueSize, counter and highid */
renatofilho@787
    67
renatofilho@787
    68
  gint nextnotlinked;	/* ID of the next queue not linked (-1 : none) */
renatofilho@787
    69
renatofilho@787
    70
  gint numwaiting;	/* number of not-linked pads waiting */
renatofilho@787
    71
};
renatofilho@787
    72
renatofilho@787
    73
struct _GstMultiQueueClass {
renatofilho@787
    74
  GstElementClass parent_class;
renatofilho@787
    75
renatofilho@787
    76
  /* signals emitted when ALL queues are either full or empty */
renatofilho@787
    77
  void (*underrun)	(GstMultiQueue *queue);
renatofilho@787
    78
  void (*overrun)	(GstMultiQueue *queue);
renatofilho@787
    79
};
renatofilho@787
    80
renatofilho@787
    81
GType gst_multi_queue_get_type (void);
renatofilho@787
    82
renatofilho@787
    83
G_END_DECLS
renatofilho@787
    84
renatofilho@787
    85
renatofilho@787
    86
#endif /* __GST_MULTI_QUEUE_H__ */