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.ParentBufferMeta;
26 
27 private import glib.c.functions;
28 private import gobject.ObjectG;
29 private import gstreamer.Buffer;
30 private import gstreamer.c.functions;
31 public  import gstreamer.c.types;
32 public  import gstreamerc.gstreamertypes;
33 private import gtkd.Loader;
34 
35 
36 /**
37  * The #GstParentBufferMeta is a #GstMeta which can be attached to a #GstBuffer
38  * to hold a reference to another buffer that is only released when the child
39  * #GstBuffer is released.
40  * 
41  * Typically, #GstParentBufferMeta is used when the child buffer is directly
42  * using the #GstMemory of the parent buffer, and wants to prevent the parent
43  * buffer from being returned to a buffer pool until the #GstMemory is available
44  * for re-use.
45  *
46  * Since: 1.6
47  */
48 public final class ParentBufferMeta
49 {
50 	/** the main Gtk struct */
51 	protected GstParentBufferMeta* gstParentBufferMeta;
52 	protected bool ownedRef;
53 
54 	/** Get the main Gtk struct */
55 	public GstParentBufferMeta* getParentBufferMetaStruct(bool transferOwnership = false)
56 	{
57 		if (transferOwnership)
58 			ownedRef = false;
59 		return gstParentBufferMeta;
60 	}
61 
62 	/** the main Gtk struct as a void* */
63 	protected void* getStruct()
64 	{
65 		return cast(void*)gstParentBufferMeta;
66 	}
67 
68 	/**
69 	 * Sets our main struct and passes it to the parent class.
70 	 */
71 	public this (GstParentBufferMeta* gstParentBufferMeta, bool ownedRef = false)
72 	{
73 		this.gstParentBufferMeta = gstParentBufferMeta;
74 		this.ownedRef = ownedRef;
75 	}
76 
77 	~this ()
78 	{
79 		if ( Linker.isLoaded(LIBRARY_GSTREAMER) && ownedRef )
80 			g_free(gstParentBufferMeta);
81 	}
82 
83 
84 	/**
85 	 * the parent #GstMeta structure
86 	 */
87 	public @property GstMeta parent()
88 	{
89 		return gstParentBufferMeta.parent;
90 	}
91 
92 	/** Ditto */
93 	public @property void parent(GstMeta value)
94 	{
95 		gstParentBufferMeta.parent = value;
96 	}
97 
98 	/**
99 	 * the #GstBuffer on which a reference is being held.
100 	 */
101 	public @property Buffer buffer()
102 	{
103 		return ObjectG.getDObject!(Buffer)(gstParentBufferMeta.buffer, false);
104 	}
105 
106 	/** Ditto */
107 	public @property void buffer(Buffer value)
108 	{
109 		gstParentBufferMeta.buffer = value.getBufferStruct();
110 	}
111 
112 	/**
113 	 * Get the global #GstMetaInfo describing  the #GstParentBufferMeta meta.
114 	 *
115 	 * Returns: The #GstMetaInfo
116 	 *
117 	 * Since: 1.6
118 	 */
119 	public static GstMetaInfo* getInfo()
120 	{
121 		return gst_parent_buffer_meta_get_info();
122 	}
123 
124 	/** */
125 	public static GType getType()
126 	{
127 		return gst_parent_buffer_meta_api_get_type();
128 	}
129 }