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 * Params: 59 * api = an API 60 * Return: an array of tags as strings. 61 * 62 * Since: 1.2 63 */ 64 public static string[] apiTypeGetTags(GType api) 65 { 66 return Str.toStringArray(gst_meta_api_type_get_tags(api)); 67 } 68 69 /** 70 * Check if @api was registered with @tag. 71 * 72 * Params: 73 * api = an API 74 * tag = the tag to check 75 * 76 * Return: %TRUE if @api was registered with @tag. 77 */ 78 public static bool apiTypeHasTag(GType api, GQuark tag) 79 { 80 return gst_meta_api_type_has_tag(api, tag) != 0; 81 } 82 83 /** 84 * Register and return a GType for the @api and associate it with 85 * @tags. 86 * 87 * Params: 88 * api = an API to register 89 * tags = tags for @api 90 * 91 * Return: a unique GType for @api. 92 */ 93 public static GType apiTypeRegister(string api, string[] tags) 94 { 95 return gst_meta_api_type_register(Str.toStringz(api), Str.toStringzArray(tags)); 96 } 97 98 /** 99 * Lookup a previously registered meta info structure by its implementation name 100 * @impl. 101 * 102 * Params: 103 * impl = the name 104 * 105 * Return: a #GstMetaInfo with @impl, or 106 * %NULL when no such metainfo exists. 107 */ 108 public static GstMetaInfo* getInfo(string impl) 109 { 110 return gst_meta_get_info(Str.toStringz(impl)); 111 } 112 113 /** 114 * Register a new #GstMeta implementation. 115 * 116 * The same @info can be retrieved later with gst_meta_get_info() by using 117 * @impl as the key. 118 * 119 * Params: 120 * api = the type of the #GstMeta API 121 * impl = the name of the #GstMeta implementation 122 * size = the size of the #GstMeta structure 123 * initFunc = a #GstMetaInitFunction 124 * freeFunc = a #GstMetaFreeFunction 125 * transformFunc = a #GstMetaTransformFunction 126 * 127 * Return: a #GstMetaInfo that can be used to access metadata. 128 */ 129 public static GstMetaInfo* register(GType api, string impl, size_t size, GstMetaInitFunction initFunc, GstMetaFreeFunction freeFunc, GstMetaTransformFunction transformFunc) 130 { 131 return gst_meta_register(api, Str.toStringz(impl), size, initFunc, freeFunc, transformFunc); 132 } 133 }