| 178 | } |
| 179 | |
| 180 | ParserAnnexB::ParseResult |
| 181 | ParserAnnexBAVC::parseAndAddNALUnit(int nalID, |
| 182 | const ByteVector & data, |
| 183 | std::optional<BitratePlotModel::BitrateEntry> bitrateEntry, |
| 184 | std::optional<pairUint64> nalStartEndPosFile, |
| 185 | std::shared_ptr<TreeItem> parent) |
| 186 | { |
| 187 | ParserAnnexB::ParseResult parseResult; |
| 188 | |
| 189 | if (nalID == -1 && data.empty()) |
| 190 | { |
| 191 | if (this->curFrameData && this->curFrameData->poc) |
| 192 | { |
| 193 | // Save the info of the last frame |
| 194 | if (!this->addFrameToList(*this->curFrameData->poc, |
| 195 | this->curFrameData->fileStartEndPos, |
| 196 | this->curFrameData->isRandomAccess)) |
| 197 | { |
| 198 | if (parent) |
| 199 | parent->createChildItem("Error - POC " + std::to_string(*this->curFrameData->poc) + |
| 200 | "alread in the POC list."); |
| 201 | return parseResult; |
| 202 | } |
| 203 | if (this->curFrameData->fileStartEndPos) |
| 204 | DEBUG_AVC("ParserAnnexBAVC::parseAndAddNALUnit Adding start/end " |
| 205 | << this->curFrameData->fileStartEndPos->first << "/" |
| 206 | << this->curFrameData->fileStartEndPos->second << " - POC " |
| 207 | << *this->curFrameData->poc |
| 208 | << (this->curFrameData->isRandomAccess ? " - ra" : "")); |
| 209 | else |
| 210 | DEBUG_AVC("ParserAnnexBAVC::parseAndAddNALUnit Adding start/end NA/NA - POC " |
| 211 | << *this->curFrameData->poc |
| 212 | << (this->curFrameData->isRandomAccess ? " - ra" : "")); |
| 213 | } |
| 214 | // The file ended |
| 215 | this->hrd.endOfFile(this->getHRDPlotModel()); |
| 216 | return parseResult; |
| 217 | } |
| 218 | |
| 219 | // Use the given tree item. If it is not set, use the nalUnitMode (if active). |
| 220 | // We don't set data (a name) for this item yet. |
| 221 | // We want to parse the item and then set a good description. |
| 222 | std::shared_ptr<TreeItem> nalRoot; |
| 223 | if (parent) |
| 224 | nalRoot = parent->createChildItem(); |
| 225 | else if (packetModel->rootItem) |
| 226 | nalRoot = packetModel->rootItem->createChildItem(); |
| 227 | |
| 228 | if (nalRoot) |
| 229 | ParserAnnexB::logNALSize(data, nalRoot, nalStartEndPosFile); |
| 230 | |
| 231 | reader::SubByteReaderLogging reader(data, nalRoot, "", getStartCodeOffset(data)); |
| 232 | |
| 233 | std::string specificDescription; |
| 234 | auto nalAVC = std::make_shared<NalUnitAVC>(nalID, nalStartEndPosFile); |
| 235 | |
| 236 | std::optional<CurrentSliceData> currentSliceData; |
| 237 |
no test coverage detected