/usr/include/d/gtkd-3/gstreamer/GhostPad.d is in libgstreamerd-3-dev 3.7.5-2build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 | /*
* This file is part of gtkD.
*
* gtkD is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 3
* of the License, or (at your option) any later version, with
* some exceptions, please read the COPYING file.
*
* gtkD is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with gtkD; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
*/
// generated automatically - do not change
// find conversion definition on APILookup.txt
// implement new conversion functionalities on the wrap.utils pakage
module gstreamer.GhostPad;
private import glib.ConstructionException;
private import glib.Str;
private import gobject.ObjectG;
private import gstreamer.ObjectGst;
private import gstreamer.Pad;
private import gstreamer.PadTemplate;
private import gstreamer.ProxyPad;
private import gstreamer.c.functions;
public import gstreamer.c.types;
public import gstreamerc.gstreamertypes;
/**
* GhostPads are useful when organizing pipelines with #GstBin like elements.
* The idea here is to create hierarchical element graphs. The bin element
* contains a sub-graph. Now one would like to treat the bin-element like any
* other #GstElement. This is where GhostPads come into play. A GhostPad acts as
* a proxy for another pad. Thus the bin can have sink and source ghost-pads
* that are associated with sink and source pads of the child elements.
*
* If the target pad is known at creation time, gst_ghost_pad_new() is the
* function to use to get a ghost-pad. Otherwise one can use gst_ghost_pad_new_no_target()
* to create the ghost-pad and use gst_ghost_pad_set_target() to establish the
* association later on.
*
* Note that GhostPads add overhead to the data processing of a pipeline.
*/
public class GhostPad : ProxyPad
{
/** the main Gtk struct */
protected GstGhostPad* gstGhostPad;
/** Get the main Gtk struct */
public GstGhostPad* getGhostPadStruct(bool transferOwnership = false)
{
if (transferOwnership)
ownedRef = false;
return gstGhostPad;
}
/** the main Gtk struct as a void* */
protected override void* getStruct()
{
return cast(void*)gstGhostPad;
}
protected override void setStruct(GObject* obj)
{
gstGhostPad = cast(GstGhostPad*)obj;
super.setStruct(obj);
}
/**
* Sets our main struct and passes it to the parent class.
*/
public this (GstGhostPad* gstGhostPad, bool ownedRef = false)
{
this.gstGhostPad = gstGhostPad;
super(cast(GstProxyPad*)gstGhostPad, ownedRef);
}
/** */
public static GType getType()
{
return gst_ghost_pad_get_type();
}
/**
* Create a new ghostpad with @target as the target. The direction will be taken
* from the target pad. @target must be unlinked.
*
* Will ref the target.
*
* Params:
* name = the name of the new pad, or %NULL to assign a default name
* target = the pad to ghost.
*
* Returns: a new #GstPad, or %NULL in
* case of an error.
*
* Throws: ConstructionException GTK+ fails to create the object.
*/
public this(string name, Pad target)
{
auto p = gst_ghost_pad_new(Str.toStringz(name), (target is null) ? null : target.getPadStruct());
if(p is null)
{
throw new ConstructionException("null returned by new");
}
this(cast(GstGhostPad*) p);
}
/**
* Create a new ghostpad with @target as the target. The direction will be taken
* from the target pad. The template used on the ghostpad will be @template.
*
* Will ref the target.
*
* Params:
* name = the name of the new pad, or %NULL to assign a default name.
* target = the pad to ghost.
* templ = the #GstPadTemplate to use on the ghostpad.
*
* Returns: a new #GstPad, or %NULL in
* case of an error.
*
* Throws: ConstructionException GTK+ fails to create the object.
*/
public this(string name, Pad target, PadTemplate templ)
{
auto p = gst_ghost_pad_new_from_template(Str.toStringz(name), (target is null) ? null : target.getPadStruct(), (templ is null) ? null : templ.getPadTemplateStruct());
if(p is null)
{
throw new ConstructionException("null returned by new_from_template");
}
this(cast(GstGhostPad*) p, true);
}
/**
* Create a new ghostpad without a target with the given direction.
* A target can be set on the ghostpad later with the
* gst_ghost_pad_set_target() function.
*
* The created ghostpad will not have a padtemplate.
*
* Params:
* name = the name of the new pad, or %NULL to assign a default name.
* dir = the direction of the ghostpad
*
* Returns: a new #GstPad, or %NULL in
* case of an error.
*
* Throws: ConstructionException GTK+ fails to create the object.
*/
public this(string name, GstPadDirection dir)
{
auto p = gst_ghost_pad_new_no_target(Str.toStringz(name), dir);
if(p is null)
{
throw new ConstructionException("null returned by new_no_target");
}
this(cast(GstGhostPad*) p, true);
}
/**
* Create a new ghostpad based on @templ, without setting a target. The
* direction will be taken from the @templ.
*
* Params:
* name = the name of the new pad, or %NULL to assign a default name
* templ = the #GstPadTemplate to create the ghostpad from.
*
* Returns: a new #GstPad, or %NULL in
* case of an error.
*
* Throws: ConstructionException GTK+ fails to create the object.
*/
public this(string name, PadTemplate templ)
{
auto p = gst_ghost_pad_new_no_target_from_template(Str.toStringz(name), (templ is null) ? null : templ.getPadTemplateStruct());
if(p is null)
{
throw new ConstructionException("null returned by new_no_target_from_template");
}
this(cast(GstGhostPad*) p, true);
}
/**
* Invoke the default activate mode function of a ghost pad.
*
* Params:
* pad = the #GstPad to activate or deactivate.
* parent = the parent of @pad or %NULL
* mode = the requested activation mode
* active = whether the pad should be active or not.
*
* Returns: %TRUE if the operation was successful.
*/
public static bool activateModeDefault(Pad pad, ObjectGst parent, GstPadMode mode, bool active)
{
return gst_ghost_pad_activate_mode_default((pad is null) ? null : pad.getPadStruct(), (parent is null) ? null : parent.getObjectGstStruct(), mode, active) != 0;
}
/**
* Invoke the default activate mode function of a proxy pad that is
* owned by a ghost pad.
*
* Params:
* pad = the #GstPad to activate or deactivate.
* parent = the parent of @pad or %NULL
* mode = the requested activation mode
* active = whether the pad should be active or not.
*
* Returns: %TRUE if the operation was successful.
*/
public static bool internalActivateModeDefault(Pad pad, ObjectGst parent, GstPadMode mode, bool active)
{
return gst_ghost_pad_internal_activate_mode_default((pad is null) ? null : pad.getPadStruct(), (parent is null) ? null : parent.getObjectGstStruct(), mode, active) != 0;
}
/**
* Finish initialization of a newly allocated ghost pad.
*
* This function is most useful in language bindings and when subclassing
* #GstGhostPad; plugin and application developers normally will not call this
* function. Call this function directly after a call to g_object_new
* (GST_TYPE_GHOST_PAD, "direction", @dir, ..., NULL).
*
* Returns: %TRUE if the construction succeeds, %FALSE otherwise.
*/
public bool construct()
{
return gst_ghost_pad_construct(gstGhostPad) != 0;
}
/**
* Get the target pad of @gpad. Unref target pad after usage.
*
* Returns: the target #GstPad, can be
* %NULL if the ghostpad has no target set. Unref target pad after
* usage.
*/
public Pad getTarget()
{
auto p = gst_ghost_pad_get_target(gstGhostPad);
if(p is null)
{
return null;
}
return ObjectG.getDObject!(Pad)(cast(GstPad*) p, true);
}
/**
* Set the new target of the ghostpad @gpad. Any existing target
* is unlinked and links to the new target are established. if @newtarget is
* %NULL the target will be cleared.
*
* Params:
* newtarget = the new pad target
*
* Returns: %TRUE if the new target could be set. This function
* can return %FALSE when the internal pads could not be linked.
*/
public bool setTarget(Pad newtarget)
{
return gst_ghost_pad_set_target(gstGhostPad, (newtarget is null) ? null : newtarget.getPadStruct()) != 0;
}
}
|