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.
 
 
 
 
 
 

39 lines
949 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 PathProvider
{
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;
// PathProvider (WebRTC server)
std::shared_ptr<MediaPath> findPath(const std::string & name) const override { return find(name); }
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