| 259 | } |
| 260 | |
| 261 | void 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(¶ms); |
| 270 | |
| 271 | params.logLevel = VVDEC_INFO; |
| 272 | |
| 273 | this->decoder = this->lib.vvdec_decoder_open(¶ms); |
| 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 | |
| 304 | bool decoderVVDec::decodeNextFrame() |
| 305 | { |
no test coverage detected