From 4b9c9e02872b4cc9aaacf9365b31e9cd61bf529b Mon Sep 17 00:00:00 2001 From: =?utf8?q?B=C3=A5rd=20Eirik=20Winther?= Date: Fri, 9 Aug 2013 12:03:22 +0000 Subject: [PATCH] qv4l2: fix GeneralTab layout MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This moves the layout items for cropping, scaling and ALSA to not interfere with driver specific controls. Signed-off-by: BÃ¥rd Eirik Winther Signed-off-by: Hans Verkuil --- utils/qv4l2/general-tab.cpp | 128 ++++++++++++++++++++++---------------------- 1 file changed, 64 insertions(+), 64 deletions(-) diff --git a/utils/qv4l2/general-tab.cpp b/utils/qv4l2/general-tab.cpp index a1a8d4a..0bb328f 100644 --- a/utils/qv4l2/general-tab.cpp +++ b/utils/qv4l2/general-tab.cpp @@ -98,6 +98,70 @@ GeneralTab::GeneralTab(const QString &device, v4l2 &fd, int n, QWidget *parent) if (m_querycap.capabilities & V4L2_CAP_DEVICE_CAPS) m_isVbi = caps() & (V4L2_CAP_VBI_CAPTURE | V4L2_CAP_SLICED_VBI_CAPTURE); + if (hasAlsaAudio()) { + m_audioInDevice = new QComboBox(parent); + m_audioOutDevice = new QComboBox(parent); + m_audioInDevice->setSizeAdjustPolicy(QComboBox::AdjustToContents); + m_audioOutDevice->setSizeAdjustPolicy(QComboBox::AdjustToContents); + + if (createAudioDeviceList()) { + addLabel("Audio Input Device"); + connect(m_audioInDevice, SIGNAL(activated(int)), SLOT(changeAudioDevice())); + addWidget(m_audioInDevice); + + addLabel("Audio Output Device"); + connect(m_audioOutDevice, SIGNAL(activated(int)), SLOT(changeAudioDevice())); + addWidget(m_audioOutDevice); + + if (isRadio()) { + setAudioDeviceBufferSize(75); + } else { + v4l2_fract fract; + if (!v4l2::get_interval(fract)) { + // Default values are for 30 FPS + fract.numerator = 33; + fract.denominator = 1000; + } + // Standard capacity is two frames + setAudioDeviceBufferSize((fract.numerator * 2000) / fract.denominator); + } + } else { + delete m_audioInDevice; + delete m_audioOutDevice; + m_audioInDevice = NULL; + m_audioOutDevice = NULL; + } + } + + if (!isRadio() && !isVbi()) { + m_pixelAspectRatio = new QComboBox(parent); + m_pixelAspectRatio->addItem("Autodetect"); + m_pixelAspectRatio->addItem("Square"); + m_pixelAspectRatio->addItem("NTSC/PAL-M/PAL-60"); + m_pixelAspectRatio->addItem("NTSC/PAL-M/PAL-60, Anamorphic"); + m_pixelAspectRatio->addItem("PAL/SECAM"); + m_pixelAspectRatio->addItem("PAL/SECAM, Anamorphic"); + + // Update hints by calling a get + getPixelAspectRatio(); + + addLabel("Pixel Aspect Ratio"); + addWidget(m_pixelAspectRatio); + connect(m_pixelAspectRatio, SIGNAL(activated(int)), SLOT(changePixelAspectRatio())); + + m_crop = new QComboBox(parent); + m_crop->addItem("None"); + m_crop->addItem("Top and Bottom Line"); + m_crop->addItem("Widescreen 14:9"); + m_crop->addItem("Widescreen 16:9"); + m_crop->addItem("Cinema 1.85:1"); + m_crop->addItem("Cinema 2.39:1"); + + addLabel("Cropping"); + addWidget(m_crop); + connect(m_crop, SIGNAL(activated(int)), SIGNAL(cropChanged())); + } + if (!isRadio() && enum_input(vin, true)) { addLabel("Input"); m_videoInput = new QComboBox(parent); @@ -148,41 +212,6 @@ GeneralTab::GeneralTab(const QString &device, v4l2 &fd, int n, QWidget *parent) updateAudioOutput(); } - if (hasAlsaAudio()) { - m_audioInDevice = new QComboBox(parent); - m_audioOutDevice = new QComboBox(parent); - m_audioInDevice->setSizeAdjustPolicy(QComboBox::AdjustToContents); - m_audioOutDevice->setSizeAdjustPolicy(QComboBox::AdjustToContents); - - if (createAudioDeviceList()) { - addLabel("Audio Input Device"); - connect(m_audioInDevice, SIGNAL(activated(int)), SLOT(changeAudioDevice())); - addWidget(m_audioInDevice); - - addLabel("Audio Output Device"); - connect(m_audioOutDevice, SIGNAL(activated(int)), SLOT(changeAudioDevice())); - addWidget(m_audioOutDevice); - - if (isRadio()) { - setAudioDeviceBufferSize(75); - } else { - v4l2_fract fract; - if (!v4l2::get_interval(fract)) { - // Default values are for 30 FPS - fract.numerator = 33; - fract.denominator = 1000; - } - // Standard capacity is two frames - setAudioDeviceBufferSize((fract.numerator * 2000) / fract.denominator); - } - } else { - delete m_audioInDevice; - delete m_audioOutDevice; - m_audioInDevice = NULL; - m_audioOutDevice = NULL; - } - } - if (needsStd) { v4l2_std_id tmp; @@ -211,35 +240,6 @@ GeneralTab::GeneralTab(const QString &device, v4l2 &fd, int n, QWidget *parent) connect(m_qryTimings, SIGNAL(clicked()), SLOT(qryTimingsClicked())); } - if (!isRadio() && !isVbi()) { - m_pixelAspectRatio = new QComboBox(parent); - m_pixelAspectRatio->addItem("Autodetect"); - m_pixelAspectRatio->addItem("Square"); - m_pixelAspectRatio->addItem("NTSC/PAL-M/PAL-60"); - m_pixelAspectRatio->addItem("NTSC/PAL-M/PAL-60, Anamorphic"); - m_pixelAspectRatio->addItem("PAL/SECAM"); - m_pixelAspectRatio->addItem("PAL/SECAM, Anamorphic"); - - // Update hints by calling a get - getPixelAspectRatio(); - - addLabel("Pixel Aspect Ratio"); - addWidget(m_pixelAspectRatio); - connect(m_pixelAspectRatio, SIGNAL(activated(int)), SLOT(changePixelAspectRatio())); - - m_crop = new QComboBox(parent); - m_crop->addItem("None"); - m_crop->addItem("Top and Bottom Line"); - m_crop->addItem("Widescreen 14:9"); - m_crop->addItem("Widescreen 16:9"); - m_crop->addItem("Cinema 1.85:1"); - m_crop->addItem("Cinema 2.39:1"); - - addLabel("Cropping"); - addWidget(m_crop); - connect(m_crop, SIGNAL(activated(int)), SIGNAL(cropChanged())); - } - if (m_tuner.capability) { QDoubleValidator *val; double factor = (m_tuner.capability & V4L2_TUNER_CAP_LOW) ? 16 : 16000; -- 2.7.4