]> git.sesse.net Git - kdenlive/commitdiff
Get rid of buggy "drop B frame" speedup feature
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Sun, 14 Nov 2010 10:50:20 +0000 (10:50 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Sun, 14 Nov 2010 10:50:20 +0000 (10:50 +0000)
svn path=/trunk/kdenlive/; revision=5093

12 files changed:
src/clipmanager.cpp
src/clipmanager.h
src/docclipbase.cpp
src/kdenlivedoc.cpp
src/kdenlivedoc.h
src/kdenlivesettings.kcfg
src/kdenlivesettingsdialog.cpp
src/kdenlivesettingsdialog.h
src/mainwindow.cpp
src/mainwindow.h
src/renderer.cpp
src/widgets/configsdl_ui.ui

index 6b464814e0780a9fa67e78495c6ee258c4fa5afb..f0b28c1c551fc4df1a7615f6437616e188283bf5 100644 (file)
@@ -225,22 +225,6 @@ const QList <DocClipBase *> ClipManager::getClipByResource(QString resource)
     return list;
 }
 
-void ClipManager::updatePreviewSettings()
-{
-    for (int i = 0; i < m_clipList.count(); i++) {
-        if (m_clipList.at(i)->clipType() == AV || m_clipList.at(i)->clipType() == VIDEO) {
-            if (m_clipList.at(i)->producerProperty("meta.media.0.codec.name") && strcmp(m_clipList.at(i)->producerProperty("meta.media.0.codec.name"), "h264") == 0) {
-                if (KdenliveSettings::dropbframes()) {
-                    m_clipList[i]->setProducerProperty("skip_loop_filter", "all");
-                    m_clipList[i]->setProducerProperty("skip_frame", "bidir");
-                } else {
-                    m_clipList[i]->setProducerProperty("skip_loop_filter", "");
-                    m_clipList[i]->setProducerProperty("skip_frame", "");
-                }
-            }
-        }
-    }
-}
 
 void ClipManager::clearUnusedProducers()
 {
index 2e83e7c546a9a2a4923c42e7a925d47e7e2cea22..1fcfa6c6f3dbb450ad62d58b213f878455ee65ec 100644 (file)
@@ -104,9 +104,6 @@ Q_OBJECT public:
     QDomElement groupsXml() const;
     int clipsCount() const;
 
-public slots:
-    void updatePreviewSettings();
-
 private slots:
     /** A clip was externally modified, monitor for more changes and prepare for reload */
     void slotClipModified(const QString &path);
index 4dcf2cd5722b734d2f9b76a918a985ab6992a036..214693c6eef5df9667a995cf160b6e024b5bc9fc 100644 (file)
@@ -602,10 +602,7 @@ Mlt::Producer *DocClipBase::producer(int track)
         if (m_properties.contains("video_index")) m_baseTrackProducers[track]->set("video_index", m_properties.value("video_index").toInt());
         if (m_properties.contains("audio_index")) m_baseTrackProducers[track]->set("audio_index", m_properties.value("audio_index").toInt());
         m_baseTrackProducers[track]->set("id", QString(getId() + '_' + QString::number(track)).toUtf8().data());
-        if (KdenliveSettings::dropbframes() && m_baseTrackProducers.at(i)->get("skip_loop_filter") && strcmp(m_baseTrackProducers.at(i)->get("skip_loop_filter"), "all") == 0) {
-            m_baseTrackProducers[track]->set("skip_loop_filter", "all");
-            m_baseTrackProducers[track]->set("skip_frame", "bidir");
-        }
+
         if (m_properties.contains("force_colorspace")) m_baseTrackProducers[track]->set("force_colorspace", m_properties.value("force_colorspace").toInt());
         if (m_properties.contains("full_luma")) m_baseTrackProducers[track]->set("set.force_full_luma", m_properties.value("full_luma").toInt());
     }
index fb87c65cb02731fa8c0fed7554599baf45ad0b97..572389272e1913a0f1fcaea1c6531003cf545f6c 100644 (file)
@@ -483,15 +483,7 @@ void KdenliveDoc::slotAutoSave()
             kDebug() << "ERROR; CANNOT CREATE AUTOSAVE FILE";
         }
         kDebug() << "// AUTOSAVE FILE: " << m_autosave->fileName();
-        QString doc;
-        if (KdenliveSettings::dropbframes()) {
-            KdenliveSettings::setDropbframes(false);
-            m_clipManager->updatePreviewSettings();
-            doc = m_render->sceneList();
-            KdenliveSettings::setDropbframes(true);
-            m_clipManager->updatePreviewSettings();
-        } else doc = m_render->sceneList();
-        saveSceneList(m_autosave->fileName(), doc);
+        saveSceneList(m_autosave->fileName(), m_render->sceneList());
     }
 }
 
@@ -813,16 +805,6 @@ void KdenliveDoc::checkProjectClips()
     m_clipManager->resetProducersList(m_render->producersList());
 }
 
-void KdenliveDoc::updatePreviewSettings()
-{
-    m_clipManager->updatePreviewSettings();
-    m_render->updatePreviewSettings();
-    QList <Mlt::Producer *> prods = m_render->producersList();
-    m_clipManager->resetProducersList(m_render->producersList());
-    qDeleteAll(prods);
-    prods.clear();
-}
-
 Render *KdenliveDoc::renderer()
 {
     return m_render;
@@ -1167,7 +1149,7 @@ void KdenliveDoc::slotCreateTextTemplateClip(QString group, const QString &group
 {
     QString titlesFolder = projectFolder().path(KUrl::AddTrailingSlash) + "titles/";
     if (path.isEmpty()) {
-        path = KFileDialog::getOpenUrl(KUrl(titlesFolder), "*.kdenlivetitle", kapp->activeWindow(), i18n("Enter Template Path"));
+        path = KFileDialog::getOpenUrl(KUrl(titlesFolder), "application/x-kdenlivetitle", kapp->activeWindow(), i18n("Enter Template Path"));
     }
 
     if (path.isEmpty()) return;
index e0648673cd0e665d31fd727875fe4a5a7afca2b1..5ae8045ab5b49716a3e159415d96948f5f329175 100644 (file)
@@ -129,7 +129,6 @@ Q_OBJECT public:
     void setZone(int start, int end);
     QPoint zone() const;
     int setSceneList();
-    void updatePreviewSettings();
     bool isTrackLocked(int ix) const;
     void setDocumentProperty(const QString &name, const QString &value);
     const QString getDocumentProperty(const QString &name) const;
index 49d65f06879244d0113a8e6d1901d50290cd24eb..852e04406194fbb0003068c4b49d5e195f0bb38d 100644 (file)
       <default>100</default>
     </entry>
 
-    <entry name="dropbframes" type="Bool">
-      <label>Drop B Frames on H.264 clips for faster playback (For monitor preview only).</label>
-      <default>false</default>
-    </entry>
   </group>
 
   <group name="env">
index 91933f9c7f28144764448f7264e8d743172afaea..e997fa76fab527a423d20a99c4f663667a64f854 100644 (file)
@@ -122,8 +122,6 @@ KdenliveSettingsDialog::KdenliveSettingsDialog(QWidget * parent) :
     QWidget *p6 = new QWidget;
     m_configSdl.setupUi(p6);
 
-    // Disable drop B frames, see Kdenlive issue #1330
-    m_configSdl.groupBox->setHidden(true);
 #if not defined(Q_WS_MAC) && not defined(USE_OPEN_GL)
     m_configSdl.kcfg_openglmonitors->setHidden(true);
 #endif
@@ -537,12 +535,6 @@ void KdenliveSettingsDialog::updateSettings()
         resetProfile = true;
     }
 
-    bool updatePreview = false;
-    if (m_configSdl.kcfg_dropbframes->isChecked() != KdenliveSettings::dropbframes()) {
-        KdenliveSettings::setDropbframes(m_configSdl.kcfg_dropbframes->isChecked());
-        updatePreview = true;
-    }
-
     if (m_modified) {
         // The transcoding profiles were modified, save.
         m_modified = false;
@@ -555,7 +547,6 @@ void KdenliveSettingsDialog::updateSettings()
 
     //KConfigDialog::updateSettings();
     if (resetProfile) emit doResetProfile();
-    if (updatePreview) emit updatePreviewSettings();
 }
 
 void KdenliveSettingsDialog::slotUpdateDisplay()
index 05f01c0c2c7c5468fff84c63252507d80d08f5d7..3eb3804f78881123c8d7c76ad1930b3c64512bf1 100644 (file)
@@ -97,7 +97,6 @@ private:
 signals:
     void customChanged();
     void doResetProfile();
-    void updatePreviewSettings();
     void updateCaptureFolder();
 };
 
index d578f11907dcf62e31329358bcc60ecb373317f4..55431d6f6ddd2d7d2fa79495bf6cb9454a0204f7 100644 (file)
@@ -516,9 +516,6 @@ MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, const QString &
     m_monitorManager->initMonitors(m_clipMonitor, m_projectMonitor);
     slotConnectMonitors();
 
-    // Disable drop B frames, see Kdenlive issue #1330, see also kdenlivesettingsdialog.cpp
-    KdenliveSettings::setDropbframes(false);
-
     // Open or create a file.  Command line argument passed in Url has
     // precedence, then "openlastproject", then just a plain empty file.
     // If opening Url fails, openlastproject will _not_ be used.
@@ -1861,15 +1858,8 @@ bool MainWindow::saveFileAs(const QString &outputFileName)
 {
     QString currentSceneList;
     m_monitorManager->stopActiveMonitor();
-    if (KdenliveSettings::dropbframes()) {
-        KdenliveSettings::setDropbframes(false);
-        m_activeDocument->clipManager()->updatePreviewSettings();
-        currentSceneList = m_projectMonitor->sceneList();
-        KdenliveSettings::setDropbframes(true);
-        m_activeDocument->clipManager()->updatePreviewSettings();
-    } else currentSceneList = m_projectMonitor->sceneList();
-
-    if (m_activeDocument->saveSceneList(outputFileName, currentSceneList) == false)
+
+    if (m_activeDocument->saveSceneList(outputFileName, m_projectMonitor->sceneList()) == false)
         return false;
 
     // Save timeline thumbnails
@@ -2477,7 +2467,6 @@ void MainWindow::connectDocument(TrackView *trackView, KdenliveDoc *doc)   //cha
 #ifndef   Q_WS_MAC
     m_recMonitor->slotUpdateCaptureFolder(m_activeDocument->projectFolder().path(KUrl::AddTrailingSlash));
 #endif
-    if (KdenliveSettings::dropbframes()) slotUpdatePreviewSettings();
     //Update the mouse position display so it will display in DF/NDF format by default based on the project setting.
     slotUpdateMousePosition(0);
     // set tool to select tool
@@ -2524,11 +2513,9 @@ void MainWindow::slotPreferences(int page, int option)
     connect(dialog, SIGNAL(settingsChanged(const QString&)), this, SLOT(updateConfiguration()));
     //connect(dialog, SIGNAL(doResetProfile()), this, SLOT(slotDetectAudioDriver()));
     connect(dialog, SIGNAL(doResetProfile()), m_monitorManager, SLOT(slotResetProfiles()));
-    connect(dialog, SIGNAL(updatePreviewSettings()), this, SLOT(slotUpdatePreviewSettings()));
 #ifndef Q_WS_MAC
     connect(dialog, SIGNAL(updateCaptureFolder()), this, SLOT(slotUpdateCaptureFolder()));
 #endif
-    //connect(dialog, SIGNAL(updatePreviewSettings()), this, SLOT(slotUpdatePreviewSettings()));
     dialog->show();
     if (page != -1) dialog->showPage(page, option);
 }
@@ -2542,14 +2529,6 @@ void MainWindow::slotUpdateCaptureFolder()
 #endif
 }
 
-void MainWindow::slotUpdatePreviewSettings()
-{
-    if (m_activeDocument) {
-        m_clipMonitor->slotSetXml(NULL);
-        m_activeDocument->updatePreviewSettings();
-    }
-}
-
 void MainWindow::updateConfiguration()
 {
     //TODO: we should apply settings to all projects, not only the current one
index 27365b4b777c8bfec17b32424a5513d952366edb..42894c826234abcdac22776bfbe5ade8423d61f3 100644 (file)
@@ -452,7 +452,6 @@ private slots:
     /** @brief Lets the sampleplugin create a generator.  */
     void generateClip();
     void slotZoneMoved(int start, int end);
-    void slotUpdatePreviewSettings();
     void slotDvdWizard(const QString &url = QString(), const QString &profile = "dv_pal");
     void slotGroupClips();
     void slotUnGroupClips();
index 8cae1952565f79b6724d2ce1b4715dc1c470f4cf..d785dec093dd3185541add7cd4b6cdfbb07b739b 100644 (file)
@@ -740,17 +740,6 @@ void Render::getFileProperties(const QDomElement xml, const QString &clipId, int
         filePropertyMap["pix_fmt"] = producer->get(query.toUtf8().constData());
         filePropertyMap["colorspace"] = producer->get("meta.media.colorspace");
 
-        if (KdenliveSettings::dropbframes()) {
-            kDebug() << "// LOOKING FOR H264 on: " << default_video;
-            snprintf(property, sizeof(property), "meta.media.%d.codec.name", default_video);
-            kDebug() << "PROP: " << property << " = " << producer->get(property);
-            if (producer->get(property) && strcmp(producer->get(property), "h264") == 0) {
-                kDebug() << "// GOT H264 CLIP, SETTING FAST PROPS";
-                producer->set("skip_loop_filter", "all");
-                producer->set("skip_frame", "bidir");
-            }
-        }
-
     } else kDebug() << " / / / / /WARNING, VIDEO CONTEXT IS NULL!!!!!!!!!!!!!!";
     if (producer->get_int("audio_index") > -1) {
         // Get the audio_index
@@ -842,10 +831,6 @@ int Render::setProducer(Mlt::Producer *producer, int position)
         m_mltProducer = new Mlt::Producer(producer->get_producer());
     } else m_mltProducer = m_blackClip->cut(0, 50);
 
-    /*if (KdenliveSettings::dropbframes()) {
-    m_mltProducer->set("skip_loop_filter", "all");
-        m_mltProducer->set("skip_frame", "bidir");
-    }*/
     if (!m_mltProducer || !m_mltProducer->is_valid()) {
         kDebug() << " WARNING - - - - -INVALID PLAYLIST: ";
         return -1;
index 6e78e329d741cba037434fe1f6649c074e08e64b..cee49078449593c6587e5444c4133bd99c761159 100644 (file)
@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>353</width>
-    <height>247</height>
+    <width>342</width>
+    <height>241</height>
    </rect>
   </property>
   <layout class="QGridLayout" name="gridLayout_2">
@@ -83,7 +83,7 @@
      </property>
     </widget>
    </item>
-   <item row="9" column="1" colspan="2">
+   <item row="8" column="1" colspan="2">
     <spacer name="verticalSpacer">
      <property name="orientation">
       <enum>Qt::Vertical</enum>
      </property>
     </spacer>
    </item>
-   <item row="8" column="0" colspan="3">
-    <widget class="QGroupBox" name="groupBox">
-     <property name="title">
-      <string>Monitor Preview Speedup Settings</string>
-     </property>
-     <layout class="QGridLayout" name="gridLayout">
-      <item row="0" column="0">
-       <widget class="QCheckBox" name="kcfg_dropbframes">
-        <property name="text">
-         <string>Drop B frames on H.264 clips</string>
-        </property>
-       </widget>
-      </item>
-     </layout>
-    </widget>
-   </item>
    <item row="6" column="0" colspan="2">
     <widget class="QLabel" name="label">
      <property name="text">