1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
From 11cb568621e0641c562f8910636e9193f9d90d84 Mon Sep 17 00:00:00 2001
From: Lukas Rusak <lorusak@gmail.com>
Date: Thu, 16 Aug 2018 21:11:38 -0700
Subject: [PATCH 5/9] libavcodec: v4l2m2m: allow using software pixel formats
---
libavcodec/v4l2_m2m_dec.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
--- a/libavcodec/v4l2_m2m_dec.c
+++ b/libavcodec/v4l2_m2m_dec.c
@@ -217,8 +217,16 @@ static av_cold int v4l2_decode_init(AVCo
* - 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;
+ }
s->avctx = avctx;
ret = ff_v4l2_m2m_codec_init(priv);
@@ -276,6 +284,7 @@ static const AVCodecHWConfigInternal *v4
FF_CODEC_CAP_INIT_CLEANUP, \
.p.wrapper_name = "v4l2m2m", \
.p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_DRM_PRIME, \
+ AV_PIX_FMT_NV12, \
AV_PIX_FMT_NONE}, \
.hw_configs = v4l2_m2m_hw_configs, \
}
|