upload tizen1.0 source
[framework/multimedia/gst-plugins-good0.10.git] / gst / multipart / multipartdemux.h
1 /* GStreamer
2  * Copyright (C) 2006 Sjoerd Simons <sjoerd@luon.net>
3  * Copyright (C) 2004 Wim Taymans <wim@fluendo.com>
4  *
5  * gstmultipartdemux.h: multipart stream demuxer
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Library General Public
9  * License as published by the Free Software Foundation; either
10  * version 2 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Library General Public License for more details.
16  *
17  * You should have received a copy of the GNU Library General Public
18  * License along with this library; if not, write to the
19  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20  * Boston, MA 02111-1307, USA.
21  */
22
23 #ifndef __GST_MULTIPART_DEMUX__
24 #define __GST_MULTIPART_DEMUX__
25
26 #include <gst/gst.h>
27 #include <gst/base/gstadapter.h>
28
29 #include <string.h>
30
31 G_BEGIN_DECLS
32
33 #define GST_TYPE_MULTIPART_DEMUX (gst_multipart_demux_get_type())
34 #define GST_MULTIPART_DEMUX(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_MULTIPART_DEMUX, GstMultipartDemux))
35 #define GST_MULTIPART_DEMUX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_MULTIPART_DEMUX, GstMultipartDemux))
36 #define GST_MULTIPART_DEMUX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_MULTIPART_DEMUX, GstMultipartDemuxClass))
37 #define GST_IS_MULTIPART_DEMUX(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_MULTIPART_DEMUX))
38 #define GST_IS_MULTIPART_DEMUX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_MULTIPART_DEMUX))
39
40 typedef struct _GstMultipartDemux GstMultipartDemux;
41 typedef struct _GstMultipartDemuxClass GstMultipartDemuxClass;
42
43 #define MULTIPART_NEED_MORE_DATA -1
44 #define MULTIPART_DATA_ERROR     -2
45 #define MULTIPART_DATA_EOS       -3
46
47 /* all information needed for one multipart stream */
48 typedef struct
49 {
50   GstPad *pad;                  /* reference for this pad is held by element we belong to */
51
52   gchar *mime;
53
54   GstFlowReturn last_ret;
55 }
56 GstMultipartPad;
57
58 /**
59  * GstMultipartDemux:
60  *
61  * The opaque #GstMultipartDemux structure.
62  */
63 struct _GstMultipartDemux
64 {
65   GstElement element;
66
67   /* pad */
68   GstPad *sinkpad;
69
70   GSList *srcpads;
71   gint numpads;
72
73   GstAdapter *adapter;
74
75   /* Header information of the current frame */
76   gboolean header_completed;
77   gchar *boundary;
78   guint boundary_len;
79   gchar *mime_type;
80   gint content_length;
81
82   /* deprecated, unused */
83   gboolean autoscan;
84
85   /* Index inside the current data when manually looking for the boundary */
86   gint scanpos;
87 };
88
89 struct _GstMultipartDemuxClass
90 {
91   GstElementClass parent_class;
92
93   GHashTable *gstnames;
94 };
95
96 GType gst_multipart_demux_get_type (void);
97
98 gboolean gst_multipart_demux_plugin_init (GstPlugin * plugin);
99
100 G_END_DECLS
101
102 #endif /* __GST_MULTIPART_DEMUX__ */
103