In some cases decoding engine needs extra space in capture buffers. This
is the case for decoding 10-bit HEVC frames into 8-bit capture format.
This commit only adds infrastructure for such cases.
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
        int (*start)(struct cedrus_ctx *ctx);
        void (*stop)(struct cedrus_ctx *ctx);
        void (*trigger)(struct cedrus_ctx *ctx);
+       unsigned int (*extra_cap_size)(struct cedrus_ctx *ctx,
+                                      struct v4l2_pix_format *pix_fmt);
 };
 
 struct cedrus_variant {
 
        pix_fmt->height = ctx->src_fmt.height;
        cedrus_prepare_format(pix_fmt);
 
+       if (ctx->current_codec->extra_cap_size)
+               pix_fmt->sizeimage +=
+                       ctx->current_codec->extra_cap_size(ctx, pix_fmt);
+
        return 0;
 }