| 52 | } |
| 53 | |
| 54 | ProcessingResultsPromise::FutureImpl ImageGenericEncoder::encode( |
| 55 | const std::vector<IImage*>& images, const std::vector<ICodeStream*>& code_streams, const nvimgcodecEncodeParams_t* params) noexcept { |
| 56 | try { |
| 57 | curr_params_ = params; |
| 58 | return process(code_streams, images); |
| 59 | } catch (const std::exception& e) { |
| 60 | NVIMGCODEC_LOG_ERROR(logger_, "Exception during encode: " << e.what()); |
| 61 | auto promise = std::make_shared<ProcessingResultsPromise>(code_streams.size()); |
| 62 | for (size_t i = 0; i < code_streams.size(); i++) { |
| 63 | promise->set(i, ProcessingResult::failure(NVIMGCODEC_PROCESSING_STATUS_FAIL)); |
| 64 | } |
| 65 | return promise->getFuture(); |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | nvimgcodecProcessingStatus_t ImageGenericEncoder::canProcessImpl(Entry& sample, ProcessorEntry* processor, int tid) noexcept { |
| 70 | NVIMGCODEC_LOG_TRACE(this->logger_, tid << ": " << sample.processor->id_ << " canEncode #" << sample.sample_idx); |
no test coverage detected