1 From bf9263611ac50bbe7b0113782468f653a28d2e52 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Tue, 14 Mar 2023 14:29:52 +0000
4 Subject: [PATCH] staging: bcm2835-codec: Add
5 V4L2_CID_MPEG_VIDEO_B_FRAMES control
7 FFmpeg insists on trying to set V4L2_CID_MPEG_VIDEO_B_FRAMES to
8 0, and generates an error should it fail.
9 As our encoder doesn't support B frames, add a stub handler for
12 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
14 .../vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c | 10 +++++++++-
15 1 file changed, 9 insertions(+), 1 deletion(-)
17 --- a/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c
18 +++ b/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c
19 @@ -2367,6 +2367,10 @@ static int bcm2835_codec_s_ctrl(struct v
23 + case V4L2_CID_MPEG_VIDEO_B_FRAMES:
27 case V4L2_CID_JPEG_COMPRESSION_QUALITY:
30 @@ -3356,7 +3360,7 @@ static int bcm2835_codec_open(struct fil
34 - v4l2_ctrl_handler_init(hdl, 11);
35 + v4l2_ctrl_handler_init(hdl, 12);
37 v4l2_ctrl_new_std_menu(hdl, &bcm2835_codec_ctrl_ops,
38 V4L2_CID_MPEG_VIDEO_BITRATE_MODE,
39 @@ -3417,6 +3421,10 @@ static int bcm2835_codec_open(struct fil
40 v4l2_ctrl_new_std(hdl, &bcm2835_codec_ctrl_ops,
41 V4L2_CID_MPEG_VIDEO_FORCE_KEY_FRAME,
43 + v4l2_ctrl_new_std(hdl, &bcm2835_codec_ctrl_ops,
44 + V4L2_CID_MPEG_VIDEO_B_FRAMES,
49 goto free_ctrl_handler;