2 * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
20 #include "qtdemux_types.h"
21 #include "qtdemux_dump.h"
24 static const QtNodeType qt_node_types[] = {
25 {FOURCC_moov, "movie", QT_FLAG_CONTAINER,},
26 {FOURCC_mvhd, "movie header", 0,
28 {FOURCC_clip, "clipping", QT_FLAG_CONTAINER,},
29 {FOURCC_trak, "track", QT_FLAG_CONTAINER,},
30 {FOURCC_udta, "user data", QT_FLAG_CONTAINER,}, /* special container */
31 {FOURCC_ctab, "color table", 0,},
32 {FOURCC_tkhd, "track header", 0,
34 {FOURCC_crgn, "clipping region", 0,},
35 {FOURCC_matt, "track matte", QT_FLAG_CONTAINER,},
36 {FOURCC_kmat, "compressed matte", 0,},
37 {FOURCC_edts, "edit", QT_FLAG_CONTAINER,},
38 {FOURCC_elst, "edit list", 0,
40 {FOURCC_load, "track load settings", 0,},
41 {FOURCC_tref, "track reference", QT_FLAG_CONTAINER,},
42 {FOURCC_imap, "track input map", QT_FLAG_CONTAINER,},
43 {FOURCC___in, "track input", 0,}, /* special container */
44 {FOURCC___ty, "input type", 0,},
45 {FOURCC_mdia, "media", QT_FLAG_CONTAINER},
46 {FOURCC_mdhd, "media header", 0,
48 {FOURCC_hdlr, "handler reference", 0,
50 {FOURCC_minf, "media information", QT_FLAG_CONTAINER},
51 {FOURCC_vmhd, "video media information", 0,
53 {FOURCC_smhd, "sound media information", 0},
54 {FOURCC_gmhd, "base media information header", 0},
55 {FOURCC_gmin, "base media info", 0},
56 {FOURCC_dinf, "data information", QT_FLAG_CONTAINER},
57 {FOURCC_dref, "data reference", 0,
59 {FOURCC_stbl, "sample table", QT_FLAG_CONTAINER},
60 {FOURCC_stsd, "sample description", 0,
62 {FOURCC_stts, "time-to-sample", 0,
64 {FOURCC_stps, "partial sync sample", 0,
66 {FOURCC_stss, "sync sample", 0,
68 {FOURCC_stsc, "sample-to-chunk", 0,
70 {FOURCC_stsz, "sample size", 0,
72 {FOURCC_stco, "chunk offset", 0,
74 {FOURCC_co64, "64-bit chunk offset", 0,
76 {FOURCC_vide, "video media", 0},
77 {FOURCC_cmov, "compressed movie", QT_FLAG_CONTAINER},
78 {FOURCC_dcom, "compressed data", 0, qtdemux_dump_dcom},
79 {FOURCC_cmvd, "compressed movie data", 0, qtdemux_dump_cmvd},
80 {FOURCC_hint, "hint", 0,},
81 {FOURCC_mp4a, "mp4a", 0,},
82 {FOURCC_mp4v, "mp4v", 0,},
83 {FOURCC_mjp2, "mjp2", 0,},
84 {FOURCC_mhdr, "mhdr", QT_FLAG_CONTAINER,},
85 {FOURCC_jp2h, "jp2h", QT_FLAG_CONTAINER,},
86 {FOURCC_colr, "colr", 0,},
87 {FOURCC_fiel, "fiel", 0,},
88 {FOURCC_jp2x, "jp2x", 0,},
89 {FOURCC_alac, "alac", 0,},
90 {FOURCC_wave, "wave", QT_FLAG_CONTAINER},
91 {FOURCC_appl, "appl", QT_FLAG_CONTAINER},
92 {FOURCC_esds, "esds", 0},
93 {FOURCC_hnti, "hnti", QT_FLAG_CONTAINER},
94 {FOURCC_rtp_, "rtp ", 0, qtdemux_dump_unknown},
95 {FOURCC_sdp_, "sdp ", 0, qtdemux_dump_unknown},
96 {FOURCC_meta, "meta", 0, qtdemux_dump_unknown},
97 {FOURCC_ilst, "ilst", QT_FLAG_CONTAINER,},
98 {FOURCC__nam, "Name", QT_FLAG_CONTAINER,},
99 {FOURCC_titl, "Title", QT_FLAG_CONTAINER,},
100 {FOURCC__ART, "Artist", QT_FLAG_CONTAINER,},
101 {FOURCC_aART, "Album Artist", QT_FLAG_CONTAINER,},
102 {FOURCC_auth, "Author", QT_FLAG_CONTAINER,},
103 {FOURCC_perf, "Performer", QT_FLAG_CONTAINER,},
104 {FOURCC__wrt, "Writer", QT_FLAG_CONTAINER,},
105 {FOURCC__grp, "Grouping", QT_FLAG_CONTAINER,},
106 {FOURCC__alb, "Album", QT_FLAG_CONTAINER,},
107 {FOURCC_albm, "Album", QT_FLAG_CONTAINER,},
108 {FOURCC__day, "Date", QT_FLAG_CONTAINER,},
109 {FOURCC__cpy, "Copyright", QT_FLAG_CONTAINER,},
110 {FOURCC__cmt, "Comment", QT_FLAG_CONTAINER,},
111 {FOURCC__des, "Description", QT_FLAG_CONTAINER,},
112 {FOURCC_desc, "Description", QT_FLAG_CONTAINER,},
113 {FOURCC_dscp, "Description", QT_FLAG_CONTAINER,},
114 {FOURCC__lyr, "Lyrics", QT_FLAG_CONTAINER,},
115 {FOURCC__req, "Requirement", QT_FLAG_CONTAINER,},
116 {FOURCC__enc, "Encoder", QT_FLAG_CONTAINER,},
117 {FOURCC_gnre, "Genre", QT_FLAG_CONTAINER,},
118 {FOURCC_trkn, "Track Number", QT_FLAG_CONTAINER,},
119 {FOURCC_disc, "Disc Number", QT_FLAG_CONTAINER,},
120 {FOURCC_disk, "Disc Number", QT_FLAG_CONTAINER,},
121 {FOURCC_cprt, "Copyright", QT_FLAG_CONTAINER,},
122 {FOURCC_cpil, "Compilation", QT_FLAG_CONTAINER,},
123 {FOURCC_pgap, "Gapless", QT_FLAG_CONTAINER,},
124 {FOURCC_pcst, "Podcast", QT_FLAG_CONTAINER,},
125 {FOURCC_tmpo, "Tempo", QT_FLAG_CONTAINER,},
126 {FOURCC_covr, "Cover", QT_FLAG_CONTAINER,},
127 {FOURCC_sonm, "Sort Title", QT_FLAG_CONTAINER,},
128 {FOURCC_soal, "Sort Album", QT_FLAG_CONTAINER,},
129 {FOURCC_soar, "Sort Artist", QT_FLAG_CONTAINER,},
130 {FOURCC_soaa, "Sort Album Artist", QT_FLAG_CONTAINER,},
131 {FOURCC_soco, "Sort Composer", QT_FLAG_CONTAINER,},
132 {FOURCC_sosn, "Sort TV Show", QT_FLAG_CONTAINER,},
133 {FOURCC_tvsh, "TV Show", QT_FLAG_CONTAINER,},
134 {FOURCC_tven, "TV Episode ID", QT_FLAG_CONTAINER,},
135 {FOURCC_tvsn, "TV Season Number", QT_FLAG_CONTAINER,},
136 {FOURCC_tves, "TV Episode Number", QT_FLAG_CONTAINER,},
137 {FOURCC_keyw, "Keywords", QT_FLAG_CONTAINER,},
138 {FOURCC_kywd, "Keywords", QT_FLAG_CONTAINER,},
139 {FOURCC__too, "Encoder", QT_FLAG_CONTAINER,},
140 {FOURCC_____, "----", QT_FLAG_CONTAINER,},
141 {FOURCC_data, "data", 0, qtdemux_dump_unknown},
142 {FOURCC_free, "free", 0,},
143 {FOURCC_SVQ3, "SVQ3", 0,},
144 {FOURCC_rmra, "rmra", QT_FLAG_CONTAINER,},
145 {FOURCC_rmda, "rmda", QT_FLAG_CONTAINER,},
146 {FOURCC_rdrf, "rdrf", 0,},
147 {FOURCC__gen, "Custom Genre", QT_FLAG_CONTAINER,},
148 {FOURCC_ctts, "Composition time to sample", 0, qtdemux_dump_ctts},
149 {FOURCC_cslg, "Composition Shift Least Greatest", 0, qtdemux_dump_cslg},
150 {FOURCC_XiTh, "XiTh", 0},
151 {FOURCC_XdxT, "XdxT", 0},
152 {FOURCC_loci, "loci", 0},
153 {FOURCC_clsf, "clsf", 0},
154 {FOURCC_mfra, "movie fragment random access",
156 {FOURCC_tfra, "track fragment random access", 0,
158 {FOURCC_mfro, "movie fragment random access offset", 0,
160 {FOURCC_moof, "movie fragment", QT_FLAG_CONTAINER,},
161 {FOURCC_mfhd, "movie fragment header", 0, qtdemux_dump_mfhd},
162 {FOURCC_traf, "track fragment", QT_FLAG_CONTAINER,},
163 {FOURCC_tfhd, "track fragment header", 0,
165 {FOURCC_sdtp, "independent and disposable samples", 0,
167 {FOURCC_trun, "track fragment run", 0, qtdemux_dump_trun},
168 {FOURCC_mdat, "moovie data", 0, qtdemux_dump_unknown},
169 {FOURCC_trex, "moovie data", 0, qtdemux_dump_trex},
170 {FOURCC_mvex, "mvex", QT_FLAG_CONTAINER,},
171 {FOURCC_mehd, "movie extends header", 0,
173 {FOURCC_ovc1, "ovc1", 0},
174 {FOURCC_owma, "owma", 0},
175 {FOURCC_avcC, "AV codec configuration container", 0},
176 {FOURCC_avc1, "AV codec configuration v1", 0},
177 {FOURCC_avc3, "AV codec configuration v3", 0},
178 {FOURCC_mp4s, "VOBSUB codec configuration", 0},
179 {FOURCC_hvc1, "HEVC codec configuration", 0},
180 {FOURCC_hev1, "HEVC codec configuration", 0},
181 {FOURCC_hvcC, "HEVC codec configuration container", 0},
182 {FOURCC_tfdt, "Track fragment decode time", 0, qtdemux_dump_tfdt},
183 {FOURCC_chap, "Chapter Reference"},
184 {FOURCC_btrt, "Bitrate information", 0},
185 {FOURCC_frma, "Audio codec format", 0},
186 {FOURCC_name, "name", 0},
187 {FOURCC_mean, "mean", 0},
188 {FOURCC_svmi, "Stereoscopic Video Media Information", 0,
190 {FOURCC_scdi, "Stereoscopic Camera and Display Information", 0,
191 qtdemux_dump_unknown},
192 {FOURCC_saiz, "sample auxiliary information sizes", 0},
193 {FOURCC_saio, "sample auxiliary information offsets", 0},
194 {FOURCC_encv, "encrypted visual sample entry", 0},
195 {FOURCC_enca, "encrypted audio sample entry", 0},
196 {FOURCC_enct, "encrypted text sample entry", 0},
197 {FOURCC_encs, "encrypted system sample entry", 0},
198 {FOURCC_sinf, "protection scheme information", QT_FLAG_CONTAINER},
199 {FOURCC_frma, "original format", 0},
200 {FOURCC_schm, "scheme type", 0},
201 {FOURCC_schi, "scheme information", QT_FLAG_CONTAINER},
202 {FOURCC_pssh, "protection system specific header", 0},
203 {FOURCC_tenc, "track encryption", 0},
204 {FOURCC_stpp, "XML subtitle sample entry", 0},
208 static const int n_qt_node_types =
209 sizeof (qt_node_types) / sizeof (qt_node_types[0]);
212 qtdemux_type_get (guint32 fourcc)
216 for (i = 0; i < n_qt_node_types; i++) {
217 if (G_UNLIKELY (qt_node_types[i].fourcc == fourcc))
218 return qt_node_types + i;
221 GST_WARNING ("unknown QuickTime node type %" GST_FOURCC_FORMAT,
222 GST_FOURCC_ARGS (fourcc));
224 return qt_node_types + n_qt_node_types - 1;