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
37 lines
792 B
/*
|
|
MediaMtx (C++) - path manager (MediaMTX: internal/core/path_manager.go)
|
|
*/
|
|
#pragma once
|
|
|
|
#include <map>
|
|
#include <memory>
|
|
#include <mutex>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#include "../conf/conf.h"
|
|
#include "path.h"
|
|
|
|
namespace mtx {
|
|
|
|
class PathManager : public LogParent
|
|
{
|
|
public:
|
|
explicit PathManager(const Conf & global);
|
|
~PathManager();
|
|
|
|
// Starts new paths, stops removed ones, restarts changed ones
|
|
void applyPaths(const std::vector<PathConf> & paths);
|
|
void closeAll();
|
|
|
|
std::shared_ptr<Path> find(const std::string & name) const;
|
|
std::vector<PathInfo> list() const;
|
|
std::vector<PathConf> confs() const;
|
|
|
|
private:
|
|
Conf m_global;
|
|
mutable std::mutex m_mutex;
|
|
std::map<std::string, std::shared_ptr<Path>> m_paths;
|
|
};
|
|
|
|
} // namespace mtx
|