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 module gstreamer.ProxyPad;
26 
27 private import gobject.ObjectG;
28 private import gstreamer.Buffer;
29 private import gstreamer.BufferList;
30 private import gstreamer.Iterator;
31 private import gstreamer.ObjectGst;
32 private import gstreamer.Pad;
33 private import gstreamerc.gstreamer;
34 public  import gstreamerc.gstreamertypes;
35 
36 
37 /** */
38 public class ProxyPad : Pad
39 {
40 	/** the main Gtk struct */
41 	protected GstProxyPad* gstProxyPad;
42 
43 	/** Get the main Gtk struct */
44 	public GstProxyPad* getProxyPadStruct(bool transferOwnership = false)
45 	{
46 		if (transferOwnership)
47 			ownedRef = false;
48 		return gstProxyPad;
49 	}
50 
51 	/** the main Gtk struct as a void* */
52 	protected override void* getStruct()
53 	{
54 		return cast(void*)gstProxyPad;
55 	}
56 
57 	protected override void setStruct(GObject* obj)
58 	{
59 		gstProxyPad = cast(GstProxyPad*)obj;
60 		super.setStruct(obj);
61 	}
62 
63 	/**
64 	 * Sets our main struct and passes it to the parent class.
65 	 */
66 	public this (GstProxyPad* gstProxyPad, bool ownedRef = false)
67 	{
68 		this.gstProxyPad = gstProxyPad;
69 		super(cast(GstPad*)gstProxyPad, ownedRef);
70 	}
71 
72 
73 	/** */
74 	public static GType getType()
75 	{
76 		return gst_proxy_pad_get_type();
77 	}
78 
79 	/**
80 	 * Invoke the default chain function of the proxy pad.
81 	 *
82 	 * Params:
83 	 *     pad = a sink #GstPad, returns GST_FLOW_ERROR if not.
84 	 *     parent = the parent of @pad or %NULL
85 	 *     buffer = the #GstBuffer to send, return GST_FLOW_ERROR
86 	 *         if not.
87 	 *
88 	 * Returns: a #GstFlowReturn from the pad.
89 	 */
90 	public static GstFlowReturn chainDefault(Pad pad, ObjectGst parent, Buffer buffer)
91 	{
92 		return gst_proxy_pad_chain_default((pad is null) ? null : pad.getPadStruct(), (parent is null) ? null : parent.getObjectGstStruct(), (buffer is null) ? null : buffer.getBufferStruct());
93 	}
94 
95 	/**
96 	 * Invoke the default chain list function of the proxy pad.
97 	 *
98 	 * Params:
99 	 *     pad = a sink #GstPad, returns GST_FLOW_ERROR if not.
100 	 *     parent = the parent of @pad or %NULL
101 	 *     list = the #GstBufferList to send, return GST_FLOW_ERROR
102 	 *         if not.
103 	 *
104 	 * Returns: a #GstFlowReturn from the pad.
105 	 */
106 	public static GstFlowReturn chainListDefault(Pad pad, ObjectGst parent, BufferList list)
107 	{
108 		return gst_proxy_pad_chain_list_default((pad is null) ? null : pad.getPadStruct(), (parent is null) ? null : parent.getObjectGstStruct(), (list is null) ? null : list.getBufferListStruct());
109 	}
110 
111 	/**
112 	 * Invoke the default getrange function of the proxy pad.
113 	 *
114 	 * Params:
115 	 *     pad = a src #GstPad, returns #GST_FLOW_ERROR if not.
116 	 *     parent = the parent of @pad
117 	 *     offset = The start offset of the buffer
118 	 *     size = The length of the buffer
119 	 *     buffer = a pointer to hold the #GstBuffer,
120 	 *         returns #GST_FLOW_ERROR if %NULL.
121 	 *
122 	 * Returns: a #GstFlowReturn from the pad.
123 	 */
124 	public static GstFlowReturn getrangeDefault(Pad pad, ObjectGst parent, ulong offset, uint size, out Buffer buffer)
125 	{
126 		GstBuffer* outbuffer = null;
127 		
128 		auto p = gst_proxy_pad_getrange_default((pad is null) ? null : pad.getPadStruct(), (parent is null) ? null : parent.getObjectGstStruct(), offset, size, &outbuffer);
129 		
130 		buffer = ObjectG.getDObject!(Buffer)(outbuffer);
131 		
132 		return p;
133 	}
134 
135 	/**
136 	 * Invoke the default iterate internal links function of the proxy pad.
137 	 *
138 	 * Params:
139 	 *     pad = the #GstPad to get the internal links of.
140 	 *     parent = the parent of @pad or %NULL
141 	 *
142 	 * Returns: a #GstIterator of #GstPad, or %NULL if @pad
143 	 *     has no parent. Unref each returned pad with gst_object_unref().
144 	 */
145 	public static Iterator iterateInternalLinksDefault(Pad pad, ObjectGst parent)
146 	{
147 		auto p = gst_proxy_pad_iterate_internal_links_default((pad is null) ? null : pad.getPadStruct(), (parent is null) ? null : parent.getObjectGstStruct());
148 		
149 		if(p is null)
150 		{
151 			return null;
152 		}
153 		
154 		return ObjectG.getDObject!(Iterator)(cast(GstIterator*) p, true);
155 	}
156 
157 	/**
158 	 * Get the internal pad of @pad. Unref target pad after usage.
159 	 *
160 	 * The internal pad of a #GstGhostPad is the internally used
161 	 * pad of opposite direction, which is used to link to the target.
162 	 *
163 	 * Returns: the target #GstProxyPad, can
164 	 *     be %NULL.  Unref target pad after usage.
165 	 */
166 	public ProxyPad getInternal()
167 	{
168 		auto p = gst_proxy_pad_get_internal(gstProxyPad);
169 		
170 		if(p is null)
171 		{
172 			return null;
173 		}
174 		
175 		return ObjectG.getDObject!(ProxyPad)(cast(GstProxyPad*) p, true);
176 	}
177 }