source: trunk/third/gstreamer/gst/gstthread.h @ 21448

Revision 21448, 2.6 KB checked in by ghudson, 20 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r21447, which included commits to RCS files with non-trunk default branches.
Line 
1/* GStreamer
2 * Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
3 *                    2000 Wim Taymans <wtay@chello.be>
4 *
5 * gstthread.h: Header for GstThread object
6 *
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.
11 *
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.
16 *
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.
21 */
22
23
24#ifndef __GST_THREAD_H__
25#define __GST_THREAD_H__
26
27#include <glib.h>
28
29#include <gst/gstbin.h>
30
31
32G_BEGIN_DECLS
33
34extern GPrivate *gst_thread_current;
35
36typedef enum {
37  GST_THREAD_STATE_SPINNING     = GST_BIN_FLAG_LAST,
38  GST_THREAD_STATE_REAPING,
39  GST_THREAD_STATE_WAITING,
40
41  /* padding */
42  GST_THREAD_FLAG_LAST          = GST_BIN_FLAG_LAST + 4
43} GstThreadState;
44
45#define GST_TYPE_THREAD                 (gst_thread_get_type())
46#define GST_THREAD(obj)                 (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_THREAD,GstThread))
47#define GST_IS_THREAD(obj)              (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_THREAD))
48#define GST_THREAD_CLASS(klass)         (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_THREAD,GstThreadClass))
49#define GST_IS_THREAD_CLASS(klass)      (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_THREAD))
50#define GST_THREAD_GET_CLASS(obj)       (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_THREAD, GstThreadClass))
51
52typedef struct _GstThread       GstThread;
53typedef struct _GstThreadClass  GstThreadClass;
54
55struct _GstThread {
56  GstBin         bin;
57
58  GThread       *thread_id;             /* id of the thread, if any */
59  GThreadPriority priority;
60
61  GMutex        *lock;                  /* thread lock/condititon pairs */
62  GCond         *cond;                  /* used to control the thread */
63
64  GMutex        *iterate_lock;          /* lock iteration in state change  */
65
66  gpointer _gst_reserved[GST_PADDING-1];
67};
68
69struct _GstThreadClass {
70  GstBinClass parent_class;
71
72  /* signals */
73  void  (*shutdown)     (GstThread *thread);
74
75  gpointer _gst_reserved[GST_PADDING];
76};
77
78GType   gst_thread_get_type     (void);
79
80GstElement*     gst_thread_new          (const gchar *name);
81
82void            gst_thread_set_priority (GstThread *thread, GThreadPriority priority);
83GstThread *     gst_thread_get_current  (void);
84
85G_END_DECLS
86
87
88#endif /* __GST_THREAD_H__ */
Note: See TracBrowser for help on using the repository browser.