mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 01:49:46 +00:00
staging/bcm2835-camera: Add support for H264 levels 4.1 and 4.2
Whilst the hardware can't achieve the limits of level 4.2 under all situations, it can exceed level 4.0. Allow selection of levels 4.1 and 4.2. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
This commit is contained in:
committed by
Dom Cobley
parent
25a18999c4
commit
43255668c5
@@ -702,6 +702,8 @@ static int ctrl_set_video_encode_profile_level(struct bcm2835_mmal_dev *dev,
|
||||
case V4L2_MPEG_VIDEO_H264_LEVEL_3_1:
|
||||
case V4L2_MPEG_VIDEO_H264_LEVEL_3_2:
|
||||
case V4L2_MPEG_VIDEO_H264_LEVEL_4_0:
|
||||
case V4L2_MPEG_VIDEO_H264_LEVEL_4_1:
|
||||
case V4L2_MPEG_VIDEO_H264_LEVEL_4_2:
|
||||
dev->capture.enc_level = ctrl->val;
|
||||
break;
|
||||
default:
|
||||
@@ -767,6 +769,17 @@ static int ctrl_set_video_encode_profile_level(struct bcm2835_mmal_dev *dev,
|
||||
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. Achieving levels
|
||||
* above that depend on exactly the resolution and frame rate
|
||||
* being requested.
|
||||
*/
|
||||
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;
|
||||
@@ -1216,8 +1229,10 @@ static const struct bcm2835_mmal_v4l2_ctrl v4l2_ctrls[V4L2_CTRL_COUNT] = {
|
||||
BIT(V4L2_MPEG_VIDEO_H264_LEVEL_3_0) |
|
||||
BIT(V4L2_MPEG_VIDEO_H264_LEVEL_3_1) |
|
||||
BIT(V4L2_MPEG_VIDEO_H264_LEVEL_3_2) |
|
||||
BIT(V4L2_MPEG_VIDEO_H264_LEVEL_4_0)),
|
||||
.max = V4L2_MPEG_VIDEO_H264_LEVEL_4_0,
|
||||
BIT(V4L2_MPEG_VIDEO_H264_LEVEL_4_0) |
|
||||
BIT(V4L2_MPEG_VIDEO_H264_LEVEL_4_1) |
|
||||
BIT(V4L2_MPEG_VIDEO_H264_LEVEL_4_2)),
|
||||
.max = V4L2_MPEG_VIDEO_H264_LEVEL_4_2,
|
||||
.def = V4L2_MPEG_VIDEO_H264_LEVEL_4_0,
|
||||
.step = 1,
|
||||
.imenu = NULL,
|
||||
|
||||
Reference in New Issue
Block a user