]> git.sesse.net Git - kdenlive/blobdiff - src/mltdevicecapture.h
Rewrite generation of timeline thumbnails when zooming at frame level, using separate...
[kdenlive] / src / mltdevicecapture.h
index 461c8295f75e599e68c71db33a45b7f1374374ff..9603326e3394245e970436c19b614381e1f7f7bb 100644 (file)
@@ -28,6 +28,8 @@
 #include "abstractmonitor.h"
 #include "mlt/framework/mlt_types.h"
 
+#include <QtConcurrentRun>
+
 namespace Mlt
 {
 class Consumer;
@@ -57,7 +59,7 @@ Q_OBJECT public:
     /** @brief Destroy the MLT Renderer. */
     ~MltDeviceCapture();
 
-    bool doCapture;
+    int doCapture;
 
     /** @brief This property is used to decide if the renderer should convert it's frames to QImage for use in other Kdenlive widgets. */
     bool sendFrameForAnalysis;
@@ -76,19 +78,38 @@ Q_OBJECT public:
     /** @brief Starts the MLT Video4Linux process.
      * @param surface The widget onto which the frame should be painted
      */
-    bool slotStartCapture(const QString &params, const QString &path, const QString &playlist);
-    bool slotStartPreview(const QString &producer);
+    bool slotStartCapture(const QString &params, const QString &path, const QString &playlist, int livePreview, bool xmlPlaylist = true);
+    bool slotStartPreview(const QString &producer, bool xmlFormat = false);
     /** @brief A frame arrived from the MLT Video4Linux process. */
     void gotCapturedFrame(Mlt::Frame& frame);
     /** @brief Save current frame to file. */
     void captureFrame(const QString &path);
     void doRefresh();
+    /** @brief This will add the video clip from path and add it in the overlay track. */
+    void setOverlay(const QString &path);
+
+    /** @brief This will add an MLT video effect to the overlay track. */
+    void setOverlayEffect(const QString tag, QStringList parameters);
+
+    /** @brief This will add a horizontal flip effect, easier to work when filming yourself. */
+    void mirror(bool activate);
+
+    /** @brief This property is used to decide if the renderer should send audio data for monitoring. */
+    bool analyseAudio;
+    
+    /** @brief True if we are processing an image (yuv > rgb) when recording. */
+    bool processingImage;
 
 private:
     Mlt::Consumer * m_mltConsumer;
     Mlt::Producer * m_mltProducer;
     Mlt::Profile *m_mltProfile;
     QString m_activeProfile;
+    int m_droppedFrames;
+    /** @brief When true, images will be displayed on monitor while capturing. */
+    int m_livePreview;
+    /** @brief Count captured frames, used to display only one in ten images while capturing. */
+    int m_frameCount;
 
     /** @brief The surface onto which the captured frames should be painted. */
     VideoPreviewContainer *m_captureDisplayWidget;
@@ -96,8 +117,7 @@ private:
     /** @brief A human-readable description of this renderer. */
     int m_winid;
 
-    /** @brief This property is used to decide if the renderer should send audio data for monitoring. */
-    bool m_analyseAudio;
+    void uyvy2rgb(unsigned char *yuv_buffer, int width, int height);
 
     QString m_capturePath;
 
@@ -105,8 +125,11 @@ private:
      *  @param profileName The MLT profile to use for the consumer */
     void buildConsumer(const QString &profileName = QString());
 
-private slots:
 
+private slots:
+    void slotPreparePreview();
+    void slotAllowPreview();
+  
 signals:
     /** @brief A frame's image has to be shown.
      *
@@ -117,6 +140,12 @@ signals:
     void audioSamplesSignal(const QVector<int16_t>&, int freq, int num_channels, int num_samples);
 
     void frameSaved(const QString);
+    
+    void droppedFrames(int);
+    
+    void unblockPreview();
+    void imageReady(QImage);
+
 
 public slots: