1 /* GStreamer Matroska muxer/demuxer
2 * (c) 2003 Ronald Bultje <rbultje@ronald.bitfreak.net>
4 * matroska-ids.h: matroska file/stream data IDs
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_IDS_H__
23 #define __GST_MATROSKA_IDS_H__
28 * Matroska element IDs. max. 32-bit.
31 /* toplevel segment */
32 #define GST_MATROSKA_ID_SEGMENT 0x18538067
34 /* matroska top-level master IDs */
35 #define GST_MATROSKA_ID_INFO 0x1549A966
36 #define GST_MATROSKA_ID_TRACKS 0x1654AE6B
37 #define GST_MATROSKA_ID_CUES 0x1C53BB6B
38 #define GST_MATROSKA_ID_TAGS 0x1254C367
39 #define GST_MATROSKA_ID_SEEKHEAD 0x114D9B74
40 #define GST_MATROSKA_ID_CLUSTER 0x1F43B675
42 /* IDs in the info master */
43 #define GST_MATROSKA_ID_TIMECODESCALE 0x2AD7B1
44 #define GST_MATROSKA_ID_DURATION 0x4489
45 #define GST_MATROSKA_ID_WRITINGAPP 0x5741
46 #define GST_MATROSKA_ID_MUXINGAPP 0x4D80
47 #define GST_MATROSKA_ID_DATEUTC 0x4461
49 /* ID in the tracks master */
50 #define GST_MATROSKA_ID_TRACKENTRY 0xAE
52 /* IDs in the trackentry master */
53 #define GST_MATROSKA_ID_TRACKNUMBER 0xD7
54 #define GST_MATROSKA_ID_TRACKUID 0x73C5
55 #define GST_MATROSKA_ID_TRACKTYPE 0x83
56 #define GST_MATROSKA_ID_TRACKAUDIO 0xE1
57 #define GST_MATROSKA_ID_TRACKVIDEO 0xE0
58 #define GST_MATROSKA_ID_CODECID 0x86
59 #define GST_MATROSKA_ID_CODECPRIVATE 0x63A2
60 #define GST_MATROSKA_ID_CODECNAME 0x258688
61 #define GST_MATROSKA_ID_CODECINFOURL 0x3B4040
62 #define GST_MATROSKA_ID_CODECDOWNLOADURL 0x26B240
63 #define GST_MATROSKA_ID_TRACKNAME 0x536E
64 #define GST_MATROSKA_ID_TRACKLANGUAGE 0x22B59C
65 #define GST_MATROSKA_ID_TRACKFLAGENABLED 0xB9
66 #define GST_MATROSKA_ID_TRACKFLAGDEFAULT 0x88
67 #define GST_MATROSKA_ID_TRACKFLAGLACING 0x9C
68 #define GST_MATROSKA_ID_TRACKMINCACHE 0x6DE7
69 #define GST_MATROSKA_ID_TRACKMAXCACHE 0x6DF8
70 #define GST_MATROSKA_ID_TRACKDEFAULTDURATION 0x23E383
72 /* IDs in the trackvideo master */
73 #define GST_MATROSKA_ID_VIDEOFRAMERATE 0x2383E3
74 #define GST_MATROSKA_ID_VIDEODISPLAYWIDTH 0x54B0
75 #define GST_MATROSKA_ID_VIDEODISPLAYHEIGHT 0x54BA
76 #define GST_MATROSKA_ID_VIDEOPIXELWIDTH 0xB0
77 #define GST_MATROSKA_ID_VIDEOPIXELHEIGHT 0xBA
78 #define GST_MATROSKA_ID_VIDEOFLAGINTERLACED 0x9A
79 #define GST_MATROSKA_ID_VIDEOSTEREOMODE 0x53B9
80 #define GST_MATROSKA_ID_VIDEOASPECTRATIO 0x54B3
81 #define GST_MATROSKA_ID_VIDEOCOLOURSPACE 0x2EB524
83 /* IDs in the trackaudio master */
84 #define GST_MATROSKA_ID_AUDIOSAMPLINGFREQ 0xB5
85 #define GST_MATROSKA_ID_AUDIOBITDEPTH 0x6264
86 #define GST_MATROSKA_ID_AUDIOCHANNELS 0x9F
88 /* ID in the cues master */
89 #define GST_MATROSKA_ID_POINTENTRY 0xBB
91 /* IDs in the pointentry master */
92 #define GST_MATROSKA_ID_CUETIME 0xB3
93 #define GST_MATROSKA_ID_CUETRACKPOSITION 0xB7
95 /* IDs in the cuetrackposition master */
96 #define GST_MATROSKA_ID_CUETRACK 0xF7
97 #define GST_MATROSKA_ID_CUECLUSTERPOSITION 0xF1
99 /* IDs in the tags master */
102 /* IDs in the seekhead master */
103 #define GST_MATROSKA_ID_SEEKENTRY 0x4DBB
105 /* IDs in the seekpoint master */
106 #define GST_MATROSKA_ID_SEEKID 0x53AB
107 #define GST_MATROSKA_ID_SEEKPOSITION 0x53AC
109 /* IDs in the cluster master */
110 #define GST_MATROSKA_ID_CLUSTERTIMECODE 0xE7
111 #define GST_MATROSKA_ID_BLOCKGROUP 0xA0
113 /* IDs in the blockgroup master */
114 #define GST_MATROSKA_ID_BLOCK 0xA1
115 #define GST_MATROSKA_ID_BLOCKDURATION 0x9B
118 * Matroska Codec IDs. Strings.
121 #define GST_MATROSKA_CODEC_ID_VIDEO_VFW_FOURCC "V_MS/VFW/FOURCC"
122 #define GST_MATROSKA_CODEC_ID_VIDEO_UNCOMPRESSED "V_UNCOMPRESSED"
123 #define GST_MATROSKA_CODEC_ID_VIDEO_MPEG4_SP "V_MPEG4/ISO/SP"
124 #define GST_MATROSKA_CODEC_ID_VIDEO_MPEG4_ASP "V_MPEG4/ISO/ASP"
125 #define GST_MATROSKA_CODEC_ID_VIDEO_MPEG4_AP "V_MPEG4/ISO/AP"
126 #define GST_MATROSKA_CODEC_ID_VIDEO_MSMPEG4V3 "V_MPEG4/MS/V3"
127 #define GST_MATROSKA_CODEC_ID_VIDEO_MPEG1 "V_MPEG1"
128 #define GST_MATROSKA_CODEC_ID_VIDEO_MPEG2 "V_MPEG2"
129 #define GST_MATROSKA_CODEC_ID_VIDEO_MJPEG "V_MJPEG"
130 /* TODO: Real/Quicktime */
132 #define GST_MATROSKA_CODEC_ID_AUDIO_MPEG1_L1 "A_MPEG/L1"
133 #define GST_MATROSKA_CODEC_ID_AUDIO_MPEG1_L2 "A_MPEG/L2"
134 #define GST_MATROSKA_CODEC_ID_AUDIO_MPEG1_L3 "A_MPEG/L3"
135 #define GST_MATROSKA_CODEC_ID_AUDIO_PCM_INT_BE "A_PCM/INT/BIG"
136 #define GST_MATROSKA_CODEC_ID_AUDIO_PCM_INT_LE "A_PCM/INT/LIT"
137 #define GST_MATROSKA_CODEC_ID_AUDIO_PCM_FLOAT "A_PCM/FLOAT/IEEE"
138 #define GST_MATROSKA_CODEC_ID_AUDIO_AC3 "A_AC3"
139 #define GST_MATROSKA_CODEC_ID_AUDIO_DTS "A_DTS"
140 #define GST_MATROSKA_CODEC_ID_AUDIO_VORBIS "A_VORBIS"
141 #define GST_MATROSKA_CODEC_ID_AUDIO_ACM "A_MS/ACM"
142 #define GST_MATROSKA_CODEC_ID_AUDIO_MPEG2 "A_AAC/MPEG2/"
143 #define GST_MATROSKA_CODEC_ID_AUDIO_MPEG4 "A_AAC/MPEG4/"
144 /* TODO: AC3-9/10 (?), Real, Musepack, Quicktime */
147 * Enumerations for various types (mapping from binary
148 * value to what it actually means).
152 GST_MATROSKA_TRACK_TYPE_VIDEO = 0x1,
153 GST_MATROSKA_TRACK_TYPE_AUDIO = 0x2,
154 GST_MATROSKA_TRACK_TYPE_COMPLEX = 0x3,
155 GST_MATROSKA_TRACK_TYPE_LOGO = 0x10,
156 GST_MATROSKA_TRACK_TYPE_SUBTITLE = 0x11,
157 GST_MATROSKA_TRACK_TYPE_CONTROL = 0x20,
158 } GstMatroskaTrackType;
161 GST_MATROSKA_EYE_MODE_MONO = 0x0,
162 GST_MATROSKA_EYE_MODE_RIGHT = 0x1,
163 GST_MATROSKA_EYE_MODE_LEFT = 0x2,
164 GST_MATROSKA_EYE_MODE_BOTH = 0x3,
165 } GstMatroskaEyeMode;
168 GST_MATROSKA_ASPECT_RATIO_MODE_FREE = 0x0,
169 GST_MATROSKA_ASPECT_RATIO_MODE_KEEP = 0x1,
170 GST_MATROSKA_ASPECT_RATIO_MODE_FIXED = 0x2,
171 } GstMatroskaAspectRatioMode;
174 * These aren't in any way "matroska-form" things,
175 * it's just something I use in the muxer/demuxer.
179 GST_MATROSKA_TRACK_ENABLED = (1<<0),
180 GST_MATROSKA_TRACK_DEFAULT = (1<<1),
181 GST_MATROSKA_TRACK_LACING = (1<<2),
182 GST_MATROSKA_TRACK_SHIFT = (1<<16)
183 } GstMatroskaTrackFlags;
186 GST_MATROSKA_VIDEOTRACK_INTERLACED = (GST_MATROSKA_TRACK_SHIFT<<0)
187 } GstMatroskaVideoTrackFlags;
189 typedef struct _GstMatroskaTrackContext {
194 /* some often-used info */
195 gchar *codec_id, *codec_name, *name, *language;
197 guint codec_priv_size;
198 GstMatroskaTrackType type;
200 GstMatroskaTrackFlags flags;
201 guint64 default_duration;
202 } GstMatroskaTrackContext;
204 typedef struct _GstMatroskaTrackVideoContext {
205 GstMatroskaTrackContext parent;
207 guint pixel_width, pixel_height,
208 display_width, display_height;
209 GstMatroskaEyeMode eye_mode;
210 GstMatroskaAspectRatioMode asr_mode;
212 } GstMatroskaTrackVideoContext;
214 typedef struct _GstMatroskaTrackAudioContext {
215 GstMatroskaTrackContext parent;
217 guint samplerate, channels, bitdepth;
218 } GstMatroskaTrackAudioContext;
220 typedef struct _GstMatroskaTrackComplexContext {
221 GstMatroskaTrackContext parent;
223 /* nothing special goes here, apparently */
224 } GstMatroskaTrackComplexContext;
226 typedef struct _GstMatroskaTrackSubtitleContext {
227 GstMatroskaTrackContext parent;
230 } GstMatroskaTrackSubtitleContext;
232 typedef struct _GstMatroskaIndex {
233 guint64 pos; /* of the corresponding *cluster*! */
234 guint16 track; /* reference to 'num' */
235 guint64 time; /* in nanoseconds */
238 #endif /* __GST_MATROSKA_IDS_H__ */