MCPcopy Create free account
hub / github.com/IENT/YUView / seekToFirstNAL

Method seekToFirstNAL

YUViewLib/src/filesource/FileSourceAnnexBFile.cpp:75–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73}
74
75void FileSourceAnnexBFile::seekToFirstNAL()
76{
77 auto nextStartCodePos = this->fileBuffer.indexOf(STARTCODE);
78 if (nextStartCodePos < 0)
79 // The first buffer does not contain a start code. This is very unusual. Use the normal getNextNALUnit to seek
80 this->getNextNALUnit();
81 else
82 {
83 // For 0001 or 001 point to the first 0 byte
84 if (nextStartCodePos > 0 && this->fileBuffer.at(nextStartCodePos-1) ==(char)0)
85 this->posInBuffer = nextStartCodePos - 1;
86 else
87 this->posInBuffer = nextStartCodePos;
88 }
89
90 assert(this->posInBuffer >= 0);
91 this->nrBytesBeforeFirstNAL = this->bufferStartPosInFile + uint64_t(this->posInBuffer);
92}
93
94QByteArray FileSourceAnnexBFile::getNextNALUnit(bool getLastDataAgain, pairUint64 *startEndPosInFile)
95{

Callers 2

openFileMethod · 0.95
seekMethod · 0.95

Calls 3

getNextNALUnitMethod · 0.95
indexOfMethod · 0.80
atMethod · 0.45

Tested by

no test coverage detected