1 /* GStreamer Matroska muxer/demuxer
2 * (c) 2003 Ronald Bultje <rbultje@ronald.bitfreak.net>
4 * matroska-demux.h: matroska file/stream demuxer definition
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.
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.
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.
22 #ifndef __GST_MATROSKA_DEMUX_H__
23 #define __GST_MATROSKA_DEMUX_H__
26 #include <gst/bytestream/bytestream.h>
28 #include "ebml-read.h"
29 #include "matroska-ids.h"
32 #define GST_TYPE_MATROSKA_DEMUX \
33 (gst_matroska_demux_get_type ())
34 #define GST_MATROSKA_DEMUX(obj) \
35 (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_MATROSKA_DEMUX, GstMatroskaDemux))
36 #define GST_MATROSKA_DEMUX_CLASS(klass) \
37 (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_MATROSKA_DEMUX, GstMatroskaDemux))
38 #define GST_IS_MATROSKA_DEMUX(obj) \
39 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_MATROSKA_DEMUX))
40 #define GST_IS_MATROSKA_DEMUX_CLASS(obj) \
41 (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_MATROSKA_DEMUX))
42 #define GST_MATROSKA_DEMUX_MAX_STREAMS 64
45 GST_MATROSKA_DEMUX_STATE_START,
46 GST_MATROSKA_DEMUX_STATE_HEADER,
47 GST_MATROSKA_DEMUX_STATE_DATA
48 } GstMatroskaDemuxState;
50 typedef struct _GstMatroskaDemuxIndex
52 guint64 pos; /* of the corresponding *cluster*! */
53 guint16 track; /* reference to 'num' */
54 guint64 time; /* in nanoseconds */
55 } GstMatroskaDemuxIndex;
57 typedef struct _GstMatroskaDemux
63 GstMatroskaTrackContext *src[GST_MATROSKA_DEMUX_MAX_STREAMS];
64 guint num_streams, num_v_streams, num_a_streams, num_t_streams;
70 gchar *muxing_app, *writing_app;
74 GstMatroskaDemuxState state;
77 /* did we parse metadata/cues already? */
78 gboolean metadata_parsed, index_parsed;
80 /* start-of-segment */
81 guint64 segment_start;
83 /* a cue (index) table */
84 GstMatroskaIndex *index;
87 /* timescale in the file */
90 /* length, position (time, ns) */
91 guint64 duration, pos;
93 /* a possible pending seek */
97 typedef struct _GstMatroskaDemuxClass
99 GstEbmlReadClass parent;
100 } GstMatroskaDemuxClass;
102 GType gst_matroska_demux_get_type (void);
104 gboolean gst_matroska_demux_plugin_init (GstPlugin * plugin);
107 #endif /* __GST_MATROSKA_DEMUX_H__ */