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
49 * - GstGhostPad* -> GhostPad
55 module gstreamer
.GhostPad
;
57 private import gstreamerc
.gstreamertypes
;
59 private import gstreamerc
.gstreamer
;
61 private import glib
.Str
;
62 private import gstreamer
.Pad
;
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()
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.
114 * the name of the new pad, or NULL to assign a default name.
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.
137 * the name of the new pad, or NULL to assign a default name.
139 * the direction of the ghostpad
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.
154 * the name of the new pad, or NULL to assign a default name.
158 * the GstPadTemplate to use on the ghostpad.
160 * a new GstPad, or NULL in case of an error.
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.
173 * the name of the new pad, or NULL to assign a default name.
175 * the GstPadTemplate to create the ghostpad from.
177 * a new GstPad, or NULL in case of an error.
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.
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.
208 * the target GstPad, can be NULL if the ghostpad
209 * has no target set. Unref target pad after usage.
213 public Pad
getTarget()
215 // GstPad* gst_ghost_pad_get_target (GstGhostPad *gpad);
216 return new Pad( gst_ghost_pad_get_target(gstGhostPad
) );