matroskademux: Add support for group-id in the stream-start event
[platform/upstream/gst-plugins-good.git] / gst / matroska / matroska-demux.h
1 /* GStreamer Matroska muxer/demuxer
2  * (c) 2003 Ronald Bultje <rbultje@ronald.bitfreak.net>
3  * (c) 2011 Debarshi Ray <rishi@gnu.org>
4  *
5  * matroska-demux.h: matroska file/stream demuxer definition
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., 51 Franklin St, Fifth Floor,
20  * Boston, MA 02110-1301, USA.
21  */
22
23 #ifndef __GST_MATROSKA_DEMUX_H__
24 #define __GST_MATROSKA_DEMUX_H__
25
26 #include <gst/gst.h>
27
28 #include "ebml-read.h"
29 #include "matroska-ids.h"
30 #include "matroska-read-common.h"
31
32 G_BEGIN_DECLS
33
34 #define GST_TYPE_MATROSKA_DEMUX \
35   (gst_matroska_demux_get_type ())
36 #define GST_MATROSKA_DEMUX(obj) \
37   (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_MATROSKA_DEMUX, GstMatroskaDemux))
38 #define GST_MATROSKA_DEMUX_CLASS(klass) \
39   (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_MATROSKA_DEMUX, GstMatroskaDemuxClass))
40 #define GST_IS_MATROSKA_DEMUX(obj) \
41   (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_MATROSKA_DEMUX))
42 #define GST_IS_MATROSKA_DEMUX_CLASS(klass) \
43   (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_MATROSKA_DEMUX))
44
45 typedef struct _GstMatroskaDemux {
46   GstElement              parent;
47
48   /* < private > */
49
50   GstMatroskaReadCommon    common;
51
52   /* pads */
53   GstClock                *clock;
54   guint                    num_v_streams;
55   guint                    num_a_streams;
56   guint                    num_t_streams;
57
58   guint                    group_id;
59   gboolean                 have_group_id;
60
61   /* state */
62   gboolean                 streaming;
63   guint                    level_up;
64   guint64                  seek_block;
65   gboolean                 seek_first;
66
67   /* did we parse cues/tracks/segmentinfo already? */
68   gboolean                 tracks_parsed;
69   GList                   *seek_parsed;
70
71   /* cluster positions (optional) */
72   GArray                  *clusters;
73
74   /* keeping track of playback position */
75   GstClockTime             last_stop_end;
76   GstClockTime             stream_start_time;
77
78   /* Stop time for reverse playback */
79   GstClockTime             to_time;
80   GstEvent                *new_segment;
81
82   /* some state saving */
83   GstClockTime             cluster_time;
84   guint64                  cluster_offset;
85   guint64                  first_cluster_offset;
86   guint64                  next_cluster_offset;
87   GstClockTime             requested_seek_time;
88   guint64                  seek_offset;
89
90   /* index stuff */
91   gboolean                 seekable;
92   gboolean                 building_index;
93   guint64                  index_offset;
94   GstEvent                *seek_event;
95   gboolean                 need_segment;
96
97   /* reverse playback */
98   GArray                  *seek_index;
99   gint                     seek_entry;
100
101   /* gap handling */
102   guint64                  max_gap_time;
103
104   /* for non-finalized files, with invalid segment duration */
105   gboolean                 invalid_duration;
106 } GstMatroskaDemux;
107
108 typedef struct _GstMatroskaDemuxClass {
109   GstElementClass parent;
110 } GstMatroskaDemuxClass;
111
112 gboolean gst_matroska_demux_plugin_init (GstPlugin *plugin);
113
114 G_END_DECLS
115
116 #endif /* __GST_MATROSKA_DEMUX_H__ */