diff mbox series

[14/15] staging/vc04_services: rename MPEG to CODEC

Message ID 20210313144323.143600-15-hverkuil-cisco@xs4all.nl
State New
Headers show
Series v4l2-controls.h: rename _MPEG_ to _CODEC_ | expand

Commit Message

Hans Verkuil March 13, 2021, 2:43 p.m. UTC
Historically all codec-related data structures and defines used the
MPEG prefix. This is confusing. Rename MPEG to CODEC to make it clear
that the MPEG prefix isn't MPEG specific.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
---
 .../bcm2835-camera/bcm2835-camera.c           |   4 +-
 .../bcm2835-camera/bcm2835-camera.h           |   4 +-
 .../vc04_services/bcm2835-camera/controls.c   | 126 +++++++++---------
 3 files changed, 67 insertions(+), 67 deletions(-)
diff mbox series

Patch

diff --git a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
index df90c1f9d148..528c57811e96 100644
--- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
+++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
@@ -1668,8 +1668,8 @@  static int mmal_init(struct bm2835_mmal_dev *dev)
 	dev->capture.fmt = &formats[0];
 	dev->capture.encode_component = NULL;
 	dev->capture.timeperframe = tpf_default;
-	dev->capture.enc_profile = V4L2_MPEG_VIDEO_H264_PROFILE_HIGH;
-	dev->capture.enc_level = V4L2_MPEG_VIDEO_H264_LEVEL_4_0;
+	dev->capture.enc_profile = V4L2_CODEC_VIDEO_H264_PROFILE_HIGH;
+	dev->capture.enc_level = V4L2_CODEC_VIDEO_H264_LEVEL_4_0;
 
 	/* get the preview component ready */
 	ret = vchiq_mmal_component_init(dev->instance, "ril.video_render",
diff --git a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.h b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.h
index 75524adff0f5..c7538daa6ebc 100644
--- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.h
+++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.h
@@ -77,9 +77,9 @@  struct bm2835_mmal_dev {
 		/* H264 bitrate mode. CBR/VBR */
 		int encode_bitrate_mode;
 		/* H264 profile */
-		enum v4l2_mpeg_video_h264_profile enc_profile;
+		enum v4l2_codec_video_h264_profile enc_profile;
 		/* H264 level */
-		enum v4l2_mpeg_video_h264_level enc_level;
+		enum v4l2_codec_video_h264_level enc_level;
 		/* JPEG Q-factor */
 		int q_factor;
 
diff --git a/drivers/staging/vc04_services/bcm2835-camera/controls.c b/drivers/staging/vc04_services/bcm2835-camera/controls.c
index b096a12387f7..1ac825653c54 100644
--- a/drivers/staging/vc04_services/bcm2835-camera/controls.c
+++ b/drivers/staging/vc04_services/bcm2835-camera/controls.c
@@ -625,10 +625,10 @@  static int ctrl_set_bitrate_mode(struct bm2835_mmal_dev *dev,
 	dev->capture.encode_bitrate_mode = ctrl->val;
 	switch (ctrl->val) {
 	default:
-	case V4L2_MPEG_VIDEO_BITRATE_MODE_VBR:
+	case V4L2_CODEC_VIDEO_BITRATE_MODE_VBR:
 		bitrate_mode = MMAL_VIDEO_RATECONTROL_VARIABLE;
 		break;
-	case V4L2_MPEG_VIDEO_BITRATE_MODE_CBR:
+	case V4L2_CODEC_VIDEO_BITRATE_MODE_CBR:
 		bitrate_mode = MMAL_VIDEO_RATECONTROL_CONSTANT;
 		break;
 	}
@@ -679,32 +679,32 @@  static int ctrl_set_video_encode_profile_level(struct bm2835_mmal_dev *dev,
 	struct mmal_parameter_video_profile param;
 	int ret = 0;
 
-	if (ctrl->id == V4L2_CID_MPEG_VIDEO_H264_PROFILE) {
+	if (ctrl->id == V4L2_CID_CODEC_VIDEO_H264_PROFILE) {
 		switch (ctrl->val) {
-		case V4L2_MPEG_VIDEO_H264_PROFILE_BASELINE:
-		case V4L2_MPEG_VIDEO_H264_PROFILE_CONSTRAINED_BASELINE:
-		case V4L2_MPEG_VIDEO_H264_PROFILE_MAIN:
-		case V4L2_MPEG_VIDEO_H264_PROFILE_HIGH:
+		case V4L2_CODEC_VIDEO_H264_PROFILE_BASELINE:
+		case V4L2_CODEC_VIDEO_H264_PROFILE_CONSTRAINED_BASELINE:
+		case V4L2_CODEC_VIDEO_H264_PROFILE_MAIN:
+		case V4L2_CODEC_VIDEO_H264_PROFILE_HIGH:
 			dev->capture.enc_profile = ctrl->val;
 			break;
 		default:
 			ret = -EINVAL;
 			break;
 		}
-	} else if (ctrl->id == V4L2_CID_MPEG_VIDEO_H264_LEVEL) {
+	} else if (ctrl->id == V4L2_CID_CODEC_VIDEO_H264_LEVEL) {
 		switch (ctrl->val) {
-		case V4L2_MPEG_VIDEO_H264_LEVEL_1_0:
-		case V4L2_MPEG_VIDEO_H264_LEVEL_1B:
-		case V4L2_MPEG_VIDEO_H264_LEVEL_1_1:
-		case V4L2_MPEG_VIDEO_H264_LEVEL_1_2:
-		case V4L2_MPEG_VIDEO_H264_LEVEL_1_3:
-		case V4L2_MPEG_VIDEO_H264_LEVEL_2_0:
-		case V4L2_MPEG_VIDEO_H264_LEVEL_2_1:
-		case V4L2_MPEG_VIDEO_H264_LEVEL_2_2:
-		case V4L2_MPEG_VIDEO_H264_LEVEL_3_0:
-		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_CODEC_VIDEO_H264_LEVEL_1_0:
+		case V4L2_CODEC_VIDEO_H264_LEVEL_1B:
+		case V4L2_CODEC_VIDEO_H264_LEVEL_1_1:
+		case V4L2_CODEC_VIDEO_H264_LEVEL_1_2:
+		case V4L2_CODEC_VIDEO_H264_LEVEL_1_3:
+		case V4L2_CODEC_VIDEO_H264_LEVEL_2_0:
+		case V4L2_CODEC_VIDEO_H264_LEVEL_2_1:
+		case V4L2_CODEC_VIDEO_H264_LEVEL_2_2:
+		case V4L2_CODEC_VIDEO_H264_LEVEL_3_0:
+		case V4L2_CODEC_VIDEO_H264_LEVEL_3_1:
+		case V4L2_CODEC_VIDEO_H264_LEVEL_3_2:
+		case V4L2_CODEC_VIDEO_H264_LEVEL_4_0:
 			dev->capture.enc_level = ctrl->val;
 			break;
 		default:
@@ -715,17 +715,17 @@  static int ctrl_set_video_encode_profile_level(struct bm2835_mmal_dev *dev,
 
 	if (!ret) {
 		switch (dev->capture.enc_profile) {
-		case V4L2_MPEG_VIDEO_H264_PROFILE_BASELINE:
+		case V4L2_CODEC_VIDEO_H264_PROFILE_BASELINE:
 			param.profile = MMAL_VIDEO_PROFILE_H264_BASELINE;
 			break;
-		case V4L2_MPEG_VIDEO_H264_PROFILE_CONSTRAINED_BASELINE:
+		case V4L2_CODEC_VIDEO_H264_PROFILE_CONSTRAINED_BASELINE:
 			param.profile =
 				MMAL_VIDEO_PROFILE_H264_CONSTRAINED_BASELINE;
 			break;
-		case V4L2_MPEG_VIDEO_H264_PROFILE_MAIN:
+		case V4L2_CODEC_VIDEO_H264_PROFILE_MAIN:
 			param.profile = MMAL_VIDEO_PROFILE_H264_MAIN;
 			break;
-		case V4L2_MPEG_VIDEO_H264_PROFILE_HIGH:
+		case V4L2_CODEC_VIDEO_H264_PROFILE_HIGH:
 			param.profile = MMAL_VIDEO_PROFILE_H264_HIGH;
 			break;
 		default:
@@ -734,40 +734,40 @@  static int ctrl_set_video_encode_profile_level(struct bm2835_mmal_dev *dev,
 		}
 
 		switch (dev->capture.enc_level) {
-		case V4L2_MPEG_VIDEO_H264_LEVEL_1_0:
+		case V4L2_CODEC_VIDEO_H264_LEVEL_1_0:
 			param.level = MMAL_VIDEO_LEVEL_H264_1;
 			break;
-		case V4L2_MPEG_VIDEO_H264_LEVEL_1B:
+		case V4L2_CODEC_VIDEO_H264_LEVEL_1B:
 			param.level = MMAL_VIDEO_LEVEL_H264_1b;
 			break;
-		case V4L2_MPEG_VIDEO_H264_LEVEL_1_1:
+		case V4L2_CODEC_VIDEO_H264_LEVEL_1_1:
 			param.level = MMAL_VIDEO_LEVEL_H264_11;
 			break;
-		case V4L2_MPEG_VIDEO_H264_LEVEL_1_2:
+		case V4L2_CODEC_VIDEO_H264_LEVEL_1_2:
 			param.level = MMAL_VIDEO_LEVEL_H264_12;
 			break;
-		case V4L2_MPEG_VIDEO_H264_LEVEL_1_3:
+		case V4L2_CODEC_VIDEO_H264_LEVEL_1_3:
 			param.level = MMAL_VIDEO_LEVEL_H264_13;
 			break;
-		case V4L2_MPEG_VIDEO_H264_LEVEL_2_0:
+		case V4L2_CODEC_VIDEO_H264_LEVEL_2_0:
 			param.level = MMAL_VIDEO_LEVEL_H264_2;
 			break;
-		case V4L2_MPEG_VIDEO_H264_LEVEL_2_1:
+		case V4L2_CODEC_VIDEO_H264_LEVEL_2_1:
 			param.level = MMAL_VIDEO_LEVEL_H264_21;
 			break;
-		case V4L2_MPEG_VIDEO_H264_LEVEL_2_2:
+		case V4L2_CODEC_VIDEO_H264_LEVEL_2_2:
 			param.level = MMAL_VIDEO_LEVEL_H264_22;
 			break;
-		case V4L2_MPEG_VIDEO_H264_LEVEL_3_0:
+		case V4L2_CODEC_VIDEO_H264_LEVEL_3_0:
 			param.level = MMAL_VIDEO_LEVEL_H264_3;
 			break;
-		case V4L2_MPEG_VIDEO_H264_LEVEL_3_1:
+		case V4L2_CODEC_VIDEO_H264_LEVEL_3_1:
 			param.level = MMAL_VIDEO_LEVEL_H264_31;
 			break;
-		case V4L2_MPEG_VIDEO_H264_LEVEL_3_2:
+		case V4L2_CODEC_VIDEO_H264_LEVEL_3_2:
 			param.level = MMAL_VIDEO_LEVEL_H264_32;
 			break;
-		case V4L2_MPEG_VIDEO_H264_LEVEL_4_0:
+		case V4L2_CODEC_VIDEO_H264_LEVEL_4_0:
 			param.level = MMAL_VIDEO_LEVEL_H264_4;
 			break;
 		default:
@@ -1138,10 +1138,10 @@  static const struct bm2835_mmal_v4l2_ctrl v4l2_ctrls[V4L2_CTRL_COUNT] = {
 		.setter = ctrl_set_flip,
 	},
 	{
-		.id = V4L2_CID_MPEG_VIDEO_BITRATE_MODE,
+		.id = V4L2_CID_CODEC_VIDEO_BITRATE_MODE,
 		.type = MMAL_CONTROL_TYPE_STD_MENU,
 		.min = 0,
-		.max = V4L2_MPEG_VIDEO_BITRATE_MODE_CBR,
+		.max = V4L2_CODEC_VIDEO_BITRATE_MODE_CBR,
 		.def = 0,
 		.step = 0,
 		.imenu = NULL,
@@ -1149,7 +1149,7 @@  static const struct bm2835_mmal_v4l2_ctrl v4l2_ctrls[V4L2_CTRL_COUNT] = {
 		.setter = ctrl_set_bitrate_mode,
 	},
 	{
-		.id = V4L2_CID_MPEG_VIDEO_BITRATE,
+		.id = V4L2_CID_CODEC_VIDEO_BITRATE,
 		.type = MMAL_CONTROL_TYPE_STD,
 		.min = 25 * 1000,
 		.max = 25 * 1000 * 1000,
@@ -1182,7 +1182,7 @@  static const struct bm2835_mmal_v4l2_ctrl v4l2_ctrls[V4L2_CTRL_COUNT] = {
 		.setter = ctrl_set_flicker_avoidance,
 	},
 	{
-		.id = V4L2_CID_MPEG_VIDEO_REPEAT_SEQ_HEADER,
+		.id = V4L2_CID_CODEC_VIDEO_REPEAT_SEQ_HEADER,
 		.type = MMAL_CONTROL_TYPE_STD,
 		.min = 0,
 		.max = 1,
@@ -1193,36 +1193,36 @@  static const struct bm2835_mmal_v4l2_ctrl v4l2_ctrls[V4L2_CTRL_COUNT] = {
 		.setter = ctrl_set_video_encode_param_output,
 	},
 	{
-		.id = V4L2_CID_MPEG_VIDEO_H264_PROFILE,
+		.id = V4L2_CID_CODEC_VIDEO_H264_PROFILE,
 		.type = MMAL_CONTROL_TYPE_STD_MENU,
-		.min = ~(BIT(V4L2_MPEG_VIDEO_H264_PROFILE_BASELINE) |
-			 BIT(V4L2_MPEG_VIDEO_H264_PROFILE_CONSTRAINED_BASELINE) |
-			 BIT(V4L2_MPEG_VIDEO_H264_PROFILE_MAIN) |
-			 BIT(V4L2_MPEG_VIDEO_H264_PROFILE_HIGH)),
-		.max = V4L2_MPEG_VIDEO_H264_PROFILE_HIGH,
-		.def = V4L2_MPEG_VIDEO_H264_PROFILE_HIGH,
+		.min = ~(BIT(V4L2_CODEC_VIDEO_H264_PROFILE_BASELINE) |
+			 BIT(V4L2_CODEC_VIDEO_H264_PROFILE_CONSTRAINED_BASELINE) |
+			 BIT(V4L2_CODEC_VIDEO_H264_PROFILE_MAIN) |
+			 BIT(V4L2_CODEC_VIDEO_H264_PROFILE_HIGH)),
+		.max = V4L2_CODEC_VIDEO_H264_PROFILE_HIGH,
+		.def = V4L2_CODEC_VIDEO_H264_PROFILE_HIGH,
 		.step = 1,
 		.imenu = NULL,
 		.mmal_id = MMAL_PARAMETER_PROFILE,
 		.setter = ctrl_set_video_encode_profile_level,
 	},
 	{
-		.id = V4L2_CID_MPEG_VIDEO_H264_LEVEL,
+		.id = V4L2_CID_CODEC_VIDEO_H264_LEVEL,
 		.type = MMAL_CONTROL_TYPE_STD_MENU,
-		.min = ~(BIT(V4L2_MPEG_VIDEO_H264_LEVEL_1_0) |
-			 BIT(V4L2_MPEG_VIDEO_H264_LEVEL_1B) |
-			 BIT(V4L2_MPEG_VIDEO_H264_LEVEL_1_1) |
-			 BIT(V4L2_MPEG_VIDEO_H264_LEVEL_1_2) |
-			 BIT(V4L2_MPEG_VIDEO_H264_LEVEL_1_3) |
-			 BIT(V4L2_MPEG_VIDEO_H264_LEVEL_2_0) |
-			 BIT(V4L2_MPEG_VIDEO_H264_LEVEL_2_1) |
-			 BIT(V4L2_MPEG_VIDEO_H264_LEVEL_2_2) |
-			 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,
-		.def = V4L2_MPEG_VIDEO_H264_LEVEL_4_0,
+		.min = ~(BIT(V4L2_CODEC_VIDEO_H264_LEVEL_1_0) |
+			 BIT(V4L2_CODEC_VIDEO_H264_LEVEL_1B) |
+			 BIT(V4L2_CODEC_VIDEO_H264_LEVEL_1_1) |
+			 BIT(V4L2_CODEC_VIDEO_H264_LEVEL_1_2) |
+			 BIT(V4L2_CODEC_VIDEO_H264_LEVEL_1_3) |
+			 BIT(V4L2_CODEC_VIDEO_H264_LEVEL_2_0) |
+			 BIT(V4L2_CODEC_VIDEO_H264_LEVEL_2_1) |
+			 BIT(V4L2_CODEC_VIDEO_H264_LEVEL_2_2) |
+			 BIT(V4L2_CODEC_VIDEO_H264_LEVEL_3_0) |
+			 BIT(V4L2_CODEC_VIDEO_H264_LEVEL_3_1) |
+			 BIT(V4L2_CODEC_VIDEO_H264_LEVEL_3_2) |
+			 BIT(V4L2_CODEC_VIDEO_H264_LEVEL_4_0)),
+		.max = V4L2_CODEC_VIDEO_H264_LEVEL_4_0,
+		.def = V4L2_CODEC_VIDEO_H264_LEVEL_4_0,
 		.step = 1,
 		.imenu = NULL,
 		.mmal_id = MMAL_PARAMETER_PROFILE,
@@ -1241,7 +1241,7 @@  static const struct bm2835_mmal_v4l2_ctrl v4l2_ctrls[V4L2_CTRL_COUNT] = {
 		.setter = ctrl_set_scene_mode,
 	},
 	{
-		.id = V4L2_CID_MPEG_VIDEO_H264_I_PERIOD,
+		.id = V4L2_CID_CODEC_VIDEO_H264_I_PERIOD,
 		.type = MMAL_CONTROL_TYPE_STD,
 		.min = 0,
 		.max = 0x7FFFFFFF,