| 44 | } AV1DecodeContext; |
| 45 | |
| 46 | static av_cold int aom_init(AVCodecContext *avctx, |
| 47 | const struct aom_codec_iface *iface) |
| 48 | { |
| 49 | AV1DecodeContext *ctx = avctx->priv_data; |
| 50 | struct aom_codec_dec_cfg deccfg = { |
| 51 | .threads = FFMIN(avctx->thread_count ? avctx->thread_count : av_cpu_count(), 16) |
| 52 | }; |
| 53 | |
| 54 | av_log(avctx, AV_LOG_VERBOSE, "%s\n", aom_codec_version_str()); |
| 55 | av_log(avctx, AV_LOG_VERBOSE, "%s\n", aom_codec_build_config()); |
| 56 | |
| 57 | if (aom_codec_dec_init(&ctx->decoder, iface, &deccfg, 0) != AOM_CODEC_OK) { |
| 58 | const char *error = aom_codec_error(&ctx->decoder); |
| 59 | av_log(avctx, AV_LOG_ERROR, "Failed to initialize decoder: %s\n", |
| 60 | error); |
| 61 | return AVERROR(EINVAL); |
| 62 | } |
| 63 | |
| 64 | return 0; |
| 65 | } |
| 66 | |
| 67 | // returns 0 on success, AVERROR_INVALIDDATA otherwise |
| 68 | static int set_pix_fmt(AVCodecContext *avctx, struct aom_image *img) |
no test coverage detected