[FFmpeg-devel] [PATCH] avcodec/v4l2_m2m_enc: check for V4L2_CID_MPEG_VIDEO_FORCE_KEY_FRAME availability before using
Michael Niedermayer
michael at niedermayer.cc
Sun Sep 15 15:10:43 EEST 2019
On Sun, Sep 15, 2019 at 08:43:32AM +0000, Guo, Yejun wrote:
>
>
> > -----Original Message-----
> > From: Aman Gupta [mailto:aman at tmm1.net] On Behalf Of Aman Gupta
> > Sent: Saturday, September 14, 2019 7:31 AM
> > To: ffmpeg-devel at ffmpeg.org
> > Cc: Guo, Yejun <yejun.guo at intel.com>; Aman Gupta <aman at tmm1.net>
> > Subject: [PATCH] avcodec/v4l2_m2m_enc: check for
> > V4L2_CID_MPEG_VIDEO_FORCE_KEY_FRAME availability before using
> >
> > From: Aman Gupta <aman at tmm1.net>
> >
> > Signed-off-by: Aman Gupta <aman at tmm1.net>
> > ---
> > libavcodec/v4l2_m2m_enc.c | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/libavcodec/v4l2_m2m_enc.c b/libavcodec/v4l2_m2m_enc.c
> > index 4849bc26c5..474e6bef89 100644
> > --- a/libavcodec/v4l2_m2m_enc.c
> > +++ b/libavcodec/v4l2_m2m_enc.c
> > @@ -245,8 +245,10 @@ static int v4l2_send_frame(AVCodecContext *avctx,
> > const AVFrame *frame)
> > V4L2m2mContext *s = ((V4L2m2mPriv*)avctx->priv_data)->context;
> > V4L2Context *const output = &s->output;
> >
> > +#ifdef V4L2_CID_MPEG_VIDEO_FORCE_KEY_FRAME
> > if (frame && frame->pict_type == AV_PICTURE_TYPE_I)
> > v4l2_set_ext_ctrl(s, MPEG_CID(FORCE_KEY_FRAME), 0, "force key
> > frame");
> > +#endif
>
> thanks, the specific build issue is fixed on my system, but I still met other v4l2 build issues on master with this patch.
>
> src/libavcodec/v4l2_m2m_enc.c: In function 'v4l2_set_ext_ctrl':
> src/libavcodec/v4l2_m2m_enc.c:51:12: warning: braces around scalar initializer
> struct v4l2_ext_controls ctrls = { { 0 } };
> ^
> src/libavcodec/v4l2_m2m_enc.c:51:12: note: (near initialization for 'ctrls.ctrl_class')
> src/libavcodec/v4l2_m2m_enc.c: In function 'v4l2_get_ext_ctrl':
> src/libavcodec/v4l2_m2m_enc.c:71:12: warning: braces around scalar initializer
> struct v4l2_ext_controls ctrls = { { 0 } };
> ^
> src/libavcodec/v4l2_m2m_enc.c:71:12: note: (near initialization for 'ctrls.ctrl_class')
> src/libavcodec/v4l2_buffers.c: In function 'v4l2_buffer_swframe_to_buf':
> src/libavcodec/v4l2_buffers.c:354:10: error: 'V4L2_PIX_FMT_YUV422M' undeclared (first use in this function)
> case V4L2_PIX_FMT_YUV422M:
> ^
> src/libavcodec/v4l2_buffers.c:354:10: note: each undeclared identifier is reported only once for each function it appears in
> src/libavcodec/v4l2_buffers.c:355:10: error: 'V4L2_PIX_FMT_YVU422M' undeclared (first use in this function)
> case V4L2_PIX_FMT_YVU422M:
> ^
> src/libavcodec/v4l2_buffers.c:356:10: error: 'V4L2_PIX_FMT_YUV444M' undeclared (first use in this function)
> case V4L2_PIX_FMT_YUV444M:
> ^
> src/libavcodec/v4l2_buffers.c:357:10: error: 'V4L2_PIX_FMT_YVU444M' undeclared (first use in this function)
> case V4L2_PIX_FMT_YVU444M:
> ^
> src/ffbuild/common.mak:59: recipe for target 'libavcodec/v4l2_buffers.o' failed
> make: *** [libavcodec/v4l2_buffers.o] Error 1
> make: *** Waiting for unfinished jobs....
ossfuzz also hits these issues
https://oss-fuzz-build-logs.storage.googleapis.com/log-23c6325e-a029-4ee0-8752-b4f573601087.txt
thx
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Complexity theory is the science of finding the exact solution to an
approximation. Benchmarking OTOH is finding an approximation of the exact
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20190915/b83843e9/attachment.sig>
More information about the ffmpeg-devel
mailing list