2 * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
21 #ifndef __GST_THREAD_H__
22 #define __GST_THREAD_H__
25 #include <gst/gstbin.h>
31 #endif /* __cplusplus */
33 GstElementDetails gst_thread_details;
37 GST_THREAD_CREATE = (1 << 16),
38 GST_THREAD_STATE_SPINNING = (1 << 17),
39 GST_THREAD_STATE_REAPING = (1 << 18),
43 #define GST_TYPE_THREAD \
44 (gst_thread_get_type())
45 #define GST_THREAD(obj) \
46 (GTK_CHECK_CAST((obj),GST_TYPE_THREAD,GstThread))
47 #define GST_THREAD_CLASS(klass) \
48 (GTK_CHECK_CLASS_CAST((klass),GST_TYPE_THREAD,GstThreadClass))
49 #define GST_IS_THREAD(obj) \
50 (GTK_CHECK_TYPE((obj),GST_TYPE_THREAD))
51 #define GST_IS_THREAD_CLASS(obj) \
52 (GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_THREAD)))
54 typedef struct _GstThread GstThread;
55 typedef struct _GstThreadClass GstThreadClass;
60 GList *entries; /* used to determine iterate behavior */
61 gint numentries; /* number of above entry points */
63 pthread_t thread_id; /* id of the thread, if any */
64 GMutex *lock; /* thread lock/condititon pair... */
65 GCond *cond; /* used to control the thread */
68 struct _GstThreadClass {
69 GstBinClass parent_class;
72 GtkType gst_thread_get_type(void);
73 GstElement *gst_thread_new(guchar *name);
75 void *gst_thread_main_loop(void *arg);
76 void gst_thread_iterate(GstThread *thread);
80 #endif /* __cplusplus */
83 #endif /* __GST_THREAD_H__ */