diff options
-rw-r--r-- | linux/drivers/media/dvb/frontends/mt312.c | 1 | ||||
-rw-r--r-- | v4l/versions.txt | 6 | ||||
-rw-r--r-- | v4l2-apps/util/v4l2-ctl.cpp | 33 |
3 files changed, 38 insertions, 2 deletions
diff --git a/linux/drivers/media/dvb/frontends/mt312.c b/linux/drivers/media/dvb/frontends/mt312.c index 071328d7b..f348f8bea 100644 --- a/linux/drivers/media/dvb/frontends/mt312.c +++ b/linux/drivers/media/dvb/frontends/mt312.c @@ -35,6 +35,7 @@ #include "dvb_frontend.h" #include "mt312_priv.h" #include "mt312.h" +#include "compat.h" struct mt312_state { diff --git a/v4l/versions.txt b/v4l/versions.txt index 792419f99..01b553d6c 100644 --- a/v4l/versions.txt +++ b/v4l/versions.txt @@ -26,11 +26,13 @@ SOC_CAMERA SOC_CAMERA_MT9V022 SOC_CAMERA_MT9M001 +[2.6.24] +# Some freezer routines +USB_GSPCA_SN9C20X_EVDEV + [2.6.23] # Needs field intf_assoc in struct usb_host_config VIDEO_CX231XX -# Some freezer routines -USB_GSPCA_SN9C20X_EVDEV [2.6.22] #This driver requires I2C probe/remove fields diff --git a/v4l2-apps/util/v4l2-ctl.cpp b/v4l2-apps/util/v4l2-ctl.cpp index 6f6b5e2f8..5410e5d03 100644 --- a/v4l2-apps/util/v4l2-ctl.cpp +++ b/v4l2-apps/util/v4l2-ctl.cpp @@ -147,6 +147,7 @@ static unsigned capabilities; typedef std::vector<struct v4l2_ext_control> ctrl_list; static ctrl_list user_ctrls; static ctrl_list mpeg_ctrls; +static ctrl_list camera_ctrls; typedef std::map<std::string, unsigned> ctrl_strmap; static ctrl_strmap ctrl_str2id; @@ -2187,6 +2188,8 @@ set_vid_fmt_error: ctrl.value = strtol(iter->second.c_str(), NULL, 0); if (V4L2_CTRL_ID2CLASS(ctrl.id) == V4L2_CTRL_CLASS_MPEG) mpeg_ctrls.push_back(ctrl); + else if (V4L2_CTRL_ID2CLASS(ctrl.id) == V4L2_CTRL_CLASS_CAMERA) + camera_ctrls.push_back(ctrl); else user_ctrls.push_back(ctrl); } @@ -2217,6 +2220,22 @@ set_vid_fmt_error: } } } + if (camera_ctrls.size()) { + ctrls.ctrl_class = V4L2_CTRL_CLASS_CAMERA; + ctrls.count = camera_ctrls.size(); + ctrls.controls = &camera_ctrls[0]; + if (doioctl(fd, VIDIOC_S_EXT_CTRLS, &ctrls, "VIDIOC_S_EXT_CTRLS")) { + if (ctrls.error_idx >= ctrls.count) { + fprintf(stderr, "Error setting CAMERA controls: %s\n", + strerror(errno)); + } + else { + fprintf(stderr, "%s: %s\n", + ctrl_id2str[camera_ctrls[ctrls.error_idx].id].c_str(), + strerror(errno)); + } + } + } } /* Get options */ @@ -2432,6 +2451,7 @@ set_vid_fmt_error: struct v4l2_ext_controls ctrls = { 0 }; mpeg_ctrls.clear(); + camera_ctrls.clear(); user_ctrls.clear(); for (ctrl_get_list::iterator iter = get_ctrls.begin(); iter != get_ctrls.end(); ++iter) { @@ -2440,6 +2460,8 @@ set_vid_fmt_error: ctrl.id = ctrl_str2id[*iter]; if (V4L2_CTRL_ID2CLASS(ctrl.id) == V4L2_CTRL_CLASS_MPEG) mpeg_ctrls.push_back(ctrl); + else if (V4L2_CTRL_ID2CLASS(ctrl.id) == V4L2_CTRL_CLASS_CAMERA) + camera_ctrls.push_back(ctrl); else user_ctrls.push_back(ctrl); } @@ -2461,6 +2483,17 @@ set_vid_fmt_error: printf("%s: %d\n", ctrl_id2str[ctrl.id].c_str(), ctrl.value); } } + if (camera_ctrls.size()) { + ctrls.ctrl_class = V4L2_CTRL_CLASS_CAMERA; + ctrls.count = camera_ctrls.size(); + ctrls.controls = &camera_ctrls[0]; + doioctl(fd, VIDIOC_G_EXT_CTRLS, &ctrls, "VIDIOC_G_EXT_CTRLS"); + for (unsigned i = 0; i < camera_ctrls.size(); i++) { + struct v4l2_ext_control ctrl = camera_ctrls[i]; + + printf("%s: %d\n", ctrl_id2str[ctrl.id].c_str(), ctrl.value); + } + } } if (options[OptGetTuner]) { |