2 * Copyright (C) 2002 Erik Walthinsen <omega@cse.ogi.edu>
3 * 2002 Wim Taymans <wtay@chello.be>
5 * gstspider.h: Header for GstSpider 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.
23 #ifndef __GST_SPIDER_H__
24 #define __GST_SPIDER_H__
27 #include "gstspideridentity.h"
31 extern GstElementDetails gst_spider_details;
32 GST_DEBUG_CATEGORY_EXTERN(gst_spider_debug);
35 * Theory of operation:
36 * When connecting a sink to a source, GstSpiderConnections are used to keep track
37 * of the current status of the link. sink -> src is the path we intend to
38 * plug. current is how far we've come. If current equals
39 * - NULL, there is no possible path,
40 * - src, the link is established.
41 * - sink, it wasn't tried to establish a link.
42 * - something else, we have come that far while plugging.
43 * signal_id is used to remember the signal_id when we are waiting for a "new_pad"
44 * callback during link.
45 * When a path is established, the elements in the path (excluding sink and src)
46 * are refcounted once for every path.
47 * A GstSpider keeps a list of all GstSpiderConnections in it.
50 GstSpiderIdentity *src;
51 /* dunno if the path should stay here or if its too much load.
52 * it's at least easier then always searching it */
56 } GstSpiderConnection;
58 #define GST_TYPE_SPIDER \
59 (gst_spider_get_type())
60 #define GST_SPIDER(obj) \
61 (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_SPIDER,GstSpider))
62 #define GST_SPIDER_CLASS(klass) \
63 (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_SPIDER,GstSpiderClass))
64 #define GST_IS_SPIDER(obj) \
65 (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_SPIDER))
66 #define GST_IS_SPIDER_CLASS(obj) \
67 (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SPIDER))
69 typedef struct _GstSpider GstSpider;
70 typedef struct _GstSpiderClass GstSpiderClass;
75 GstSpiderIdentity *sink_ident;
76 GList * factories; /* factories to use for plugging */
78 GList * links; /* GStSpiderConnection list of all links */
81 struct _GstSpiderClass {
82 GstBinClass parent_class;
85 /* default initialization stuff */
86 GType gst_spider_get_type (void);
88 /* private link functions to be called by GstSpiderIdentity */
89 void gst_spider_identity_plug (GstSpiderIdentity *ident);
90 void gst_spider_identity_unplug (GstSpiderIdentity *ident);
94 #endif /* __GST_SPIDER_H__ */