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 
64 private import glib.Str;
65 private import gstreamer.Iterator;
66 
67 
68 
69 
70 /**
71  */
72 
73 /**
74  * Get a printable name for the given format. Do not modify or free.
75  * Params:
76  * format = a GstFormat
77  * Returns: a reference to the static name of the format or NULL if the format is unknown.
78  */
79 public static string getName(GstFormat format)
80 {
81 	// const gchar * gst_format_get_name (GstFormat format);
82 	return Str.toString(gst_format_get_name(format));
83 }
84 
85 /**
86  * Get the unique quark for the given format.
87  * Params:
88  * format = a GstFormat
89  * Returns: the quark associated with the format or 0 if the format is unknown.
90  */
91 public static GQuark toQuark(GstFormat format)
92 {
93 	// GQuark gst_format_to_quark (GstFormat format);
94 	return gst_format_to_quark(format);
95 }
96 
97 /**
98  * Create a new GstFormat based on the nick or return an
99  * already registered format with that nick.
100  * Params:
101  * nick = The nick of the new format
102  * description = The description of the new format
103  * Returns: A new GstFormat or an already registered format with the same nick. MT safe.
104  */
105 public static GstFormat register(string nick, string description)
106 {
107 	// GstFormat gst_format_register (const gchar *nick,  const gchar *description);
108 	return gst_format_register(Str.toStringz(nick), Str.toStringz(description));
109 }
110 
111 /**
112  * Return the format registered with the given nick.
113  * Params:
114  * nick = The nick of the format
115  * Returns: The format with nick or GST_FORMAT_UNDEFINED if the format was not registered.
116  */
117 public static GstFormat getByNick(string nick)
118 {
119 	// GstFormat gst_format_get_by_nick (const gchar *nick);
120 	return gst_format_get_by_nick(Str.toStringz(nick));
121 }
122 
123 /**
124  * See if the given format is inside the format array.
125  * Params:
126  * formats = The format array to search. [array zero-terminated=1]
127  * format = the format to find
128  * Returns: TRUE if the format is found inside the array
129  */
130 public static int gstFormatsContains(GstFormat[] formats, GstFormat format)
131 {
132 	// gboolean gst_formats_contains (const GstFormat *formats,  GstFormat format);
133 	return gst_formats_contains(formats.ptr, format);
134 }
135 
136 /**
137  * Get details about the given format.
138  * Params:
139  * format = The format to get details of
140  * Returns: The GstFormatDefinition for format or NULL on failure. MT safe.
141  */
142 public static GstFormatDefinition* getDetails(GstFormat format)
143 {
144 	// const GstFormatDefinition * gst_format_get_details (GstFormat format);
145 	return gst_format_get_details(format);
146 }
147 
148 /**
149  * Iterate all the registered formats. The format definition is read
150  * only.
151  * Returns: a GstIterator of GstFormatDefinition. [transfer full]
152  */
153 public static Iterator iterateDefinitions()
154 {
155 	// GstIterator * gst_format_iterate_definitions (void);
156 	auto p = gst_format_iterate_definitions();
157 	
158 	if(p is null)
159 	{
160 		return null;
161 	}
162 	
163 	return ObjectG.getDObject!(Iterator)(cast(GstIterator*) p);
164 }
165