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  * Conversion parameters:
26  * inFile  = gstreamer-GstMeta.html
27  * outPack = gstreamer
28  * outFile = Meta
29  * strct   = 
30  * realStrct=
31  * ctorStrct=
32  * clss    = Meta
33  * interf  = 
34  * class Code: No
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * prefixes:
40  * 	- gst_meta_
41  * omit structs:
42  * omit prefixes:
43  * omit code:
44  * omit signals:
45  * imports:
46  * 	- glib.Str
47  * structWrap:
48  * module aliases:
49  * local aliases:
50  * overrides:
51  */
52 
53 module gstreamer.Meta;
54 
55 public  import gstreamerc.gstreamertypes;
56 
57 private import gstreamerc.gstreamer;
58 private import glib.ConstructionException;
59 private import gobject.ObjectG;
60 
61 private import glib.Str;
62 
63 
64 
65 /**
66  * The GstMeta structure should be included as the first member of a GstBuffer
67  * metadata structure. The structure defines the API of the metadata and should
68  * be accessible to all elements using the metadata.
69  *
70  * A metadata API is registered with gst_meta_api_type_register() which takes a
71  * name for the metadata API and some tags associated with the metadata.
72  * With gst_meta_api_type_has_tag() one can check if a certain metadata API
73  * contains a given tag.
74  *
75  * Multiple implementations of a metadata API can be registered.
76  * To implement a metadata API, gst_meta_register() should be used. This
77  * function takes all parameters needed to create, free and transform metadata
78  * along with the size of the metadata. The function returns a GstMetaInfo
79  * structure that contains the information for the implementation of the API.
80  *
81  * A specific implementation can be retrieved by name with gst_meta_get_info().
82  *
83  * See GstBuffer for how the metadata can be added, retrieved and removed from
84  * buffers.
85  *
86  * Last reviewed on 2012-03-28 (0.11.3)
87  */
88 public class Meta
89 {
90 	
91 	/**
92 	 */
93 	
94 	/**
95 	 * Register and return a GType for the api and associate it with
96 	 * tags.
97 	 * Params:
98 	 * api = an API to register
99 	 * tags = tags for api
100 	 * Returns: a unique GType for api.
101 	 */
102 	public static GType apiTypeRegister(string api, string[] tags)
103 	{
104 		// GType gst_meta_api_type_register (const gchar *api,  const gchar **tags);
105 		return gst_meta_api_type_register(Str.toStringz(api), Str.toStringzArray(tags));
106 	}
107 	
108 	/**
109 	 * Check if api was registered with tag.
110 	 * Params:
111 	 * api = an API
112 	 * tag = the tag to check
113 	 * Returns: TRUE if api was registered with tag.
114 	 */
115 	public static int apiTypeHasTag(GType api, GQuark tag)
116 	{
117 		// gboolean gst_meta_api_type_has_tag (GType api,  GQuark tag);
118 		return gst_meta_api_type_has_tag(api, tag);
119 	}
120 	
121 	/**
122 	 * Register a new GstMeta implementation.
123 	 * The same info can be retrieved later with gst_meta_get_info() by using
124 	 * impl as the key.
125 	 * Params:
126 	 * api = the type of the GstMeta API
127 	 * impl = the name of the GstMeta implementation
128 	 * size = the size of the GstMeta structure
129 	 * initFunc = (scope async) a GstMetaInitFunction
130 	 * freeFunc = (scope async) a GstMetaFreeFunction
131 	 * transformFunc = (scope async) a GstMetaTransformFunction
132 	 * Returns: a GstMetaInfo that can be used to access metadata. [transfer none]
133 	 */
134 	public static GstMetaInfo* register(GType api, string impl, gsize size, GstMetaInitFunction initFunc, GstMetaFreeFunction freeFunc, GstMetaTransformFunction transformFunc)
135 	{
136 		// const GstMetaInfo * gst_meta_register (GType api,  const gchar *impl,  gsize size,  GstMetaInitFunction init_func,  GstMetaFreeFunction free_func,  GstMetaTransformFunction transform_func);
137 		return gst_meta_register(api, Str.toStringz(impl), size, initFunc, freeFunc, transformFunc);
138 	}
139 	
140 	/**
141 	 * Lookup a previously registered meta info structure by its implementation name
142 	 * impl.
143 	 * Params:
144 	 * impl = the name
145 	 * Returns: a GstMetaInfo with impl, or NULL when no such metainfo exists. [transfer none]
146 	 */
147 	public static GstMetaInfo* getInfo(string impl)
148 	{
149 		// const GstMetaInfo * gst_meta_get_info (const gchar *impl);
150 		return gst_meta_get_info(Str.toStringz(impl));
151 	}
152 }