This is an automatic generated email to let you know that the following patch 
were queued at the 
http://git.linuxtv.org/cgit.cgi/v4l-utils.git tree:

Subject: qv4l2: add support for /dev/v4l-touchX devices
Author:  Hans Verkuil <hverkuil-ci...@xs4all.nl>
Date:    Mon Apr 15 13:21:11 2024 +0200

Touch devices weren't supported in qv4l2, add support for this.

Signed-off-by: Hans Verkuil <hverkuil-ci...@xs4all.nl>

 utils/qv4l2/general-tab.cpp | 19 +++++++++++++------
 utils/qv4l2/general-tab.h   |  2 ++
 utils/qv4l2/qv4l2.cpp       | 15 +++++++++++++--
 3 files changed, 28 insertions(+), 8 deletions(-)

---

http://git.linuxtv.org/cgit.cgi/v4l-utils.git/commit/?id=75fa382f2c9a00d8f9e94f4998d56ff609267658
diff --git a/utils/qv4l2/general-tab.cpp b/utils/qv4l2/general-tab.cpp
index bceaab09852d..52cac8b59bb8 100644
--- a/utils/qv4l2/general-tab.cpp
+++ b/utils/qv4l2/general-tab.cpp
@@ -68,6 +68,7 @@ GeneralTab::GeneralTab(const QString &device, cv4l_fd *fd, 
int n, QWidget *paren
        m_hMargin(20),
        m_isRadio(false),
        m_isSDR(false),
+       m_isTouch(false),
        m_isVbi(false),
        m_isOutput(false),
        m_isSDTV(false),
@@ -165,6 +166,7 @@ GeneralTab::GeneralTab(const QString &device, cv4l_fd *fd, 
int n, QWidget *paren
                m_isVbi = g_caps() & (V4L2_CAP_VBI_CAPTURE | 
V4L2_CAP_SLICED_VBI_CAPTURE |
                                      V4L2_CAP_VBI_OUTPUT | 
V4L2_CAP_SLICED_VBI_OUTPUT);
                m_isSDR = g_caps() & V4L2_CAP_SDR_CAPTURE;
+               m_isTouch = g_caps() & V4L2_CAP_TOUCH;
                if (m_isSDR)
                        m_isRadio = true;
                if (g_caps() & (V4L2_CAP_VIDEO_OUTPUT | 
V4L2_CAP_VIDEO_OUTPUT_MPLANE |
@@ -195,7 +197,7 @@ GeneralTab::GeneralTab(const QString &device, cv4l_fd *fd, 
int n, QWidget *paren
                m_audioOutDevice = new QComboBox(parent);
        }
 
-       if (!isVbi() && (createAudioDeviceList() || (!isRadio() && 
!enum_audio(vaudio, true)) ||
+       if (!isVbi() && !isTouch() && (createAudioDeviceList() || (!isRadio() 
&& !enum_audio(vaudio, true)) ||
            (!isSDR() && m_tuner.capability) || (!isRadio() && 
!enum_audout(vaudout, true)))) {
                addTitle("Audio Settings");
                audioSection(vaudio, vaudout); 
@@ -275,7 +277,7 @@ GeneralTab::GeneralTab(const QString &device, cv4l_fd *fd, 
int n, QWidget *paren
        m_recordPrio = new QCheckBox(parentWidget());
        addWidget(m_recordPrio);
 
-       if (!isRadio() && !isVbi() && (has_crop() || has_compose())) {
+       if (!isRadio() && !isVbi() && !isTouch() && (has_crop() || 
has_compose())) {
                addTitle("Cropping & Compose Settings");
                cropSection();
        }
@@ -755,6 +757,8 @@ void GeneralTab::formatSection(v4l2_fmtdesc fmt)
                m_colorspace->addItem("SMPTE 240M", 
QVariant(V4L2_COLORSPACE_SMPTE240M));
                m_colorspace->addItem("470 System M", 
QVariant(V4L2_COLORSPACE_470_SYSTEM_M));
                m_colorspace->addItem("470 System BG", 
QVariant(V4L2_COLORSPACE_470_SYSTEM_BG));
+               m_colorspace->addItem("JPEG", QVariant(V4L2_COLORSPACE_JPEG));
+               m_colorspace->addItem("Raw", QVariant(V4L2_COLORSPACE_RAW));
 
                addLabel("Colorspace");
                addWidget(m_colorspace);
@@ -800,7 +804,7 @@ void GeneralTab::formatSection(v4l2_fmtdesc fmt)
                connect(m_quantRange, SIGNAL(activated(int)), 
SLOT(quantRangeChanged(int)));
        }
 
-       if (m_isOutput)
+       if (m_isOutput || isTouch())
                return;
 
        m_cropping = new QComboBox(parentWidget());
@@ -1202,7 +1206,7 @@ void GeneralTab::updateGUIInput(__u32 input)
                m_stackedFrequency->hide();
        }
 
-       if (isVbi()) {
+       if (isVbi() || isTouch()) {
                m_stackedFrameSettings->hide();
        }
 }
@@ -1823,7 +1827,7 @@ void GeneralTab::updateStandard()
        m_tvStandard->setStatusTip(what);
        m_tvStandard->setWhatsThis(what);
        updateVidFormat();
-       if (!isVbi() && !m_isOutput)
+       if (!isVbi() && !isTouch() && !m_isOutput)
                changePixelAspectRatio();
 }
 
@@ -2263,6 +2267,9 @@ double GeneralTab::getPixelAspectRatio()
        unsigned w = 0, h = 0;
 
        ratio = g_pixel_aspect(w, h);
+       if (!m_pixelAspectRatio)
+               return 1;
+
        switch (m_pixelAspectRatio->currentIndex()) {
        // override ratio if hardcoded, but keep w and h
        case 1:
@@ -2428,7 +2435,7 @@ int GeneralTab::matchAudioDevice()
 bool GeneralTab::hasAlsaAudio()
 {
 #ifdef HAVE_ALSA
-       return !isVbi();
+       return !isVbi() && !isTouch();
 #else
        return false;
 #endif
diff --git a/utils/qv4l2/general-tab.h b/utils/qv4l2/general-tab.h
index f5ec73e5788b..15d2d52a73e2 100644
--- a/utils/qv4l2/general-tab.h
+++ b/utils/qv4l2/general-tab.h
@@ -67,6 +67,7 @@ public:
        int height() const { return m_height; }
        bool isRadio() const { return m_isRadio; }
        bool isSDR() const { return m_isSDR; }
+       bool isTouch() const { return m_isTouch; }
        bool isVbi() const { return m_isVbi; }
        bool isSlicedVbi() const;
        bool isPlanar() const { return m_isPlanar; }
@@ -299,6 +300,7 @@ private:
        int m_maxh;
        bool m_isRadio;
        bool m_isSDR;
+       bool m_isTouch;
        bool m_isVbi;
        bool m_isOutput;
        bool m_isSDTV;
diff --git a/utils/qv4l2/qv4l2.cpp b/utils/qv4l2/qv4l2.cpp
index 534bedb22757..ddb43e3834f9 100644
--- a/utils/qv4l2/qv4l2.cpp
+++ b/utils/qv4l2/qv4l2.cpp
@@ -476,7 +476,7 @@ void ApplicationWindow::setDevice(const QString &device, 
bool rawOpen)
 
 void ApplicationWindow::opendev()
 {
-       QFileDialog d(this, "Select v4l device", "/dev", "V4L Devices (video* 
vbi* radio* swradio*)");
+       QFileDialog d(this, "Select v4l device", "/dev", "V4L Devices (video* 
vbi* radio* swradio* v4l-touch*)");
 
        d.setFilter(QDir::AllDirs | QDir::Files | QDir::System);
        d.setFileMode(QFileDialog::ExistingFile);
@@ -486,7 +486,7 @@ void ApplicationWindow::opendev()
 
 void ApplicationWindow::openrawdev()
 {
-       QFileDialog d(this, "Select v4l device", "/dev", "V4L Devices (video* 
vbi* radio* swradio*)");
+       QFileDialog d(this, "Select v4l device", "/dev", "V4L Devices (video* 
vbi* radio* swradio* v4l-touch*)");
 
        d.setFilter(QDir::AllDirs | QDir::Files | QDir::System);
        d.setFileMode(QFileDialog::ExistingFile);
@@ -1813,6 +1813,8 @@ static void usage()
               "                     if <dev> is a number, then /dev/radio<dev> 
is used\n"
               "  -S, --sdr-device=<dev> use device <dev> as the SDR device\n"
               "                     if <dev> is a number, then 
/dev/swradio<dev> is used\n"
+              "  -t, --touch-device=<dev> use device <dev> as the touch 
device\n"
+              "                     if <dev> is a number, then 
/dev/v4l-touch<dev> is used\n"
               "  -h, --help         display this help message\n"
               "  -R, --raw          open device in raw mode.\n");
 }
@@ -1875,6 +1877,7 @@ int main(int argc, char **argv)
        QString vbi_device;
        QString radio_device;
        QString sdr_device;
+       QString touch_device;
 
        a.setWindowIcon(QIcon(":/qv4l2.png"));
        g_mw = new ApplicationWindow();
@@ -1906,6 +1909,12 @@ int main(int argc, char **argv)
                } else if (args[i].startsWith("--sdr-device")) {
                        if (!processLongOption(args, i, sdr_device))
                                return 0;
+               } else if (args[i].startsWith("-t")) {
+                       if (!processShortOption(args, i, touch_device))
+                               return 0;
+               } else if (args[i].startsWith("--touch-device")) {
+                       if (!processLongOption(args, i, touch_device))
+                               return 0;
                } else if (args[i] == "-h" || args[i] == "--help") {
                        usage();
                        return 0;
@@ -1926,6 +1935,8 @@ int main(int argc, char **argv)
                device = getDeviceName("/dev/radio", radio_device);
        else if (sdr_device != nullptr)
                device = getDeviceName("/dev/swradio", sdr_device);
+       else if (touch_device != nullptr)
+               device = getDeviceName("/dev/v4l-touch", touch_device);
        else
                device = "/dev/video0";
 

Reply via email to