gst: Update for GST_PLUGIN_DEFINE() API changes
[platform/upstream/gstreamer.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/gstcollectpads2.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   GstCollectData2 collect;       /* we extend the CollectData2 */
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   GstPad *pad;
51 }
52 GstMultipartPadData;
53
54 /**
55  * GstMultipartMux:
56  *
57  * The opaque #GstMultipartMux structure.
58  */
59 struct _GstMultipartMux
60 {
61   GstElement element;
62
63   /* pad */
64   GstPad *srcpad;
65
66   /* sinkpads */
67   GstCollectPads2 *collect;
68
69   gint numpads;
70
71   /* offset in stream */
72   guint64 offset;
73
74   /* boundary string */
75   gchar *boundary;
76
77   gboolean negotiated;
78   gboolean need_segment;
79 };
80
81 struct _GstMultipartMuxClass
82 {
83   GstElementClass parent_class;
84
85   GHashTable *mimetypes;
86 };
87
88 GType gst_multipart_mux_get_type (void);
89
90 gboolean gst_multipart_mux_plugin_init (GstPlugin * plugin);
91
92 G_END_DECLS
93
94 #endif /* __GST_MULTIPART_MUX__ */
95