Skip to content

Commit

Permalink
v4l2-ctl: fix regression in ability to set/get private controls
Browse files Browse the repository at this point in the history
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@kernellabs.com>
Acked-by: Hans Verkuil <hverkuil@xs4all.nl>
  • Loading branch information
dheitmueller authored and jwrdegoede committed Mar 12, 2010
1 parent a4bdf35 commit 23958e6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions utils/v4l2-ctl/v4l2-ctl.cpp
Expand Up @@ -2589,7 +2589,8 @@ int main(int argc, char **argv)
}
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;

Expand Down Expand Up @@ -2881,7 +2882,8 @@ int main(int argc, char **argv)
}
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;

Expand Down

0 comments on commit 23958e6

Please sign in to comment.