1 | /* |
2 | Copyright (c) 2012, Broadcom Europe Ltd |
3 | All rights reserved. |
4 | |
5 | Redistribution and use in source and binary forms, with or without |
6 | modification, are permitted provided that the following conditions are met: |
7 | * Redistributions of source code must retain the above copyright |
8 | notice, this list of conditions and the following disclaimer. |
9 | * Redistributions in binary form must reproduce the above copyright |
10 | notice, this list of conditions and the following disclaimer in the |
11 | documentation and/or other materials provided with the distribution. |
12 | * Neither the name of the copyright holder nor the |
13 | names of its contributors may be used to endorse or promote products |
14 | derived from this software without specific prior written permission. |
15 | |
16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY |
20 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
23 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ |
27 | #ifndef MP4_COMMON_H |
28 | #define MP4_COMMON_H |
29 | |
30 | /****************************************************************************** |
31 | Type definitions. |
32 | ******************************************************************************/ |
33 | typedef enum { |
34 | MP4_BOX_TYPE_UNKNOWN = 0, |
35 | MP4_BOX_TYPE_ROOT = VC_FOURCC('r','o','o','t'), |
36 | MP4_BOX_TYPE_FTYP = VC_FOURCC('f','t','y','p'), |
37 | MP4_BOX_TYPE_MDAT = VC_FOURCC('m','d','a','t'), |
38 | MP4_BOX_TYPE_MOOV = VC_FOURCC('m','o','o','v'), |
39 | MP4_BOX_TYPE_MVHD = VC_FOURCC('m','v','h','d'), |
40 | MP4_BOX_TYPE_TRAK = VC_FOURCC('t','r','a','k'), |
41 | MP4_BOX_TYPE_TKHD = VC_FOURCC('t','k','h','d'), |
42 | MP4_BOX_TYPE_MDIA = VC_FOURCC('m','d','i','a'), |
43 | MP4_BOX_TYPE_MDHD = VC_FOURCC('m','d','h','d'), |
44 | MP4_BOX_TYPE_HDLR = VC_FOURCC('h','d','l','r'), |
45 | MP4_BOX_TYPE_MINF = VC_FOURCC('m','i','n','f'), |
46 | MP4_BOX_TYPE_VMHD = VC_FOURCC('v','m','h','d'), |
47 | MP4_BOX_TYPE_SMHD = VC_FOURCC('s','m','h','d'), |
48 | MP4_BOX_TYPE_DINF = VC_FOURCC('d','i','n','f'), |
49 | MP4_BOX_TYPE_DREF = VC_FOURCC('d','r','e','f'), |
50 | MP4_BOX_TYPE_STBL = VC_FOURCC('s','t','b','l'), |
51 | MP4_BOX_TYPE_STSD = VC_FOURCC('s','t','s','d'), |
52 | MP4_BOX_TYPE_STTS = VC_FOURCC('s','t','t','s'), |
53 | MP4_BOX_TYPE_CTTS = VC_FOURCC('c','t','t','s'), |
54 | MP4_BOX_TYPE_STSC = VC_FOURCC('s','t','s','c'), |
55 | MP4_BOX_TYPE_STSZ = VC_FOURCC('s','t','s','z'), |
56 | MP4_BOX_TYPE_STCO = VC_FOURCC('s','t','c','o'), |
57 | MP4_BOX_TYPE_CO64 = VC_FOURCC('c','o','6','4'), |
58 | MP4_BOX_TYPE_STSS = VC_FOURCC('s','t','s','s'), |
59 | MP4_BOX_TYPE_VIDE = VC_FOURCC('v','i','d','e'), |
60 | MP4_BOX_TYPE_SOUN = VC_FOURCC('s','o','u','n'), |
61 | MP4_BOX_TYPE_TEXT = VC_FOURCC('t','e','x','t'), |
62 | MP4_BOX_TYPE_FREE = VC_FOURCC('f','r','e','e'), |
63 | MP4_BOX_TYPE_SKIP = VC_FOURCC('s','k','i','p'), |
64 | MP4_BOX_TYPE_WIDE = VC_FOURCC('w','i','d','e'), |
65 | MP4_BOX_TYPE_PNOT = VC_FOURCC('p','m','o','t'), |
66 | MP4_BOX_TYPE_PICT = VC_FOURCC('P','I','C','T'), |
67 | MP4_BOX_TYPE_UDTA = VC_FOURCC('u','d','t','a'), |
68 | MP4_BOX_TYPE_UUID = VC_FOURCC('u','u','i','d'), |
69 | MP4_BOX_TYPE_ESDS = VC_FOURCC('e','s','d','s'), |
70 | MP4_BOX_TYPE_AVCC = VC_FOURCC('a','v','c','C'), |
71 | MP4_BOX_TYPE_D263 = VC_FOURCC('d','2','6','3'), |
72 | MP4_BOX_TYPE_DAMR = VC_FOURCC('d','a','m','r'), |
73 | MP4_BOX_TYPE_DAWP = VC_FOURCC('d','a','w','p'), |
74 | MP4_BOX_TYPE_DEVC = VC_FOURCC('d','e','v','c'), |
75 | MP4_BOX_TYPE_WAVE = VC_FOURCC('w','a','v','e'), |
76 | MP4_BOX_TYPE_ZERO = 0 |
77 | } MP4_BOX_TYPE_T; |
78 | |
79 | typedef enum { |
80 | MP4_BRAND_ISOM = VC_FOURCC('i','s','o','m'), |
81 | MP4_BRAND_MP42 = VC_FOURCC('m','p','4','2'), |
82 | MP4_BRAND_3GP4 = VC_FOURCC('3','g','p','4'), |
83 | MP4_BRAND_3GP5 = VC_FOURCC('3','g','p','5'), |
84 | MP4_BRAND_3GP6 = VC_FOURCC('3','g','p','6'), |
85 | MP4_BRAND_SKM2 = VC_FOURCC('s','k','m','2'), |
86 | MP4_BRAND_SKM3 = VC_FOURCC('s','k','m','3'), |
87 | MP4_BRAND_QT = VC_FOURCC('q','t',' ',' '), |
88 | MP4_BRAND_NUM |
89 | } MP4_BRAND_T; |
90 | |
91 | typedef enum |
92 | { |
93 | MP4_SAMPLE_TABLE_STTS = 0, /* decoding time to sample */ |
94 | MP4_SAMPLE_TABLE_STSZ = 1, /* sample size */ |
95 | MP4_SAMPLE_TABLE_STSC = 2, /* sample to chunk */ |
96 | MP4_SAMPLE_TABLE_STCO = 3, /* sample to chunk-offset */ |
97 | MP4_SAMPLE_TABLE_STSS = 4, /* sync sample */ |
98 | MP4_SAMPLE_TABLE_CO64 = 5, /* sample to chunk-offset */ |
99 | MP4_SAMPLE_TABLE_CTTS = 6, /* composite time to sample */ |
100 | MP4_SAMPLE_TABLE_NUM |
101 | } MP4_SAMPLE_TABLE_T; |
102 | |
103 | /* Values for object_type_indication (mp4_decoder_config_descriptor) |
104 | * see ISO/IEC 14496-1:2001(E) section 8.6.6.2 table 8 p. 30 |
105 | * see ISO/IEC 14496-15:2003 (draft) section 4.2.2 table 3 p. 11 |
106 | * see SKT Spec 8.2.3 p. 107 |
107 | * see 3GPP2 Spec v1.0 p. 22 */ |
108 | #define MP4_MPEG4_VISUAL_OBJECT_TYPE 0x20 /* visual ISO/IEC 14496-2 */ |
109 | #define MP4_MPEG4_H264_OBJECT_TYPE 0x21 /* visual ISO/IEC 14496-10 */ |
110 | #define MP4_MPEG4_H264_PS_OBJECT_TYPE 0x22 /* visual ISO/IEC 14496-10 (used for parameter ES) */ |
111 | #define MP4_MPEG4_AAC_LC_OBJECT_TYPE 0x40 /* audio ISO/IEC 14496-3 */ |
112 | #define MP4_MPEG2_SP_OBJECT_TYPE 0x60 /* visual ISO/IEC 13818-2 Simple Profile */ |
113 | #define MP4_MPEG2_MP_OBJECT_TYPE 0x61 /* visual ISO/IEC 13818-2 Main Profile */ |
114 | #define MP4_MPEG2_SNR_OBJECT_TYPE 0x62 /* visual ISO/IEC 13818-2 SNR Profile */ |
115 | #define MP4_MPEG2_AAC_LC_OBJECT_TYPE 0x67 /* audio ISO/IEC 13818-7 LowComplexity Profile */ |
116 | #define MP4_MP3_OBJECT_TYPE 0x69 /* audio ISO/IEC 13818-3 */ |
117 | #define MP4_MPEG1_VISUAL_OBJECT_TYPE 0x6A /* visual ISO/IEC 11172-2 */ |
118 | #define MP4_MPEG1_AUDIO_OBJECT_TYPE 0x6B /* audio ISO/IEC 11172-3 */ |
119 | #define MP4_JPEG_OBJECT_TYPE 0x6C /* visual ISO/IEC 10918-1 */ |
120 | #define MP4_SKT_EVRC_2V1_OBJECT_TYPE 0x82 /* SKT spec V2.1 for EVRC */ |
121 | #define MP4_KTF_EVRC_OBJECT_TYPE 0xC2 /* KTF spec V1.2 for EVRC */ |
122 | #define MP4_KTF_AMR_OBJECT_TYPE 0xC4 /* KTF spec V1.2 for AMR */ |
123 | #define MP4_KTF_MP3_OBJECT_TYPE 0xC5 /* KTF spec V1.2 for MP3 */ |
124 | #define MP4_SKT_TEXT_OBJECT_TYPE 0xD0 /* SKT spec V2.2 for Text */ |
125 | #define MP4_SKT_EVRC_OBJECT_TYPE 0xD1 /* SKT spec V2.2 for EVRC */ |
126 | #define MP4_3GPP2_QCELP_OBJECT_TYPE 0xE1 /* 3GPP2 spec V1.0 for QCELP13K */ |
127 | |
128 | #endif /* MP4_COMMON_H */ |
129 | |