| 42 | namespace nvimgcodec { |
| 43 | |
| 44 | nvimgcodecStatus_t ImageGenericDecoder::getMetadata(ICodeStream* code_stream, nvimgcodecMetadata_t** metadata, int* metadata_count) noexcept { |
| 45 | nvimgcodecStatus_t ret = NVIMGCODEC_STATUS_IMPLEMENTATION_UNSUPPORTED; |
| 46 | try { |
| 47 | NVIMGCODEC_LOG_INFO(logger_, "ImageGenericDecoder::getMetadata"); |
| 48 | auto codec = code_stream->getCodec(); |
| 49 | auto* processor = initProcessorsAndGetFirstForCodec(codec); |
| 50 | |
| 51 | while (processor) { |
| 52 | auto cs_desc = code_stream->getCodeStreamDesc(); |
| 53 | auto status = processor->instance_->getMetadata(cs_desc, metadata, metadata_count); |
| 54 | if (status != NVIMGCODEC_STATUS_IMPLEMENTATION_UNSUPPORTED) { |
| 55 | ret = status; |
| 56 | } |
| 57 | if (status == NVIMGCODEC_STATUS_SUCCESS) { |
| 58 | break; |
| 59 | } |
| 60 | processor = processor->fallback_; |
| 61 | } |
| 62 | } catch (const std::exception& e) { |
| 63 | NVIMGCODEC_LOG_ERROR(logger_, "Exception during getMetadata: " << e.what()); |
| 64 | return NVIMGCODEC_STATUS_INTERNAL_ERROR; |
| 65 | } |
| 66 | return ret; |
| 67 | } |
| 68 | |
| 69 | void ImageGenericDecoder::canDecode(const std::vector<ICodeStream*>& code_streams, const std::vector<IImage*>& images, |
| 70 | const nvimgcodecDecodeParams_t* params, nvimgcodecProcessingStatus_t* processing_status, int force_format) noexcept { |
nothing calls this directly
no test coverage detected