]> git.sesse.net Git - kdenlive/commitdiff
Merge branch 'master' into next
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Wed, 9 Nov 2011 02:25:21 +0000 (03:25 +0100)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Wed, 9 Nov 2011 02:25:21 +0000 (03:25 +0100)
effects/pan_zoom.xml
src/initeffects.cpp
src/kdenlivesettingsdialog.cpp
src/mainwindow.cpp
src/projectlist.cpp
src/projectsettings.cpp
src/renderer.cpp
src/renderer.h
src/v4l/src.c
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 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 5fe10437fed91dced3dac2b2e34507ddac5b8a08..520501e5069191995bcf1f966ffa5acaf2d93bd8 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 de8c7494bd4f27cf42e607b60b0da9c49ce7ee84..5982d3024a143a93ef807e3144e37f012a18b83b 100644 (file)
@@ -617,7 +617,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);
@@ -628,7 +628,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);
@@ -639,7 +639,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);
index 44e2311d17536d952bad6afb2248cdf528ce87f4..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;
 
@@ -1281,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);
@@ -1829,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);
             }
index 08bda5a1872fec31286fbe5833ef17cd189492d9..bce75275d7ac0f46bdaf6e359154124c8fd5e1c0 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 4be4ae91f32e8301fbeb7df070dc40edff69f59c..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;
         }
 
@@ -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 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));
             }
         }
     }