Tizen 2.0 Release
[framework/multimedia/gst-plugins-good0.10.git] / gst / multipart / multipartmux.h
1 /* GStreamer
2  * Copyright (C) 2004 Wim Taymans <wim@fluendo.com>
3  *
4  * gstmultipartmux.h: multipart stream muxer
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 #ifndef __GST_MULTIPART_MUX__
23 #define __GST_MULTIPART_MUX__
24
25 #include <gst/gst.h>
26 #include <gst/base/gstcollectpads.h>
27
28 #include <string.h>
29
30 G_BEGIN_DECLS
31
32 #define GST_TYPE_MULTIPART_MUX (gst_multipart_mux_get_type())
33 #define GST_MULTIPART_MUX(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_MULTIPART_MUX, GstMultipartMux))
34 #define GST_MULTIPART_MUX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_MULTIPART_MUX, GstMultipartMux))
35 #define GST_MULTIPART_MUX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_MULTIPART_MUX, GstMultipartMuxClass))
36 #define GST_IS_MULTIPART_MUX(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_MULTIPART_MUX))
37 #define GST_IS_MULTIPART_MUX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_MULTIPART_MUX))
38
39 typedef struct _GstMultipartMux GstMultipartMux;
40 typedef struct _GstMultipartMuxClass GstMultipartMuxClass;
41
42 /* all information needed for one multipart stream */
43 typedef struct
44 {
45   GstCollectData collect;       /* we extend the CollectData */
46
47   GstBuffer *buffer;            /* the queued buffer for this pad */
48   GstClockTime timestamp;       /* its timestamp, converted to running_time so that we can
49                                    correctly sort over multiple segments. */
50 }
51 GstMultipartPadData;
52
53 /**
54  * GstMultipartMux:
55  *
56  * The opaque #GstMultipartMux structure.
57  */
58 struct _GstMultipartMux
59 {
60   GstElement element;
61
62   /* pad */
63   GstPad *srcpad;
64
65   /* sinkpads */
66   GstCollectPads *collect;
67
68   gint numpads;
69
70   /* offset in stream */
71   guint64 offset;
72
73   /* boundary string */
74   gchar *boundary;
75
76   gboolean negotiated;
77   gboolean need_segment;
78 };
79
80 struct _GstMultipartMuxClass
81 {
82   GstElementClass parent_class;
83
84   GHashTable *mimetypes;
85 };
86
87 GType gst_multipart_mux_get_type (void);
88
89 gboolean gst_multipart_mux_plugin_init (GstPlugin * plugin);
90
91 G_END_DECLS
92
93 #endif /* __GST_MULTIPART_MUX__ */
94