mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
RTC: Refine resouce management
This commit is contained in:
parent
1173d35e33
commit
64705d1cc8
29 changed files with 364 additions and 177 deletions
|
@ -28,8 +28,32 @@
|
|||
|
||||
#include <string>
|
||||
|
||||
// The resource managed by ISrsResourceManager.
|
||||
class ISrsResource
|
||||
{
|
||||
public:
|
||||
ISrsResource();
|
||||
virtual ~ISrsResource();
|
||||
public:
|
||||
// Get the context id of connection.
|
||||
virtual const SrsContextId& get_id() = 0;
|
||||
// The resource description, optional.
|
||||
virtual std::string desc() = 0;
|
||||
};
|
||||
|
||||
// The manager for resource.
|
||||
class ISrsResourceManager
|
||||
{
|
||||
public:
|
||||
ISrsResourceManager();
|
||||
virtual ~ISrsResourceManager();
|
||||
public:
|
||||
// Remove then free the specified connection.
|
||||
virtual void remove(ISrsResource* c) = 0;
|
||||
};
|
||||
|
||||
// The connection interface for all HTTP/RTMP/RTSP object.
|
||||
class ISrsConnection
|
||||
class ISrsConnection : public ISrsResource
|
||||
{
|
||||
public:
|
||||
ISrsConnection();
|
||||
|
@ -39,16 +63,5 @@ public:
|
|||
virtual std::string remote_ip() = 0;
|
||||
};
|
||||
|
||||
// The manager for connection.
|
||||
class IConnectionManager
|
||||
{
|
||||
public:
|
||||
IConnectionManager();
|
||||
virtual ~IConnectionManager();
|
||||
public:
|
||||
// Remove then free the specified connection.
|
||||
virtual void remove(ISrsConnection* c) = 0;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue