| 187 | } |
| 188 | |
| 189 | bool ParserAVFormat::parseExtradata_hevc(ByteVector &extradata) |
| 190 | { |
| 191 | if (extradata.empty() || !packetModel->rootItem) |
| 192 | return true; |
| 193 | |
| 194 | if (extradata.at(0) == 1) |
| 195 | { |
| 196 | auto hevcParser = dynamic_cast<ParserAnnexBHEVC *>(this->annexBParser.get()); |
| 197 | if (!hevcParser) |
| 198 | return false; |
| 199 | |
| 200 | try |
| 201 | { |
| 202 | avformat::HVCC hvcc; |
| 203 | hvcc.parse(extradata, packetModel->rootItem, hevcParser, this->bitratePlotModel.data()); |
| 204 | } |
| 205 | catch (...) |
| 206 | { |
| 207 | DEBUG_AVFORMAT("ParserAVFormat::parseExtradata_hevc Error parsing HEVC Extradata"); |
| 208 | return false; |
| 209 | } |
| 210 | } |
| 211 | else if (extradata.at(0) == 0) |
| 212 | { |
| 213 | auto item = packetModel->rootItem->createChildItem("Extradata (Raw HEVC NAL units)"); |
| 214 | this->parseByteVectorAnnexBStartCodes(extradata, PacketDataFormat::RawNAL, {}, item); |
| 215 | } |
| 216 | else |
| 217 | { |
| 218 | packetModel->rootItem->createChildItem( |
| 219 | "Unsupported extradata format (configurationVersion != 1)"s, {}, {}, {}, {}, true); |
| 220 | return false; |
| 221 | } |
| 222 | |
| 223 | return true; |
| 224 | } |
| 225 | |
| 226 | bool ParserAVFormat::parseExtradata_mpeg2(ByteVector &extradata) |
| 227 | { |
no test coverage detected