| 51 | }; |
| 52 | |
| 53 | static av_cold int imm5_init(AVCodecContext *avctx) |
| 54 | { |
| 55 | IMM5Context *ctx = avctx->priv_data; |
| 56 | int ret; |
| 57 | |
| 58 | EXTERN const FFCodec ff_h264_decoder; |
| 59 | ctx->h264_avctx = avcodec_alloc_context3(&ff_h264_decoder.p); |
| 60 | if (!ctx->h264_avctx) |
| 61 | return AVERROR(ENOMEM); |
| 62 | ctx->h264_avctx->thread_count = 1; |
| 63 | ctx->h264_avctx->flags = avctx->flags; |
| 64 | ctx->h264_avctx->flags2 = avctx->flags2; |
| 65 | ctx->h264_avctx->max_pixels = avctx->max_pixels; |
| 66 | ret = avcodec_open2(ctx->h264_avctx, NULL, NULL); |
| 67 | if (ret < 0) |
| 68 | return ret; |
| 69 | |
| 70 | EXTERN const FFCodec ff_hevc_decoder; |
| 71 | ctx->hevc_avctx = avcodec_alloc_context3(&ff_hevc_decoder.p); |
| 72 | if (!ctx->hevc_avctx) |
| 73 | return AVERROR(ENOMEM); |
| 74 | ctx->hevc_avctx->thread_count = 1; |
| 75 | ctx->hevc_avctx->flags = avctx->flags; |
| 76 | ctx->hevc_avctx->flags2 = avctx->flags2; |
| 77 | ctx->hevc_avctx->max_pixels = avctx->max_pixels; |
| 78 | ret = avcodec_open2(ctx->hevc_avctx, NULL, NULL); |
| 79 | if (ret < 0) |
| 80 | return ret; |
| 81 | |
| 82 | return 0; |
| 83 | } |
| 84 | |
| 85 | static int imm5_decode_frame(AVCodecContext *avctx, AVFrame *frame, |
| 86 | int *got_frame, AVPacket *avpkt) |
nothing calls this directly
no test coverage detected