#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
{
/** @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, bool livePreview, bool xmlPlaylist = true);
+ bool slotStartCapture(const QString ¶ms, 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);
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;
- bool m_livePreview;
+ /** @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;
/** @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;
* @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.
*
* Used in Mac OS X. */
void showImageSignal(QImage);
-
- /** @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: