alternative to assert
[gtkD.git] / gtkD / srcgstreamer / gstreamer / TypeFind.d
blobd2caf49cdbe44860a26166b3b59957c0d4efb867
1 /*
2 * This file is part of gtkD.
4 * gtkD is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2.1 of the License, or
7 * (at your option) any later version.
9 * gtkD is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with gtkD; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // generated automatically - do not change
20 // find conversion definition on APILookup.txt
21 // implement new conversion functionalities on the wrap.utils pakage
24 * Conversion parameters:
25 * inFile = gstreamer-GstTypeFind.html
26 * outPack = gstreamer
27 * outFile = TypeFind
28 * strct = GstTypeFind
29 * realStrct=
30 * ctorStrct=
31 * clss = TypeFind
32 * interf =
33 * class Code: No
34 * interface Code: No
35 * template for:
36 * extend =
37 * implements:
38 * prefixes:
39 * - gst_type_find_
40 * - gst_
41 * omit structs:
42 * omit prefixes:
43 * omit code:
44 * imports:
45 * - glib.Str
46 * - gstreamer.Caps
47 * - gstreamer.Plugin
48 * structWrap:
49 * - GstCaps* -> Caps
50 * - GstPlugin* -> Plugin
51 * - GstTypeFind* -> TypeFind
52 * module aliases:
53 * local aliases:
56 module gstreamer.TypeFind;
58 private import gstreamerc.gstreamertypes;
60 private import gstreamerc.gstreamer;
62 private import glib.Str;
63 private import gstreamer.Caps;
64 private import gstreamer.Plugin;
68 /**
69 * Description
70 * The following functions allow you to detect the media type of an unknown
71 * stream.
72 * Last reviewed on 2005-11-09 (0.9.4)
74 public class TypeFind
77 /** the main Gtk struct */
78 protected GstTypeFind* gstTypeFind;
81 public GstTypeFind* getTypeFindStruct()
83 return gstTypeFind;
87 /** the main Gtk struct as a void* */
88 protected void* getStruct()
90 return cast(void*)gstTypeFind;
93 /**
94 * Sets our main struct and passes it to the parent class
96 public this (GstTypeFind* gstTypeFind)
98 this.gstTypeFind = gstTypeFind;
108 * Returns the size bytes of the stream to identify beginning at offset. If
109 * offset is a positive number, the offset is relative to the beginning of the
110 * stream, if offset is a negative number the offset is relative to the end of
111 * the stream. The returned memory is valid until the typefinding function
112 * returns and must not be freed.
113 * find:
114 * The GstTypeFind object the function was called with
115 * offset:
116 * The offset
117 * size:
118 * The number of bytes to return
119 * Returns:
120 * the requested data, or NULL if that data is not available.
122 public byte* peek(long offset, uint size)
124 // guint8* gst_type_find_peek (GstTypeFind *find, gint64 offset, guint size);
125 return gst_type_find_peek(gstTypeFind, offset, size);
129 * If a GstTypeFindFunction calls this function it suggests the caps with the
130 * given probability. A GstTypeFindFunction may supply different suggestions
131 * in one call.
132 * It is up to the caller of the GstTypeFindFunction to interpret these values.
133 * find:
134 * The GstTypeFind object the function was called with
135 * probability:
136 * The probability in percent that the suggestion is right
137 * caps:
138 * The fixed GstCaps to suggest
140 public void suggest(uint probability, Caps caps)
142 // void gst_type_find_suggest (GstTypeFind *find, guint probability, const GstCaps *caps);
143 gst_type_find_suggest(gstTypeFind, probability, (caps is null) ? null : caps.getCapsStruct());
147 * Get the length of the data stream.
148 * find:
149 * The GstTypeFind the function was called with
150 * Returns:
151 * The length of the data stream, or 0 if it is not available.
153 public ulong getLength()
155 // guint64 gst_type_find_get_length (GstTypeFind *find);
156 return gst_type_find_get_length(gstTypeFind);
160 * Registers a new typefind function to be used for typefinding. After
161 * registering this function will be available for typefinding.
162 * This function is typically called during an element's plugin initialization.
163 * plugin:
164 * A GstPlugin.
165 * name:
166 * The name for registering
167 * rank:
168 * The rank (or importance) of this typefind function
169 * func:
170 * The GstTypeFindFunction to use
171 * extensions:
172 * Optional extensions that could belong to this type
173 * possible_caps:
174 * Optionally the caps that could be returned when typefinding
175 * succeeds
176 * data:
177 * Optional user data. This user data must be available until the plugin
178 * is unloaded.
179 * data_notify:
180 * a GDestroyNotify that will be called on data when the plugin
181 * is unloaded.
182 * Returns:
183 * TRUE on success, FALSE otherwise
185 public static int register(Plugin plugin, char[] name, uint rank, GstTypeFindFunction func, char** extensions, Caps possibleCaps, void* data, GDestroyNotify dataNotify)
187 // gboolean gst_type_find_register (GstPlugin *plugin, const gchar *name, guint rank, GstTypeFindFunction func, gchar **extensions, const GstCaps *possible_caps, gpointer data, GDestroyNotify data_notify);
188 return gst_type_find_register((plugin is null) ? null : plugin.getPluginStruct(), Str.toStringz(name), rank, func, extensions, (possibleCaps is null) ? null : possibleCaps.getCapsStruct(), data, dataNotify);