]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/gstreamer0-10.git/blob - gst/gsttype.h
initial checkin
[glsdk/gstreamer0-10.git] / gst / gsttype.h
1 /* Gnome-Streamer
2  * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library 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 GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
21 #ifndef __GST_TYPE_H__
22 #define __GST_TYPE_H__
25 #include <gst/gstbuffer.h>
26 #include <gst/gstelement.h>
29 /* type of function used to check a stream for equality with type */
30 typedef gboolean (*GstTypeFindFunc) (GstBuffer *buf,gpointer *private);
32 typedef struct _GstType GstType;
33 typedef struct _GstTypeFactory GstTypeFactory;
35 struct _GstType {
36   guint16 id;                   /* type id (assigned) */
38   gchar *mime;                  /* MIME type */
39   gchar *exts;                  /* space-delimited list of extensions */
41   GstTypeFindFunc typefindfunc; /* typefind function */
43   GList *srcs;                  /* list of src objects for this type */
44   GList *sinks;                 /* list of sink objects for type */
45 };
47 struct _GstTypeFactory {
48   gchar *mime;
49   gchar *exts;
50   GstTypeFindFunc typefindfunc;
51 };
54 /* initialize the subsystem */
55 void gst_type_initialize();
57 /* create a new type, or find/merge an existing one */
58 guint16 gst_type_register(GstTypeFactory *factory);
60 /* look up a type by mime or extension */
61 guint16 gst_type_find_by_mime(gchar *mime);
62 guint16 gst_type_find_by_ext(gchar *ext);
64 /* add src or sink object */
65 void gst_type_add_src(guint16 id,GstElementFactory *src);
66 void gst_type_add_sink(guint16 id,GstElementFactory *sink);
67 /* get list of src or sink objects */
68 GList *gst_type_get_srcs(guint16 id);
69 GList *gst_type_get_sinks(guint16 id);
71 /* get GstType by id */
72 GstType *gst_type_find_by_id(guint16 id);
73 /* get the list of registered types (returns list of GstType!) */
74 GList *gst_type_get_list();
76 #endif /* __GST_TYPE_H__ */