[PATCH] v4l2-ctl: fix regression in ability to set/get private controls

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>From 3dbab2e437c4a1673c1966937faec6e0fc56be01 Mon Sep 17 00:00:00 2001
From: Devin Heitmueller <dheitmueller@xxxxxxxxxxxxxx>
Date: Wed, 10 Mar 2010 23:01:53 -0500
Subject: [PATCH] v4l2-ctl: fix regression in ability to set/get private controls

From: Devin Heitmueller <dheitmueller@xxxxxxxxxxxxxx>

In hg revision 12546, a regression was introduced which resulted in the
ability to get/set private controls.  The change resulted in all attempts
to set private controls going through the extended controls interface, and
the extended controls interface explicitly denies ability to use private
control CIDs (it's enforced in the check_ext_ctl function in v4l2-ioctl.c.

Fix the code such that it goes back to using the older g_ctrl/s_ctrl if the
control ID is a private control.

Priority: high

Signed-off-by: Devin Heitmueller <dheitmueller@xxxxxxxxxxxxxx>
Acked-by: Hans Verkuil <hverkuil@xxxxxxxxx>
---
 utils/v4l2-ctl/v4l2-ctl.cpp |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/utils/v4l2-ctl/v4l2-ctl.cpp b/utils/v4l2-ctl/v4l2-ctl.cpp
index 26d3996..c88bf6e 100644
--- a/utils/v4l2-ctl/v4l2-ctl.cpp
+++ b/utils/v4l2-ctl/v4l2-ctl.cpp
@@ -2589,7 +2589,8 @@ set_vid_fmt_error:
                }
                for (class2ctrls_map::iterator iter = class2ctrls.begin();
                                iter != class2ctrls.end(); ++iter) {
-                       if (iter->first == V4L2_CTRL_CLASS_USER) {
+                       if (iter->first == V4L2_CTRL_CLASS_USER ||
+                           iter->first == V4L2_CID_PRIVATE_BASE) {
                                for (unsigned i = 0; i <
iter->second.size(); i++) {
                                        struct v4l2_control ctrl;

@@ -2881,7 +2882,8 @@ set_vid_fmt_error:
                }
                for (class2ctrls_map::iterator iter = class2ctrls.begin();
                                iter != class2ctrls.end(); ++iter) {
-                       if (iter->first == V4L2_CTRL_CLASS_USER) {
+                       if (iter->first == V4L2_CTRL_CLASS_USER ||
+                           iter->first == V4L2_CID_PRIVATE_BASE) {
                                for (unsigned i = 0; i <
iter->second.size(); i++) {
                                        struct v4l2_control ctrl;

-- 
1.6.3.3


-- 
Devin J. Heitmueller
http://www.devinheitmueller.com
AIM: devinheitmueller
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux