aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2015-04-08 15:18:44 +0200
committerHans Verkuil <hans.verkuil@cisco.com>2015-04-08 15:18:44 +0200
commit9b68b3052698c476ce21a68ca26c7d3ee020d553 (patch)
treef75441c833916083075d67b66000737d0bbc303c
parent9a1583cedd32a1c3443c3b8bd37654cdb4eeab58 (diff)
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
-rw-r--r--utils/qv4l2/general-tab.cpp15
-rw-r--r--utils/qv4l2/general-tab.h1
-rw-r--r--utils/qv4l2/qv4l2.cpp5
3 files changed, 16 insertions, 5 deletions
diff --git a/utils/qv4l2/general-tab.cpp b/utils/qv4l2/general-tab.cpp
index 764ce330..a17b255c 100644
--- a/utils/qv4l2/general-tab.cpp
+++ b/utils/qv4l2/general-tab.cpp
@@ -1401,6 +1401,16 @@ void GeneralTab::quantRangeChanged(int idx)
updateVidFormat();
}
+void GeneralTab::clearColorspace(cv4l_fmt &fmt)
+{
+ if (m_colorspace->currentIndex() == 0)
+ fmt.s_colorspace(0);
+ if (m_ycbcrEnc->currentIndex() == 0)
+ fmt.s_ycbcr_enc(V4L2_YCBCR_ENC_DEFAULT);
+ if (m_quantRange->currentIndex() == 0)
+ fmt.s_quantization(V4L2_QUANTIZATION_DEFAULT);
+}
+
void GeneralTab::vidCapFormatChanged(int idx)
{
v4l2_fmtdesc desc;
@@ -1411,6 +1421,7 @@ void GeneralTab::vidCapFormatChanged(int idx)
g_fmt(fmt);
fmt.s_pixelformat(desc.pixelformat);
+ clearColorspace(fmt);
if (try_fmt(fmt) == 0)
s_fmt(fmt);
@@ -1468,6 +1479,7 @@ void GeneralTab::frameWidthChanged()
if (m_frameWidth->isEnabled()) {
g_fmt(fmt);
fmt.s_width(val);
+ clearColorspace(fmt);
if (try_fmt(fmt) == 0)
s_fmt(fmt);
}
@@ -1483,6 +1495,7 @@ void GeneralTab::frameHeightChanged()
if (m_frameHeight->isEnabled()) {
g_fmt(fmt);
fmt.s_height(val);
+ clearColorspace(fmt);
if (try_fmt(fmt) == 0)
s_fmt(fmt);
}
@@ -1500,6 +1513,7 @@ void GeneralTab::frameSizeChanged(int idx)
g_fmt(fmt);
fmt.s_width(frmsize.discrete.width);
fmt.s_height(frmsize.discrete.height);
+ clearColorspace(fmt);
if (try_fmt(fmt) == 0)
s_fmt(fmt);
}
@@ -1527,6 +1541,7 @@ void GeneralTab::vidOutFormatChanged(int idx)
g_fmt(fmt);
fmt.s_pixelformat(desc.pixelformat);
+ clearColorspace(fmt);
if (try_fmt(fmt) == 0)
s_fmt(fmt);
updateVidOutFormat();
diff --git a/utils/qv4l2/general-tab.h b/utils/qv4l2/general-tab.h
index 4b6e75d9..a69b8e93 100644
--- a/utils/qv4l2/general-tab.h
+++ b/utils/qv4l2/general-tab.h
@@ -151,6 +151,7 @@ private:
void updateFreqChannel();
void updateFreqRf();
void updateColorspace();
+ void clearColorspace(cv4l_fmt &fmt);
void updateVidCapFormat();
void updateVidFields();
void updateFrameSize();
diff --git a/utils/qv4l2/qv4l2.cpp b/utils/qv4l2/qv4l2.cpp
index 42a59111..fec6b83a 100644
--- a/utils/qv4l2/qv4l2.cpp
+++ b/utils/qv4l2/qv4l2.cpp
@@ -626,11 +626,6 @@ bool ApplicationWindow::startStreaming()
m_tpgField = V4L2_FIELD_TOP;
for (unsigned p = 0; p < m_queue.g_num_planes(); p++)
tpg_fillbuffer(&m_tpg, m_tpgStd, p, (u8 *)m_queue.g_dataptr(i, p));
- {
- const u8 *ptr = (const u8 *)m_queue.g_dataptr(i, 0);
- ptr += 600 * 4;
- fprintf(stderr, "%d %d %d %d\n", ptr[0], ptr[1], ptr[2], ptr[3]);
- }
qbuf(buf);
tpg_update_mv_count(&m_tpg, V4L2_FIELD_HAS_T_OR_B(m_tpgField));
}

Privacy Policy