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
50 * - GstPlugin* -> Plugin
51 * - GstTypeFind* -> TypeFind
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
;
70 * The following functions allow you to detect the media type of an unknown
72 * Last reviewed on 2005-11-09 (0.9.4)
77 /** the main Gtk struct */
78 protected GstTypeFind
* gstTypeFind
;
81 public GstTypeFind
* getTypeFindStruct()
87 /** the main Gtk struct as a void* */
88 protected void* getStruct()
90 return cast(void*)gstTypeFind
;
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.
114 * The GstTypeFind object the function was called with
118 * The number of bytes to return
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
132 * It is up to the caller of the GstTypeFindFunction to interpret these values.
134 * The GstTypeFind object the function was called with
136 * The probability in percent that the suggestion is right
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.
149 * The GstTypeFind the function was called with
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.
166 * The name for registering
168 * The rank (or importance) of this typefind function
170 * The GstTypeFindFunction to use
172 * Optional extensions that could belong to this type
174 * Optionally the caps that could be returned when typefinding
177 * Optional user data. This user data must be available until the plugin
180 * a GDestroyNotify that will be called on data when the plugin
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
);