VIDEO: Implement NodeData struct and getNodeData method

This commit is contained in:
Krish 2024-07-10 22:26:46 +05:30 committed by Eugene Sandulenko
parent 764e4c15ae
commit 8221cd6df0
2 changed files with 40 additions and 0 deletions

View File

@ -671,6 +671,28 @@ void QuickTimeDecoder::handleMouseButton(bool isDown, int16 x, int16 y) {
} }
} }
QuickTimeDecoder::NodeData QuickTimeDecoder::getNodeData(uint32 nodeID) {
for (const auto &sample : _panoTrack->panoSamples) {
if (sample.hdr.nodeID == nodeID) {
return {
nodeID,
sample.hdr.defHPan,
sample.hdr.defVPan,
sample.hdr.defZoom,
sample.hdr.minHPan,
sample.hdr.minVPan,
sample.hdr.maxHPan,
sample.hdr.maxVPan,
sample.hdr.minZoom,
sample.strTable.getString(sample.hdr.nameStrOffset)};
}
}
error("QuickTimeDecoder::getNodeData(): Node with nodeID %d not found!", nodeID);
return {};
}
Audio::Timestamp QuickTimeDecoder::VideoTrackHandler::getFrameTime(uint frame) const { Audio::Timestamp QuickTimeDecoder::VideoTrackHandler::getFrameTime(uint frame) const {
// TODO: This probably doesn't work right with edit lists // TODO: This probably doesn't work right with edit lists
int cumulativeDuration = 0; int cumulativeDuration = 0;

View File

@ -86,6 +86,24 @@ public:
bool isVR() const { return _isVR; } bool isVR() const { return _isVR; }
QTVRType getQTVRType() const { return _qtvrType; } QTVRType getQTVRType() const { return _qtvrType; }
struct NodeData {
uint32 nodeID;
float defHPan;
float defVPan;
float defZoom;
float minHPan;
float minVPan;
float maxHPan;
float maxVPan;
float minZoom;
Common::String name;
};
NodeData getNodeData(uint32 nodeID);
protected: protected:
Common::QuickTimeParser::SampleDesc *readSampleDesc(Common::QuickTimeParser::Track *track, uint32 format, uint32 descSize); Common::QuickTimeParser::SampleDesc *readSampleDesc(Common::QuickTimeParser::Track *track, uint32 format, uint32 descSize);