#include <QList>
#include <QEvent>
#include <QMutex>
+#include <QFuture>
class QTimer;
class QPixmap;
class Service;
};
+struct requestClipInfo {
+ QDomElement xml;
+ QString clipId;
+ int imageHeight;
+ bool replaceProducer;
+
+bool operator==(const requestClipInfo &a)
+{
+ return clipId == a.clipId;
+}
+};
+
class MltErrorEvent : public QEvent
{
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;
+ /** @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:
QTimer *m_osdTimer;
QMutex m_mutex;
+ QMutex m_infoMutex;
/** @brief A human-readable description of this renderer. */
int m_winid;
QLocale m_locale;
+ QFuture <void> m_infoThread;
+ QList <requestClipInfo> m_requestList;
void closeMlt();
void mltCheckLength(Mlt::Tractor *tractor);
/** @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:
void refresh();
void slotOsdTimeout();
int connectPlaylist();
- //void initSceneList();
+ /** @brief Process the clip info requests (in a separate thread). */
+ void processFileProperties();
signals:
/** @brief The renderer received a reply to a getFileProperties request. */
- void replyGetFileProperties(const QString &clipId, Mlt::Producer*, const QMap < QString, QString > &, const QMap < QString, QString > &, bool, bool);
+ void replyGetFileProperties(const QString &clipId, Mlt::Producer*, const stringMap &, const stringMap &, bool replaceProducer, bool refreshThumbnail = false);
/** @brief The renderer received a reply to a getImage request. */
- void replyGetImage(const QString &, const QPixmap &);
+ void replyGetImage(const QString &, const QString &, int, int);
+ void replyGetImage(const QString &, const QImage &);
/** @brief The renderer stopped, either playing or rendering. */
void stopped();
/** @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, bool selectClip = false);
-
void exportFileToFirewire(QString srcFileName, int port, GenTime startTime, GenTime endTime);
void mltSavePlaylist();
void slotSplitView(bool doit);