Skip to content

Commit

Permalink
libavcodec: v4l2m2m: allow using software pixel formats
Browse files Browse the repository at this point in the history
  • Loading branch information
lrusak committed Sep 25, 2018
1 parent 0936566 commit 8405b57
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion libavcodec/v4l2_m2m_dec.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,16 @@ static av_cold int v4l2_decode_init(AVCodecContext *avctx)
* - the DRM frame format is passed in the DRM frame descriptor layer.
* check the v4l2_get_drm_frame function.
*/
if (ff_get_format(avctx, avctx->codec->pix_fmts) == AV_PIX_FMT_DRM_PRIME)
switch (ff_get_format(avctx, avctx->codec->pix_fmts)) {
case AV_PIX_FMT_DRM_PRIME:
s->output_drm = 1;
break;
case AV_PIX_FMT_NONE:
return 0;
break;
default:
break;
}

ret = ff_v4l2_m2m_codec_init(avctx);
if (ret) {
Expand Down Expand Up @@ -251,6 +259,7 @@ static const AVCodecHWConfigInternal *v4l2_m2m_hw_configs[] = {
.receive_frame = v4l2_receive_frame, \
.close = ff_v4l2_m2m_codec_end, \
.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_DRM_PRIME, \
AV_PIX_FMT_NV12, \
AV_PIX_FMT_NONE}, \
.bsfs = bsf_name, \
.hw_configs = v4l2_m2m_hw_configs, \
Expand Down

0 comments on commit 8405b57

Please sign in to comment.