etCameraTest.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #ifndef ETCAMERATEST_H
  2. #define ETCAMERATEST_H
  3. #include <QWidget>
  4. #include <opencv2/opencv.hpp>
  5. #include <mutex>
  6. #include <QTimer>
  7. #include "CLiveViodeProc.h"
  8. namespace Ui {
  9. class etCameraTest;
  10. }
  11. class etCameraTest : public QWidget, ITRTCVideoRenderCallback
  12. {
  13. Q_OBJECT
  14. public:
  15. explicit etCameraTest(QWidget *parent = nullptr);
  16. ~etCameraTest();
  17. int setUI(const int nLeft, const int nTop, const int nWidth);
  18. int widgetHeight();
  19. int getCheckStatus();//0:false 1:true 2:未检测
  20. private slots:
  21. void on_btn_IsSelf_clicked();
  22. void on_btn_IsNotSelf_clicked();
  23. private:
  24. void onRenderVideoFrame(const char* userId, TRTCVideoStreamType streamType, TRTCVideoFrame* frame);
  25. void setCameraStaus(bool bOpened);
  26. Ui::etCameraTest *ui;
  27. std::shared_ptr<QTimer> m_pVideoTimer;
  28. // std::shared_ptr<QTimer> m_pinitTimer;
  29. // cv::VideoCapture m_cam;
  30. cv::Mat m_nCurImage;
  31. std::mutex m_imageMutex;
  32. __int64 m_lastFaceTime=0;
  33. int m_nCameraOpenStatus;
  34. bool m_bSetCameraStaus = false;
  35. };
  36. #endif // ETCAMERATEST_H