mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-26 06:18:23 +00:00
COMMON: FORMATS: Implement pInf atom parsing for QuickTime movies
This commit implements pInf (Panorama Information) atom parsing for QuickTime movies. It contains information about panoramic nodes (ID, timestamp) and the default node's zoom level.
This commit is contained in:
parent
4a180f94f5
commit
fc34902998
@ -171,6 +171,8 @@ void QuickTimeParser::initParseTable() {
|
||||
{ &QuickTimeParser::readSMI, MKTAG('S', 'M', 'I', ' ') },
|
||||
{ &QuickTimeParser::readDefault, MKTAG('g', 'm', 'h', 'd') },
|
||||
{ &QuickTimeParser::readLeaf, MKTAG('g', 'm', 'i', 'n') },
|
||||
{ &QuickTimeParser::readDefault, MKTAG('S', 'T', 'p', 'n') },
|
||||
{ &QuickTimeParser::readPINF, MKTAG('p', 'I', 'n', 'f') },
|
||||
{ nullptr, 0 }
|
||||
};
|
||||
|
||||
@ -853,6 +855,25 @@ int QuickTimeParser::readNAVG(Atom atom) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int QuickTimeParser::readPINF(Atom atom) {
|
||||
Track *track = _tracks.back();
|
||||
|
||||
track->panoInfo.name = _fd->readPascalString();
|
||||
_fd->seek((int64)atom.offset + 32);
|
||||
track->panoInfo.defNodeID = _fd->readUint32BE();
|
||||
track->panoInfo.defZoom = readAppleFloatField(_fd);
|
||||
_fd->readUint32BE(); // reserved
|
||||
_fd->readSint16BE(); // padding
|
||||
int16 numEntries = _fd->readSint16BE();
|
||||
track->panoInfo.nodes.resize(numEntries);
|
||||
for (int16 i = 0; i < numEntries; i++) {
|
||||
track->panoInfo.nodes[i].nodeID = _fd->readUint32BE();
|
||||
track->panoInfo.nodes[i].timestamp = _fd->readUint32BE();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int QuickTimeParser::readDREF(Atom atom) {
|
||||
if (atom.size > 1) {
|
||||
Track *track = _tracks.back();
|
||||
|
@ -144,6 +144,18 @@ protected:
|
||||
CODEC_TYPE_MIDI
|
||||
};
|
||||
|
||||
struct PanoramaNode {
|
||||
uint32 nodeID;
|
||||
uint32 timestamp;
|
||||
};
|
||||
|
||||
struct PanoramaInformation {
|
||||
String name;
|
||||
uint32 defNodeID;
|
||||
float defZoom;
|
||||
Array<PanoramaNode> nodes;
|
||||
};
|
||||
|
||||
struct Track {
|
||||
Track();
|
||||
~Track();
|
||||
@ -181,6 +193,8 @@ protected:
|
||||
Common::String directory;
|
||||
int16 nlvlFrom;
|
||||
int16 nlvlTo;
|
||||
|
||||
PanoramaInformation panoInfo;
|
||||
};
|
||||
|
||||
enum class MovieType {
|
||||
@ -269,6 +283,7 @@ private:
|
||||
int readSMI(Atom atom);
|
||||
int readCTYP(Atom atom);
|
||||
int readNAVG(Atom atom);
|
||||
int readPINF(Atom atom);
|
||||
};
|
||||
|
||||
/** @} */
|
||||
|
Loading…
x
Reference in New Issue
Block a user