+ path = KStandardDirs::locateLocal("appdata", "profiles/video4linux");
+ profile = ProfilesDialog::getVideoProfile(path);
+ if (m_captureDevice == NULL) {
+ m_captureDevice = new MltDeviceCapture(path, m_videoBox, this);
+ m_captureDevice->sendFrameForAnalysis = m_analyse;
+ m_manager->updateScopeSource();
+ }
+ playlist = QString("<mlt title=\"capture\"><producer id=\"producer0\" in=\"0\" out=\"99999\"><property name=\"mlt_type\">producer</property><property name=\"length\">100000</property><property name=\"eof\">pause</property><property name=\"resource\">video4linux2:%1?width:%2&height:%3&frame_rate:%4</property><property name=\"mlt_service\">avformat-novalidate</property></producer><playlist id=\"playlist0\"><entry producer=\"producer0\" in=\"0\" out=\"99999\"/></playlist>").arg(KdenliveSettings::video4vdevice()).arg(profile.width).arg(profile.height).arg((double) profile.frame_rate_num / profile.frame_rate_den);
+
+ // Add alsa audio capture
+ if (KdenliveSettings::v4l_captureaudio()) {
+ playlist.append(QString("<producer id=\"producer1\" in=\"0\" out=\"99999\"><property name=\"mlt_type\">producer</property><property name=\"length\">100000</property><property name=\"eof\">pause</property><property name=\"resource\">alsa:%5</property><property name=\"audio_index\">0</property><property name=\"video_index\">-1</property><property name=\"mlt_service\">avformat</property></producer><playlist id=\"playlist1\"><entry producer=\"producer1\" in=\"0\" out=\"99999\"/></playlist>").arg(KdenliveSettings::v4l_alsadevicename()));
+ }
+
+
+ playlist.append("<tractor id=\"tractor0\" title=\"video0\" global_feed=\"1\" in=\"0\" out=\"99999\">");
+
+ playlist.append("<track producer=\"playlist0\"/>");
+
+ // Audio mix
+ if (KdenliveSettings::v4l_captureaudio()) {
+ playlist.append("<track producer=\"playlist1\"/>");
+ playlist.append("<transition id=\"transition0\" in=\"0\" out=\"0\"><property name=\"a_track\">0</property><property name=\"b_track\">1</property><property name=\"mlt_type\">transition</property><property name=\"mlt_service\">mix</property></transition>");
+ }
+
+ playlist.append("</tractor></mlt>");
+
+ if (m_captureDevice->slotStartCapture(KdenliveSettings::v4l_parameters(), m_captureFile.path(), playlist)) {
+ m_videoBox->setHidden(false);
+ m_isCapturing = true;
+ }
+ else {
+ video_frame->setText(i18n("Failed to start Video4Linux,\ncheck your parameters..."));
+ m_videoBox->setHidden(true);
+ m_isCapturing = false;
+ m_recAction->setChecked(false);
+ }
+
+ /*