| 277 | } |
| 278 | |
| 279 | static int lcevc_init(FFLCEVCContext *lcevc, void *logctx) |
| 280 | { |
| 281 | LCEVC_AccelContextHandle dummy = { 0 }; |
| 282 | const int32_t event = LCEVC_Log; |
| 283 | |
| 284 | if (LCEVC_CreateDecoder(&lcevc->decoder, dummy) != LCEVC_Success) { |
| 285 | av_log(logctx, AV_LOG_ERROR, "Failed to create LCEVC decoder\n"); |
| 286 | return AVERROR_EXTERNAL; |
| 287 | } |
| 288 | |
| 289 | LCEVC_ConfigureDecoderInt(lcevc->decoder, "log_level", 4); |
| 290 | LCEVC_ConfigureDecoderIntArray(lcevc->decoder, "events", 1, &event); |
| 291 | LCEVC_SetDecoderEventCallback(lcevc->decoder, event_callback, logctx); |
| 292 | |
| 293 | if (LCEVC_InitializeDecoder(lcevc->decoder) != LCEVC_Success) { |
| 294 | av_log(logctx, AV_LOG_ERROR, "Failed to initialize LCEVC decoder\n"); |
| 295 | LCEVC_DestroyDecoder(lcevc->decoder); |
| 296 | return AVERROR_EXTERNAL; |
| 297 | } |
| 298 | |
| 299 | lcevc->initialized = 1; |
| 300 | |
| 301 | return 0; |
| 302 | } |
| 303 | |
| 304 | int ff_lcevc_process(void *logctx, AVFrame *frame) |
| 305 | { |
no test coverage detected