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 
75 private import glib.Str;
76 private import gstreamer.Buffer;
77 private import gstreamer.BufferList;
78 private import gstreamer.Iterator;
79 private import gstreamer.ObjectGst;
80 private import gstreamer.Pad;
81 
82 
83 
84 private import gstreamer.Pad;
85 
86 /**
87  * GhostPads are useful when organizing pipelines with GstBin like elements.
88  * The idea here is to create hierarchical element graphs. The bin element
89  * contains a sub-graph. Now one would like to treat the bin-element like any
90  * other GstElement. This is where GhostPads come into play. A GhostPad acts as
91  * a proxy for another pad. Thus the bin can have sink and source ghost-pads
92  * that are associated with sink and source pads of the child elements.
93  *
94  * If the target pad is known at creation time, gst_ghost_pad_new() is the
95  * function to use to get a ghost-pad. Otherwise one can use gst_ghost_pad_new_no_target()
96  * to create the ghost-pad and use gst_ghost_pad_set_target() to establish the
97  * association later on.
98  *
99  * Note that GhostPads add overhead to the data processing of a pipeline.
100  *
101  * Last reviewed on 2005-11-18 (0.9.5)
102  */
103 public class ProxyPad : Pad
104 {
105 	
106 	/** the main Gtk struct */
107 	protected GstProxyPad* gstProxyPad;
108 	
109 	
110 	public GstProxyPad* getProxyPadStruct()
111 	{
112 		return gstProxyPad;
113 	}
114 	
115 	
116 	/** the main Gtk struct as a void* */
117 	protected override void* getStruct()
118 	{
119 		return cast(void*)gstProxyPad;
120 	}
121 	
122 	/**
123 	 * Sets our main struct and passes it to the parent class
124 	 */
125 	public this (GstProxyPad* gstProxyPad)
126 	{
127 		super(cast(GstPad*)gstProxyPad);
128 		this.gstProxyPad = gstProxyPad;
129 	}
130 	
131 	protected override void setStruct(GObject* obj)
132 	{
133 		super.setStruct(obj);
134 		gstProxyPad = cast(GstProxyPad*)obj;
135 	}
136 	
137 	/**
138 	 * Get the internal pad of pad. Unref target pad after usage.
139 	 * The internal pad of a GstGhostPad is the internally used
140 	 * pad of opposite direction, which is used to link to the target.
141 	 *
142 	 * Params:
143 	 *     pad = the GstProxyPad
144 	 * Returns: the target GstProxyPad, can be NULL. Unref target pad after usage. [transfer full]
145 	 */
146 	public ProxyPad getInternal()
147 	{
148 		// GstProxyPad * gst_proxy_pad_get_internal (GstProxyPad *pad);
149 		auto p = gst_proxy_pad_get_internal(gstProxyPad);
150 		
151 		if(p is null)
152 		{
153 			return null;
154 		}
155 		
156 		return ObjectG.getDObject!(ProxyPad)(cast(GstProxyPad*) p);
157 	}
158 	
159 	/**
160 	 */
161 	
162 	/**
163 	 * Invoke the default iterate internal links function of the proxy pad.
164 	 * Params:
165 	 * parent = the parent of pad or NULL. [allow-none]
166 	 * Returns: a GstIterator of GstPad, or NULL if pad has no parent. Unref each returned pad with gst_object_unref().
167 	 */
168 	public override Iterator iterateInternalLinksDefault(ObjectGst parent)
169 	{
170 		// GstIterator * gst_proxy_pad_iterate_internal_links_default  (GstPad *pad,  GstObject *parent);
171 		auto p = gst_proxy_pad_iterate_internal_links_default(gstPad, (parent is null) ? null : parent.getObjectGstStruct());
172 		
173 		if(p is null)
174 		{
175 			return null;
176 		}
177 		
178 		return ObjectG.getDObject!(Iterator)(cast(GstIterator*) p);
179 	}
180 	
181 	/**
182 	 * Invoke the default chain function of the proxy pad.
183 	 * Params:
184 	 * parent = the parent of pad or NULL. [allow-none]
185 	 * buffer = the GstBuffer to send, return GST_FLOW_ERROR
186 	 * if not. [transfer full]
187 	 * Returns: a GstFlowReturn from the pad.
188 	 */
189 	public GstFlowReturn chainDefault(ObjectGst parent, Buffer buffer)
190 	{
191 		// GstFlowReturn gst_proxy_pad_chain_default (GstPad *pad,  GstObject *parent,  GstBuffer *buffer);
192 		return gst_proxy_pad_chain_default(gstPad, (parent is null) ? null : parent.getObjectGstStruct(), (buffer is null) ? null : buffer.getBufferStruct());
193 	}
194 	
195 	/**
196 	 * Invoke the default chain list function of the proxy pad.
197 	 * Params:
198 	 * parent = the parent of pad or NULL. [allow-none]
199 	 * list = the GstBufferList to send, return GST_FLOW_ERROR
200 	 * if not. [transfer full]
201 	 * Returns: a GstFlowReturn from the pad.
202 	 */
203 	public GstFlowReturn chainListDefault(ObjectGst parent, BufferList list)
204 	{
205 		// GstFlowReturn gst_proxy_pad_chain_list_default (GstPad *pad,  GstObject *parent,  GstBufferList *list);
206 		return gst_proxy_pad_chain_list_default(gstPad, (parent is null) ? null : parent.getObjectGstStruct(), (list is null) ? null : list.getBufferListStruct());
207 	}
208 	
209 	/**
210 	 * returns GST_FLOW_ERROR if NULL.
211 	 * Invoke the default getrange function of the proxy pad.
212 	 * Params:
213 	 * parent = the parent of pad
214 	 * offset = The start offset of the buffer
215 	 * size = The length of the buffer
216 	 * buffer = a pointer to hold the GstBuffer,. [out callee-allocates]
217 	 * Returns: a GstFlowReturn from the pad.
218 	 */
219 	public GstFlowReturn getrangeDefault(ObjectGst parent, ulong offset, uint size, out Buffer buffer)
220 	{
221 		// GstFlowReturn gst_proxy_pad_getrange_default (GstPad *pad,  GstObject *parent,  guint64 offset,  guint size,  GstBuffer **buffer);
222 		GstBuffer* outbuffer = null;
223 		
224 		auto p = gst_proxy_pad_getrange_default(gstPad, (parent is null) ? null : parent.getObjectGstStruct(), offset, size, &outbuffer);
225 		
226 		buffer = ObjectG.getDObject!(Buffer)(outbuffer);
227 		return p;
228 	}
229 }