MppManager.h 608 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #include "MppDecoder.h"
  2. #ifndef MPPMANAGER_H
  3. #define MPPMANAGER_H
  4. #include "MppDecoder.h"
  5. #include <thread>
  6. #include <vector>
  7. class MppManager
  8. {
  9. public:
  10. static MppManager &getInstance()
  11. {
  12. static MppManager instance;
  13. return instance;
  14. }
  15. MppManager(const MppManager &) = delete;
  16. MppManager &operator=(const MppManager &) = delete;
  17. void addMppDecode();
  18. private:
  19. MppManager() = default;
  20. ~MppManager();
  21. void decodeThread();
  22. private:
  23. std::vector<std::thread> m_threads;
  24. // thread switch
  25. bool m_threadSwitch{false};
  26. };
  27. #endif // MPPMANAGER_H