]> git.sesse.net Git - kdenlive/blobdiff - src/mltdevicecapture.h
create menu for video stabilize
[kdenlive] / src / mltdevicecapture.h
index da341ebc29d399c2502f2136378ba8f99d31cc99..ba757335077180dc829706049bfcf3856c081604 100644 (file)
 #include "gentime.h"
 #include "definitions.h"
 #include "abstractmonitor.h"
-#include "mlt/framework/mlt_types.h"
+
+#include <mlt/framework/mlt_types.h>
+
+#include <QtConcurrentRun>
 
 namespace Mlt
 {
@@ -76,7 +79,7 @@ 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 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);
@@ -87,16 +90,27 @@ Q_OBJECT public:
     void setOverlay(const QString &path);
 
     /** @brief This will add an MLT video effect to the overlay track. */
-    void setOverlayEffect(const QString tag, QStringList parameters);
+    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;
@@ -104,8 +118,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;
 
@@ -113,8 +126,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.
      *
@@ -124,7 +140,13 @@ signals:
     /** @brief This signal contains the audio of the current frame. */
     void audioSamplesSignal(const QVector<int16_t>&, int freq, int num_channels, int num_samples);
 
-    void frameSaved(const QString);
+    void frameSaved(const QString &);
+    
+    void droppedFrames(int);
+    
+    void unblockPreview();
+    void imageReady(QImage);
+
 
 public slots: