staging/bcm2835-codec: Fix support for levels 4.1 and 4.2
authorDave Stevenson <dave.stevenson@raspberrypi.com>
Thu, 25 Mar 2021 18:28:40 +0000 (18:28 +0000)
committerPhil Elwell <8911409+pelwell@users.noreply.github.com>
Fri, 23 Apr 2021 13:01:36 +0000 (14:01 +0100)
The driver said it supported H264 levels 4.1 and 4.2, but
was missing the V4L2 to MMAL mappings.

Add in those mappings.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c

index 5729a8a..4622057 100644 (file)
@@ -1789,6 +1789,17 @@ static int bcm2835_codec_set_level_profile(struct bcm2835_codec_ctx *ctx,
                case V4L2_MPEG_VIDEO_H264_LEVEL_4_0:
                        param.level = MMAL_VIDEO_LEVEL_H264_4;
                        break;
+               /*
+                * Note that the hardware spec is level 4.0. Levels above that
+                * are there for correctly encoding the headers and may not
+                * be able to keep up with real-time.
+                */
+               case V4L2_MPEG_VIDEO_H264_LEVEL_4_1:
+                       param.level = MMAL_VIDEO_LEVEL_H264_41;
+                       break;
+               case V4L2_MPEG_VIDEO_H264_LEVEL_4_2:
+                       param.level = MMAL_VIDEO_LEVEL_H264_42;
+                       break;
                default:
                        /* Should never get here */
                        break;