From: Hans Verkuil Date: Sun, 20 Jul 2014 13:36:47 +0000 (+0200) Subject: qv4l2: add Trace IOCTLs option X-Git-Tag: v4l-utils-1.3.90~73 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d60b0a37c5756467c0e00efe4be738f854cb4b80;p=platform%2Fupstream%2Fv4l-utils.git qv4l2: add Trace IOCTLs option Useful for debugging and understanding what is happening. Signed-off-by: Hans Verkuil --- diff --git a/utils/qv4l2/general-tab.h b/utils/qv4l2/general-tab.h index 6941f78..48109f7 100644 --- a/utils/qv4l2/general-tab.h +++ b/utils/qv4l2/general-tab.h @@ -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 diff --git a/utils/qv4l2/qv4l2.cpp b/utils/qv4l2/qv4l2.cpp index a0209ac..6c11efe 100644 --- a/utils/qv4l2/qv4l2.cpp +++ b/utils/qv4l2/qv4l2.cpp @@ -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) diff --git a/utils/qv4l2/qv4l2.h b/utils/qv4l2/qv4l2.h index 40fbaa7..dc3b5e4 100644 --- a/utils/qv4l2/qv4l2.h +++ b/utils/qv4l2/qv4l2.h @@ -130,6 +130,7 @@ private slots: void saveRaw(bool); void setRenderMethod(bool); void setBlending(bool); + void traceIoctls(bool); void changeAudioDevice(); // gui