read_thread.h 622 B

12345678910111213141516171819202122232425262728
  1. #pragma once
  2. #include <QThread>
  3. #include "packets_sync.h"
  4. class ReadThread : public QThread
  5. {
  6. Q_OBJECT
  7. public:
  8. explicit ReadThread(QObject* parent = nullptr, VideoState* pState = nullptr);
  9. ~ReadThread();
  10. public:
  11. void set_video_state(VideoState* pState = nullptr); // call before start
  12. // thread
  13. protected:
  14. int stream_component_open(int stream_index);
  15. void stream_component_close(VideoState* is, int stream_index);
  16. int loop_read();
  17. protected:
  18. void run() override;
  19. private:
  20. VideoState* m_pPlayData;
  21. QMutex m_waitMutex;
  22. };