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