#ifndef QGVIDEORECORDER_H
#define QGVIDEORECORDER_H

#include <QObject>

#include <QProcess>
#include <QImage>

class QgLogger;

class QgVideoRecorder : public QObject
{
    Q_OBJECT
public:
    explicit QgVideoRecorder(QObject *parent = 0);

signals:
    void vcrStarted();
    void vcrTerminated();

public slots:
    void recStart();
    void recStop();
    void recClose();

    void addFrame(const QImage& img);

private slots:
    void procErrorOccurred(QProcess::ProcessError error);
    void procFinished(int exitCode, QProcess::ExitStatus exitStatus);
    void procReadyReadStandardError();
    void procReadyReadStandardOutput();
    void procStarted();
    void procStateChanged(QProcess::ProcessState newState);

public:
    QProcess* proc;
    QgLogger* log;

    QString fileName;
};

#endif // QGVIDEORECORDER_H
