aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2014-07-28 16:21:56 +0200
committerHans Verkuil <hans.verkuil@cisco.com>2014-07-28 16:21:56 +0200
commit5a0bbe5d884c005cc460b49b8606df01577c0233 (patch)
tree82ec3b06148b8bc09b3eea153edbaa4d98c5dc19
parentfaaf33fd3b40c81d818c695219fddad31293c05d (diff)
qv4l2: convert the last direct ioctl calls to a cv4l-helper.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
-rw-r--r--utils/qv4l2/general-tab.cpp2
-rw-r--r--utils/qv4l2/general-tab.h1
-rw-r--r--utils/qv4l2/qv4l2.cpp4
-rw-r--r--utils/v4l2-compliance/cv4l-helpers.h25
4 files changed, 29 insertions, 3 deletions
diff --git a/utils/qv4l2/general-tab.cpp b/utils/qv4l2/general-tab.cpp
index 8a2c90ed..5e33562e 100644
--- a/utils/qv4l2/general-tab.cpp
+++ b/utils/qv4l2/general-tab.cpp
@@ -121,7 +121,7 @@ GeneralTab::GeneralTab(const QString &device, cv4l_fd *fd, int n, QWidget *paren
m_maxw[i] = 0;
}
- cv4l_ioctl(VIDIOC_QUERYCAP, &m_querycap);
+ querycap(m_querycap);
addTitle("General Information");
diff --git a/utils/qv4l2/general-tab.h b/utils/qv4l2/general-tab.h
index a31d386a..d724098e 100644
--- a/utils/qv4l2/general-tab.h
+++ b/utils/qv4l2/general-tab.h
@@ -218,6 +218,7 @@ private:
bool g_direct() const { return m_fd->g_direct(); }
void s_direct(bool direct) { m_fd->s_direct(direct); }
+ void querycap(v4l2_capability &cap) { return m_fd->querycap(cap); }
int queryctrl(v4l2_queryctrl &qc) { return m_fd->queryctrl(qc); }
int querymenu(v4l2_querymenu &qm) { return m_fd->querymenu(qm); }
int g_fmt(v4l2_format &fmt, unsigned type = 0) { return m_fd->g_fmt(fmt); }
diff --git a/utils/qv4l2/qv4l2.cpp b/utils/qv4l2/qv4l2.cpp
index 6daa0956..86dcc6a9 100644
--- a/utils/qv4l2/qv4l2.cpp
+++ b/utils/qv4l2/qv4l2.cpp
@@ -412,7 +412,7 @@ void ApplicationWindow::ctrlEvent()
ctrls.count = 1;
ctrls.ctrl_class = 0;
ctrls.controls = &c;
- if (!cv4l_ioctl(VIDIOC_G_EXT_CTRLS, &ctrls))
+ if (!g_ext_ctrls(ctrls))
setString(ev.id, c.string);
free(c.string);
}
@@ -956,7 +956,7 @@ void ApplicationWindow::stopStreaming()
if (v4l_type_is_capture(g_type())) {
memset(&cmd, 0, sizeof(cmd));
cmd.cmd = V4L2_ENC_CMD_STOP;
- cv4l_ioctl(VIDIOC_ENCODER_CMD, &cmd);
+ encoder_cmd(cmd);
}
break;
diff --git a/utils/v4l2-compliance/cv4l-helpers.h b/utils/v4l2-compliance/cv4l-helpers.h
index 49ab7f74..1b01a6ca 100644
--- a/utils/v4l2-compliance/cv4l-helpers.h
+++ b/utils/v4l2-compliance/cv4l-helpers.h
@@ -59,6 +59,11 @@ public:
bool has_streaming() const { return v4l_has_streaming(this); }
bool has_ext_pix_format() const { return v4l_has_ext_pix_format(this); }
+ void querycap(v4l2_capability &cap)
+ {
+ cap = this->cap;
+ }
+
int queryctrl(v4l2_queryctrl &qc)
{
return cv4l_ioctl(VIDIOC_QUERYCTRL, &qc);
@@ -469,6 +474,26 @@ public:
return -1;
}
+ int encoder_cmd(v4l2_encoder_cmd &cmd)
+ {
+ return cv4l_ioctl(VIDIOC_ENCODER_CMD, &cmd);
+ }
+
+ int try_encoder_cmd(v4l2_encoder_cmd &cmd)
+ {
+ return cv4l_ioctl(VIDIOC_TRY_ENCODER_CMD, &cmd);
+ }
+
+ int decoder_cmd(v4l2_decoder_cmd &cmd)
+ {
+ return cv4l_ioctl(VIDIOC_DECODER_CMD, &cmd);
+ }
+
+ int try_decoder_cmd(v4l2_decoder_cmd &cmd)
+ {
+ return cv4l_ioctl(VIDIOC_TRY_DECODER_CMD, &cmd);
+ }
+
v4l2_fract g_pixel_aspect(unsigned &width, unsigned &height, unsigned type = 0)
{
v4l2_cropcap ratio;

Privacy Policy