srs/trunk/src/app/srs_app_coworkers.hpp
Winlin e7069788e9
SmartPtr: Support shared ptr for live source. v6.0.129 (#4089)
Detail change log:

1. [Simple,Refactor] Remove member fields of http entry, etc.
e34b3d3aa4
2. [Ignore] Rename source to live_source.
846f95ec96
3. [Ignore] Use directly ptr in consumer.
d38af021ad
4. [Complex, Important] Use shared ptr for live source.
88f922413a

The object relationship:

![live-source](https://github.com/ossrs/srs/assets/2777660/1adb59af-6e7a-40f3-9a4a-1cc849d7dae1)

---

Co-authored-by: Jacob Su <suzp1984@gmail.com>
2024-06-15 07:54:56 +08:00

41 lines
852 B
C++

//
// Copyright (c) 2013-2024 The SRS Authors
//
// SPDX-License-Identifier: MIT
//
#ifndef SRS_APP_COWORKERS_HPP
#define SRS_APP_COWORKERS_HPP
#include <srs_core.hpp>
#include <string>
#include <map>
class SrsJsonAny;
class SrsRequest;
class SrsLiveSource;
// For origin cluster.
class SrsCoWorkers
{
private:
static SrsCoWorkers* _instance;
private:
std::map<std::string, SrsRequest*> streams;
private:
SrsCoWorkers();
virtual ~SrsCoWorkers();
public:
static SrsCoWorkers* instance();
public:
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);
public:
virtual srs_error_t on_publish(SrsRequest* r);
virtual void on_unpublish(SrsRequest* r);
};
#endif