#ifndef MONITORWINDOW_H
#define MONITORWINDOW_H

#include <QObject>
#include <QLabel>
#include <QString>

class QFFmpeg;
class RtspThread;


//ӴڣƵͼʾڼӴ
class MonitorWindow : public QLabel
{
	Q_OBJECT

public:
	MonitorWindow(QWidget *parent);
	~MonitorWindow();

public slots:
    //жϴǷڲ
	bool isPlaying() const;
	//жϴǷ¼
	bool isRecording() const;
	//жϴǷڻ״̬
	bool isActive() const;
	//ôڵĽ
	QFFmpeg* ffmpeg() const;
	//ôڵurl·
	void setUrl(QString& url);
    void setRtspUrl(QString& rtsp_url);
	//ôƵ¼ļ·
	void setOutPath(QString& path,QString& format);
	//ʼ
	void startPlaying();
	//ͣ
	void pausePlaying();
	//
	void resumePlaying();
	//ʼ¼
	void startRecording();
	//ֹͣ¼
	void stopRecording();
	//رղź¼ƣʱisActive᷵false
	void stop();
	//һ֡ͼõʾ
	void setImage(const QImage& img);
	

private:

	RtspThread *m_thread;
	QFFmpeg *m_ffmpeg;
	QString m_url;
	QString m_recordPath;
	QString m_format;

	bool m_isRecording;
	bool m_isPlaying;
	bool m_isActive;
	
};

#endif // MONITORWINDOW_H
