qtdemux.h 3.48 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
/* GStreamer
 * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the
Tim-Philipp Müller's avatar
Tim-Philipp Müller committed
16 17
 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
 * Boston, MA 02110-1301, USA.
18 19 20 21 22 23 24
 */


#ifndef __GST_QTDEMUX_H__
#define __GST_QTDEMUX_H__

#include <gst/gst.h>
25
#include <gst/base/gstadapter.h>
26

27
G_BEGIN_DECLS
28

29 30 31
GST_DEBUG_CATEGORY_EXTERN (qtdemux_debug);
#define GST_CAT_DEFAULT qtdemux_debug

32 33 34 35 36
#define GST_TYPE_QTDEMUX \
  (gst_qtdemux_get_type())
#define GST_QTDEMUX(obj) \
  (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_QTDEMUX,GstQTDemux))
#define GST_QTDEMUX_CLASS(klass) \
37
  (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_QTDEMUX,GstQTDemuxClass))
38 39
#define GST_IS_QTDEMUX(obj) \
  (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_QTDEMUX))
40
#define GST_IS_QTDEMUX_CLASS(klass) \
41 42
  (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_QTDEMUX))

43
#define GST_QTDEMUX_CAST(obj) ((GstQTDemux *)(obj))
44

45 46
/* qtdemux produces these for atoms it cannot parse */
#define GST_QT_DEMUX_PRIVATE_TAG "private-qt-tag"
47
#define GST_QT_DEMUX_CLASSIFICATION_TAG "classification"
48

49
#define GST_QTDEMUX_MAX_STREAMS         32
50

Johan Dahlin's avatar
Johan Dahlin committed
51 52 53
typedef struct _GstQTDemux GstQTDemux;
typedef struct _GstQTDemuxClass GstQTDemuxClass;
typedef struct _QtDemuxStream QtDemuxStream;
54

Johan Dahlin's avatar
Johan Dahlin committed
55 56
struct _GstQTDemux {
  GstElement element;
57

Johan Dahlin's avatar
Johan Dahlin committed
58 59
  /* pads */
  GstPad *sinkpad;
60

Johan Dahlin's avatar
Johan Dahlin committed
61
  QtDemuxStream *streams[GST_QTDEMUX_MAX_STREAMS];
62 63 64
  gint     n_streams;
  gint     n_video_streams;
  gint     n_audio_streams;
65
  gint     n_sub_streams;
66

67 68 69
  gboolean have_group_id;
  guint group_id;

70
  guint  major_brand;
71
  GstBuffer *comp_brands;
Johan Dahlin's avatar
Johan Dahlin committed
72 73
  GNode *moov_node;
  GNode *moov_node_compressed;
74

Johan Dahlin's avatar
Johan Dahlin committed
75
  guint32 timescale;
76
  guint64 duration;
77

78 79 80
  gboolean fragmented;
  /* offset of the mfra atom */
  guint64 mfra_offset;
81
  guint64 moof_offset;
82

83
  gint state;
84

85
  gboolean pullbased;
86
  gboolean posted_redirect;
87 88 89 90 91

  /* push based variables */
  guint neededbytes;
  guint todrop;
  GstAdapter *adapter;
92
  GstBuffer *mdatbuffer;
93
  guint64 mdatleft;
94

95
  guint64 offset;
96 97
  /* offset of the mdat atom */
  guint64 mdatoffset;
98
  guint64 first_mdat;
99
  gboolean got_moov;
100
  guint header_size;
101

102 103
  GstTagList *tag_list;

104
  /* configured playback region */
105
  GstSegment segment;
106
  GstEvent *pending_newsegment;
107
  gboolean upstream_newsegment;
108 109 110
  gint64 seek_offset;
  gint64 push_seek_start;
  gint64 push_seek_stop;
111

112
#if 0
113 114 115
  /* gst index support */
  GstIndex *element_index;
  gint index_id;
116
#endif
117

118
  gboolean upstream_seekable;
119
  gint64 upstream_size;
Thiago Santos's avatar
Thiago Santos committed
120 121 122 123 124 125

  /* MSS streams have a single media that is unspecified at the atoms, so
   * upstream provides it at the caps */
  GstCaps *media_caps;
  gboolean exposed;
  gboolean mss_mode; /* flag to indicate that we're working with a smoothstreaming fragment */
126
  guint64 fragment_start;
127 128
    
  gint64 chapters_track_id;
129 130

  GstClockTime min_elst_offset;
Johan Dahlin's avatar
Johan Dahlin committed
131
};
132

Johan Dahlin's avatar
Johan Dahlin committed
133 134 135
struct _GstQTDemuxClass {
  GstElementClass parent_class;
};
136

137 138
GType gst_qtdemux_get_type (void);

139
G_END_DECLS
140

Johan Dahlin's avatar
Johan Dahlin committed
141
#endif /* __GST_QTDEMUX_H__ */