Statistics
| Branch: | Revision:

ffmpeg / libavformat / matroska.h @ 0ab1ebea

History | View | Annotate | Download (5.68 KB)

1
/*
2
 * Matroska constants
3
 * Copyright (c) 2003-2004 The ffmpeg Project
4
 *
5
 * This file is part of FFmpeg.
6
 *
7
 * FFmpeg is free software; you can redistribute it and/or
8
 * modify it under the terms of the GNU Lesser General Public
9
 * License as published by the Free Software Foundation; either
10
 * version 2.1 of the License, or (at your option) any later version.
11
 *
12
 * FFmpeg is distributed in the hope that it will be useful,
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15
 * Lesser General Public License for more details.
16
 *
17
 * You should have received a copy of the GNU Lesser General Public
18
 * License along with FFmpeg; if not, write to the Free Software
19
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20
 */
21

    
22
#ifndef MATROSKA_H
23
#define MATROSKA_H
24

    
25
#include "avcodec.h"
26

    
27
/* EBML version supported */
28
#define EBML_VERSION 1
29

    
30
/* top-level master-IDs */
31
#define EBML_ID_HEADER             0x1A45DFA3
32

    
33
/* IDs in the HEADER master */
34
#define EBML_ID_EBMLVERSION        0x4286
35
#define EBML_ID_EBMLREADVERSION    0x42F7
36
#define EBML_ID_EBMLMAXIDLENGTH    0x42F2
37
#define EBML_ID_EBMLMAXSIZELENGTH  0x42F3
38
#define EBML_ID_DOCTYPE            0x4282
39
#define EBML_ID_DOCTYPEVERSION     0x4287
40
#define EBML_ID_DOCTYPEREADVERSION 0x4285
41

    
42
/* general EBML types */
43
#define EBML_ID_VOID               0xEC
44

    
45
/*
46
 * Matroska element IDs. max. 32-bit.
47
 */
48

    
49
/* toplevel segment */
50
#define MATROSKA_ID_SEGMENT    0x18538067
51

    
52
/* matroska top-level master IDs */
53
#define MATROSKA_ID_INFO       0x1549A966
54
#define MATROSKA_ID_TRACKS     0x1654AE6B
55
#define MATROSKA_ID_CUES       0x1C53BB6B
56
#define MATROSKA_ID_TAGS       0x1254C367
57
#define MATROSKA_ID_SEEKHEAD   0x114D9B74
58
#define MATROSKA_ID_CLUSTER    0x1F43B675
59

    
60
/* IDs in the info master */
61
#define MATROSKA_ID_TIMECODESCALE 0x2AD7B1
62
#define MATROSKA_ID_DURATION   0x4489
63
#define MATROSKA_ID_TITLE      0x7BA9
64
#define MATROSKA_ID_WRITINGAPP 0x5741
65
#define MATROSKA_ID_MUXINGAPP  0x4D80
66
#define MATROSKA_ID_DATEUTC    0x4461
67
#define MATROSKA_ID_SEGMENTUID 0x73A4
68

    
69
/* ID in the tracks master */
70
#define MATROSKA_ID_TRACKENTRY 0xAE
71

    
72
/* IDs in the trackentry master */
73
#define MATROSKA_ID_TRACKNUMBER 0xD7
74
#define MATROSKA_ID_TRACKUID   0x73C5
75
#define MATROSKA_ID_TRACKTYPE  0x83
76
#define MATROSKA_ID_TRACKAUDIO 0xE1
77
#define MATROSKA_ID_TRACKVIDEO 0xE0
78
#define MATROSKA_ID_CODECID    0x86
79
#define MATROSKA_ID_CODECPRIVATE 0x63A2
80
#define MATROSKA_ID_CODECNAME  0x258688
81
#define MATROSKA_ID_CODECINFOURL 0x3B4040
82
#define MATROSKA_ID_CODECDOWNLOADURL 0x26B240
83
#define MATROSKA_ID_TRACKNAME  0x536E
84
#define MATROSKA_ID_TRACKLANGUAGE 0x22B59C
85
#define MATROSKA_ID_TRACKFLAGENABLED 0xB9
86
#define MATROSKA_ID_TRACKFLAGDEFAULT 0x88
87
#define MATROSKA_ID_TRACKFLAGLACING 0x9C
88
#define MATROSKA_ID_TRACKMINCACHE 0x6DE7
89
#define MATROSKA_ID_TRACKMAXCACHE 0x6DF8
90
#define MATROSKA_ID_TRACKDEFAULTDURATION 0x23E383
91

    
92
/* IDs in the trackvideo master */
93
#define MATROSKA_ID_VIDEOFRAMERATE 0x2383E3
94
#define MATROSKA_ID_VIDEODISPLAYWIDTH 0x54B0
95
#define MATROSKA_ID_VIDEODISPLAYHEIGHT 0x54BA
96
#define MATROSKA_ID_VIDEOPIXELWIDTH 0xB0
97
#define MATROSKA_ID_VIDEOPIXELHEIGHT 0xBA
98
#define MATROSKA_ID_VIDEOFLAGINTERLACED 0x9A
99
#define MATROSKA_ID_VIDEOSTEREOMODE 0x53B9
100
#define MATROSKA_ID_VIDEOASPECTRATIO 0x54B3
101
#define MATROSKA_ID_VIDEOCOLOURSPACE 0x2EB524
102

    
103
/* IDs in the trackaudio master */
104
#define MATROSKA_ID_AUDIOSAMPLINGFREQ 0xB5
105
#define MATROSKA_ID_AUDIOOUTSAMPLINGFREQ 0x78B5
106

    
107
#define MATROSKA_ID_AUDIOBITDEPTH 0x6264
108
#define MATROSKA_ID_AUDIOCHANNELS 0x9F
109

    
110
/* ID in the cues master */
111
#define MATROSKA_ID_POINTENTRY 0xBB
112

    
113
/* IDs in the pointentry master */
114
#define MATROSKA_ID_CUETIME    0xB3
115
#define MATROSKA_ID_CUETRACKPOSITION 0xB7
116

    
117
/* IDs in the cuetrackposition master */
118
#define MATROSKA_ID_CUETRACK   0xF7
119
#define MATROSKA_ID_CUECLUSTERPOSITION 0xF1
120

    
121
/* IDs in the tags master */
122
/* TODO */
123

    
124
/* IDs in the seekhead master */
125
#define MATROSKA_ID_SEEKENTRY  0x4DBB
126

    
127
/* IDs in the seekpoint master */
128
#define MATROSKA_ID_SEEKID     0x53AB
129
#define MATROSKA_ID_SEEKPOSITION 0x53AC
130

    
131
/* IDs in the cluster master */
132
#define MATROSKA_ID_CLUSTERTIMECODE 0xE7
133
#define MATROSKA_ID_BLOCKGROUP 0xA0
134
#define MATROSKA_ID_SIMPLEBLOCK 0xA3
135

    
136
/* IDs in the blockgroup master */
137
#define MATROSKA_ID_BLOCK      0xA1
138
#define MATROSKA_ID_BLOCKDURATION 0x9B
139
#define MATROSKA_ID_BLOCKREFERENCE 0xFB
140

    
141
typedef enum {
142
  MATROSKA_TRACK_TYPE_VIDEO    = 0x1,
143
  MATROSKA_TRACK_TYPE_AUDIO    = 0x2,
144
  MATROSKA_TRACK_TYPE_COMPLEX  = 0x3,
145
  MATROSKA_TRACK_TYPE_LOGO     = 0x10,
146
  MATROSKA_TRACK_TYPE_SUBTITLE = 0x11,
147
  MATROSKA_TRACK_TYPE_CONTROL  = 0x20,
148
} MatroskaTrackType;
149

    
150
typedef enum {
151
  MATROSKA_EYE_MODE_MONO  = 0x0,
152
  MATROSKA_EYE_MODE_RIGHT = 0x1,
153
  MATROSKA_EYE_MODE_LEFT  = 0x2,
154
  MATROSKA_EYE_MODE_BOTH  = 0x3,
155
} MatroskaEyeMode;
156

    
157
typedef enum {
158
  MATROSKA_ASPECT_RATIO_MODE_FREE  = 0x0,
159
  MATROSKA_ASPECT_RATIO_MODE_KEEP  = 0x1,
160
  MATROSKA_ASPECT_RATIO_MODE_FIXED = 0x2,
161
} MatroskaAspectRatioMode;
162

    
163
/*
164
 * These aren't in any way "matroska-form" things,
165
 * it's just something I use in the muxer/demuxer.
166
 */
167

    
168
typedef enum {
169
  MATROSKA_TRACK_ENABLED = (1<<0),
170
  MATROSKA_TRACK_DEFAULT = (1<<1),
171
  MATROSKA_TRACK_LACING  = (1<<2),
172
  MATROSKA_TRACK_REAL_V  = (1<<4),
173
  MATROSKA_TRACK_SHIFT   = (1<<16)
174
} MatroskaTrackFlags;
175

    
176
typedef enum {
177
  MATROSKA_VIDEOTRACK_INTERLACED = (MATROSKA_TRACK_SHIFT<<0)
178
} MatroskaVideoTrackFlags;
179

    
180
/*
181
 * Matroska Codec IDs. Strings.
182
 */
183

    
184
typedef struct CodecTags{
185
    const char *str;
186
    enum CodecID id;
187
}CodecTags;
188

    
189
#define MATROSKA_CODEC_ID_VIDEO_VFW_FOURCC   "V_MS/VFW/FOURCC"
190
#define MATROSKA_CODEC_ID_AUDIO_ACM          "A_MS/ACM"
191

    
192
/* max. depth in the EBML tree structure */
193
#define EBML_MAX_DEPTH 16
194

    
195
extern CodecTags ff_mkv_codec_tags[];
196

    
197
#endif /* MATROSKA_H */