Skip to contentSkip to conversation

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

PATCH New Devin Heitmueller 1 participant 1 message Mar 12, 2010 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

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

Quoted 1 line

From 3dbab2e437c4a1673c1966937faec6e0fc56be01 Mon Sep 17 00:00:00 2001

From: Devin Heitmueller <[email protected]>
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 <[email protected]>

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

---
 utils/v4l2-ctl/v4l2-ctl.cpp |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
utils/v4l2-ctl/v4l2-ctl.cpp +2 -1
index 26d3996..c88bf6e 100644
@@ -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;
Signature · 7 lines
1.6.3.3


-- 
Devin J. Heitmueller
http://www.devinheitmueller.com
AIM: devinheitmueller