void GeneralTab::cropChanged()
{
- v4l2_selection sel;
+ v4l2_selection sel = { 0 };
if (!m_cropWidth->isEnabled() || !cur_io_has_crop())
return;
void GeneralTab::composeChanged()
{
- v4l2_selection sel;
+ v4l2_selection sel = { 0 };
if (!m_composeWidth->isEnabled() || !cur_io_has_compose())
return;
v4l2_standard vs;
QString what;
- g_std(std);
- if (!enum_std(vs, true)) {
- do {
- if (vs.id == std)
- break;
- } while (!enum_std(vs));
- }
+ if (g_std(std))
+ return;
+ if (enum_std(vs, true))
+ return;
+ do {
+ if (vs.id == std)
+ break;
+ } while (!enum_std(vs));
if (vs.id != std) {
if (!enum_std(vs, true)) {
do {
v4l2_enum_dv_timings p;
QString what;
- g_dv_timings(timings);
- if (!enum_dv_timings(p, true)) {
- do {
- if (!memcmp(&timings, &p.timings, sizeof(timings)))
- break;
- } while (!enum_dv_timings(p));
- }
+ if (g_dv_timings(timings))
+ return;
+ if (enum_dv_timings(p, true))
+ return;
+ do {
+ if (!memcmp(&timings, &p.timings, sizeof(timings)))
+ break;
+ } while (!enum_dv_timings(p));
if (memcmp(&timings, &p.timings, sizeof(timings)))
return;
m_videoTimings->setCurrentIndex(p.index);
if (m_cropWidth == NULL || !m_cropWidth->isEnabled())
return;
- v4l2_selection sel;
+ v4l2_selection sel = { 0 };
v4l2_rect &r = sel.r;
v4l2_rect b = { 0, 0, m_width, m_height };
if (m_composeWidth == NULL || !m_composeWidth->isEnabled())
return;
- v4l2_selection sel;
+ v4l2_selection sel = { 0 };
v4l2_rect &r = sel.r;
v4l2_rect b = { 0, 0, m_width, m_height };
}
m_capSrcFormat.s_type(g_type());
- g_fmt(m_capSrcFormat);
+ if (g_fmt(m_capSrcFormat)) {
+ error("could not obtain a source format\n");
+ return;
+ }
s_fmt(m_capSrcFormat);
- if (!m_genTab->get_interval(interval))
+ if (m_genTab->get_interval(interval))
set_interval(interval);
m_frameData = new unsigned char[m_capSrcFormat.g_sizeimage(0) +
delete m_ctrlNotifier;
m_ctrlNotifier = NULL;
}
- delete m_frameData;
+ delete [] m_frameData;
m_frameData = NULL;
v4lconvert_destroy(m_convertData);
cv4l_fd::close();
m_tabs->removeTab(0);
delete page;
}
+ m_genTab = NULL;
m_ctrlMap.clear();
m_widgetMap.clear();
m_sliderMap.clear();
v4l2_streamparm parm;
parm.type = type ? type : g_type();
+ memset(parm.parm.capture.reserved, 0, sizeof(parm.parm.capture.reserved));
if (cv4l_ioctl(VIDIOC_G_PARM, &parm) ||
!(parm.parm.capture.capability & V4L2_CAP_TIMEPERFRAME))
return -1;
v4l2_streamparm parm;
parm.type = type ? type : g_type();
+ memset(parm.parm.capture.reserved, 0, sizeof(parm.parm.capture.reserved));
if (cv4l_ioctl(VIDIOC_G_PARM, &parm) == 0 &&
(parm.parm.capture.capability & V4L2_CAP_TIMEPERFRAME)) {
interval = parm.parm.capture.timeperframe;