MCPcopy Create free account
hub / github.com/IENT/YUView / allocateNewDecoder

Method allocateNewDecoder

YUViewLib/src/decoder/decoderVVDec.cpp:261–302  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

259}
260
261void decoderVVDec::allocateNewDecoder()
262{
263 if (this->decoder != nullptr)
264 return;
265
266 DEBUG_vvdec("decoderVVDec::allocateNewDecoder - decodeSignal %d", decodeSignal);
267
268 vvdecParams params;
269 this->lib.vvdec_params_default(&params);
270
271 params.logLevel = VVDEC_INFO;
272
273 this->decoder = this->lib.vvdec_decoder_open(&params);
274 if (this->decoder == nullptr)
275 {
276 this->setError("Error allocating decoder");
277 return;
278 }
279
280 this->flushing = false;
281 this->currentOutputBuffer.clear();
282 this->decoderState = DecoderState::NeedsMoreData;
283 this->currentFrameReadyForRetrieval = false;
284 this->currentFrame = nullptr;
285
286 auto ret = this->lib.vvdec_set_logging_callback(this->decoder, loggingCallback);
287 if (ret != VVDEC_OK)
288 DEBUG_vvdec("decoderVVDec::allocateNewDecoder - error setting logging callback");
289
290 if (this->accessUnit == nullptr)
291 {
292 this->accessUnit = this->lib.vvdec_accessUnit_alloc();
293 if (this->accessUnit == nullptr)
294 {
295 this->setError("Error allocating access unit");
296 return;
297 }
298 this->lib.vvdec_accessUnit_alloc_payload(this->accessUnit, MAX_CODED_PICTURE_SIZE);
299 if (this->accessUnit->payload == nullptr)
300 this->setError("Error allocating AU payload buffer");
301 }
302}
303
304bool decoderVVDec::decodeNextFrame()
305{

Callers 2

decoderVVDecMethod · 0.95
resetDecoderMethod · 0.95

Calls 2

setErrorMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected