1 From 563790ba8caf80523a07e8767dab67d41c14ced0 Mon Sep 17 00:00:00 2001
2 From: Aman Gupta <aman@tmm1.net>
3 Date: Thu, 22 Aug 2019 22:31:37 +0000
4 Subject: [PATCH 772/782] staging: bcm2835-codec: add support for
5 V4L2_CID_MPEG_VIDEO_FORCE_KEY_FRAME
9 Signed-off-by: Aman Gupta <aman@tmm1.net>
11 .../bcm2835-codec/bcm2835-v4l2-codec.c | 19 ++++++++++++++++++-
12 1 file changed, 18 insertions(+), 1 deletion(-)
14 --- a/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c
15 +++ b/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c
16 @@ -1587,6 +1587,20 @@ static int bcm2835_codec_s_ctrl(struct v
17 ret = bcm2835_codec_set_level_profile(ctx, ctrl);
20 + case V4L2_CID_MPEG_VIDEO_FORCE_KEY_FRAME: {
23 + if (!ctx->component)
26 + ret = vchiq_mmal_port_parameter_set(ctx->dev->instance,
27 + &ctx->component->output[0],
28 + MMAL_PARAMETER_VIDEO_REQUEST_I_FRAME,
35 v4l2_err(&ctx->dev->v4l2_dev, "Invalid control\n");
37 @@ -2311,7 +2325,7 @@ static int bcm2835_codec_open(struct fil
39 if (dev->role == ENCODE) {
41 - v4l2_ctrl_handler_init(hdl, 6);
42 + v4l2_ctrl_handler_init(hdl, 7);
44 v4l2_ctrl_new_std_menu(hdl, &bcm2835_codec_ctrl_ops,
45 V4L2_CID_MPEG_VIDEO_BITRATE_MODE,
46 @@ -2355,6 +2369,9 @@ static int bcm2835_codec_open(struct fil
47 BIT(V4L2_MPEG_VIDEO_H264_PROFILE_MAIN) |
48 BIT(V4L2_MPEG_VIDEO_H264_PROFILE_HIGH)),
49 V4L2_MPEG_VIDEO_H264_PROFILE_HIGH);
50 + v4l2_ctrl_new_std(hdl, &bcm2835_codec_ctrl_ops,
51 + V4L2_CID_MPEG_VIDEO_FORCE_KEY_FRAME,
55 goto free_ctrl_handler;