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 = GstPluginFeature.html 27 * outPack = gstreamer 28 * outFile = PluginFeature 29 * strct = GstPluginFeature 30 * realStrct= 31 * ctorStrct= 32 * clss = PluginFeature 33 * interf = 34 * class Code: No 35 * interface Code: No 36 * template for: 37 * extend = 38 * implements: 39 * prefixes: 40 * - gst_plugin_feature_ 41 * omit structs: 42 * omit prefixes: 43 * omit code: 44 * omit signals: 45 * imports: 46 * - glib.Str 47 * - glib.ListG 48 * - gstreamer.Plugin 49 * structWrap: 50 * - GList* -> ListG 51 * - GstPlugin* -> Plugin 52 * - GstPluginFeature* -> PluginFeature 53 * module aliases: 54 * local aliases: 55 * - setName -> setFeatureName 56 * overrides: 57 * - getName 58 */ 59 60 module gstreamer.PluginFeature; 61 62 public import gstreamerc.gstreamertypes; 63 64 private import gstreamerc.gstreamer; 65 private import glib.ConstructionException; 66 private import gobject.ObjectG; 67 68 private import glib.Str; 69 private import glib.ListG; 70 private import gstreamer.Plugin; 71 72 73 private import gstreamer.ObjectGst; 74 75 /** 76 * This is a base class for anything that can be added to a GstPlugin. 77 */ 78 public class PluginFeature : ObjectGst 79 { 80 81 /** the main Gtk struct */ 82 protected GstPluginFeature* gstPluginFeature; 83 84 85 /** Get the main Gtk struct */ 86 public GstPluginFeature* getPluginFeatureStruct() 87 { 88 return gstPluginFeature; 89 } 90 91 92 /** the main Gtk struct as a void* */ 93 protected override void* getStruct() 94 { 95 return cast(void*)gstPluginFeature; 96 } 97 98 /** 99 * Sets our main struct and passes it to the parent class 100 */ 101 public this (GstPluginFeature* gstPluginFeature) 102 { 103 super(cast(GstObject*)gstPluginFeature); 104 this.gstPluginFeature = gstPluginFeature; 105 } 106 107 protected override void setStruct(GObject* obj) 108 { 109 super.setStruct(obj); 110 gstPluginFeature = cast(GstPluginFeature*)obj; 111 } 112 113 /** 114 */ 115 116 /** 117 * Specifies a rank for a plugin feature, so that autoplugging uses 118 * the most appropriate feature. 119 * Params: 120 * rank = rank value - higher number means more priority rank 121 */ 122 public void setRank(uint rank) 123 { 124 // void gst_plugin_feature_set_rank (GstPluginFeature *feature, guint rank); 125 gst_plugin_feature_set_rank(gstPluginFeature, rank); 126 } 127 128 /** 129 * Gets the rank of a plugin feature. 130 * Returns: The rank of the feature 131 */ 132 public uint getRank() 133 { 134 // guint gst_plugin_feature_get_rank (GstPluginFeature *feature); 135 return gst_plugin_feature_get_rank(gstPluginFeature); 136 } 137 138 /** 139 * Get the plugin that provides this feature. 140 * Returns: the plugin that provides this feature, or NULL. Unref with gst_object_unref() when no longer needed. [transfer full] 141 */ 142 public Plugin getPlugin() 143 { 144 // GstPlugin * gst_plugin_feature_get_plugin (GstPluginFeature *feature); 145 auto p = gst_plugin_feature_get_plugin(gstPluginFeature); 146 147 if(p is null) 148 { 149 return null; 150 } 151 152 return ObjectG.getDObject!(Plugin)(cast(GstPlugin*) p); 153 } 154 155 /** 156 * Get the name of the plugin that provides this feature. 157 * Since 1.2.0 158 * Returns: the name of the plugin that provides this feature, or NULL if the feature is not associated with a plugin. 159 */ 160 public string getPluginName() 161 { 162 // const gchar * gst_plugin_feature_get_plugin_name (GstPluginFeature *feature); 163 return Str.toString(gst_plugin_feature_get_plugin_name(gstPluginFeature)); 164 } 165 166 /** 167 * Loads the plugin containing feature if it's not already loaded. feature is 168 * unaffected; use the return value instead. 169 * Returns: a reference to the loaded feature, or NULL on error. [transfer full] 170 */ 171 public PluginFeature load() 172 { 173 // GstPluginFeature * gst_plugin_feature_load (GstPluginFeature *feature); 174 auto p = gst_plugin_feature_load(gstPluginFeature); 175 176 if(p is null) 177 { 178 return null; 179 } 180 181 return ObjectG.getDObject!(PluginFeature)(cast(GstPluginFeature*) p); 182 } 183 184 /** 185 * Copies the list of features. Caller should call gst_plugin_feature_list_free 186 * when done with the list. 187 * Params: 188 * list = list 189 * of GstPluginFeature. [transfer none][element-type Gst.PluginFeature] 190 * Returns: a copy of list, with each feature's reference count incremented. [transfer full][element-type Gst.PluginFeature] 191 */ 192 public static ListG listCopy(ListG list) 193 { 194 // GList * gst_plugin_feature_list_copy (GList *list); 195 auto p = gst_plugin_feature_list_copy((list is null) ? null : list.getListGStruct()); 196 197 if(p is null) 198 { 199 return null; 200 } 201 202 return ObjectG.getDObject!(ListG)(cast(GList*) p); 203 } 204 205 /** 206 * Unrefs each member of list, then frees the list. 207 * Params: 208 * list = list 209 * of GstPluginFeature. [transfer full][element-type Gst.PluginFeature] 210 */ 211 public static void listFree(ListG list) 212 { 213 // void gst_plugin_feature_list_free (GList *list); 214 gst_plugin_feature_list_free((list is null) ? null : list.getListGStruct()); 215 } 216 217 /** 218 * Checks whether the given plugin feature is at least 219 * the required version 220 * Params: 221 * minMajor = minimum required major version 222 * minMinor = minimum required minor version 223 * minMicro = minimum required micro version 224 * Returns: TRUE if the plugin feature has at least the required version, otherwise FALSE. 225 */ 226 public int checkVersion(uint minMajor, uint minMinor, uint minMicro) 227 { 228 // gboolean gst_plugin_feature_check_version (GstPluginFeature *feature, guint min_major, guint min_minor, guint min_micro); 229 return gst_plugin_feature_check_version(gstPluginFeature, minMajor, minMinor, minMicro); 230 } 231 232 /** 233 * Compares the two given GstPluginFeature instances. This function can be 234 * used as a GCompareFunc when sorting by rank and then by name. 235 * Params: 236 * p1 = a GstPluginFeature 237 * p2 = a GstPluginFeature 238 * Returns: negative value if the rank of p1 > the rank of p2 or the ranks are equal but the name of p1 comes before the name of p2; zero if the rank and names are equal; positive value if the rank of p1 < the rank of p2 or the ranks are equal but the name of p2 comes before the name of p1 239 */ 240 public static int rankCompareFunc(void* p1, void* p2) 241 { 242 // gint gst_plugin_feature_rank_compare_func (gconstpointer p1, gconstpointer p2); 243 return gst_plugin_feature_rank_compare_func(p1, p2); 244 } 245 }