1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-02-24 15:04:20 +00:00
srs/trunk/src/app/srs_app_coworkers.hpp

41 lines
879 B
C++
Raw Normal View History

//
// 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>
#include <map>
2018-02-15 12:55:34 +00:00
class SrsJsonAny;
class SrsRequest;
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;
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);
private:
virtual SrsRequest* find_stream_info(std::string vhost, std::string app, std::string stream);
2018-02-15 12:55:34 +00:00
public:
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