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 gst.base.AggregatorPad;
26 
27 private import gobject.ObjectG;
28 private import gst.base.c.functions;
29 public  import gst.base.c.types;
30 private import gstreamer.Buffer;
31 private import gstreamer.Pad;
32 
33 
34 /**
35  * Pads managed by a #GstAggregor subclass.
36  * 
37  * This class used to live in gst-plugins-bad and was moved to core.
38  */
39 public class AggregatorPad : Pad
40 {
41 	/** the main Gtk struct */
42 	protected GstAggregatorPad* gstAggregatorPad;
43 
44 	/** Get the main Gtk struct */
45 	public GstAggregatorPad* getAggregatorPadStruct(bool transferOwnership = false)
46 	{
47 		if (transferOwnership)
48 			ownedRef = false;
49 		return gstAggregatorPad;
50 	}
51 
52 	/** the main Gtk struct as a void* */
53 	protected override void* getStruct()
54 	{
55 		return cast(void*)gstAggregatorPad;
56 	}
57 
58 	/**
59 	 * Sets our main struct and passes it to the parent class.
60 	 */
61 	public this (GstAggregatorPad* gstAggregatorPad, bool ownedRef = false)
62 	{
63 		this.gstAggregatorPad = gstAggregatorPad;
64 		super(cast(GstPad*)gstAggregatorPad, ownedRef);
65 	}
66 
67 
68 	/** */
69 	public static GType getType()
70 	{
71 		return gst_aggregator_pad_get_type();
72 	}
73 
74 	/**
75 	 * Drop the buffer currently queued in @pad.
76 	 *
77 	 * Returns: TRUE if there was a buffer queued in @pad, or FALSE if not.
78 	 */
79 	public bool dropBuffer()
80 	{
81 		return gst_aggregator_pad_drop_buffer(gstAggregatorPad) != 0;
82 	}
83 
84 	/**
85 	 * Returns: %TRUE if the pad is EOS, otherwise %FALSE.
86 	 */
87 	public bool isEos()
88 	{
89 		return gst_aggregator_pad_is_eos(gstAggregatorPad) != 0;
90 	}
91 
92 	/**
93 	 * Returns: A reference to the buffer in @pad or
94 	 *     NULL if no buffer was queued. You should unref the buffer after
95 	 *     usage.
96 	 */
97 	public Buffer peekBuffer()
98 	{
99 		auto p = gst_aggregator_pad_peek_buffer(gstAggregatorPad);
100 
101 		if(p is null)
102 		{
103 			return null;
104 		}
105 
106 		return ObjectG.getDObject!(Buffer)(cast(GstBuffer*) p, true);
107 	}
108 
109 	/**
110 	 * Steal the ref to the buffer currently queued in @pad.
111 	 *
112 	 * Returns: The buffer in @pad or NULL if no buffer was
113 	 *     queued. You should unref the buffer after usage.
114 	 */
115 	public Buffer popBuffer()
116 	{
117 		auto p = gst_aggregator_pad_pop_buffer(gstAggregatorPad);
118 
119 		if(p is null)
120 		{
121 			return null;
122 		}
123 
124 		return ObjectG.getDObject!(Buffer)(cast(GstBuffer*) p, true);
125 	}
126 }