MCPcopy Create free account
hub / github.com/MrNeRF/LichtFeld-Studio / encode

Method encode

external/nvImageCodec/src/image_generic_encoder.cpp:54–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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);

Callers 1

processImplMethod · 0.45

Calls 4

getFutureMethod · 0.80
whatMethod · 0.45
sizeMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected