#ifndef STHREADWATCHVIDEOLINK_H
#define STHREADWATCHVIDEOLINK_H

#include <QThread>
#include <QMutex>
#include <QDebug>
#include <QMutexLocker>

#include "qsthread.h"

#include "common.h"

#include <QTimer>

#include <QElapsedTimer>

#include "qrtspthread.h"


class SThreadWatchVideoLink : public QSThread
{
    Q_OBJECT
public:
    explicit SThreadWatchVideoLink();

    virtual ~SThreadWatchVideoLink();

    virtual void InnerRun();

    virtual void Init();

    int WatchVideoConnect();
    int open_device(std::string strDevice);
    int xioctl(int fh, unsigned long int request, void *arg);

    void SetThreadRTSP(QRTSPThread* pThread);

    bool IsConnectHDMI();
protected:
    QElapsedTimer m_TimerEDID;

    QRTSPThread* m_pThreadRTSP;

    int m_nRTSPStatus;
    int m_nCaptureMode;

    bool m_bConnectHDMI;

    QMutex m_Lock;

signals:
    void HDMICalbeConnect(bool bCableConnect);
};

#endif // STHREADWATCHVIDEOLINK_H
