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