blob: 4f05e59eee89078aff0daa8a49cbd7f5fd25830b [file] [log] [blame]
From a5839e8d64641c650696b453eeedc45d7c71e664 Mon Sep 17 00:00:00 2001
From: Keiichi Watanabe <keiichiw@chromium.org>
Date: Mon, 18 Jun 2018 03:58:52 -0400
Subject: [PATCH] BACKPORT: FROMGIT: media: v4l2-ctrl: Change control for
VP8 profile to menu control
Add a menu control V4L2_CID_MPEG_VIDEO_VP8_PROFILE for VP8 profile and make
V4L2_CID_MPEG_VIDEO_VPX_PROFILE an alias of it. This new control is used to
select the desired profile for VP8 encoder and query for supported profiles
by VP8 encoder/decoder.
Though we have originally a control V4L2_CID_MPEG_VIDEO_VPX_PROFILE and its
name contains 'VPX', it works only for VP8 because supported profiles
usually differ between VP8 and VP9. In addition, this control cannot be
used for querying since it is not a menu control but an integer control,
which cannot return an arbitrary set of supported profiles.
The new control V4L2_CID_MPEG_VIDEO_VP8_PROFILE is a menu control as with
controls for other codec profiles. (e.g. H264)
In addition, this patch also fixes the use of
V4L2_CID_MPEG_VIDEO_VPX_PROFILE in drivers of Qualcomm's venus and
Samsung's s5p-mfc.
Signed-off-by: Keiichi Watanabe <keiichiw@chromium.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
(cherry picked from commit 5520b9467a39d5ec9ce9cd8a9ed01f826b817524 git://git.linuxtv.org/media_tree.git)
Conflicts:
drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
drivers/media/v4l2-core/v4l2-ctrls.c
include/uapi/linux/v4l2-controls.h
BUG=chromium:819930
TEST=compile
Change-Id: Ia77aeb0ca6b62e5ce53f303162357432ad8bc066
Signed-off-by: Keiichi Watanabe <keiichiw@chromium.org>
---
--- a/include/uapi/linux/v4l2-controls.h
+++ b/include/uapi/linux/v4l2-controls.h
@@ -583,7 +583,16 @@ enum v4l2_vp8_golden_frame_sel {
#define V4L2_CID_MPEG_VIDEO_VPX_MAX_QP (V4L2_CID_MPEG_BASE+508)
#define V4L2_CID_MPEG_VIDEO_VPX_I_FRAME_QP (V4L2_CID_MPEG_BASE+509)
#define V4L2_CID_MPEG_VIDEO_VPX_P_FRAME_QP (V4L2_CID_MPEG_BASE+510)
-#define V4L2_CID_MPEG_VIDEO_VPX_PROFILE (V4L2_CID_MPEG_BASE+511)
+
+#define V4L2_CID_MPEG_VIDEO_VP8_PROFILE (V4L2_CID_MPEG_BASE+511)
+enum v4l2_mpeg_video_vp8_profile {
+ V4L2_MPEG_VIDEO_VP8_PROFILE_0 = 0,
+ V4L2_MPEG_VIDEO_VP8_PROFILE_1 = 1,
+ V4L2_MPEG_VIDEO_VP8_PROFILE_2 = 2,
+ V4L2_MPEG_VIDEO_VP8_PROFILE_3 = 3,
+};
+/* Deprecated alias for compatibility reasons. */
+#define V4L2_CID_MPEG_VIDEO_VPX_PROFILE V4L2_CID_MPEG_VIDEO_VP8_PROFILE
/* Control IDs not existing in upstream */
#define V4L2_CID_MPEG_VIDEO_VP8_FRAME_HDR (V4L2_CID_MPEG_BASE+590)
--
2.18.0.865.gffc8e1a3cd6-goog