2 * Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
3 * 2000 Wim Taymans <wtay@chello.be>
5 * gstthread.h: Header for GstThread object
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details.
17 * You should have received a copy of the GNU Library General Public
18 * License along with this library; if not, write to the
19 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 * Boston, MA 02111-1307, USA.
24 #ifndef __GST_THREAD_H__
25 #define __GST_THREAD_H__
29 #include <gst/gstbin.h>
34 #endif /* __cplusplus */
36 extern GstElementDetails gst_thread_details;
40 GST_THREAD_CREATE = GST_BIN_FLAG_LAST,
41 GST_THREAD_STATE_SPINNING,
42 GST_THREAD_STATE_REAPING,
45 GST_THREAD_FLAG_LAST = GST_BIN_FLAG_LAST + 4,
49 #define GST_TYPE_THREAD \
50 (gst_thread_get_type())
51 #define GST_THREAD(obj) \
52 (GTK_CHECK_CAST((obj),GST_TYPE_THREAD,GstThread))
53 #define GST_THREAD_CLASS(klass) \
54 (GTK_CHECK_CLASS_CAST((klass),GST_TYPE_THREAD,GstThreadClass))
55 #define GST_IS_THREAD(obj) \
56 (GTK_CHECK_TYPE((obj),GST_TYPE_THREAD))
57 #define GST_IS_THREAD_CLASS(obj) \
58 (GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_THREAD))
60 typedef struct _GstThread GstThread;
61 typedef struct _GstThreadClass GstThreadClass;
66 pthread_t thread_id; /* id of the thread, if any */
67 GMutex *lock; /* thread lock/condititon pair... */
68 GCond *cond; /* used to control the thread */
71 struct _GstThreadClass {
72 GstBinClass parent_class;
75 GtkType gst_thread_get_type (void);
77 GstElement* gst_thread_new (guchar *name);
81 #endif /* __cplusplus */
84 #endif /* __GST_THREAD_H__ */