1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

0x0 resolution removed

better camera initializing in av settings
This commit is contained in:
derMart 2015-01-12 16:50:00 +01:00
parent e5d736e6c0
commit 7d11e9192c
3 changed files with 9 additions and 3 deletions

View File

@ -112,7 +112,7 @@ void CameraWorker::_probeResolutions()
//qDebug() << "PROBING:" << res << " got " << w << h;
if (!resolutions.contains(QSize(w,h)))
if (w>0 && h>0 && !resolutions.contains(QSize(w,h)))
resolutions.append(QSize(w,h));
}

View File

@ -67,6 +67,10 @@ void AVForm::present()
Camera::getInstance()->probeProp(Camera::HUE);
Camera::getInstance()->probeResolutions();
bodyUI->videoModescomboBox->blockSignals(true);
bodyUI->videoModescomboBox->addItem(tr("Initializing Camera..."));
bodyUI->videoModescomboBox->blockSignals(false);
}
void AVForm::on_ContrastSlider_sliderMoved(int position)
@ -89,7 +93,7 @@ void AVForm::on_HueSlider_sliderMoved(int position)
Camera::getInstance()->setProp(Camera::HUE, position / 100.0);
}
void AVForm::on_videoModescomboBox_activated(int index)
void AVForm::on_videoModescomboBox_currentIndexChanged(int index)
{
Camera::getInstance()->setResolution(bodyUI->videoModescomboBox->itemData(index).toSize());
}
@ -118,8 +122,10 @@ void AVForm::onPropProbingFinished(Camera::Prop prop, double val)
void AVForm::onResProbingFinished(QList<QSize> res)
{
bodyUI->videoModescomboBox->clear();
bodyUI->videoModescomboBox->blockSignals(true);
for (QSize r : res)
bodyUI->videoModescomboBox->addItem(QString("%1x%2").arg(QString::number(r.width()),QString::number(r.height())), r);
bodyUI->videoModescomboBox->blockSignals(false);
bodyUI->videoModescomboBox->setCurrentIndex(bodyUI->videoModescomboBox->count()-1);
}

View File

@ -47,7 +47,7 @@ private slots:
void on_SaturationSlider_sliderMoved(int position);
void on_BrightnessSlider_sliderMoved(int position);
void on_HueSlider_sliderMoved(int position);
void on_videoModescomboBox_activated(int index);
void on_videoModescomboBox_currentIndexChanged(int index);
// audio
void onInDevChanged(const QString& deviceDescriptor);