m_configCapture.setupUi(p4);
V4lCaptureHandler v4l(NULL);
- int width;
- int height;
// Video 4 Linux device detection
for (int i = 0; i < 10; i++) {
QString path = "/dev/video" + QString::number(i);
if (QFile::exists(path)) {
- QString deviceName = v4l.getDeviceName(path.toUtf8().constData(), &width, &height);
- m_configCapture.kcfg_detectedv4ldevices->addItem(deviceName, path);
- if (width > 0) m_configCapture.kcfg_detectedv4ldevices->setItemData(m_configCapture.kcfg_detectedv4ldevices->count() - 1, QString("%1x%2").arg(width).arg(height), Qt::UserRole + 1);
+ QStringList deviceInfo = v4l.getDeviceName(path);
+ m_configCapture.kcfg_detectedv4ldevices->addItem(deviceInfo.at(0), path);
+ m_configCapture.kcfg_detectedv4ldevices->setItemData(m_configCapture.kcfg_detectedv4ldevices->count() - 1, deviceInfo.at(1), Qt::UserRole + 1);
}
}
connect(m_configCapture.kcfg_detectedv4ldevices, SIGNAL(currentIndexChanged(int)), this, SLOT(slotUpdatev4lDevice()));