gst/qtdemux/: Streamline tag handling and pass unparsed tags as binary blob in privat...
[platform/upstream/gstreamer.git] / gst / qtdemux / qtdemux.h
1 /* GStreamer
2  * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
3  *
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.
8  *
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.
13  *
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., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19
20
21 #ifndef __GST_QTDEMUX_H__
22 #define __GST_QTDEMUX_H__
23
24 #include <gst/gst.h>
25 #include <gst/base/gstadapter.h>
26
27 G_BEGIN_DECLS
28
29 GST_DEBUG_CATEGORY_EXTERN (qtdemux_debug);
30 #define GST_CAT_DEFAULT qtdemux_debug
31
32 #define GST_TYPE_QTDEMUX \
33   (gst_qtdemux_get_type())
34 #define GST_QTDEMUX(obj) \
35   (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_QTDEMUX,GstQTDemux))
36 #define GST_QTDEMUX_CLASS(klass) \
37   (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_QTDEMUX,GstQTDemuxClass))
38 #define GST_IS_QTDEMUX(obj) \
39   (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_QTDEMUX))
40 #define GST_IS_QTDEMUX_CLASS(klass) \
41   (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_QTDEMUX))
42
43 #define GST_QTDEMUX_CAST(obj) ((GstQTDemux *)(obj))
44
45 /* qtdemux produces these for atoms it cannot parse */
46 #define GST_QT_DEMUX_PRIVATE_TAG "private-qt-tag"
47
48 #define GST_QTDEMUX_MAX_STREAMS         8
49
50 typedef struct _GstQTDemux GstQTDemux;
51 typedef struct _GstQTDemuxClass GstQTDemuxClass;
52 typedef struct _QtDemuxStream QtDemuxStream;
53
54 struct _GstQTDemux {
55   GstElement element;
56
57   /* pads */
58   GstPad *sinkpad;
59
60   QtDemuxStream *streams[GST_QTDEMUX_MAX_STREAMS];
61   gint     n_streams;
62   gint     n_video_streams;
63   gint     n_audio_streams;
64
65   guint  major_brand;
66   GNode *moov_node;
67   GNode *moov_node_compressed;
68
69   guint32 timescale;
70   guint32 duration;
71
72   gint state;
73
74   gboolean pullbased;
75
76   /* push based variables */
77   guint neededbytes;
78   guint todrop;
79   GstAdapter *adapter;
80   GstBuffer *mdatbuffer;
81
82   /* offset of the media data (i.e.: Size of header) */
83   guint64 offset;
84   /* offset of the mdat atom */
85   guint64 mdatoffset;
86
87   GstTagList *tag_list;
88
89   /* track stuff */
90   guint64 last_ts;
91
92   /* configured playback region */
93   GstSegment segment;
94   gboolean segment_running;
95   GstEvent *pending_newsegment;
96 };
97
98 struct _GstQTDemuxClass {
99   GstElementClass parent_class;
100 };
101
102 GType gst_qtdemux_get_type (void);
103
104 G_END_DECLS
105
106 #endif /* __GST_QTDEMUX_H__ */