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.
24 #include <gst/gstelement.h>
25 #include <gst/cothreads.h>
29 #endif /* __cplusplus */
31 extern GstElementDetails gst_bin_details;
33 #define GST_TYPE_BIN \
35 #define GST_BIN(obj) \
36 (GTK_CHECK_CAST((obj),GST_TYPE_BIN,GstBin))
37 #define GST_BIN_CLASS(klass) \
38 (GTK_CHECK_CLASS_CAST((klass),GST_TYPE_BIN,GstBinClass))
39 #define GST_IS_BIN(obj) \
40 (GTK_CHECK_TYPE((obj),GST_TYPE_BIN))
41 #define GST_IS_BIN_CLASS(obj) \
42 (GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_BIN))
45 // this bin is a manager of child elements, i.e. a pipeline or thread
46 GST_BIN_FLAG_MANAGER = GST_ELEMENT_FLAG_LAST,
48 // we prefer to have cothreads when its an option, over chain-based
49 GST_BIN_FLAG_PREFER_COTHREADS,
52 GST_BIN_FLAG_LAST = GST_ELEMENT_FLAG_LAST + 4,
55 typedef struct _GstBin GstBin;
56 typedef struct _GstBinClass GstBinClass;
66 gboolean need_cothreads;
67 GList *managed_elements;
68 gint num_managed_elements;
72 cothread_context *threadcontext;
73 gboolean use_cothreads;
74 GList *outside_schedules;
78 GstElementClass parent_class;
81 void (*object_added) (GstObject *object, GstObject *child);
82 void (*object_removed) (GstObject *object, GstObject *child);
84 /* change the state of elements of the given type */
85 gboolean (*change_state_type) (GstBin *bin,
86 GstElementState state,
88 /* create a plan for the execution of the bin */
89 void (*create_plan) (GstBin *bin);
90 /* run a full iteration of operation */
91 void (*iterate) (GstBin *bin);
96 GtkType gst_bin_get_type (void);
97 GstElement* gst_bin_new (gchar *name);
98 #define gst_bin_destroy(bin) gst_object_destroy(GST_OBJECT(bin))
100 /* add and remove elements from the bin */
101 void gst_bin_add (GstBin *bin,
102 GstElement *element);
103 void gst_bin_remove (GstBin *bin,
104 GstElement *element);
106 /* retrieve a single element or the list of children */
107 GstElement* gst_bin_get_by_name (GstBin *bin,
109 GList* gst_bin_get_list (GstBin *bin);
111 void gst_bin_create_plan (GstBin *bin);
112 gboolean gst_bin_set_state_type (GstBin *bin,
113 GstElementState state,
116 void gst_bin_iterate (GstBin *bin);
119 void gst_bin_use_cothreads (GstBin *bin,
124 #endif /* __cplusplus */
127 #endif /* __GST_BIN_H__ */