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 = GstTypeFindFactory.html 27 * outPack = gstreamer 28 * outFile = TypeFindFactory 29 * strct = GstTypeFindFactory 30 * realStrct= 31 * ctorStrct= 32 * clss = TypeFindFactory 33 * interf = 34 * class Code: No 35 * interface Code: No 36 * template for: 37 * extend = 38 * implements: 39 * prefixes: 40 * - gst_type_find_factory_ 41 * omit structs: 42 * omit prefixes: 43 * omit code: 44 * omit signals: 45 * imports: 46 * - glib.Str 47 * - glib.ListG 48 * - gstreamer.Caps 49 * - gstreamer.TypeFind 50 * structWrap: 51 * - GList* -> ListG 52 * - GstCaps* -> Caps 53 * - GstTypeFind* -> TypeFind 54 * module aliases: 55 * local aliases: 56 * overrides: 57 */ 58 59 module gstreamer.TypeFindFactory; 60 61 public import gstreamerc.gstreamertypes; 62 63 private import gstreamerc.gstreamer; 64 private import glib.ConstructionException; 65 private import gobject.ObjectG; 66 67 68 private import glib.Str; 69 private import glib.ListG; 70 private import gstreamer.Caps; 71 private import gstreamer.TypeFind; 72 73 74 75 private import gstreamer.PluginFeature; 76 77 /** 78 * These functions allow querying informations about registered typefind 79 * functions. How to create and register these functions is described in 80 * the section 81 * "Writing typefind functions". 82 * 83 * $(DDOC_COMMENT example) 84 * 85 * The above example shows how to write a very simple typefinder that 86 * identifies the given data. You can get quite a bit more complicated than 87 * that though. 88 * 89 * Last reviewed on 2005-11-09 (0.9.4) 90 */ 91 public class TypeFindFactory : PluginFeature 92 { 93 94 /** the main Gtk struct */ 95 protected GstTypeFindFactory* gstTypeFindFactory; 96 97 98 public GstTypeFindFactory* getTypeFindFactoryStruct() 99 { 100 return gstTypeFindFactory; 101 } 102 103 104 /** the main Gtk struct as a void* */ 105 protected override void* getStruct() 106 { 107 return cast(void*)gstTypeFindFactory; 108 } 109 110 /** 111 * Sets our main struct and passes it to the parent class 112 */ 113 public this (GstTypeFindFactory* gstTypeFindFactory) 114 { 115 super(cast(GstPluginFeature*)gstTypeFindFactory); 116 this.gstTypeFindFactory = gstTypeFindFactory; 117 } 118 119 protected override void setStruct(GObject* obj) 120 { 121 super.setStruct(obj); 122 gstTypeFindFactory = cast(GstTypeFindFactory*)obj; 123 } 124 125 /** 126 */ 127 128 /** 129 * Gets the list of all registered typefind factories. You must free the 130 * list using gst_plugin_feature_list_free(). 131 * The returned factories are sorted by highest rank first, and then by 132 * factory name. 133 * Free-function: gst_plugin_feature_list_free 134 * Returns: the list of all registered GstTypeFindFactory. [transfer full][element-type Gst.TypeFindFactory] 135 */ 136 public static ListG getList() 137 { 138 // GList * gst_type_find_factory_get_list (void); 139 auto p = gst_type_find_factory_get_list(); 140 141 if(p is null) 142 { 143 return null; 144 } 145 146 return ObjectG.getDObject!(ListG)(cast(GList*) p); 147 } 148 149 /** 150 * Gets the extensions associated with a GstTypeFindFactory. The returned 151 * array should not be changed. If you need to change stuff in it, you should 152 * copy it using g_strdupv(). This function may return NULL to indicate 153 * a 0-length list. 154 * Returns: a NULL-terminated array of extensions associated with this factory. [transfer none][array zero-terminated=1][element-type utf8] 155 */ 156 public string[] getExtensions() 157 { 158 // const gchar * const * gst_type_find_factory_get_extensions (GstTypeFindFactory *factory); 159 return Str.toStringArray(gst_type_find_factory_get_extensions(gstTypeFindFactory)); 160 } 161 162 /** 163 * Gets the GstCaps associated with a typefind factory. 164 * Returns: the GstCaps associated with this factory. [transfer none] 165 */ 166 public Caps getCaps() 167 { 168 // GstCaps * gst_type_find_factory_get_caps (GstTypeFindFactory *factory); 169 auto p = gst_type_find_factory_get_caps(gstTypeFindFactory); 170 171 if(p is null) 172 { 173 return null; 174 } 175 176 return ObjectG.getDObject!(Caps)(cast(GstCaps*) p); 177 } 178 179 /** 180 * Check whether the factory has a typefind function. Typefind factories 181 * without typefind functions are a last-effort fallback mechanism to 182 * e.g. assume a certain media type based on the file extension. 183 * Returns: TRUE if the factory has a typefind functions set, otherwise FALSE 184 */ 185 public int hasFunction() 186 { 187 // gboolean gst_type_find_factory_has_function (GstTypeFindFactory *factory); 188 return gst_type_find_factory_has_function(gstTypeFindFactory); 189 } 190 191 /** 192 * Calls the GstTypeFindFunction associated with this factory. 193 * Params: 194 * find = a properly setup GstTypeFind entry. The get_data 195 * and suggest_type members must be set. [transfer none] 196 */ 197 public void callFunction(TypeFind find) 198 { 199 // void gst_type_find_factory_call_function (GstTypeFindFactory *factory, GstTypeFind *find); 200 gst_type_find_factory_call_function(gstTypeFindFactory, (find is null) ? null : find.getTypeFindStruct()); 201 } 202 }