Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / media / formats / mp4 / fourccs.h
blobfd9779762187f3033445cb5a5d0c5110e7f0ea2d
1 // Copyright 2014 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.
5 #ifndef MEDIA_FORMATS_MP4_FOURCCS_H_
6 #define MEDIA_FORMATS_MP4_FOURCCS_H_
8 #include <string>
10 namespace media {
11 namespace mp4 {
13 enum FourCC {
14 FOURCC_NULL = 0,
15 FOURCC_AVC1 = 0x61766331,
16 FOURCC_AVC3 = 0x61766333,
17 FOURCC_AVCC = 0x61766343,
18 FOURCC_BLOC = 0x626C6F63,
19 FOURCC_CENC = 0x63656e63,
20 FOURCC_CO64 = 0x636f3634,
21 FOURCC_CTTS = 0x63747473,
22 FOURCC_DINF = 0x64696e66,
23 FOURCC_EDTS = 0x65647473,
24 FOURCC_EMSG = 0x656d7367,
25 FOURCC_ELST = 0x656c7374,
26 FOURCC_ENCA = 0x656e6361,
27 FOURCC_ENCV = 0x656e6376,
28 FOURCC_ESDS = 0x65736473,
29 FOURCC_FREE = 0x66726565,
30 FOURCC_FRMA = 0x66726d61,
31 FOURCC_FTYP = 0x66747970,
32 FOURCC_HDLR = 0x68646c72,
33 FOURCC_HINT = 0x68696e74,
34 #if defined(ENABLE_HEVC_DEMUXING)
35 FOURCC_HEV1 = 0x68657631,
36 FOURCC_HVC1 = 0x68766331,
37 FOURCC_HVCC = 0x68766343,
38 #endif
39 FOURCC_IODS = 0x696f6473,
40 FOURCC_MDAT = 0x6d646174,
41 FOURCC_MDHD = 0x6d646864,
42 FOURCC_MDIA = 0x6d646961,
43 FOURCC_MECO = 0x6d65636f,
44 FOURCC_MEHD = 0x6d656864,
45 FOURCC_META = 0x6d657461,
46 FOURCC_MFHD = 0x6d666864,
47 FOURCC_MFRA = 0x6d667261,
48 FOURCC_MINF = 0x6d696e66,
49 FOURCC_MOOF = 0x6d6f6f66,
50 FOURCC_MOOV = 0x6d6f6f76,
51 FOURCC_MP4A = 0x6d703461,
52 FOURCC_MP4V = 0x6d703476,
53 FOURCC_MVEX = 0x6d766578,
54 FOURCC_MVHD = 0x6d766864,
55 FOURCC_PASP = 0x70617370,
56 FOURCC_PDIN = 0x7064696e,
57 FOURCC_PRFT = 0x70726674,
58 FOURCC_PSSH = 0x70737368,
59 FOURCC_SAIO = 0x7361696f,
60 FOURCC_SAIZ = 0x7361697a,
61 FOURCC_SBGP = 0x73626770,
62 FOURCC_SCHI = 0x73636869,
63 FOURCC_SCHM = 0x7363686d,
64 FOURCC_SDTP = 0x73647470,
65 FOURCC_SEIG = 0x73656967,
66 FOURCC_SGPD = 0x73677064,
67 FOURCC_SIDX = 0x73696478,
68 FOURCC_SINF = 0x73696e66,
69 FOURCC_SKIP = 0x736b6970,
70 FOURCC_SMHD = 0x736d6864,
71 FOURCC_SOUN = 0x736f756e,
72 FOURCC_SSIX = 0x73736978,
73 FOURCC_STBL = 0x7374626c,
74 FOURCC_STCO = 0x7374636f,
75 FOURCC_STSC = 0x73747363,
76 FOURCC_STSD = 0x73747364,
77 FOURCC_STSS = 0x73747373,
78 FOURCC_STSZ = 0x7374737a,
79 FOURCC_STTS = 0x73747473,
80 FOURCC_STYP = 0x73747970,
81 FOURCC_TENC = 0x74656e63,
82 FOURCC_TFDT = 0x74666474,
83 FOURCC_TFHD = 0x74666864,
84 FOURCC_TKHD = 0x746b6864,
85 FOURCC_TRAF = 0x74726166,
86 FOURCC_TRAK = 0x7472616b,
87 FOURCC_TREX = 0x74726578,
88 FOURCC_TRUN = 0x7472756e,
89 FOURCC_UDTA = 0x75647461,
90 FOURCC_UUID = 0x75756964,
91 FOURCC_VIDE = 0x76696465,
92 FOURCC_VMHD = 0x766d6864,
93 FOURCC_WIDE = 0x77696465,
96 const inline std::string FourCCToString(FourCC fourcc) {
97 char buf[5];
98 buf[0] = (fourcc >> 24) & 0xff;
99 buf[1] = (fourcc >> 16) & 0xff;
100 buf[2] = (fourcc >> 8) & 0xff;
101 buf[3] = (fourcc) & 0xff;
102 buf[4] = 0;
103 return std::string(buf);
106 } // namespace mp4
107 } // namespace media
109 #endif // MEDIA_FORMATS_MP4_FOURCCS_H_