forked from FFmpeg/FFmpeg
avcodec/mmaldec: Avoid using AVCodec.pix_fmts
It is entirely unnecessary to use it given that all decoders here share the same set of supported pixel formats. So just hardcode this list. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
parent
89995cfda1
commit
687a287e14
1 changed files with 5 additions and 4 deletions
|
@ -101,6 +101,10 @@ typedef struct MMALDecodeContext {
|
||||||
// packets (where each packet contains 1 frame).
|
// packets (where each packet contains 1 frame).
|
||||||
#define MAX_DELAYED_FRAMES 16
|
#define MAX_DELAYED_FRAMES 16
|
||||||
|
|
||||||
|
static const enum AVPixelFormat mmal_pixfmts[] = {
|
||||||
|
AV_PIX_FMT_MMAL, AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE
|
||||||
|
};
|
||||||
|
|
||||||
static void ffmmal_poolref_unref(FFPoolRef *ref)
|
static void ffmmal_poolref_unref(FFPoolRef *ref)
|
||||||
{
|
{
|
||||||
if (ref &&
|
if (ref &&
|
||||||
|
@ -367,7 +371,7 @@ static av_cold int ffmmal_init_decoder(AVCodecContext *avctx)
|
||||||
return AVERROR(ENOSYS);
|
return AVERROR(ENOSYS);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((ret = ff_get_format(avctx, avctx->codec->pix_fmts)) < 0)
|
if ((ret = ff_get_format(avctx, mmal_pixfmts)) < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
avctx->pix_fmt = ret;
|
avctx->pix_fmt = ret;
|
||||||
|
@ -844,9 +848,6 @@ static const AVClass ffmmal_dec_class = {
|
||||||
.p.priv_class = &ffmmal_dec_class, \
|
.p.priv_class = &ffmmal_dec_class, \
|
||||||
.p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE, \
|
.p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE, \
|
||||||
.caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE, \
|
.caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE, \
|
||||||
.p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_MMAL, \
|
|
||||||
AV_PIX_FMT_YUV420P, \
|
|
||||||
AV_PIX_FMT_NONE}, \
|
|
||||||
.hw_configs = mmal_hw_configs, \
|
.hw_configs = mmal_hw_configs, \
|
||||||
.p.wrapper_name = "mmal", \
|
.p.wrapper_name = "mmal", \
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue