1 /* 2 * This file is part of gtkD. 3 * 4 * gtkD is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU Lesser General Public License 6 * as published by the Free Software Foundation; either version 3 7 * of the License, or (at your option) any later version, with 8 * some exceptions, please read the COPYING file. 9 * 10 * gtkD is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU Lesser General Public License for more details. 14 * 15 * You should have received a copy of the GNU Lesser General Public License 16 * along with gtkD; if not, write to the Free Software 17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA 18 */ 19 20 // generated automatically - do not change 21 // find conversion definition on APILookup.txt 22 // implement new conversion functionalities on the wrap.utils pakage 23 24 /* 25 * Conversion parameters: 26 * inFile = 27 * outPack = gstreamer 28 * outFile = ProxyPad 29 * strct = GstPad 30 * realStrct=GstProxyPad 31 * ctorStrct= 32 * clss = ProxyPad 33 * interf = 34 * class Code: Yes 35 * interface Code: No 36 * template for: 37 * extend = 38 * implements: 39 * prefixes: 40 * - gst_proxy_pad_ 41 * omit structs: 42 * omit prefixes: 43 * omit code: 44 * - gst_proxy_pad_get_internal 45 * omit signals: 46 * imports: 47 * - glib.Str 48 * - gstreamer.Buffer 49 * - gstreamer.BufferList 50 * - gstreamer.Iterator 51 * - gstreamer.ObjectGst 52 * - gstreamer.Pad 53 * structWrap: 54 * - GstBuffer* -> Buffer 55 * - GstBufferList* -> BufferList 56 * - GstIterator* -> Iterator 57 * - GstObject* -> ObjectGst 58 * - GstPad* -> Pad 59 * - GstProxyPad* -> ProxyPad 60 * module aliases: 61 * local aliases: 62 * overrides: 63 * - iterateInternalLinksDefault 64 */ 65 66 module gstreamer.ProxyPad; 67 68 public import gstreamerc.gstreamertypes; 69 70 private import gstreamerc.gstreamer; 71 private import glib.ConstructionException; 72 private import gobject.ObjectG; 73 74 private import glib.Str; 75 private import gstreamer.Buffer; 76 private import gstreamer.BufferList; 77 private import gstreamer.Iterator; 78 private import gstreamer.ObjectGst; 79 private import gstreamer.Pad; 80 81 82 private import gstreamer.Pad; 83 84 /** 85 * GhostPads are useful when organizing pipelines with GstBin like elements. 86 * The idea here is to create hierarchical element graphs. The bin element 87 * contains a sub-graph. Now one would like to treat the bin-element like any 88 * other GstElement. This is where GhostPads come into play. A GhostPad acts as 89 * a proxy for another pad. Thus the bin can have sink and source ghost-pads 90 * that are associated with sink and source pads of the child elements. 91 * 92 * If the target pad is known at creation time, gst_ghost_pad_new() is the 93 * function to use to get a ghost-pad. Otherwise one can use gst_ghost_pad_new_no_target() 94 * to create the ghost-pad and use gst_ghost_pad_set_target() to establish the 95 * association later on. 96 * 97 * Note that GhostPads add overhead to the data processing of a pipeline. 98 * 99 * Last reviewed on 2005-11-18 (0.9.5) 100 */ 101 public class ProxyPad : Pad 102 { 103 104 /** the main Gtk struct */ 105 protected GstProxyPad* gstProxyPad; 106 107 108 /** Get the main Gtk struct */ 109 public GstProxyPad* getProxyPadStruct() 110 { 111 return gstProxyPad; 112 } 113 114 115 /** the main Gtk struct as a void* */ 116 protected override void* getStruct() 117 { 118 return cast(void*)gstProxyPad; 119 } 120 121 /** 122 * Sets our main struct and passes it to the parent class 123 */ 124 public this (GstProxyPad* gstProxyPad) 125 { 126 super(cast(GstPad*)gstProxyPad); 127 this.gstProxyPad = gstProxyPad; 128 } 129 130 protected override void setStruct(GObject* obj) 131 { 132 super.setStruct(obj); 133 gstProxyPad = cast(GstProxyPad*)obj; 134 } 135 136 /** 137 * Get the internal pad of pad. Unref target pad after usage. 138 * The internal pad of a GstGhostPad is the internally used 139 * pad of opposite direction, which is used to link to the target. 140 * 141 * Params: 142 * pad = the GstProxyPad 143 * Returns: the target GstProxyPad, can be NULL. Unref target pad after usage. [transfer full] 144 */ 145 public ProxyPad getInternal() 146 { 147 // GstProxyPad * gst_proxy_pad_get_internal (GstProxyPad *pad); 148 auto p = gst_proxy_pad_get_internal(gstProxyPad); 149 150 if(p is null) 151 { 152 return null; 153 } 154 155 return ObjectG.getDObject!(ProxyPad)(cast(GstProxyPad*) p); 156 } 157 158 /** 159 */ 160 161 /** 162 * Invoke the default iterate internal links function of the proxy pad. 163 * Params: 164 * parent = the parent of pad or NULL. [allow-none] 165 * Returns: a GstIterator of GstPad, or NULL if pad has no parent. Unref each returned pad with gst_object_unref(). 166 */ 167 public override Iterator iterateInternalLinksDefault(ObjectGst parent) 168 { 169 // GstIterator * gst_proxy_pad_iterate_internal_links_default (GstPad *pad, GstObject *parent); 170 auto p = gst_proxy_pad_iterate_internal_links_default(gstPad, (parent is null) ? null : parent.getObjectGstStruct()); 171 172 if(p is null) 173 { 174 return null; 175 } 176 177 return ObjectG.getDObject!(Iterator)(cast(GstIterator*) p); 178 } 179 180 /** 181 * Invoke the default chain function of the proxy pad. 182 * Params: 183 * parent = the parent of pad or NULL. [allow-none] 184 * buffer = the GstBuffer to send, return GST_FLOW_ERROR 185 * if not. [transfer full] 186 * Returns: a GstFlowReturn from the pad. 187 */ 188 public GstFlowReturn chainDefault(ObjectGst parent, Buffer buffer) 189 { 190 // GstFlowReturn gst_proxy_pad_chain_default (GstPad *pad, GstObject *parent, GstBuffer *buffer); 191 return gst_proxy_pad_chain_default(gstPad, (parent is null) ? null : parent.getObjectGstStruct(), (buffer is null) ? null : buffer.getBufferStruct()); 192 } 193 194 /** 195 * Invoke the default chain list function of the proxy pad. 196 * Params: 197 * parent = the parent of pad or NULL. [allow-none] 198 * list = the GstBufferList to send, return GST_FLOW_ERROR 199 * if not. [transfer full] 200 * Returns: a GstFlowReturn from the pad. 201 */ 202 public GstFlowReturn chainListDefault(ObjectGst parent, BufferList list) 203 { 204 // GstFlowReturn gst_proxy_pad_chain_list_default (GstPad *pad, GstObject *parent, GstBufferList *list); 205 return gst_proxy_pad_chain_list_default(gstPad, (parent is null) ? null : parent.getObjectGstStruct(), (list is null) ? null : list.getBufferListStruct()); 206 } 207 208 /** 209 * returns GST_FLOW_ERROR if NULL. 210 * Invoke the default getrange function of the proxy pad. 211 * Params: 212 * parent = the parent of pad 213 * offset = The start offset of the buffer 214 * size = The length of the buffer 215 * buffer = a pointer to hold the GstBuffer,. [out callee-allocates] 216 * Returns: a GstFlowReturn from the pad. 217 */ 218 public GstFlowReturn getrangeDefault(ObjectGst parent, ulong offset, uint size, out Buffer buffer) 219 { 220 // GstFlowReturn gst_proxy_pad_getrange_default (GstPad *pad, GstObject *parent, guint64 offset, guint size, GstBuffer **buffer); 221 GstBuffer* outbuffer = null; 222 223 auto p = gst_proxy_pad_getrange_default(gstPad, (parent is null) ? null : parent.getObjectGstStruct(), offset, size, &outbuffer); 224 225 buffer = ObjectG.getDObject!(Buffer)(outbuffer); 226 return p; 227 } 228 }