| 29 | } |
| 30 | |
| 31 | std::unique_ptr<IImageParser> Codec::createParser(nvimgcodecCodeStreamDesc_t* code_stream) const { |
| 32 | NVIMGCODEC_LOG_TRACE(logger_, "Codec::getParser " << name_); |
| 33 | for (const auto& entry : parsers_) { |
| 34 | NVIMGCODEC_LOG_TRACE(logger_, "- probing parser:" << entry.second->getParserId()); |
| 35 | if (entry.second->canParse(code_stream)) { |
| 36 | NVIMGCODEC_LOG_TRACE(logger_, "- - can parse"); |
| 37 | return entry.second->createParser(); |
| 38 | } |
| 39 | } |
| 40 | |
| 41 | return nullptr; |
| 42 | } |
| 43 | |
| 44 | int Codec::getDecodersNum() const { |
| 45 | return decoders_.size(); |
no test coverage detected