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-GstFormat.html 27 * outPack = gstreamer 28 * outFile = Format 29 * strct = 30 * realStrct= 31 * ctorStrct= 32 * clss = 33 * interf = 34 * class Code: No 35 * interface Code: No 36 * template for: 37 * extend = 38 * implements: 39 * prefixes: 40 * - gst_format_ 41 * omit structs: 42 * omit prefixes: 43 * omit code: 44 * omit signals: 45 * imports: 46 * - glib.Str 47 * - gstreamer.Iterator 48 * structWrap: 49 * - GstIterator* -> Iterator 50 * module aliases: 51 * local aliases: 52 * overrides: 53 */ 54 55 module gstreamer.Format; 56 57 public import gstreamerc.gstreamertypes; 58 59 private import gstreamerc.gstreamer; 60 private import glib.ConstructionException; 61 private import gobject.ObjectG; 62 63 private import glib.Str; 64 private import gstreamer.Iterator; 65 66 67 68 /** 69 */ 70 71 /** 72 * Get a printable name for the given format. Do not modify or free. 73 * Params: 74 * format = a GstFormat 75 * Returns: a reference to the static name of the format or NULL if the format is unknown. 76 */ 77 public static string getName(GstFormat format) 78 { 79 // const gchar * gst_format_get_name (GstFormat format); 80 return Str.toString(gst_format_get_name(format)); 81 } 82 83 /** 84 * Get the unique quark for the given format. 85 * Params: 86 * format = a GstFormat 87 * Returns: the quark associated with the format or 0 if the format is unknown. 88 */ 89 public static GQuark toQuark(GstFormat format) 90 { 91 // GQuark gst_format_to_quark (GstFormat format); 92 return gst_format_to_quark(format); 93 } 94 95 /** 96 * Create a new GstFormat based on the nick or return an 97 * already registered format with that nick. 98 * Params: 99 * nick = The nick of the new format 100 * description = The description of the new format 101 * Returns: A new GstFormat or an already registered format with the same nick. MT safe. 102 */ 103 public static GstFormat register(string nick, string description) 104 { 105 // GstFormat gst_format_register (const gchar *nick, const gchar *description); 106 return gst_format_register(Str.toStringz(nick), Str.toStringz(description)); 107 } 108 109 /** 110 * Return the format registered with the given nick. 111 * Params: 112 * nick = The nick of the format 113 * Returns: The format with nick or GST_FORMAT_UNDEFINED if the format was not registered. 114 */ 115 public static GstFormat getByNick(string nick) 116 { 117 // GstFormat gst_format_get_by_nick (const gchar *nick); 118 return gst_format_get_by_nick(Str.toStringz(nick)); 119 } 120 121 /** 122 * See if the given format is inside the format array. 123 * Params: 124 * formats = The format array to search. [array zero-terminated=1] 125 * format = the format to find 126 * Returns: TRUE if the format is found inside the array 127 */ 128 public static int gstFormatsContains(GstFormat[] formats, GstFormat format) 129 { 130 // gboolean gst_formats_contains (const GstFormat *formats, GstFormat format); 131 return gst_formats_contains(formats.ptr, format); 132 } 133 134 /** 135 * Get details about the given format. 136 * Params: 137 * format = The format to get details of 138 * Returns: The GstFormatDefinition for format or NULL on failure. MT safe. 139 */ 140 public static GstFormatDefinition* getDetails(GstFormat format) 141 { 142 // const GstFormatDefinition * gst_format_get_details (GstFormat format); 143 return gst_format_get_details(format); 144 } 145 146 /** 147 * Iterate all the registered formats. The format definition is read 148 * only. 149 * Returns: a GstIterator of GstFormatDefinition. [transfer full] 150 */ 151 public static Iterator iterateDefinitions() 152 { 153 // GstIterator * gst_format_iterate_definitions (void); 154 auto p = gst_format_iterate_definitions(); 155 156 if(p is null) 157 { 158 return null; 159 } 160 161 return ObjectG.getDObject!(Iterator)(cast(GstIterator*) p); 162 } 163