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