2 * Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
3 * 2000 Wim Taymans <wtay@chello.be>
5 * gstautoplug.h: Header for autoplugging functionality
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_AUTOPLUG_H__
25 #define __GST_AUTOPLUG_H__
27 #ifndef GST_DISABLE_AUTOPLUG
29 #include <gst/gstelement.h>
33 #endif /* __cplusplus */
35 #define GST_TYPE_AUTOPLUG \
36 (gst_autoplug_get_type())
37 #define GST_AUTOPLUG(obj) \
38 (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_AUTOPLUG,GstAutoplug))
39 #define GST_AUTOPLUG_CLASS(klass) \
40 (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_AUTOPLUG,GstAutoplugClass))
41 #define GST_IS_AUTOPLUG(obj) \
42 (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_AUTOPLUG))
43 #define GST_IS_AUTOPLUG_CLASS(obj) \
44 (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AUTOPLUG))
46 typedef struct _GstAutoplug GstAutoplug;
47 typedef struct _GstAutoplugClass GstAutoplugClass;
50 GST_AUTOPLUG_TO_CAPS = GST_OBJECT_FLAG_LAST,
51 GST_AUTOPLUG_TO_RENDERER,
53 GST_AUTOPLUG_FLAG_LAST = GST_OBJECT_FLAG_LAST + 8,
61 struct _GstAutoplugClass {
62 GstObjectClass parent_class;
64 /* signal callbacks */
65 void (*new_object) (GstAutoplug *autoplug, GstObject *object);
67 /* perform the autoplugging */
68 GstElement* (*autoplug_to_caps) (GstAutoplug *autoplug, GstCaps *srccaps, GstCaps *sinkcaps, va_list args);
69 GstElement* (*autoplug_to_renderers) (GstAutoplug *autoplug, GstCaps *srccaps, GstElement *target, va_list args);
73 GType gst_autoplug_get_type (void);
75 void gst_autoplug_signal_new_object (GstAutoplug *autoplug, GstObject *object);
77 GstElement* gst_autoplug_to_caps (GstAutoplug *autoplug, GstCaps *srccaps, GstCaps *sinkcaps, ...);
78 GstElement* gst_autoplug_to_renderers (GstAutoplug *autoplug, GstCaps *srccaps,
79 GstElement *target, ...);
83 * creating autopluggers
86 #define GST_TYPE_AUTOPLUGFACTORY \
87 (gst_autoplugfactory_get_type())
88 #define GST_AUTOPLUGFACTORY(obj) \
89 (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_AUTOPLUGFACTORY,GstAutoplugFactory))
90 #define GST_AUTOPLUGFACTORY_CLASS(klass) \
91 (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_AUTOPLUGFACTORY,GstAutoplugFactoryClass))
92 #define GST_IS_AUTOPLUGFACTORY(obj) \
93 (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_AUTOPLUGFACTORY))
94 #define GST_IS_AUTOPLUGFACTORY_CLASS(obj) \
95 (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AUTOPLUGFACTORY))
97 typedef struct _GstAutoplugFactory GstAutoplugFactory;
98 typedef struct _GstAutoplugFactoryClass GstAutoplugFactoryClass;
100 struct _GstAutoplugFactory {
101 GstPluginFeature feature;
103 gchar *longdesc; /* long description of the autoplugger (well, don't overdo it..) */
104 GType type; /* unique GType of the autoplugger */
107 struct _GstAutoplugFactoryClass {
108 GstPluginFeatureClass parent;
111 GType gst_autoplugfactory_get_type (void);
113 GstAutoplugFactory* gst_autoplugfactory_new (const gchar *name, const gchar *longdesc, GType type);
114 void gst_autoplugfactory_destroy (GstAutoplugFactory *factory);
116 GstAutoplugFactory* gst_autoplugfactory_find (const gchar *name);
117 GList* gst_autoplugfactory_get_list (void);
119 GstAutoplug* gst_autoplugfactory_create (GstAutoplugFactory *factory);
120 GstAutoplug* gst_autoplugfactory_make (const gchar *name);
124 #endif /* __cplusplus */
126 #else /* GST_DISABLE_AUTOPLUG */
128 #pragma GCC poison gst_autoplug_get_type
129 #pragma GCC poison gst_autoplug_signal_new_object
130 #pragma GCC poison gst_autoplug_to_caps
131 #pragma GCC poison gst_autoplug_to_renderers
133 #pragma GCC poison gst_autoplugfactory_get_type
134 #pragma GCC poison gst_autoplugfactory_new
135 #pragma GCC poison gst_autoplugfactory_destroy
137 #pragma GCC poison gst_autoplugfactory_find
138 #pragma GCC poison gst_autoplugfactory_get_list
140 #pragma GCC poison gst_autoplugfactory_create
141 #pragma GCC poison gst_autoplugfactory_make
143 #endif /* GST_DISABLE_AUTOPLUG */
145 #endif /* __GST_AUTOPLUG_H__ */