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.Meta;
26 
27 private import glib.Str;
28 private import gstreamerc.gstreamer;
29 public  import gstreamerc.gstreamertypes;
30 
31 
32 /**
33  * The #GstMeta structure should be included as the first member of a #GstBuffer
34  * metadata structure. The structure defines the API of the metadata and should
35  * be accessible to all elements using the metadata.
36  * 
37  * A metadata API is registered with gst_meta_api_type_register() which takes a
38  * name for the metadata API and some tags associated with the metadata.
39  * With gst_meta_api_type_has_tag() one can check if a certain metadata API
40  * contains a given tag.
41  * 
42  * Multiple implementations of a metadata API can be registered.
43  * To implement a metadata API, gst_meta_register() should be used. This
44  * function takes all parameters needed to create, free and transform metadata
45  * along with the size of the metadata. The function returns a #GstMetaInfo
46  * structure that contains the information for the implementation of the API.
47  * 
48  * A specific implementation can be retrieved by name with gst_meta_get_info().
49  * 
50  * See #GstBuffer for how the metadata can be added, retrieved and removed from
51  * buffers.
52  */
53 public struct Meta
54 {
55 	/**
56 	 */
57 
58 	/**
59 	 *
60 	 * Params:
61 	 *     api = an API
62 	 * Return: an array of tags as strings.
63 	 *
64 	 * Since: 1.2
65 	 */
66 	public static string[] apiTypeGetTags(GType api)
67 	{
68 		return Str.toStringArray(gst_meta_api_type_get_tags(api));
69 	}
70 
71 	/**
72 	 * Check if @api was registered with @tag.
73 	 *
74 	 * Params:
75 	 *     api = an API
76 	 *     tag = the tag to check
77 	 *
78 	 * Return: %TRUE if @api was registered with @tag.
79 	 */
80 	public static bool apiTypeHasTag(GType api, GQuark tag)
81 	{
82 		return gst_meta_api_type_has_tag(api, tag) != 0;
83 	}
84 
85 	/**
86 	 * Register and return a GType for the @api and associate it with
87 	 * @tags.
88 	 *
89 	 * Params:
90 	 *     api = an API to register
91 	 *     tags = tags for @api
92 	 *
93 	 * Return: a unique GType for @api.
94 	 */
95 	public static GType apiTypeRegister(string api, string[] tags)
96 	{
97 		return gst_meta_api_type_register(Str.toStringz(api), Str.toStringzArray(tags));
98 	}
99 
100 	/**
101 	 * Lookup a previously registered meta info structure by its implementation name
102 	 * @impl.
103 	 *
104 	 * Params:
105 	 *     impl = the name
106 	 *
107 	 * Return: a #GstMetaInfo with @impl, or
108 	 *     %NULL when no such metainfo exists.
109 	 */
110 	public static GstMetaInfo* getInfo(string impl)
111 	{
112 		return gst_meta_get_info(Str.toStringz(impl));
113 	}
114 
115 	/**
116 	 * Register a new #GstMeta implementation.
117 	 *
118 	 * The same @info can be retrieved later with gst_meta_get_info() by using
119 	 * @impl as the key.
120 	 *
121 	 * Params:
122 	 *     api = the type of the #GstMeta API
123 	 *     impl = the name of the #GstMeta implementation
124 	 *     size = the size of the #GstMeta structure
125 	 *     initFunc = a #GstMetaInitFunction
126 	 *     freeFunc = a #GstMetaFreeFunction
127 	 *     transformFunc = a #GstMetaTransformFunction
128 	 *
129 	 * Return: a #GstMetaInfo that can be used to access metadata.
130 	 */
131 	public static GstMetaInfo* register(GType api, string impl, size_t size, GstMetaInitFunction initFunc, GstMetaFreeFunction freeFunc, GstMetaTransformFunction transformFunc)
132 	{
133 		return gst_meta_register(api, Str.toStringz(impl), size, initFunc, freeFunc, transformFunc);
134 	}
135 }