X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fmltdevicecapture.h;h=b0004a31519c86c0b630394bd6779a39b207616b;hb=54f89d367feaf9c2116a0b44e29ddbacd6610026;hp=77d285c4e805fc177c0ecaf04381c37883e98482;hpb=18e0d5bf09dc616c172876ad4f78615b2fdf4339;p=kdenlive diff --git a/src/mltdevicecapture.h b/src/mltdevicecapture.h index 77d285c4..b0004a31 100644 --- a/src/mltdevicecapture.h +++ b/src/mltdevicecapture.h @@ -50,7 +50,7 @@ Q_OBJECT public: /** @brief Build a MLT Renderer * @param winid The parent widget identifier (required for SDL display). Set to 0 for OpenGL rendering * @param profile The MLT profile used for the capture (default one will be used if empty). */ - MltDeviceCapture(QString profile, VideoPreviewContainer *surface, QWidget *parent = 0); + MltDeviceCapture(QString profile, VideoSurface *surface, QWidget *parent = 0); /** @brief Destroy the MLT Renderer. */ ~MltDeviceCapture(); @@ -74,13 +74,13 @@ Q_OBJECT public: /** @brief Starts the MLT Video4Linux process. * @param surface The widget onto which the frame should be painted */ - bool slotStartCapture(const QString ¶ms, const QString &path, const QString &playlist, int livePreview, bool xmlPlaylist = true); + bool slotStartCapture(const QString ¶ms, const QString &path, const QString &playlist, bool 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); @@ -89,12 +89,11 @@ Q_OBJECT public: /** @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; + + void pause(); private: Mlt::Consumer * m_mltConsumer; @@ -104,12 +103,12 @@ private: QString m_activeProfile; int m_droppedFrames; /** @brief When true, images will be displayed on monitor while capturing. */ - int m_livePreview; + bool 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; + VideoSurface *m_captureDisplayWidget; /** @brief A human-readable description of this renderer. */ int m_winid; @@ -117,6 +116,10 @@ private: void uyvy2rgb(unsigned char *yuv_buffer, int width, int height); QString m_capturePath; + + QTimer m_droppedFramesTimer; + + QMutex m_mutex; /** @brief Build the MLT Consumer object with initial settings. * @param profileName The MLT profile to use for the consumer */ @@ -126,6 +129,8 @@ private: private slots: void slotPreparePreview(); void slotAllowPreview(); + /** @brief When capturing, check every second for dropped frames. */ + void slotCheckDroppedFrames(); signals: /** @brief A frame's image has to be shown. @@ -145,6 +150,7 @@ public slots: /** @brief Stops the consumer. */ void stop(); + void slotDoRefresh(); }; #endif