2021-05-31 04:59:21 +00:00
|
|
|
//
|
|
|
|
// Copyright (c) 2013-2021 Winlin
|
|
|
|
//
|
|
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
//
|
2018-02-15 12:55:34 +00:00
|
|
|
|
|
|
|
#ifndef SRS_APP_COWORKERS_HPP
|
|
|
|
#define SRS_APP_COWORKERS_HPP
|
|
|
|
|
|
|
|
#include <srs_core.hpp>
|
|
|
|
|
|
|
|
#include <string>
|
2018-02-16 01:37:31 +00:00
|
|
|
#include <map>
|
2018-02-15 12:55:34 +00:00
|
|
|
|
|
|
|
class SrsJsonAny;
|
|
|
|
class SrsRequest;
|
2021-05-15 04:30:13 +00:00
|
|
|
class SrsLiveSource;
|
2018-02-15 12:55:34 +00:00
|
|
|
|
2019-04-28 01:08:05 +00:00
|
|
|
// For origin cluster.
|
2018-02-15 12:55:34 +00:00
|
|
|
class SrsCoWorkers
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
static SrsCoWorkers* _instance;
|
2018-02-16 01:37:31 +00:00
|
|
|
private:
|
2018-02-16 02:19:48 +00:00
|
|
|
std::map<std::string, SrsRequest*> streams;
|
2018-02-15 12:55:34 +00:00
|
|
|
private:
|
|
|
|
SrsCoWorkers();
|
|
|
|
virtual ~SrsCoWorkers();
|
|
|
|
public:
|
|
|
|
static SrsCoWorkers* instance();
|
|
|
|
public:
|
2019-12-01 11:24:17 +00:00
|
|
|
virtual SrsJsonAny* dumps(std::string vhost, std::string coworker, std::string app, std::string stream);
|
2018-02-16 01:37:31 +00:00
|
|
|
private:
|
|
|
|
virtual SrsRequest* find_stream_info(std::string vhost, std::string app, std::string stream);
|
2018-02-15 12:55:34 +00:00
|
|
|
public:
|
2021-05-15 04:30:13 +00:00
|
|
|
virtual srs_error_t on_publish(SrsLiveSource* s, SrsRequest* r);
|
|
|
|
virtual void on_unpublish(SrsLiveSource* s, SrsRequest* r);
|
2018-02-15 12:55:34 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|