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: changing inputs may change available stds and presets. Author: Hans Verkuil <[email protected]> Date: Fri Nov 18 10:20:12 2011 +0100 Update the standard and preset lists when the user changes the input. Signed-off-by: Hans Verkuil <[email protected]> (cherry picked from commit 65ba1706bac03dc112d4a71e79dcf8ad617e635c) Signed-off-by: Gregor Jasny <[email protected]> utils/qv4l2/general-tab.cpp | 93 +++++++++++++++++++++++++++---------------- utils/qv4l2/general-tab.h | 2 + 2 files changed, 60 insertions(+), 35 deletions(-) --- http://git.linuxtv.org/v4l-utils.git?a=commitdiff;h=2adbb34657c818aad1b0459b8557d3441d281b94 diff --git a/utils/qv4l2/general-tab.cpp b/utils/qv4l2/general-tab.cpp index 3e97b4b..4576863 100644 --- a/utils/qv4l2/general-tab.cpp +++ b/utils/qv4l2/general-tab.cpp @@ -63,46 +63,22 @@ GeneralTab::GeneralTab(const QString &device, v4l2 &fd, int n, QWidget *parent) g_tuner(m_tuner); - v4l2_standard vs; - if (enum_std(vs, true)) { - addLabel("TV Standard"); - m_tvStandard = new QComboBox(parent); - do { - m_tvStandard->addItem((char *)vs.name); - } while (enum_std(vs)); - addWidget(m_tvStandard); - connect(m_tvStandard, SIGNAL(activated(int)), SLOT(standardChanged(int))); - addLabel(""); - m_qryStandard = new QPushButton("Query Standard", parent); - addWidget(m_qryStandard); - connect(m_qryStandard, SIGNAL(clicked()), SLOT(qryStdClicked())); - } - - v4l2_dv_enum_preset preset; - if (enum_dv_preset(preset, true)) { - addLabel("Video Preset"); - m_videoPreset = new QComboBox(parent); - do { - m_videoPreset->addItem((char *)preset.name); - } while (enum_dv_preset(preset)); - addWidget(m_videoPreset); - connect(m_videoPreset, SIGNAL(activated(int)), SLOT(presetChanged(int))); - addLabel(""); - m_qryPreset = new QPushButton("Query Preset", parent); - addWidget(m_qryPreset); - connect(m_qryPreset, SIGNAL(clicked()), SLOT(qryPresetClicked())); - } - v4l2_input vin; + bool needsStd = false; + bool needsPreset = false; + if (enum_input(vin, true)) { addLabel("Input"); m_videoInput = new QComboBox(parent); do { m_videoInput->addItem((char *)vin.name); + if (vin.capabilities & V4L2_IN_CAP_STD) + needsStd = true; + if (vin.capabilities & V4L2_IN_CAP_PRESETS) + needsPreset = true; } while (enum_input(vin)); addWidget(m_videoInput); connect(m_videoInput, SIGNAL(activated(int)), SLOT(inputChanged(int))); - updateVideoInput(); } v4l2_output vout; @@ -141,6 +117,30 @@ GeneralTab::GeneralTab(const QString &device, v4l2 &fd, int n, QWidget *parent) updateAudioOutput(); } + if (needsStd) { + addLabel("TV Standard"); + m_tvStandard = new QComboBox(parent); + addWidget(m_tvStandard); + connect(m_tvStandard, SIGNAL(activated(int)), SLOT(standardChanged(int))); + refreshStandards(); + addLabel(""); + m_qryStandard = new QPushButton("Query Standard", parent); + addWidget(m_qryStandard); + connect(m_qryStandard, SIGNAL(clicked()), SLOT(qryStdClicked())); + } + + if (needsPreset) { + addLabel("Video Preset"); + m_videoPreset = new QComboBox(parent); + addWidget(m_videoPreset); + connect(m_videoPreset, SIGNAL(activated(int)), SLOT(presetChanged(int))); + refreshPresets(); + addLabel(""); + m_qryPreset = new QPushButton("Query Preset", parent); + addWidget(m_qryPreset); + connect(m_qryPreset, SIGNAL(clicked()), SLOT(qryPresetClicked())); + } + if (m_tuner.type) { m_freq = new QSpinBox(parent); m_freq->setMinimum(m_tuner.rangelow); @@ -205,10 +205,7 @@ GeneralTab::GeneralTab(const QString &device, v4l2 &fd, int n, QWidget *parent) addWidget(m_frameInterval); connect(m_frameInterval, SIGNAL(activated(int)), SLOT(frameIntervalChanged(int))); - if (m_tvStandard) - updateStandard(); - if (m_videoPreset) - updatePreset(); + updateVideoInput(); updateVidCapFormat(); @@ -427,10 +424,14 @@ void GeneralTab::updateVideoInput() enum_input(in, true, input); m_videoInput->setCurrentIndex(input); if (m_tvStandard) { + refreshStandards(); + updateStandard(); m_tvStandard->setEnabled(in.capabilities & V4L2_IN_CAP_STD); m_qryStandard->setEnabled(in.capabilities & V4L2_IN_CAP_STD); } if (m_videoPreset) { + refreshPresets(); + updatePreset(); m_videoPreset->setEnabled(in.capabilities & V4L2_IN_CAP_PRESETS); m_qryPreset->setEnabled(in.capabilities & V4L2_IN_CAP_PRESETS); } @@ -481,6 +482,17 @@ void GeneralTab::updateAudioOutput() m_audioOutput->setCurrentIndex(audio.index); } +void GeneralTab::refreshStandards() +{ + v4l2_standard vs; + m_tvStandard->clear(); + if (enum_std(vs, true)) { + do { + m_tvStandard->addItem((char *)vs.name); + } while (enum_std(vs)); + } +} + void GeneralTab::updateStandard() { v4l2_std_id std; @@ -525,6 +537,17 @@ void GeneralTab::qryStdClicked() } } +void GeneralTab::refreshPresets() +{ + v4l2_dv_enum_preset preset; + m_videoPreset->clear(); + if (enum_dv_preset(preset, true)) { + do { + m_videoPreset->addItem((char *)preset.name); + } while (enum_dv_preset(preset)); + } +} + void GeneralTab::updatePreset() { __u32 preset; diff --git a/utils/qv4l2/general-tab.h b/utils/qv4l2/general-tab.h index 0a3e304..61c2542 100644 --- a/utils/qv4l2/general-tab.h +++ b/utils/qv4l2/general-tab.h @@ -67,7 +67,9 @@ private: void updateVideoOutput(); void updateAudioInput(); void updateAudioOutput(); + void refreshStandards(); void updateStandard(); + void refreshPresets(); void updatePreset(); void updateFreq(); void updateFreqChannel(); _______________________________________________ linuxtv-commits mailing list [email protected] http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
