DASH Media Packaging SDK
 All Classes Namespaces Functions Variables Typedefs Enumerator
fourccs.h
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef MEDIA_FORMATS_MP4_FOURCCS_H_
6 #define MEDIA_FORMATS_MP4_FOURCCS_H_
7 
8 #include <string>
9 
10 namespace edash_packager {
11 namespace media {
12 namespace mp4 {
13 
14 // TODO(rkuroiwa): Make these case sensitive. e.g. FOURCC_avc1.
15 enum FourCC {
16  FOURCC_NULL = 0,
17  FOURCC_ID32 = 0x49443332,
18  FOURCC_PRIV = 0x50524956,
19  FOURCC_AC3 = 0x61632d33, // This fourcc is "ac-3".
20  FOURCC_AVC1 = 0x61766331,
21  FOURCC_AVCC = 0x61766343,
22  FOURCC_BLOC = 0x626C6F63,
23  FOURCC_CENC = 0x63656e63,
24  FOURCC_CO64 = 0x636f3634,
25  FOURCC_CTTS = 0x63747473,
26  FOURCC_DAC3 = 0x64616333,
27  FOURCC_DASH = 0x64617368,
28  FOURCC_DDTS = 0x64647473,
29  FOURCC_DEC3 = 0x64656333,
30  FOURCC_DINF = 0x64696e66,
31  FOURCC_DREF = 0x64726566,
32  FOURCC_DTSC = 0x64747363,
33  FOURCC_DTSE = 0x64747365,
34  FOURCC_DTSH = 0x64747368,
35  FOURCC_DTSL = 0x6474736c,
36  FOURCC_DTSM = 0x6474732d,
37  FOURCC_DTSP = 0x6474732b,
38  FOURCC_EAC3 = 0x65632d33, // This fourcc is "ec-3".
39  FOURCC_EDTS = 0x65647473,
40  FOURCC_ELST = 0x656c7374,
41  FOURCC_ENCA = 0x656e6361,
42  FOURCC_ENCV = 0x656e6376,
43  FOURCC_ESDS = 0x65736473,
44  FOURCC_FREE = 0x66726565,
45  FOURCC_FRMA = 0x66726d61,
46  FOURCC_FTYP = 0x66747970,
47  FOURCC_HDLR = 0x68646c72,
48  FOURCC_HEV1 = 0x68657631,
49  FOURCC_HINT = 0x68696e74,
50  FOURCC_HVC1 = 0x68766331,
51  FOURCC_HVCC = 0x68766343,
52  FOURCC_ISO6 = 0x69736f36,
53  FOURCC_IODS = 0x696f6473,
54  FOURCC_MDAT = 0x6d646174,
55  FOURCC_MDHD = 0x6d646864,
56  FOURCC_MDIA = 0x6d646961,
57  FOURCC_MECO = 0x6d65636f,
58  FOURCC_MEHD = 0x6d656864,
59  FOURCC_META = 0x6d657461,
60  FOURCC_MFHD = 0x6d666864,
61  FOURCC_MFRA = 0x6d667261,
62  FOURCC_MINF = 0x6d696e66,
63  FOURCC_MOOF = 0x6d6f6f66,
64  FOURCC_MOOV = 0x6d6f6f76,
65  FOURCC_MP41 = 0x6d703431,
66  FOURCC_MP4A = 0x6d703461,
67  FOURCC_MP4V = 0x6d703476,
68  FOURCC_MVEX = 0x6d766578,
69  FOURCC_MVHD = 0x6d766864,
70  FOURCC_PASP = 0x70617370,
71  FOURCC_PDIN = 0x7064696e,
72  FOURCC_PRFT = 0x70726674,
73  FOURCC_PSSH = 0x70737368,
74  FOURCC_SAIO = 0x7361696f,
75  FOURCC_SAIZ = 0x7361697a,
76  FOURCC_SBGP = 0x73626770,
77  FOURCC_SCHI = 0x73636869,
78  FOURCC_SCHM = 0x7363686d,
79  FOURCC_SDTP = 0x73647470,
80  FOURCC_SEIG = 0x73656967,
81  FOURCC_SENC = 0x73656e63,
82  FOURCC_SGPD = 0x73677064,
83  FOURCC_SIDX = 0x73696478,
84  FOURCC_SINF = 0x73696e66,
85  FOURCC_SKIP = 0x736b6970,
86  FOURCC_SMHD = 0x736d6864,
87  FOURCC_SOUN = 0x736f756e,
88  FOURCC_SSIX = 0x73736978,
89  FOURCC_STBL = 0x7374626c,
90  FOURCC_STCO = 0x7374636f,
91  FOURCC_STSC = 0x73747363,
92  FOURCC_STSD = 0x73747364,
93  FOURCC_STSS = 0x73747373,
94  FOURCC_STSZ = 0x7374737a,
95  FOURCC_STTS = 0x73747473,
96  FOURCC_STYP = 0x73747970,
97  FOURCC_STZ2 = 0x73747a32,
98  FOURCC_SUBT = 0x73756274,
99  FOURCC_TENC = 0x74656e63,
100  FOURCC_TEXT = 0x74657874,
101  FOURCC_TFDT = 0x74666474,
102  FOURCC_TFHD = 0x74666864,
103  FOURCC_TKHD = 0x746b6864,
104  FOURCC_TRAF = 0x74726166,
105  FOURCC_TRAK = 0x7472616b,
106  FOURCC_TREX = 0x74726578,
107  FOURCC_TRUN = 0x7472756e,
108  FOURCC_UDTA = 0x75647461,
109  FOURCC_URL = 0x75726c20,
110  FOURCC_URN = 0x75726e20,
111  FOURCC_UUID = 0x75756964,
112  FOURCC_VIDE = 0x76696465,
113  FOURCC_VMHD = 0x766d6864,
114  FOURCC_VP08 = 0x76703038,
115  FOURCC_VP09 = 0x76703039,
116  FOURCC_VP10 = 0x76703130,
117  FOURCC_VPCC = 0x76706343,
118  FOURCC_WIDE = 0x77696465,
119  FOURCC_ctim = 0x6374696d,
120  FOURCC_iden = 0x6964656e,
121  FOURCC_payl = 0x7061796c,
122  FOURCC_sthd = 0x73746864,
123  FOURCC_sttg = 0x73747467,
124  FOURCC_vlab = 0x766c6162,
125  FOURCC_vsid = 0x76736964,
126  FOURCC_vttC = 0x76747443,
127  FOURCC_vtta = 0x76747461,
128  FOURCC_vttc = 0x76747463,
129  FOURCC_vtte = 0x76747465,
130  FOURCC_wvtt = 0x77767474,
131 };
132 
133 const inline std::string FourCCToString(FourCC fourcc) {
134  char buf[5];
135  buf[0] = (fourcc >> 24) & 0xff;
136  buf[1] = (fourcc >> 16) & 0xff;
137  buf[2] = (fourcc >> 8) & 0xff;
138  buf[3] = (fourcc) & 0xff;
139  buf[4] = 0;
140  return std::string(buf);
141 }
142 
143 } // namespace mp4
144 } // namespace media
145 } // namespace edash_packager
146 
147 #endif // MEDIA_FORMATS_MP4_FOURCCS_H_