COMMON: FORMATS: Implement gmin atom parsing for QuickTime movies

This commit implements gmin (Base Media Info Atom) parsing for QuickTime movies.
It defines control information for the media, including graphics mode and balance.
This commit is contained in:
Krish 2024-06-19 14:24:11 +05:30 committed by Eugene Sandulenko
parent d704b8e959
commit 5e6b127a8c
2 changed files with 17 additions and 1 deletions

View File

@ -170,7 +170,7 @@ void QuickTimeParser::initParseTable() {
{ &QuickTimeParser::readESDS, MKTAG('e', 's', 'd', 's') },
{ &QuickTimeParser::readSMI, MKTAG('S', 'M', 'I', ' ') },
{ &QuickTimeParser::readDefault, MKTAG('g', 'm', 'h', 'd') },
{ &QuickTimeParser::readLeaf, MKTAG('g', 'm', 'i', 'n') },
{ &QuickTimeParser::readGMIN, MKTAG('g', 'm', 'i', 'n') },
{ &QuickTimeParser::readDefault, MKTAG('S', 'T', 'p', 'n') },
{ &QuickTimeParser::readPINF, MKTAG('p', 'I', 'n', 'f') },
{ nullptr, 0 }
@ -865,6 +865,18 @@ int QuickTimeParser::readNAVG(Atom atom) {
return 0;
}
int QuickTimeParser::readGMIN(Atom atom) {
Track *track = _tracks.back();
_fd->readUint32BE(); // version + flags
track->graphicsMode = (GraphicsMode)_fd->readUint16BE();
_fd->readMultipleBE(track->opcolor);
track->soundBalance = _fd->readUint16BE();
_fd->readUint16BE(); // reserved
return 0;
}
int QuickTimeParser::readPINF(Atom atom) {
Track *track = _tracks.back();
@ -1049,6 +1061,7 @@ QuickTimeParser::Track::Track() {
nlvlTo = -1;
graphicsMode = GraphicsMode::COPY;
opcolor[0] = opcolor[1] = opcolor[2] = 0;
soundBalance = 0;
}
QuickTimeParser::Track::~Track() {

View File

@ -210,6 +210,8 @@ protected:
GraphicsMode graphicsMode; // Transfer mode
uint16 opcolor[3]; // RGB values used in the transfer mode specified by graphicsMode.
uint16 soundBalance; // Controls the sound mix between the computer's two speakers, usually set to 0.
};
enum class MovieType {
@ -299,6 +301,7 @@ private:
int readSMI(Atom atom);
int readCTYP(Atom atom);
int readNAVG(Atom atom);
int readGMIN(Atom atom);
int readPINF(Atom atom);
};