]> git.sesse.net Git - kdenlive/commitdiff
Merge branch 'buildsystem' into next
authorAlberto Villa <avilla@FreeBSD.org>
Wed, 9 Nov 2011 11:26:00 +0000 (12:26 +0100)
committerAlberto Villa <avilla@FreeBSD.org>
Wed, 9 Nov 2011 11:26:00 +0000 (12:26 +0100)
16 files changed:
effects/pan_zoom.xml
src/documentchecker.cpp
src/documentchecker.h
src/initeffects.cpp
src/kdenlivesettingsdialog.cpp
src/mainwindow.cpp
src/monitor.cpp
src/monitormanager.cpp
src/projectlist.cpp
src/projectlist.h
src/projectsettings.cpp
src/renderer.cpp
src/renderer.h
src/v4l/src.c
src/videoglwidget.cpp
src/wizard.cpp

index 5258303b45c9f2cdfb9b12b3e2356ae15762c76c..1614bcb9eb6137b9c3d666d762a35f8430f2aaf6 100644 (file)
@@ -6,4 +6,7 @@
        <parameter type="geometry" name="transition.geometry" default="0%,0%:100%x100%" opacity="false">
                <name>Rectangle</name>
        </parameter>
+        <parameter type="bool" name="transition.distort" default="0">
+                <name>Distort</name>
+        </parameter>
 </effect>
index 11e4c48680347a6ecc09840b5c086e259b22e4fb..a89ddc13a243a05030b97b267d890fd23c5fbce1 100644 (file)
@@ -33,6 +33,7 @@
 #include <KApplication>
 #include <KUrlRequesterDialog>
 #include <KMessageBox>
+#include <KStandardDirs>
 
 #include <QTreeWidgetItem>
 #include <QFile>
@@ -423,7 +424,7 @@ void DocumentChecker::slotSearchClips()
                 child->setData(0, statusRole, CLIPOK);
             }
         } else if (child->data(0, statusRole).toInt() == LUMAMISSING) {
-            QString fileName = searchLuma(child->data(0, idRole).toString());
+            QString fileName = searchLuma(searchDir, child->data(0, idRole).toString());
             if (!fileName.isEmpty()) {
                 fixed = true;
                 child->setText(1, fileName);
@@ -456,24 +457,29 @@ void DocumentChecker::slotSearchClips()
 }
 
 
-QString DocumentChecker::searchLuma(const QString &file) const
+QString DocumentChecker::searchLuma(const QDir &dir, const QString &file) const
 {
     KUrl searchPath(KdenliveSettings::mltpath());
+    QString fname = KUrl(file).fileName();
     if (file.contains("PAL"))
         searchPath.cd("../lumas/PAL");
     else
         searchPath.cd("../lumas/NTSC");
-    QString result = searchPath.path(KUrl::AddTrailingSlash) + KUrl(file).fileName();
+    QString result = searchPath.path(KUrl::AddTrailingSlash) + fname;
     if (QFile::exists(result))
         return result;
     // try to find luma in application path
     searchPath.clear();
     searchPath = KUrl(QCoreApplication::applicationDirPath());
     searchPath.cd("../share/apps/kdenlive/lumas");
-    result = searchPath.path(KUrl::AddTrailingSlash) + KUrl(file).fileName();
+    result = searchPath.path(KUrl::AddTrailingSlash) + fname;
     if (QFile::exists(result))
         return result;
-    return QString();
+    // Try in Kdenlive's standard KDE path
+    result = KStandardDirs::locate("appdata", "lumas/" + fname);
+    if (!result.isEmpty()) return result;
+    // Try in user's chosen folder 
+    return searchPathRecursively(dir, fname);
 }
 
 QString DocumentChecker::searchPathRecursively(const QDir &dir, const QString &fileName) const
index 66e35debfe49824fbd37c98894cefe1f8bcb9f51..90be9360487c3462ce1a23a986213a5c31807116 100644 (file)
@@ -46,7 +46,7 @@ private slots:
     void slotDeleteSelected();
     QString getProperty(QDomElement effect, const QString &name);
     void setProperty(QDomElement effect, const QString &name, const QString value);
-    QString searchLuma(const QString &file) const;
+    QString searchLuma(const QDir &dir, const QString &file) const;
     /** @brief Check if images and fonts in this clip exists, returns a list of images that do exist so we don't check twice. */
     void checkMissingImagesAndFonts(QStringList images, QStringList fonts, const QString &id, const QString &baseClip);
     void slotCheckButtons();
index 521ac23ca29ea322aa9c20c3a8db2f9826325c2a..62961b7ccddc21c16eced2f62d1a63decd9776d8 100644 (file)
@@ -647,7 +647,7 @@ void initEffects::fillTransitionsList(Mlt::Repository *repository, EffectsList *
 
                 paramList.append(quickParameterFill(ret, "keyed", "keyed", "fixed", "1", "1", "1"));
                 paramList.append(quickParameterFill(ret, i18n("Geometry"), "geometry", "geometry",  "0/0:100%x100%:100%", "0/0:100%x100%:100%", "0/0:100%x100%:100%", "", "", "", "", "", "true"));
-
+                paramList.append(quickParameterFill(ret, i18n("Distort"), "distort", "bool", "0", "0", "1"));
                 paramList.append(quickParameterFill(ret, i18n("Rotate X"), "rotate_x", "addedgeometry", "0", "-1800", "1800", QString(), QString(), "10"));
                 paramList.append(quickParameterFill(ret, i18n("Rotate Y"), "rotate_y", "addedgeometry", "0", "-1800", "1800", QString(), QString(), "10"));
                 paramList.append(quickParameterFill(ret, i18n("Rotate Z"), "rotate_z", "addedgeometry", "0", "-1800", "1800", QString(), QString(), "10"));
index d1a586d5745f56934cee579c791804e30537fa1c..34297068c8e61ff847ac971ade8d10fabbb2b8fe 100644 (file)
@@ -618,17 +618,17 @@ void KdenliveSettingsDialog::updateSettings()
 
     // Check encoding profiles
     QString data = m_configCapture.kcfg_v4l_profile->itemData(m_configCapture.kcfg_v4l_profile->currentIndex()).toString();
-    if (!data.isEmpty() && data.section(";", 0, 0) != KdenliveSettings::v4l_parameters()) {
+    if (!data.isEmpty() && (data.section(";", 0, 0) != KdenliveSettings::v4l_parameters() || data.section(";", 1, 1) != KdenliveSettings::v4l_extension())) {
         KdenliveSettings::setV4l_parameters(data.section(";", 0, 0));
         KdenliveSettings::setV4l_extension(data.section(";", 1, 1));
     }
     data = m_configCapture.kcfg_decklink_profile->itemData(m_configCapture.kcfg_decklink_profile->currentIndex()).toString();
-    if (!data.isEmpty() && data.section(";", 0, 0) != KdenliveSettings::decklink_parameters()) {
+    if (!data.isEmpty() && (data.section(";", 0, 0) != KdenliveSettings::decklink_parameters() || data.section(";", 1, 1) != KdenliveSettings::decklink_extension())) {
         KdenliveSettings::setDecklink_parameters(data.section(";", 0, 0));
         KdenliveSettings::setDecklink_extension(data.section(";", 1, 1));
     }
     data = m_configProject.kcfg_proxy_profile->itemData(m_configProject.kcfg_proxy_profile->currentIndex()).toString();
-    if (!data.isEmpty() && data.section(";", 0, 0) != KdenliveSettings::proxyparams()) {
+    if (!data.isEmpty() && (data.section(";", 0, 0) != KdenliveSettings::proxyparams() || data.section(";", 1, 1) != KdenliveSettings::proxyextension())) {
         KdenliveSettings::setProxyparams(data.section(";", 0, 0));
         KdenliveSettings::setProxyextension(data.section(";", 1, 1));
     }
index 75ea1445b1cf0f6f7aca6cc8f509b3bdd37c99c8..d9f6c403823d3cb56a92700130107de6b4f01df9 100644 (file)
@@ -209,9 +209,19 @@ MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, const QString &
     m_clipMonitorDock->setObjectName("clip_monitor");
     m_clipMonitor = new Monitor("clip", m_monitorManager, QString(), m_timelineArea);
     m_clipMonitorDock->setWidget(m_clipMonitor);
+    
+    // Connect the project list
     connect(m_projectList, SIGNAL(clipSelected(DocClipBase *, QPoint)), m_clipMonitor, SLOT(slotSetClipProducer(DocClipBase *, QPoint)));
     connect(m_projectList, SIGNAL(raiseClipMonitor()), m_clipMonitor, SLOT(activateMonitor()));
-    
+    connect(m_projectList, SIGNAL(loadingIsOver()), this, SLOT(slotElapsedTime()));
+    connect(m_projectList, SIGNAL(displayMessage(const QString&, int)), this, SLOT(slotGotProgressInfo(const QString&, int)));
+    connect(m_projectList, SIGNAL(updateRenderStatus()), this, SLOT(slotCheckRenderStatus()));
+    connect(m_projectList, SIGNAL(clipNeedsReload(const QString&)),this, SLOT(slotUpdateClip(const QString &)));
+    connect(m_projectList, SIGNAL(updateProfile(const QString &)), this, SLOT(slotUpdateProjectProfile(const QString &)));
+    connect(m_projectList, SIGNAL(refreshClip(const QString &, bool)), m_monitorManager, SLOT(slotRefreshCurrentMonitor()));
+    connect(m_projectList, SIGNAL(findInTimeline(const QString&)), this, SLOT(slotClipInTimeline(const QString&)));
+    connect(m_clipMonitor, SIGNAL(zoneUpdated(QPoint)), m_projectList, SLOT(slotUpdateClipCut(QPoint)));
+
     m_projectMonitorDock = new QDockWidget(i18n("Project Monitor"), this);
     m_projectMonitorDock->setObjectName("project_monitor");
     m_projectMonitor = new Monitor("project", m_monitorManager, QString());
@@ -575,7 +585,6 @@ MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, const QString &
 
     connect(m_projectMonitorDock, SIGNAL(visibilityChanged(bool)), m_projectMonitor, SLOT(refreshMonitor(bool)));
     connect(m_clipMonitorDock, SIGNAL(visibilityChanged(bool)), m_clipMonitor, SLOT(refreshMonitor(bool)));
-    //connect(m_monitorManager, SIGNAL(connectMonitors()), this, SLOT(slotConnectMonitors()));
     connect(m_monitorManager, SIGNAL(checkColorScopes()), this, SLOT(slotUpdateColorScopes()));
     connect(m_monitorManager, SIGNAL(clearScopes()), this, SLOT(slotClearColorScopes()));
     connect(m_effectList, SIGNAL(addEffect(const QDomElement)), this, SLOT(slotAddEffect(const QDomElement)));
@@ -616,7 +625,7 @@ MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, const QString &
     
     // Populate encoding profiles
     KConfig conf("encodingprofiles.rc", KConfig::FullConfig, "appdata");
-    if (KdenliveSettings::proxyparams().isEmpty()) {
+    if (KdenliveSettings::proxyparams().isEmpty() || KdenliveSettings::proxyextension().isEmpty()) {
         KConfigGroup group(&conf, "proxy");
         QMap< QString, QString > values = group.entryMap();
         QMapIterator<QString, QString> i(values);
@@ -627,7 +636,7 @@ MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, const QString &
             KdenliveSettings::setProxyextension(data.section(';', 1, 1));
         }
     }
-    if (KdenliveSettings::v4l_parameters().isEmpty()) {
+    if (KdenliveSettings::v4l_parameters().isEmpty() || KdenliveSettings::v4l_extension().isEmpty()) {
         KConfigGroup group(&conf, "video4linux");
         QMap< QString, QString > values = group.entryMap();
         QMapIterator<QString, QString> i(values);
@@ -638,7 +647,7 @@ MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, const QString &
             KdenliveSettings::setV4l_extension(data.section(';', 1, 1));
         }
     }
-    if (KdenliveSettings::decklink_parameters().isEmpty()) {
+    if (KdenliveSettings::decklink_parameters().isEmpty() || KdenliveSettings::decklink_extension().isEmpty()) {
         KConfigGroup group(&conf, "decklink");
         QMap< QString, QString > values = group.entryMap();
         QMapIterator<QString, QString> i(values);
@@ -2440,7 +2449,6 @@ void MainWindow::connectDocument(TrackView *trackView, KdenliveDoc *doc)   //cha
             disconnect(m_notesWidget, SIGNAL(textChanged()), m_activeDocument, SLOT(setModified()));
             disconnect(m_clipMonitor, SIGNAL(zoneUpdated(QPoint)), m_activeDocument, SLOT(setModified()));
             disconnect(m_projectList, SIGNAL(projectModified()), m_activeDocument, SLOT(setModified()));
-            disconnect(m_projectList, SIGNAL(updateProfile(const QString &)), this, SLOT(slotUpdateProjectProfile(const QString &)));
 
             disconnect(m_projectMonitor->render, SIGNAL(refreshDocumentProducers(bool, bool)), m_activeDocument, SLOT(checkProjectClips(bool, bool)));
 
@@ -2476,14 +2484,10 @@ void MainWindow::connectDocument(TrackView *trackView, KdenliveDoc *doc)   //cha
             disconnect(m_activeTimeline->projectView(), SIGNAL(activateDocumentMonitor()), m_projectMonitor, SLOT(activateMonitor()));
             disconnect(m_activeTimeline, SIGNAL(zoneMoved(int, int)), this, SLOT(slotZoneMoved(int, int)));
             disconnect(m_projectList, SIGNAL(loadingIsOver()), m_activeTimeline->projectView(), SLOT(slotUpdateAllThumbs()));
-            disconnect(m_projectList, SIGNAL(displayMessage(const QString&, int)), this, SLOT(slotGotProgressInfo(const QString&, int)));
-            disconnect(m_projectList, SIGNAL(updateRenderStatus()), this, SLOT(slotCheckRenderStatus()));
-            disconnect(m_projectList, SIGNAL(clipNeedsReload(const QString&)), this, SLOT(slotUpdateClip(const QString &)));
             disconnect(m_projectList, SIGNAL(refreshClip(const QString &)), m_activeTimeline->projectView(), SLOT(slotRefreshThumbs(const QString &)));
             m_effectStack->clear();
         }
         //m_activeDocument->setRenderer(NULL);
-        disconnect(m_projectList, SIGNAL(refreshClip(const QString &, bool)), m_monitorManager, SLOT(slotRefreshCurrentMonitor()));
         m_clipMonitor->stop();
     }
     KdenliveSettings::setCurrent_profile(doc->profilePath());
@@ -2493,17 +2497,11 @@ void MainWindow::connectDocument(TrackView *trackView, KdenliveDoc *doc)   //cha
     m_projectList->setDocument(doc);
     m_transitionConfig->updateProjectFormat(doc->mltProfile(), doc->timecode(), doc->tracksList());
     m_effectStack->updateProjectFormat(doc->mltProfile(), doc->timecode());
-    connect(m_projectList, SIGNAL(refreshClip(const QString &, bool)), m_monitorManager, SLOT(slotRefreshCurrentMonitor()));
     connect(m_projectList, SIGNAL(refreshClip(const QString &, bool)), trackView->projectView(), SLOT(slotRefreshThumbs(const QString &, bool)));
-    connect(m_projectList, SIGNAL(clipNeedsReload(const QString&)),this, SLOT(slotUpdateClip(const QString &)));
 
     connect(m_projectList, SIGNAL(projectModified()), doc, SLOT(setModified()));
-    connect(m_projectList, SIGNAL(updateProfile(const QString &)), this, SLOT(slotUpdateProjectProfile(const QString &)));
     connect(m_projectList, SIGNAL(clipNameChanged(const QString, const QString)), trackView->projectView(), SLOT(clipNameChanged(const QString, const QString)));
 
-    connect(m_projectList, SIGNAL(findInTimeline(const QString&)), this, SLOT(slotClipInTimeline(const QString&)));
-
-
     //connect(trackView, SIGNAL(cursorMoved()), m_projectMonitor, SLOT(activateMonitor()));
     connect(trackView, SIGNAL(insertTrack(int)), this, SLOT(slotInsertTrack(int)));
     connect(trackView, SIGNAL(deleteTrack(int)), this, SLOT(slotDeleteTrack(int)));
@@ -2513,7 +2511,6 @@ void MainWindow::connectDocument(TrackView *trackView, KdenliveDoc *doc)   //cha
     connect(trackView->projectView(), SIGNAL(forceClipProcessing(const QString &)), m_projectList, SLOT(slotForceProcessing(const QString &)));
     connect(m_projectMonitor, SIGNAL(renderPosition(int)), trackView, SLOT(moveCursorPos(int)));
     connect(m_projectMonitor, SIGNAL(zoneUpdated(QPoint)), trackView, SLOT(slotSetZone(QPoint)));
-    connect(m_clipMonitor, SIGNAL(zoneUpdated(QPoint)), m_projectList, SLOT(slotUpdateClipCut(QPoint)));
     connect(m_projectMonitor, SIGNAL(zoneUpdated(QPoint)), doc, SLOT(setModified()));
     connect(m_clipMonitor, SIGNAL(zoneUpdated(QPoint)), doc, SLOT(setModified()));
     connect(m_projectMonitor, SIGNAL(durationChanged(int)), trackView, SLOT(setDuration(int)));
@@ -2566,9 +2563,6 @@ void MainWindow::connectDocument(TrackView *trackView, KdenliveDoc *doc)   //cha
     connect(trackView->projectView(), SIGNAL(activateDocumentMonitor()), m_projectMonitor, SLOT(activateMonitor()));
     connect(trackView, SIGNAL(zoneMoved(int, int)), this, SLOT(slotZoneMoved(int, int)));
     connect(m_projectList, SIGNAL(loadingIsOver()), trackView->projectView(), SLOT(slotUpdateAllThumbs()));
-    connect(m_projectList, SIGNAL(loadingIsOver()), this, SLOT(slotElapsedTime()));
-    connect(m_projectList, SIGNAL(displayMessage(const QString&, int)), this, SLOT(slotGotProgressInfo(const QString&, int)));
-    connect(m_projectList, SIGNAL(updateRenderStatus()), this, SLOT(slotCheckRenderStatus()));
 
 
     trackView->projectView()->setContextMenu(m_timelineContextMenu, m_timelineContextClipMenu, m_timelineContextTransitionMenu, m_clipTypeGroup, (QMenu*)(factory()->container("marker_menu", this)));
index 1090112d00ba652867d3109e2004f0d12de4d257..db3989406dee5d12be592f60ce96b2c36fd14ce3 100644 (file)
@@ -877,7 +877,10 @@ void Monitor::resetProfile(const QString &profile)
 {
     m_timePos->updateTimeCode(m_monitorManager->timecode());
     if (render == NULL) return;
-    render->resetProfile(profile);
+    if (!render->hasProfile(profile)) {
+        activateMonitor();
+        render->resetProfile(profile);
+    }
     if (m_effectWidget)
         m_effectWidget->resetProfile(render);
 }
@@ -1001,8 +1004,8 @@ void Monitor::slotEffectScene(bool show)
         emit requestFrameForAnalysis(show);
         if (show) {
             m_effectWidget->getScene()->slotZoomFit();
-            render->doRefresh();
         }
+        render->doRefresh();
     }
 }
 
index 8d0d2341b83929e018a35c8de7f50efd1cd09201..1b0a7c6fb278400d20a2867947a0648408ea4681 100644 (file)
@@ -187,16 +187,8 @@ void MonitorManager::slotResetProfiles()
     if (m_projectMonitor == NULL || m_clipMonitor == NULL) return;
     blockSignals(true);
     QString active = m_activeMonitor ? m_activeMonitor->name() : QString();
-    if (!m_clipMonitor->render->hasProfile(KdenliveSettings::current_profile())) {
-        activateMonitor("clip");
-        m_clipMonitor->resetProfile(KdenliveSettings::current_profile());
-        m_clipMonitor->updateTimecodeFormat();
-    }
-    if (!m_projectMonitor->render->hasProfile(KdenliveSettings::current_profile())) {
-        activateMonitor("project");
-        m_projectMonitor->resetProfile(KdenliveSettings::current_profile());
-        m_projectMonitor->updateTimecodeFormat();
-    }
+    m_clipMonitor->resetProfile(KdenliveSettings::current_profile());
+    m_projectMonitor->resetProfile(KdenliveSettings::current_profile());
     if (!active.isEmpty()) activateMonitor(active);
     blockSignals(false);
     if (m_activeMonitor) m_activeMonitor->parentWidget()->raise();
index eef4da490b172a6017a3add22bd29c281ada6b58..e2d393bfa88a9745488f613fb4f60de850e71ca7 100644 (file)
@@ -1125,7 +1125,7 @@ void ProjectList::slotAddClip(DocClipBase *clip, bool getProperties)
 
 void ProjectList::slotGotProxy(const QString &proxyPath)
 {
-    if (proxyPath.isEmpty() || !m_refreshed || m_abortAllProxies) return;
+    if (proxyPath.isEmpty() || m_abortAllProxies) return;
     QTreeWidgetItemIterator it(m_listView);
     ProjectItem *item;
 
@@ -1172,6 +1172,7 @@ void ProjectList::slotResetProjectList()
     m_proxyThreads.clearFutures();
     m_thumbnailQueue.clear();
     m_listView->clear();
+    m_listView->setEnabled(true);
     emit clipSelected(NULL);
     m_refreshed = false;
     m_allClipsProcessed = false;
@@ -1280,7 +1281,7 @@ void ProjectList::updateAllClips(bool displayRatioChanged, bool fpsChanged)
                     if (replace) resetThumbsProducer(clip);
                     m_render->getFileProperties(xml, clip->getId(), m_listView->iconSize().height(), replace);
                 }
-                else {
+                else if (clip->isPlaceHolder()) {
                     item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsDropEnabled);
                     if (item->data(0, Qt::DecorationRole).isNull()) {
                         item->setData(0, Qt::DecorationRole, missingPixmap);
@@ -1665,11 +1666,11 @@ void ProjectList::slotCheckForEmptyQueue()
 {
     if (m_render->processingItems() == 0 && m_thumbnailQueue.isEmpty()) {
         if (!m_refreshed && m_allClipsProcessed) {
+            m_refreshed = true;
             m_listView->setEnabled(true);
             slotClipSelected();
             QTimer::singleShot(500, this, SIGNAL(loadingIsOver()));
             emit displayMessage(QString(), -1);
-            m_refreshed = true;
         }
         updateButtons();
     } else if (!m_refreshed) {
@@ -1828,7 +1829,7 @@ void ProjectList::slotReplyGetFileProperties(const QString &clipId, Mlt::Produce
             if (item->parent()) {
                 if (item->parent()->type() == PROJECTFOLDERTYPE)
                     static_cast <FolderProjectItem *>(item->parent())->switchIcon();
-            } else if (KdenliveSettings::checkfirstprojectclip() &&  m_listView->topLevelItemCount() == 1) {
+            } else if (KdenliveSettings::checkfirstprojectclip() &&  m_listView->topLevelItemCount() == 1 && m_refreshed && m_allClipsProcessed) {
                 // this is the first clip loaded in project, check if we want to adjust project settings to the clip
                 updatedProfile = adjustProjectProfileToItem(item);
             }
@@ -1837,17 +1838,16 @@ void ProjectList::slotReplyGetFileProperties(const QString &clipId, Mlt::Produce
             }
         } else {
             int max = m_doc->clipManager()->clipsCount();
-            emit displayMessage(i18n("Loading clips"), (int)(100 *(max - queue) / max));
+            if (max > 0) emit displayMessage(i18n("Loading clips"), (int)(100 *(max - queue) / max));
         }
         if (m_allClipsProcessed) emit processNextThumbnail();
     }
-    if (replace && item) {
-        toReload = clipId;
-    }
     if (!item) {
         // no item for producer, delete it
         delete producer;
+        return;
     }
+    if (replace) toReload = clipId;
     if (!toReload.isEmpty())
         emit clipNeedsReload(toReload);
 }
@@ -2338,6 +2338,19 @@ void ProjectList::slotGenerateProxy()
     QFile::remove(info.dest);
     
     setProxyStatus(info.dest, CREATINGPROXY);
+    
+    // Get the list of clips that will need to get progress info
+    QTreeWidgetItemIterator it(m_listView);
+    QList <ProjectItem *> processingItems;
+    while (*it && !m_abortAllProxies) {
+        if ((*it)->type() == PROJECTCLIPTYPE) {
+            ProjectItem *item = static_cast <ProjectItem *>(*it);
+            if (item->referencedClip()->getProperty("proxy") == info.dest) {
+                processingItems.append(item);
+            }
+        }
+        ++it;
+    }
 
     // Special case: playlist clips (.mlt or .kdenlive project files)
     if (info.type == PLAYLIST) {
@@ -2382,7 +2395,7 @@ void ProjectList::slotGenerateProxy()
             }
             else {
                 QString log = QString(myProcess.readAll());
-                processLogInfo(info.dest, &duration, log);
+                processLogInfo(processingItems, &duration, log);
             }
             myProcess.waitForFinished(500);
         }
@@ -2465,13 +2478,13 @@ void ProjectList::slotGenerateProxy()
     // Make sure we don't block when proxy file already exists
     parameters << "-y";
     parameters << info.dest;
-    kDebug()<<"// STARTING PROXY GEN: "<<parameters;
     QProcess myProcess;
     myProcess.setProcessChannelMode(QProcess::MergedChannels);
     myProcess.start("ffmpeg", parameters);
     myProcess.waitForStarted();
     int result = -1;
     int duration = 0;
+   
     while (myProcess.state() != QProcess::NotRunning) {
         // building proxy file
         if (m_abortProxy.contains(info.dest) || m_abortAllProxies) {
@@ -2486,11 +2499,13 @@ void ProjectList::slotGenerateProxy()
         }
         else {
             QString log = QString(myProcess.readAll());
-            processLogInfo(info.dest, &duration, log);
+            processLogInfo(processingItems, &duration, log);
         }
         myProcess.waitForFinished(500);
     }
     myProcess.waitForFinished();
+    m_abortProxy.removeAll(info.dest);
+    m_processingProxy.removeAll(info.dest);
     if (result == -1) result = myProcess.exitStatus();
     if (result == 0) {
         // proxy successfully created
@@ -2502,12 +2517,10 @@ void ProjectList::slotGenerateProxy()
         QFile::remove(info.dest);
         setProxyStatus(info.dest, PROXYCRASHED);
     }
-    m_abortProxy.removeAll(info.dest);
-    m_processingProxy.removeAll(info.dest);
 }
 
 
-void ProjectList::processLogInfo(const QString &path, int *duration, const QString &log)
+void ProjectList::processLogInfo(QList <ProjectItem *>items, int *duration, const QString &log)
 {
     int progress;
     if (*duration == 0) {
@@ -2524,7 +2537,8 @@ void ProjectList::processLogInfo(const QString &path, int *duration, const QStri
             progress = numbers.at(0).toInt() * 3600 + numbers.at(1).toInt() * 60 + numbers.at(2).toDouble();
         }
         else progress = (int) time.toDouble();
-        setProxyStatus(path, CREATINGPROXY, (int) (100.0 * progress / (*duration)));
+        for (int i = 0; i < items.count(); i++)
+            setProxyStatus(items.at(i), CREATINGPROXY, (int) (100.0 * progress / (*duration)));
     }
 }
 
index 2bc2f950a962f411956744f1b12c894f325207ad..6f1815e44506c074393550c6a95efd609bff0466 100644 (file)
@@ -338,7 +338,7 @@ private:
     void setProxyStatus(const QString proxyPath, PROXYSTATUS status, int progress = 0);
     void setProxyStatus(ProjectItem *item, PROXYSTATUS status, int progress = 0);
     /** @brief Process ffmpeg output to find out process progress. */
-    void processLogInfo(const QString &path, int *duration, const QString &log);
+    void processLogInfo(QList <ProjectItem *>items, int *duration, const QString &log);
     void monitorItemEditing(bool enable);
     /** @brief Set thumbnail for a project's clip. */
     void setThumbnail(const QString &clipId, const QPixmap &pix);
index 270845f3c73d64b496e0755945892a420b827045..0504ba827552e0af64caa4553c26606a192fec7d 100644 (file)
@@ -104,7 +104,7 @@ ProjectSettings::ProjectSettings(ProjectList *projectlist, QStringList lumas, in
         if (!k.key().isEmpty()) {
             QString params = k.value().section(';', 0, 0);
             QString extension = k.value().section(';', 1, 1);
-            if (params == proxyparameters && extension == proxyextension) {
+            if (ix == -1 && ((params == proxyparameters && extension == proxyextension) || (proxyparameters.isEmpty() || proxyextension.isEmpty()))) {
                 // this is the current profile
                 ix = proxy_profile->count();
             }
index 142063a17d345361b36b8ec99fc42c3e1f20363b..ea95bf535a42872f5748cb9c9f92997a1a4e78b1 100644 (file)
@@ -605,10 +605,15 @@ void Render::forceProcessing(const QString &id)
     m_infoMutex.unlock();
 }
 
-int Render::processingItems() const
+int Render::processingItems()
 {
+    m_infoMutex.lock();
     int count = m_requestList.count();
-    if (m_infoThread.isRunning()) count++;
+    if (!m_processingClipId.isEmpty()) {
+        // one clip is currently processed
+        count++;
+    }
+    m_infoMutex.unlock();
     return count;
 }
 
@@ -670,13 +675,13 @@ void Render::processFileProperties()
 
         if (producer == NULL || producer->is_blank() || !producer->is_valid()) {
             kDebug() << " / / / / / / / / ERROR / / / / // CANNOT LOAD PRODUCER: "<<path;
+            m_processingClipId.clear();
             if (proxyProducer) {
                 // Proxy file is corrupted
                 emit removeInvalidProxy(info.clipId, false);
             }
             else emit removeInvalidClip(info.clipId, info.replaceProducer);
             delete producer;
-            m_processingClipId.clear();
             continue;
         }
 
@@ -685,9 +690,9 @@ void Render::processFileProperties()
             producer->set("out", info.xml.attribute("proxy_out").toInt());
             if (producer->get_out() != info.xml.attribute("proxy_out").toInt()) {
                 // Proxy file length is different than original clip length, this will corrupt project so disable this proxy clip
+                m_processingClipId.clear();
                 emit removeInvalidProxy(info.clipId, true);
                 delete producer;
-                m_processingClipId.clear();
                 continue;
             }
         }
@@ -781,8 +786,8 @@ void Render::processFileProperties()
                     emit replyGetImage(info.clipId, img);
                 }
             }
-            emit replyGetFileProperties(info.clipId, producer, stringMap(), stringMap(), info.replaceProducer);
             m_processingClipId.clear();
+            emit replyGetFileProperties(info.clipId, producer, stringMap(), stringMap(), info.replaceProducer);
             continue;
         }
 
@@ -888,7 +893,7 @@ void Render::processFileProperties()
                     }
                 } while (variance == -1);
                 delete frame;
-                if (frameNumber > -1) filePropertyMap["thumbnail"] = frameNumber;
+                if (frameNumber > -1) filePropertyMap["thumbnail"] = QString::number(frameNumber);
                 emit replyGetImage(info.clipId, img);
             } else if (frame->get_int("test_audio") == 0) {
                 emit replyGetImage(info.clipId, "audio-x-generic", fullWidth, info.imageHeight);
@@ -962,6 +967,7 @@ void Render::processFileProperties()
                 metadataPropertyMap[ name.section('.', 0, -2)] = value;
         }
         producer->seek(0);
+        m_processingClipId.clear();
         emit replyGetFileProperties(info.clipId, producer, filePropertyMap, metadataPropertyMap, info.replaceProducer);
     }
     m_processingClipId.clear();
@@ -1024,30 +1030,33 @@ int Render::setProducer(Mlt::Producer *producer, int position)
     m_mltConsumer->purge();
     consumerPosition = m_mltConsumer->position();
 
-    if (m_mltProducer) {
-        m_mltProducer->set_speed(0);
-        currentId = m_mltProducer->get("id");
-        delete m_mltProducer;
-        m_mltProducer = NULL;
-        emit stopped();
-    }
 
     blockSignals(true);
-    if (producer && producer->is_valid()) {
-        m_mltProducer = producer;
-    } else m_mltProducer = m_blackClip->cut(0, 1);
+    if (!producer || !producer->is_valid()) {
+        if (producer) delete producer;
+        producer = m_blackClip->cut(0, 1);
+    }
 
-    if (!m_mltProducer || !m_mltProducer->is_valid()) {
+    if (!producer || !producer->is_valid()) {
         kDebug() << " WARNING - - - - -INVALID PLAYLIST: ";
         return -1;
     }
-    if (position == -1 && m_mltProducer->get("id") == currentId) position = consumerPosition;
-    if (position != -1) m_mltProducer->seek(position);
+    if (m_mltProducer) currentId = m_mltProducer->get("id");
+    emit stopped();
+    if (position == -1 && producer->get("id") == currentId) position = consumerPosition;
+    if (position != -1) producer->seek(position);
     int volume = KdenliveSettings::volume();
-    m_mltProducer->set("meta.volume", (double)volume / 100);
-    m_fps = m_mltProducer->get_fps();
+    producer->set("meta.volume", (double)volume / 100);
+    m_fps = producer->get_fps();
     blockSignals(false);
-    m_mltConsumer->connect(*m_mltProducer);
+    m_mltConsumer->connect(*producer);
+
+    if (m_mltProducer) {
+        m_mltProducer->set_speed(0);
+        delete m_mltProducer;
+        m_mltProducer = NULL;
+    }
+    m_mltProducer = producer;
     m_mltProducer->set_speed(0);
     emit durationChanged(m_mltProducer->get_playtime());
     if (m_mltConsumer->start() == -1) {
index 45e140a1502a4de396c6482aad5a31f253a54bb8..34a516ab56af55baf6f413648c65f839ae171e14 100644 (file)
@@ -286,7 +286,7 @@ Q_OBJECT public:
     /** @brief Returns a pointer to the main producer. */
     Mlt::Producer *getProducer();
     /** @brief Returns the number of clips to process (When requesting clip info). */
-    int processingItems() const;
+    int processingItems();
     /** @brief Force processing of clip with selected id. */
     void forceProcessing(const QString &id);
     /** @brief Are we currently processing clip with selected id. */
index b265b989f746ec80628f2fc40e9253b8207c1d52..5d7666fc2064b25336f22567347cf84df725e158 100644 (file)
@@ -112,8 +112,9 @@ const char *query_v4ldevice(src_t *src, char **pixelformatdescription)
 
             while (ioctl(s->fd, VIDIOC_ENUM_FMT, &fmt) != -1)
             {
-                snprintf( value, sizeof(value), ">%c%c%c%c", fmt.pixelformat >> 0,  fmt.pixelformat >> 8, fmt.pixelformat >> 16, fmt.pixelformat >> 24 );
-                strcat(*pixelformatdescription, (char *) value);
+                if (strlen(*pixelformatdescription) > 2000) break;
+                if (snprintf( value, sizeof(value), ">%c%c%c%c", fmt.pixelformat >> 0,  fmt.pixelformat >> 8, fmt.pixelformat >> 16, fmt.pixelformat >> 24 ) > 0)
+                    strcat(*pixelformatdescription, (char *) value);
                 fprintf(stderr, "detected format: %s: %c%c%c%c\n", fmt.description, fmt.pixelformat >> 0,  fmt.pixelformat >> 8,
                       fmt.pixelformat >> 16, fmt.pixelformat >> 24);
 
@@ -127,12 +128,14 @@ const char *query_v4ldevice(src_t *src, char **pixelformatdescription)
                     rates.pixel_format = fmt.pixelformat;
                     rates.width = image_size.width;
                     rates.height = image_size.height;
-                    snprintf( value, sizeof(value), ":%dx%d=", image_size.width, image_size.height );
-                    strcat(*pixelformatdescription, (char *) value);
+                    if (strlen(*pixelformatdescription) > 2000) break;
+                    if (snprintf( value, sizeof(value), ":%dx%d=", image_size.width, image_size.height ) > 0)
+                        strcat(*pixelformatdescription, (char *) value);
                     fprintf(stderr, "Size: %dx%d: ", image_size.width, image_size.height);
                     while (ioctl(s->fd, VIDIOC_ENUM_FRAMEINTERVALS, &rates) != -1) {
-                        snprintf( value, sizeof(value), "%d/%d,", rates.un.discrete.denominator, rates.un.discrete.numerator );
-                        strcat(*pixelformatdescription, (char *) value);
+                        if (strlen(*pixelformatdescription) > 2000) break;
+                        if (snprintf( value, sizeof(value), "%d/%d,", rates.un.discrete.denominator, rates.un.discrete.numerator ) > 0)
+                            strcat(*pixelformatdescription, (char *) value);
                         fprintf(stderr, "%d/%d, ", rates.un.discrete.numerator, rates.un.discrete.denominator);
                         rates.index ++;
                     }
index d010b2253520c1b3d091ce62eeb74cb57f48c7bf..dffa495b6dab2829012ed0021f527a80816b2674 100644 (file)
@@ -1,6 +1,7 @@
 
 #include <QtGui>
 #include <QtOpenGL>
+#include <GL/glu.h>
 #include "videoglwidget.h"
 
 #ifndef GL_TEXTURE_RECTANGLE_EXT
index a4d400786821183e0def524ac6302a4b52e17954..39e3708d7eadb93ab1076a6a86b50f481e4a43c5 100644 (file)
@@ -219,7 +219,9 @@ void Wizard::slotUpdateCaptureParameters()
             itemSize = sizes.at(j).section("=", 0, 0);
             itemRates = sizes.at(j).section("=", 1, 1).split(",", QString::SkipEmptyParts);
             for (int k = 0; k < itemRates.count(); k++) {
-                m_capture.v4l_formats->addItem("[" + format + "] " + itemSize + " (" + itemRates.at(k) + ")", QStringList() << format << itemSize.section('x', 0, 0) << itemSize.section('x', 1, 1) << itemRates.at(k).section('/', 0, 0) << itemRates.at(k).section('/', 1, 1));
+                QString formatDescription = "[" + format + "] " + itemSize + " (" + itemRates.at(k) + ")";
+                if (m_capture.v4l_formats->findText(formatDescription) == -1)
+                    m_capture.v4l_formats->addItem(formatDescription, QStringList() << format << itemSize.section('x', 0, 0) << itemSize.section('x', 1, 1) << itemRates.at(k).section('/', 0, 0) << itemRates.at(k).section('/', 1, 1));
             }
         }
     }