]> git.sesse.net Git - kdenlive/blobdiff - src/renderer.h
Fix some avformat producer concurrency crashes
[kdenlive] / src / renderer.h
index afbf50eb78164ea860f0bdc7fec0e201efc02ad1..04d8452c7bf1656c9eda0d3fec76652b20305985 100644 (file)
@@ -66,6 +66,11 @@ struct requestClipInfo {
     QString clipId;
     int imageHeight;
     bool replaceProducer;
+
+bool operator==(const requestClipInfo &a)
+{
+    return clipId == a.clipId;
+}
 };
 
 class MltErrorEvent : public QEvent
@@ -283,6 +288,18 @@ Q_OBJECT public:
     /** @brief Force processing of clip with selected id. */
     void forceProcessing(const QString &id);
 
+    /** @brief Requests the file properties for the specified URL (will be put in a queue list)
+        @param xml The xml parameters for the clip
+        @param clipId The clip Id string
+        @param imageHeight The height (in pixels) of the returned thumbnail (height of a treewidgetitem in projectlist)
+        @param replaceProducer If true, the MLT producer will be recreated */
+    void getFileProperties(const QDomElement &xml, const QString &clipId, int imageHeight, bool replaceProducer = true);
+
+    /** @brief Lock the MLT service */
+    void lock();
+    /** @brief Unlock the MLT service */
+    void unlock();
+
 private:
 
     /** @brief The name of this renderer.
@@ -340,6 +357,8 @@ private:
 
     /** @brief Make sure our audio mixing transitions are applied to the lowest track */
     void fixAudioMixing(Mlt::Tractor tractor);
+    /** @brief Make sure we inform MLT if we need a lot of threads for avformat producer */
+    void checkMaxThreads();
 
 private slots:
 
@@ -347,7 +366,8 @@ private slots:
     void refresh();
     void slotOsdTimeout();
     int connectPlaylist();
-    //void initSceneList();
+    /** @brief Process the clip info requests (in a separate thread). */
+    void processFileProperties();
 
 signals:
 
@@ -402,18 +422,6 @@ public slots:
     /** @brief Checks if the file is readable by MLT. */
     bool isValid(KUrl url);
 
-    /** @brief Requests the file properties for the specified URL.
-        @param xml The xml parameters for the clip
-        @param clipId The clip Id string
-        @param imageHeight The height (in pixels) of the returned thumbnail (height of a treewidgetitem in projectlist)
-        @param replaceProducer If true, the MLT producer will be recreated
-        @param selectClip If true, clip item will be selected in project view
-     * Upon return, the result will be emitted via replyGetFileProperties().
-     * Wraps the VEML command of the same name. */
-    void getFileProperties(const QDomElement &xml, const QString &clipId, int imageHeight, bool replaceProducer = true);
-
-    void getFileProperties2();
-
     void exportFileToFirewire(QString srcFileName, int port, GenTime startTime, GenTime endTime);
     void mltSavePlaylist();
     void slotSplitView(bool doit);