gst-indent
[platform/upstream/gst-plugins-good.git] / gst / matroska / matroska-mux.h
1 /* GStreamer Matroska muxer/demuxer
2  * (c) 2003 Ronald Bultje <rbultje@ronald.bitfreak.net>
3  *
4  * matroska-mux.h: matroska file/stream muxer object types
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_MATROSKA_MUX_H__
23 #define __GST_MATROSKA_MUX_H__
24
25 #include <gst/gst.h>
26
27 #include "ebml-write.h"
28 #include "matroska-ids.h"
29
30 G_BEGIN_DECLS
31 #define GST_TYPE_MATROSKA_MUX \
32   (gst_matroska_mux_get_type ())
33 #define GST_MATROSKA_MUX(obj) \
34   (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_MATROSKA_MUX, GstMatroskaMux))
35 #define GST_MATROSKA_MUX_CLASS(klass) \
36   (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_MATROSKA_MUX, GstMatroskaMux))
37 #define GST_IS_MATROSKA_MUX(obj) \
38   (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_MATROSKA_MUX))
39 #define GST_IS_MATROSKA_MUX_CLASS(obj) \
40   (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_MATROSKA_MUX))
41 #define GST_MATROSKA_MUX_MAX_STREAMS 64
42     typedef enum
43 {
44   GST_MATROSKA_MUX_STATE_START,
45   GST_MATROSKA_MUX_STATE_HEADER,
46   GST_MATROSKA_MUX_STATE_DATA,
47 } GstMatroskaMuxState;
48
49 typedef struct _GstMatroskaMux
50 {
51   GstEbmlWrite parent;
52
53   /* pads */
54   GstPad *srcpad;
55   struct
56   {
57     GstMatroskaTrackContext *track;
58     GstBuffer *buffer;
59     gboolean eos;
60   } sink[GST_MATROSKA_MUX_MAX_STREAMS];
61   guint num_streams, num_v_streams, num_a_streams, num_t_streams;
62
63   /* metadata - includes writing_app and creation_time */
64   GstCaps *metadata;
65
66   /* state */
67   GstMatroskaMuxState state;
68
69   /* a cue (index) table */
70   GstMatroskaIndex *index;
71   guint num_indexes;
72
73   /* timescale in the file */
74   guint64 time_scale;
75
76   /* length, position (time, ns) */
77   guint64 duration;
78
79   /* byte-positions of master-elements (for replacing contents) */
80   guint64 segment_pos, seekhead_pos, cues_pos,
81 #if 0
82     tags_pos,
83 #endif
84     info_pos, tracks_pos, duration_pos;
85   guint64 segment_master;
86 } GstMatroskaMux;
87
88 typedef struct _GstMatroskaMuxClass
89 {
90   GstEbmlWriteClass parent;
91 } GstMatroskaMuxClass;
92
93 GType gst_matroska_mux_get_type (void);
94
95 gboolean gst_matroska_mux_plugin_init (GstPlugin * plugin);
96
97 G_END_DECLS
98 #endif /* __GST_MATROSKA_MUX_H__ */