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

feat(avform): Made warning and debug info more useful

This commit is contained in:
Diadlo 2016-07-30 14:38:52 +03:00
parent 08229735b2
commit 9478377868
No known key found for this signature in database
GPG Key ID: 5AF9F2E29107C727

View File

@ -149,13 +149,13 @@ void AVForm::on_videoModescomboBox_currentIndexChanged(int index)
{
if (index < 0 || index >= videoModes.size())
{
qWarning() << "Invalid mode index";
qWarning() << "Invalid mode index:" << index;
return;
}
int devIndex = videoDevCombobox->currentIndex();
if (devIndex < 0 || devIndex >= videoDeviceList.size())
{
qWarning() << "Invalid device index";
qWarning() << "Invalid device index:" << devIndex;
return;
}
QString devName = videoDeviceList[devIndex].first;
@ -179,9 +179,8 @@ void AVForm::on_videoModescomboBox_currentIndexChanged(int index)
mode.width = mode.width / 2 * 2;
mode.height = mode.height / 2 * 2;
// Need, if virtual screen origin is top left angle of primary screen
// Needed, if the virtual screen origin is the top left corner of the primary screen
QRect screen = QApplication::primaryScreen()->virtualGeometry();
qDebug() << screen;
mode.x += screen.x();
mode.y += screen.y();
@ -215,8 +214,6 @@ void AVForm::selectBestModes(QVector<VideoMode> &allVideoModes)
for (int i = 0; i < allVideoModes.size(); ++i)
{
VideoMode mode = allVideoModes[i];
QString pixelFormat = CameraDevice::getPixelFormatString(mode.pixel_format);
qDebug("width: %d, height: %d, FPS: %f, pixel format: %s", mode.width, mode.height, mode.FPS, pixelFormat.toStdString().c_str());
// PS3-Cam protection, everything above 60fps makes no sense
if (mode.FPS > 60)
@ -285,6 +282,7 @@ void AVForm::selectBestModes(QVector<VideoMode> &allVideoModes)
void AVForm::fillCameraModesComboBox()
{
qDebug() << "selected Modes:";
bool previouslyBlocked = videoModescomboBox->blockSignals(true);
videoModescomboBox->clear();
@ -356,7 +354,7 @@ void AVForm::updateVideoModes(int curIndex)
{
if (curIndex < 0 || curIndex >= videoDeviceList.size())
{
qWarning() << "Invalid index";
qWarning() << "Invalid index:" << curIndex;
return;
}
QString devName = videoDeviceList[curIndex].first;
@ -375,8 +373,6 @@ void AVForm::updateVideoModes(int curIndex)
{
selectBestModes(allVideoModes);
videoModes = allVideoModes;
qDebug("selected Modes:");
fillCameraModesComboBox();
}
@ -415,7 +411,7 @@ void AVForm::on_videoDevCombobox_currentIndexChanged(int index)
{
if (index < 0 || index >= videoDeviceList.size())
{
qWarning() << "Invalid index";
qWarning() << "Invalid index:" << index;
return;
}