1 <!-- ##### SECTION Title ##### -->
4 <!-- ##### SECTION Short_Description ##### -->
5 information about registered typefind functions
7 <!-- ##### SECTION Long_Description ##### -->
9 These functions allow querying informations about registered typefind
10 functions. How to create and register these functions is described in
11 the section <link linkend="gstreamer-Writing-typefind-functions">
12 "Writing typefind functions"</link>.
15 <title>how to write a simple typefinder</title>
17 /* FIXME: compile this? ;) */
25 my_peek (gpointer data, gint64 offset, guint size)
27 MyTypeFind *find = (MyTypeFind *) data;
28 if (offset >= 0 && offset + size <= find->size) {
29 return find->data + offset;
34 my_suggest (gpointer data, guint probability, GstCaps *caps)
36 MyTypeFind *find = (MyTypeFind *) data;
37 if (probability > find->probability) {
38 find->probability = probability;
39 gst_caps_replace (&find->caps, caps);
43 find_type (guint8 *data, guint size)
45 GList *walk, *type_list;
46 MyTypeFind find = {data, size, 0, NULL};
47 GstTypeFind gst_find = {my_peek, my_suggest, &find, };
49 walk = type_list = gst_type_find_factory_get_list ();
51 GstTypeFindFactory *factory = GST_TYPE_FIND_FACTORY (walk->data);
52 walk = g_list_next (walk)
53 gst_type_find_factory_call_function (factory, &gst_find);
55 g_list_free (type_list);
61 The above example shows how to write a very simple typefinder that identifies
62 the given data. You can get quite a bit more complicated than that though.
65 <!-- ##### SECTION See_Also ##### -->
67 <link linkend="gstreamer-Writing-typefind-functions">Writing typefind functions</link>
70 <!-- ##### SECTION Stability_Level ##### -->
73 <!-- ##### STRUCT GstTypeFindFactory ##### -->
75 Object that stores information about a typefind function
79 <!-- ##### FUNCTION gst_type_find_factory_get_list ##### -->
87 <!-- ##### FUNCTION gst_type_find_factory_get_extensions ##### -->
96 <!-- ##### FUNCTION gst_type_find_factory_get_caps ##### -->
105 <!-- ##### FUNCTION gst_type_find_factory_call_function ##### -->