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 62 private import glib.Str; 63 64 65 66 67 /** 68 * The GstMeta structure should be included as the first member of a GstBuffer 69 * metadata structure. The structure defines the API of the metadata and should 70 * be accessible to all elements using the metadata. 71 * 72 * A metadata API is registered with gst_meta_api_type_register() which takes a 73 * name for the metadata API and some tags associated with the metadata. 74 * With gst_meta_api_type_has_tag() one can check if a certain metadata API 75 * contains a given tag. 76 * 77 * Multiple implementations of a metadata API can be registered. 78 * To implement a metadata API, gst_meta_register() should be used. This 79 * function takes all parameters needed to create, free and transform metadata 80 * along with the size of the metadata. The function returns a GstMetaInfo 81 * structure that contains the information for the implementation of the API. 82 * 83 * A specific implementation can be retrieved by name with gst_meta_get_info(). 84 * 85 * See GstBuffer for how the metadata can be added, retrieved and removed from 86 * buffers. 87 * 88 * Last reviewed on 2012-03-28 (0.11.3) 89 */ 90 public class Meta 91 { 92 93 /** 94 */ 95 96 /** 97 * Register and return a GType for the api and associate it with 98 * tags. 99 * Params: 100 * api = an API to register 101 * tags = tags for api 102 * Returns: a unique GType for api. 103 */ 104 public static GType apiTypeRegister(string api, string[] tags) 105 { 106 // GType gst_meta_api_type_register (const gchar *api, const gchar **tags); 107 return gst_meta_api_type_register(Str.toStringz(api), Str.toStringzArray(tags)); 108 } 109 110 /** 111 * Check if api was registered with tag. 112 * Params: 113 * api = an API 114 * tag = the tag to check 115 * Returns: TRUE if api was registered with tag. 116 */ 117 public static int apiTypeHasTag(GType api, GQuark tag) 118 { 119 // gboolean gst_meta_api_type_has_tag (GType api, GQuark tag); 120 return gst_meta_api_type_has_tag(api, tag); 121 } 122 123 /** 124 * Register a new GstMeta implementation. 125 * The same info can be retrieved later with gst_meta_get_info() by using 126 * impl as the key. 127 * Params: 128 * api = the type of the GstMeta API 129 * impl = the name of the GstMeta implementation 130 * size = the size of the GstMeta structure 131 * initFunc = (scope async) a GstMetaInitFunction 132 * freeFunc = (scope async) a GstMetaFreeFunction 133 * transformFunc = (scope async) a GstMetaTransformFunction 134 * Returns: a GstMetaInfo that can be used to access metadata. [transfer none] 135 */ 136 public static GstMetaInfo* register(GType api, string impl, gsize size, GstMetaInitFunction initFunc, GstMetaFreeFunction freeFunc, GstMetaTransformFunction transformFunc) 137 { 138 // const GstMetaInfo * gst_meta_register (GType api, const gchar *impl, gsize size, GstMetaInitFunction init_func, GstMetaFreeFunction free_func, GstMetaTransformFunction transform_func); 139 return gst_meta_register(api, Str.toStringz(impl), size, initFunc, freeFunc, transformFunc); 140 } 141 142 /** 143 * Lookup a previously registered meta info structure by its implementation name 144 * impl. 145 * Params: 146 * impl = the name 147 * Returns: a GstMetaInfo with impl, or NULL when no such metainfo exists. [transfer none] 148 */ 149 public static GstMetaInfo* getInfo(string impl) 150 { 151 // const GstMetaInfo * gst_meta_get_info (const gchar *impl); 152 return gst_meta_get_info(Str.toStringz(impl)); 153 } 154 }