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 has a buffer available as the next thing. 86 * 87 * Since: 1.14.1 88 */ 89 public bool hasBuffer() 90 { 91 return gst_aggregator_pad_has_buffer(gstAggregatorPad) != 0; 92 } 93 94 /** 95 * Returns: %TRUE if the pad is EOS, otherwise %FALSE. 96 */ 97 public bool isEos() 98 { 99 return gst_aggregator_pad_is_eos(gstAggregatorPad) != 0; 100 } 101 102 /** 103 * Returns: A reference to the buffer in @pad or 104 * NULL if no buffer was queued. You should unref the buffer after 105 * usage. 106 */ 107 public Buffer peekBuffer() 108 { 109 auto p = gst_aggregator_pad_peek_buffer(gstAggregatorPad); 110 111 if(p is null) 112 { 113 return null; 114 } 115 116 return ObjectG.getDObject!(Buffer)(cast(GstBuffer*) p, true); 117 } 118 119 /** 120 * Steal the ref to the buffer currently queued in @pad. 121 * 122 * Returns: The buffer in @pad or NULL if no buffer was 123 * queued. You should unref the buffer after usage. 124 */ 125 public Buffer popBuffer() 126 { 127 auto p = gst_aggregator_pad_pop_buffer(gstAggregatorPad); 128 129 if(p is null) 130 { 131 return null; 132 } 133 134 return ObjectG.getDObject!(Buffer)(cast(GstBuffer*) p, true); 135 } 136 }