alternative to assert
[gtkD.git] / gtkD / srcgstreamer / gstreamer / GhostPad.d
blobec9a77ae1b4655ee9442639c42d287baee357dac
1 /*
2 * This file is part of gtkD.
4 * gtkD is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2.1 of the License, or
7 * (at your option) any later version.
9 * gtkD 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
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with gtkD; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // generated automatically - do not change
20 // find conversion definition on APILookup.txt
21 // implement new conversion functionalities on the wrap.utils pakage
24 * Conversion parameters:
25 * inFile = GstGhostPad.html
26 * outPack = gstreamer
27 * outFile = GhostPad
28 * strct = GstGhostPad
29 * realStrct=
30 * ctorStrct=
31 * clss = GhostPad
32 * interf =
33 * class Code: Yes
34 * interface Code: No
35 * template for:
36 * extend = Pad
37 * implements:
38 * prefixes:
39 * - gst_ghost_pad_
40 * - gst_
41 * omit structs:
42 * omit prefixes:
43 * omit code:
44 * - gst_ghost_pad_new
45 * imports:
46 * - glib.Str
47 * - gstreamer.Pad
48 * structWrap:
49 * - GstGhostPad* -> GhostPad
50 * - GstPad* -> Pad
51 * module aliases:
52 * local aliases:
55 module gstreamer.GhostPad;
57 private import gstreamerc.gstreamertypes;
59 private import gstreamerc.gstreamer;
61 private import glib.Str;
62 private import gstreamer.Pad;
66 /**
67 * Description
68 * GhostPads are useful when organizing pipelines with GstBin like elements.
69 * The idea here is to create hierarchical element graphs. The bin element
70 * contains a sub-graph. Now one would like to treat the bin-element like other
71 * GstElements. This is where GhostPads come into play. A GhostPad acts as a
72 * proxy for another pad. Thus the bin can have sink and source ghost-pads that
73 * are associated with sink and source pads of the child elements.
74 * If the target pad is known at creation time, gst_ghost_pad_new() is the
75 * function to use to get a ghost-pad. Otherwise one can use gst_ghost_pad_new_no_target()
76 * to create the ghost-pad and use gst_ghost_pad_set_target() to establish the
77 * association later on.
78 * Note that GhostPads add overhead to the data processing of a pipeline.
79 * Last reviewed on 2005-11-18 (0.9.5)
81 public class GhostPad : Pad
84 /** the main Gtk struct */
85 protected GstGhostPad* gstGhostPad;
88 public GstGhostPad* getGhostPadStruct()
90 return gstGhostPad;
94 /** the main Gtk struct as a void* */
95 protected void* getStruct()
97 return cast(void*)gstGhostPad;
101 * Sets our main struct and passes it to the parent class
103 public this (GstGhostPad* gstGhostPad)
105 super(cast(GstPad*)gstGhostPad);
106 this.gstGhostPad = gstGhostPad;
110 * Create a new ghostpad with target as the target. The direction and
111 * padtemplate will be taken from the target pad.
112 * Will ref the target.
113 * name:
114 * the name of the new pad, or NULL to assign a default name.
115 * target:
116 * the pad to ghost.
117 * Returns:
118 * a new GstPad, or NULL in case of an error.
120 public this(char[] name, Pad target)
122 // GstPad* gst_ghost_pad_new (const gchar *name, GstPad *target);
123 this( cast(GstGhostPad*) gst_ghost_pad_new(Str.toStringz(name), (target is null) ? null : target.getPadStruct()) );
132 * Create a new ghostpad without a target with the given direction.
133 * A target can be set on the ghostpad later with the
134 * gst_ghost_pad_set_target() function.
135 * The created ghostpad will not have a padtemplate.
136 * name:
137 * the name of the new pad, or NULL to assign a default name.
138 * dir:
139 * the direction of the ghostpad
140 * Returns:
141 * a new GstPad, or NULL in case of an error.
143 public static Pad newNoTarget(char[] name, GstPadDirection dir)
145 // GstPad* gst_ghost_pad_new_no_target (const gchar *name, GstPadDirection dir);
146 return new Pad( gst_ghost_pad_new_no_target(Str.toStringz(name), dir) );
150 * Create a new ghostpad with target as the target. The direction will be taken
151 * from the target pad. The template used on the ghostpad will be template.
152 * Will ref the target.
153 * name:
154 * the name of the new pad, or NULL to assign a default name.
155 * target:
156 * the pad to ghost.
157 * templ:
158 * the GstPadTemplate to use on the ghostpad.
159 * Returns:
160 * a new GstPad, or NULL in case of an error.
161 * Since 0.10.10
163 public static Pad newFromTemplate(char[] name, Pad target, GstPadTemplate* templ)
165 // GstPad* gst_ghost_pad_new_from_template (const gchar *name, GstPad *target, GstPadTemplate *templ);
166 return new Pad( gst_ghost_pad_new_from_template(Str.toStringz(name), (target is null) ? null : target.getPadStruct(), templ) );
170 * Create a new ghostpad based on templ, without setting a target. The
171 * direction will be taken from the templ.
172 * name:
173 * the name of the new pad, or NULL to assign a default name.
174 * templ:
175 * the GstPadTemplate to create the ghostpad from.
176 * Returns:
177 * a new GstPad, or NULL in case of an error.
178 * Since 0.10.10
180 public static Pad newNoTargetFromTemplate(char[] name, GstPadTemplate* templ)
182 // GstPad* gst_ghost_pad_new_no_target_from_template (const gchar *name, GstPadTemplate *templ);
183 return new Pad( gst_ghost_pad_new_no_target_from_template(Str.toStringz(name), templ) );
187 * Set the new target of the ghostpad gpad. Any existing target
188 * is unlinked and links to the new target are established.
189 * gpad:
190 * the GstGhostpad
191 * newtarget:
192 * the new pad target
193 * Returns:
194 * TRUE if the new target could be set. This function can return FALSE
195 * when the internal pads could not be linked.
197 public int setTarget(Pad newtarget)
199 // gboolean gst_ghost_pad_set_target (GstGhostPad *gpad, GstPad *newtarget);
200 return gst_ghost_pad_set_target(gstGhostPad, (newtarget is null) ? null : newtarget.getPadStruct());
204 * Get the target pad of gpad. Unref target pad after usage.
205 * gpad:
206 * the GstGhostpad
207 * Returns:
208 * the target GstPad, can be NULL if the ghostpad
209 * has no target set. Unref target pad after usage.
210 * See Also
211 * GstPad
213 public Pad getTarget()
215 // GstPad* gst_ghost_pad_get_target (GstGhostPad *gpad);
216 return new Pad( gst_ghost_pad_get_target(gstGhostPad) );