You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
792 B

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. /*
  2. MediaMtx (C++) - path manager (MediaMTX: internal/core/path_manager.go)
  3. */
  4. #pragma once
  5. #include <map>
  6. #include <memory>
  7. #include <mutex>
  8. #include <string>
  9. #include <vector>
  10. #include "../conf/conf.h"
  11. #include "path.h"
  12. namespace mtx {
  13. class PathManager : public LogParent
  14. {
  15. public:
  16. explicit PathManager(const Conf & global);
  17. ~PathManager();
  18. // Starts new paths, stops removed ones, restarts changed ones
  19. void applyPaths(const std::vector<PathConf> & paths);
  20. void closeAll();
  21. std::shared_ptr<Path> find(const std::string & name) const;
  22. std::vector<PathInfo> list() const;
  23. std::vector<PathConf> confs() const;
  24. private:
  25. Conf m_global;
  26. mutable std::mutex m_mutex;
  27. std::map<std::string, std::shared_ptr<Path>> m_paths;
  28. };
  29. } // namespace mtx