Skip to content
This repository has been archived by the owner on Feb 12, 2023. It is now read-only.

Commit

Permalink
feat(avform): Made warning and debug info more useful
Browse files Browse the repository at this point in the history
  • Loading branch information
Diadlo committed Aug 25, 2016
1 parent 0822973 commit 9478377
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions src/widget/form/settings/avform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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();

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -285,6 +282,7 @@ void AVForm::selectBestModes(QVector<VideoMode> &allVideoModes)

void AVForm::fillCameraModesComboBox()
{
qDebug() << "selected Modes:";
bool previouslyBlocked = videoModescomboBox->blockSignals(true);
videoModescomboBox->clear();

Expand Down Expand Up @@ -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;
Expand All @@ -375,8 +373,6 @@ void AVForm::updateVideoModes(int curIndex)
{
selectBestModes(allVideoModes);
videoModes = allVideoModes;

qDebug("selected Modes:");
fillCameraModesComboBox();
}

Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 9478377

Please sign in to comment.