qv4l2: add Trace IOCTLs option
authorHans Verkuil <hans.verkuil@cisco.com>
Sun, 20 Jul 2014 13:36:47 +0000 (15:36 +0200)
committerHans Verkuil <hans.verkuil@cisco.com>
Sun, 20 Jul 2014 13:36:47 +0000 (15:36 +0200)
Useful for debugging and understanding what is happening.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
utils/qv4l2/general-tab.h
utils/qv4l2/qv4l2.cpp
utils/qv4l2/qv4l2.h

index 6941f78..48109f7 100644 (file)
@@ -47,7 +47,7 @@ class QSpinBox;
 class QToolButton;
 class QSlider;
 
-class GeneralTab: public QGridLayout, cv4l_fd
+class GeneralTab: public QGridLayout, public cv4l_fd
 {
        Q_OBJECT
 
index a0209ac..6c11efe 100644 (file)
@@ -121,6 +121,11 @@ ApplicationWindow::ApplicationWindow() :
        closeAct->setShortcut(Qt::CTRL+Qt::Key_W);
        connect(closeAct, SIGNAL(triggered()), this, SLOT(closeDevice()));
 
+       QAction *traceAct = new QAction("&Trace IOCTLs", this);
+       traceAct->setStatusTip("All V4L2 IOCTLs are traced on the console");
+       traceAct->setCheckable(true);
+       connect(traceAct, SIGNAL(toggled(bool)), this, SLOT(traceIoctls(bool)));
+
        QAction *quitAct = new QAction(QIcon(":/exit.png"), "&Quit", this);
        quitAct->setStatusTip("Exit the application");
        quitAct->setShortcut(Qt::CTRL+Qt::Key_Q);
@@ -133,6 +138,8 @@ ApplicationWindow::ApplicationWindow() :
        fileMenu->addAction(m_snapshotAct);
        fileMenu->addAction(m_saveRawAct);
        fileMenu->addSeparator();
+       fileMenu->addAction(traceAct);
+       fileMenu->addSeparator();
        fileMenu->addAction(quitAct);
 
        QToolBar *toolBar = addToolBar("File");
@@ -747,6 +754,12 @@ bool ApplicationWindow::showFrames()
        return m_showFramesAct->isChecked();
 }
 
+void ApplicationWindow::traceIoctls(bool enable)
+{
+       s_trace(enable);
+       m_genTab->s_trace(enable);
+}
+
 void ApplicationWindow::enableScaling(bool enable)
 {
        if (m_capture != NULL)
index 40fbaa7..dc3b5e4 100644 (file)
@@ -130,6 +130,7 @@ private slots:
        void saveRaw(bool);
        void setRenderMethod(bool);
        void setBlending(bool);
+       void traceIoctls(bool);
        void changeAudioDevice();
 
        // gui