MCPcopy Create free account
hub / github.com/Exiv2/exiv2 / imageDescDecoder

Method imageDescDecoder

src/quicktimevideo.cpp:1234–1284  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1232} // QuickTimeVideo::audioDescDecoder
1233
1234void QuickTimeVideo::imageDescDecoder() {
1235 DataBuf buf(40);
1236 std::memset(buf.data(), 0x0, buf.size());
1237 buf.data()[4] = '\0';
1238 io_->readOrThrow(buf.data(), 4);
1239 size_t size = 82;
1240
1241 const TagVocabulary* td;
1242
1243 for (int i = 0; size / 4 != 0; size -= 4, i++) {
1244 io_->readOrThrow(buf.data(), 4);
1245
1246 switch (i) {
1247 case codec:
1248 td = Exiv2::find(qTimeFileType, Exiv2::toString(buf.data()));
1249 if (td)
1250 xmpData_["Xmp.video.Codec"] = exvGettext(td->label_);
1251 else
1252 xmpData_["Xmp.video.Codec"] = Exiv2::toString(buf.data());
1253 break;
1254 case VendorID:
1255 td = Exiv2::find(vendorIDTags, Exiv2::toString(buf.data()));
1256 if (td)
1257 xmpData_["Xmp.video.VendorID"] = exvGettext(td->label_);
1258 break;
1259 case SourceImageWidth_Height:
1260 xmpData_["Xmp.video.SourceImageWidth"] = buf.read_uint16(0, bigEndian);
1261 xmpData_["Xmp.video.SourceImageHeight"] = (buf.data()[2] * 256 + buf.data()[3]);
1262 break;
1263 case XResolution:
1264 xmpData_["Xmp.video.XResolution"] =
1265 buf.read_uint16(0, bigEndian) + ((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
1266 break;
1267 case YResolution:
1268 xmpData_["Xmp.video.YResolution"] =
1269 buf.read_uint16(0, bigEndian) + ((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
1270 io_->readOrThrow(buf.data(), 3);
1271 size -= 3;
1272 break;
1273 case CompressorName:
1274 io_->readOrThrow(buf.data(), 32);
1275 size -= 32;
1276 xmpData_["Xmp.video.Compressor"] = Exiv2::toString(buf.data());
1277 break;
1278 default:
1279 break;
1280 }
1281 }
1282 io_->readOrThrow(buf.data(), static_cast<long>(size % 4));
1283 xmpData_["Xmp.video.BitDepth"] = static_cast<int>(buf.read_uint8(0));
1284} // QuickTimeVideo::imageDescDecoder
1285
1286void QuickTimeVideo::multipleEntriesDecoder(size_t recursion_depth) {
1287 enforce(recursion_depth < max_recursion_depth_, Exiv2::ErrorCode::kerCorruptedMetadata);

Callers

nothing calls this directly

Calls 8

toStringFunction · 0.85
exvGettextFunction · 0.85
dataMethod · 0.80
readOrThrowMethod · 0.80
read_uint16Method · 0.80
read_uint8Method · 0.80
findFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected