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