123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 |
- #ifndef HKCAMERA_H
- #define HKCAMERA_H
- #include <QWidget>
- #include "spdlog/spdlog.h"
- #include "HCNetSDK.h"
- #include "CVideoPlayer.h"
- class QVideoWidget;
- class QMediaPlayer;
- class QMediaPlaylist;
- class QLayout;
- class HKCamera : public QObject
- {
- Q_OBJECT
- public:
-
- enum CallBackType{
- PlayCallBack = 0,
- DownloadCallBack
- };
- HKCamera(QObject *parent = nullptr);
- ~HKCamera();
- bool initHKCamera(const HKLoginInfo& info);
- quint32 getAnalogChannelNum();
- quint32 getAnalogChannelStart();
- quint32 getDigitalChannelNum();
- quint32 getDigitalChannelSatrt();
-
- bool getRealDataFromCamera(int Channel);
-
- void realPlayBack(int channel,QWidget* playWindow = nullptr);
-
- bool smartSearch(int channel, const QDateTime& start, const QDateTime& end);
-
- bool findFileWithTime(int channel,const QDateTime& start,const QDateTime& end);
-
- bool findFileIsComplete(int channel,const QDateTime& start,const QDateTime& end);
-
- bool downloadRecordFile(int channel,const QString& savePath, const QDateTime& start,const QDateTime& end);
-
-
- CVideoPlayer* openVideoFile(const QString& fileName);
-
- void playVideo(CVideoPlayer* CVideoPlayer);
-
- void closePlay(CVideoPlayer* CVideoPlayer);
-
- void pause(CVideoPlayer* CVideoPlayer);
-
- void stop(CVideoPlayer* CVideoPlayer);
-
- void continuePlay(CVideoPlayer* CVideoPlayer);
-
- unsigned long long getPlayDuration(CVideoPlayer* CVideoPlayer);
-
- void setCurrentPlayPos(CVideoPlayer* CVideoPlayer, unsigned long long pos);
-
- unsigned long long getCurrentPlayPos(CVideoPlayer* CVideoPlayer);
-
- bool getPlayState(CVideoPlayer* CVideoPlayer);
-
- void setVideoParent(CVideoPlayer* CVideoPlayer, QWidget* parent);
-
- void setVolume(CVideoPlayer* CVideoPlayer, int volume);
-
- int getVolume(CVideoPlayer* CVideoPlayer);
-
- bool checkVideoPlayerInList(CVideoPlayer* CVideoPlayer);
-
- void setCallBack(CallBackType type, std::function<Play_CallBack> playCallback,void* pContext);
- private:
-
- static void exceptionCallBack(unsigned int type, int userID,int handle,void* user);
-
- static void realDataCallBack(LONG realHandle, DWORD dataType, BYTE *pBuffer,DWORD bufSize,void* user);
- private:
- std::shared_ptr<spdlog::logger> m_logger = nullptr;
- int m_sdkVersion = 3;
- HKLoginInfo m_loginInfo;
- LONG m_loginID;
- DeviceInfo m_devInfo;
-
- std::function<Play_CallBack> m_playCallback = nullptr;
- std::function<Download_CallBack> m_downloadCallback = nullptr;
- void* m_playContext = nullptr;
- void* m_downloadContext = nullptr;
-
-
- QList<CVideoPlayer *> m_listPlayer;
- };
- #endif
|