whitespace fixes
[platform/upstream/gstreamer.git] / gst / gsttypefind.h
1 /* GStreamer
2  * Copyright (C) 2003 Benjamin Otte <in7y118@public.uni-hamburg.de>
3  *
4  * gsttypefind.h: typefinding subsystem
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public
17  * License along with this library; if not, write to the
18  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19  * Boston, MA 02111-1307, USA.
20  */
21
22
23 #ifndef __GST_TYPE_FIND_H__
24 #define __GST_TYPE_FIND_H__
25
26 #include <gst/gstcaps.h>
27 #include <gst/gstplugin.h>
28 #include <gst/gstpluginfeature.h>
29
30 G_BEGIN_DECLS
31
32 typedef struct _GstTypeFind GstTypeFind;
33
34 typedef void (* GstTypeFindFunction) (GstTypeFind *find, gpointer data);
35
36 typedef enum {
37   GST_TYPE_FIND_MINIMUM = 1,
38   GST_TYPE_FIND_POSSIBLE = 50,
39   GST_TYPE_FIND_LIKELY = 80,
40   GST_TYPE_FIND_NEARLY_CERTAIN = 99,
41   GST_TYPE_FIND_MAXIMUM = 100
42 } GstTypeFindProbability;
43
44 /**
45  * GstTypeFind:
46  *
47  * Object that stores typefind callbacks.
48  */
49 struct _GstTypeFind {
50   /* private to the caller of the typefind function */
51   guint8 *      (* peek)        (gpointer               data,
52                                  gint64                 offset,
53                                  guint                  size);
54   void          (* suggest)     (gpointer               data,
55                                  guint                  probability,
56                                  const GstCaps *        caps);
57
58   gpointer      data;
59
60   /* optional */
61   guint64       (* get_length)  (gpointer               data);
62
63   /* <private> */
64   gpointer _gst_reserved[GST_PADDING];
65 };
66
67 /* typefind function interface */
68 guint8 *        gst_type_find_peek                      (GstTypeFind *          find,
69                                                          gint64                 offset,
70                                                          guint                  size);
71 void            gst_type_find_suggest                   (GstTypeFind *          find,
72                                                          guint                  probability,
73                                                          const GstCaps *        caps);
74 guint64         gst_type_find_get_length                (GstTypeFind *          find);
75
76 /* registration interface */
77 gboolean        gst_type_find_register                  (GstPlugin *            plugin,
78                                                          const gchar *          name,
79                                                          guint                  rank,
80                                                          GstTypeFindFunction    func,
81                                                          gchar **               extensions,
82                                                          const GstCaps *        possible_caps,
83                                                          gpointer               data);
84
85 G_END_DECLS
86
87 #endif /* __GST_TYPE_FIND_H__ */