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

Subject: qv4l2: add support for the V4L2_EVENT_SOURCE_CHANGE event.
Author:  Hans Verkuil <[email protected]>
Date:    Fri Jun 13 15:14:51 2014 +0200

Subscribe to the V4L2_EVENT_SOURCE_CHANGE event. When such an event
arrives for the current input the application will call QUERYSTD or
QUERY_DV_TIMINGS to update the standard/timings.

Signed-off-by: Hans Verkuil <[email protected]>

 utils/qv4l2/general-tab.cpp |   18 ++++++++++++++++++
 utils/qv4l2/general-tab.h   |    1 +
 utils/qv4l2/qv4l2.cpp       |    4 ++++
 3 files changed, 23 insertions(+), 0 deletions(-)

---

http://git.linuxtv.org/v4l-utils.git?a=commitdiff;h=497936ba5110171f286205f1a0489f39f0625925

diff --git a/utils/qv4l2/general-tab.cpp b/utils/qv4l2/general-tab.cpp
index ca403bf..553f2b3 100644
--- a/utils/qv4l2/general-tab.cpp
+++ b/utils/qv4l2/general-tab.cpp
@@ -203,6 +203,12 @@ GeneralTab::GeneralTab(const QString &device, v4l2 &fd, 
int n, QWidget *parent)
                                needsStd = true;
                        if (vin.capabilities & V4L2_IN_CAP_DV_TIMINGS)
                                needsTimings = true;
+
+                       struct v4l2_event_subscription sub = {
+                               V4L2_EVENT_SOURCE_CHANGE, vin.index
+                       };
+
+                       subscribe_event(sub);
                } while (enum_input(vin));
                addWidget(m_videoInput);
                connect(m_videoInput, SIGNAL(activated(int)), 
SLOT(inputChanged(int)));
@@ -1255,6 +1261,18 @@ void GeneralTab::qryTimingsClicked()
        }
 }
 
+void GeneralTab::sourceChange(const v4l2_event &ev)
+{
+       if (!m_videoInput)
+               return;
+       if ((int)ev.id != m_videoInput->currentIndex())
+               return;
+       if (m_qryStandard && m_qryStandard->isEnabled())
+               m_qryStandard->click();
+       else if (m_qryTimings && m_qryTimings->isEnabled())
+               m_qryTimings->click();
+}
+
 void GeneralTab::updateFreq()
 {
        v4l2_frequency f;
diff --git a/utils/qv4l2/general-tab.h b/utils/qv4l2/general-tab.h
index d20f3c4..4bd87c7 100644
--- a/utils/qv4l2/general-tab.h
+++ b/utils/qv4l2/general-tab.h
@@ -80,6 +80,7 @@ public:
        inline bool streamon() { return v4l2::streamon(m_buftype); }
        inline bool streamoff() { return v4l2::streamoff(m_buftype); }
        void setHaveBuffers(bool haveBuffers);
+       void sourceChange(const v4l2_event &ev);
 
 public slots:
        void showAllAudioDevices(bool use);
diff --git a/utils/qv4l2/qv4l2.cpp b/utils/qv4l2/qv4l2.cpp
index 5f26ff4..8378018 100644
--- a/utils/qv4l2/qv4l2.cpp
+++ b/utils/qv4l2/qv4l2.cpp
@@ -305,6 +305,10 @@ void ApplicationWindow::ctrlEvent()
        v4l2_event ev;
 
        while (dqevent(ev)) {
+               if (ev.type == V4L2_EVENT_SOURCE_CHANGE) {
+                       m_genTab->sourceChange(ev);
+                       continue;
+               }
                if (ev.type != V4L2_EVENT_CTRL)
                        continue;
                m_ctrlMap[ev.id].flags = ev.u.ctrl.flags;

_______________________________________________
linuxtv-commits mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to