| 1193 | } // QuickTimeVideo::sampleDesc |
| 1194 | |
| 1195 | void QuickTimeVideo::audioDescDecoder() { |
| 1196 | DataBuf buf(40); |
| 1197 | std::memset(buf.data(), 0x0, buf.size()); |
| 1198 | buf.data()[4] = '\0'; |
| 1199 | io_->readOrThrow(buf.data(), 4); |
| 1200 | size_t size = 82; |
| 1201 | |
| 1202 | const TagVocabulary* td; |
| 1203 | |
| 1204 | for (int i = 0; size / 4 != 0; size -= 4, i++) { |
| 1205 | io_->readOrThrow(buf.data(), 4); |
| 1206 | switch (i) { |
| 1207 | case AudioFormat: |
| 1208 | td = Exiv2::find(qTimeFileType, Exiv2::toString(buf.data())); |
| 1209 | if (td) |
| 1210 | xmpData_["Xmp.audio.Compressor"] = exvGettext(td->label_); |
| 1211 | else |
| 1212 | xmpData_["Xmp.audio.Compressor"] = Exiv2::toString(buf.data()); |
| 1213 | break; |
| 1214 | case AudioVendorID: |
| 1215 | td = Exiv2::find(vendorIDTags, Exiv2::toString(buf.data())); |
| 1216 | if (td) |
| 1217 | xmpData_["Xmp.audio.VendorID"] = exvGettext(td->label_); |
| 1218 | break; |
| 1219 | case AudioChannels: |
| 1220 | xmpData_["Xmp.audio.ChannelType"] = buf.read_uint16(0, bigEndian); |
| 1221 | xmpData_["Xmp.audio.BitsPerSample"] = (buf.data()[2] * 256 + buf.data()[3]); |
| 1222 | break; |
| 1223 | case AudioSampleRate: |
| 1224 | xmpData_["Xmp.audio.SampleRate"] = |
| 1225 | buf.read_uint16(0, bigEndian) + ((buf.data()[2] * 256 + buf.data()[3]) * 0.01); |
| 1226 | break; |
| 1227 | default: |
| 1228 | break; |
| 1229 | } |
| 1230 | } |
| 1231 | io_->readOrThrow(buf.data(), static_cast<long>(size % 4)); // cause size is so small, this cast should be right. |
| 1232 | } // QuickTimeVideo::audioDescDecoder |
| 1233 | |
| 1234 | void QuickTimeVideo::imageDescDecoder() { |
| 1235 | DataBuf buf(40); |
nothing calls this directly
no test coverage detected