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;
56 #ifdef TIZEN_FEATURE_QTDEMUX_MODIFICATION
57 typedef struct _QtDemuxSphericalMetadata QtDemuxSphericalMetadata;
66 QtDemuxStream *streams[GST_QTDEMUX_MAX_STREAMS];
72 GstFlowCombiner *flowcombiner;
74 gboolean have_group_id;
78 GstBuffer *comp_brands;
80 GNode *moov_node_compressed;
83 GstClockTime duration;
86 gboolean fragmented_seek_pending;
92 gboolean posted_redirect;
94 /* push based variables */
98 GstBuffer *mdatbuffer;
100 /* When restoring the mdat to the adatpter, this buffer
101 * stores any trailing data that was after the last atom parsed as it
102 * has to be restored later along with the correct offset. Used in
103 * fragmented scenario where mdat/moof are one after the other
106 * Check https://bugzilla.gnome.org/show_bug.cgi?id=710623 */
107 GstBuffer *restoredata_buffer;
108 guint64 restoredata_offset;
111 /* offset of the mdat atom */
115 guint64 last_moov_offset;
118 GstTagList *tag_list;
120 /* configured playback region */
122 GstEvent *pending_newsegment;
123 gboolean upstream_format_is_time; /* qtdemux received upstream
124 * newsegment in TIME format which likely
125 * means that upstream is driving the pipeline
126 * (adaptive demuxers / dlna) */
128 gint64 push_seek_start;
129 gint64 push_seek_stop;
132 /* gst index support */
133 GstIndex *element_index;
137 gboolean upstream_seekable;
138 gint64 upstream_size;
140 /* MSS streams have a single media that is unspecified at the atoms, so
141 * upstream provides it at the caps */
144 gboolean mss_mode; /* flag to indicate that we're working with a smoothstreaming fragment
145 * Mss doesn't have 'moov' or any information about the streams format,
146 * requiring qtdemux to expose and create the streams */
147 guint64 fragment_start;
148 guint64 fragment_start_offset;
150 gint64 chapters_track_id;
152 /* protection support */
153 GPtrArray *protection_system_ids; /* Holds identifiers of all content protection systems for all tracks */
154 GQueue protection_event_queue; /* holds copy of upstream protection events */
155 #ifdef TIZEN_FEATURE_QTDEMUX_MODIFICATION
156 QtDemuxSphericalMetadata *spherical_metadata;
160 struct _GstQTDemuxClass {
161 GstElementClass parent_class;
164 GType gst_qtdemux_get_type (void);
168 #endif /* __GST_QTDEMUX_H__ */