| 168 | } |
| 169 | |
| 170 | SEIParsingResult sei_message::parsePayloadData( |
| 171 | bool reparse, SPSMap &spsMap, std::shared_ptr<seq_parameter_set_rbsp> associatedSPS) |
| 172 | { |
| 173 | if (this->parsingDone) |
| 174 | throw std::logic_error("Parsing of SEI is already done"); |
| 175 | |
| 176 | if (this->payloadType == 0) |
| 177 | this->payload = std::make_shared<buffering_period>(); |
| 178 | else if (this->payloadType == 1) |
| 179 | this->payload = std::make_shared<pic_timing>(); |
| 180 | else if (this->payloadType == 5) |
| 181 | this->payload = std::make_shared<user_data_unregistered>(); |
| 182 | else |
| 183 | this->payload = std::make_shared<unknown_sei>(); |
| 184 | |
| 185 | auto result = this->payload->parse(this->payloadReader, reparse, spsMap, associatedSPS); |
| 186 | |
| 187 | if (result == SEIParsingResult::OK) |
| 188 | this->parsingDone = true; |
| 189 | if (reparse && result == SEIParsingResult::WAIT_FOR_PARAMETER_SETS) |
| 190 | throw std::logic_error("Reparsing of SEI failed"); |
| 191 | |
| 192 | return result; |
| 193 | } |
| 194 | |
| 195 | } // namespace parser::avc |