2 * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
21 #ifndef __GST_QTDEMUX_H__
22 #define __GST_QTDEMUX_H__
25 #include <gst/base/gstadapter.h>
26 #include <gst/base/gstflowcombiner.h>
31 GST_DEBUG_CATEGORY_EXTERN (qtdemux_debug);
32 #define GST_CAT_DEFAULT qtdemux_debug
34 #define GST_TYPE_QTDEMUX \
35 (gst_qtdemux_get_type())
36 #define GST_QTDEMUX(obj) \
37 (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_QTDEMUX,GstQTDemux))
38 #define GST_QTDEMUX_CLASS(klass) \
39 (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_QTDEMUX,GstQTDemuxClass))
40 #define GST_IS_QTDEMUX(obj) \
41 (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_QTDEMUX))
42 #define GST_IS_QTDEMUX_CLASS(klass) \
43 (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_QTDEMUX))
45 #define GST_QTDEMUX_CAST(obj) ((GstQTDemux *)(obj))
47 /* qtdemux produces these for atoms it cannot parse */
48 #define GST_QT_DEMUX_PRIVATE_TAG "private-qt-tag"
49 #define GST_QT_DEMUX_CLASSIFICATION_TAG "classification"
51 #define GST_QTDEMUX_MAX_STREAMS 32
53 typedef struct _GstQTDemux GstQTDemux;
54 typedef struct _GstQTDemuxClass GstQTDemuxClass;
55 typedef struct _QtDemuxStream QtDemuxStream;
63 QtDemuxStream *streams[GST_QTDEMUX_MAX_STREAMS];
69 GstFlowCombiner *flowcombiner;
71 gboolean have_group_id;
75 GstBuffer *comp_brands;
77 GNode *moov_node_compressed;
80 GstClockTime duration;
83 gboolean fragmented_seek_pending;
89 gboolean posted_redirect;
91 /* push based variables */
95 GstBuffer *mdatbuffer;
97 /* When restoring the mdat to the adatpter, this buffer
98 * stores any trailing data that was after the last atom parsed as it
99 * has to be restored later along with the correct offset. Used in
100 * fragmented scenario where mdat/moof are one after the other
103 * Check https://bugzilla.gnome.org/show_bug.cgi?id=710623 */
104 GstBuffer *restoredata_buffer;
105 guint64 restoredata_offset;
108 /* offset of the mdat atom */
112 guint64 last_moov_offset;
115 GstTagList *tag_list;
117 /* configured playback region */
119 GstEvent *pending_newsegment;
120 gboolean upstream_newsegment; /* qtdemux received upstream
121 * newsegment in TIME format which likely
122 * means that upstream is driving the pipeline
123 * (adaptive demuxers) */
125 gint64 push_seek_start;
126 gint64 push_seek_stop;
129 /* gst index support */
130 GstIndex *element_index;
134 gboolean upstream_seekable;
135 gint64 upstream_size;
137 /* MSS streams have a single media that is unspecified at the atoms, so
138 * upstream provides it at the caps */
141 gboolean mss_mode; /* flag to indicate that we're working with a smoothstreaming fragment
142 * Mss doesn't have 'moov' or any information about the streams format,
143 * requiring qtdemux to expose and create the streams */
144 guint64 fragment_start;
145 guint64 fragment_start_offset;
147 gint64 chapters_track_id;
150 struct _GstQTDemuxClass {
151 GstElementClass parent_class;
154 GType gst_qtdemux_get_type (void);
158 #endif /* __GST_QTDEMUX_H__ */