mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
HLS: support kick-off hls client (#3371)
* HLS: support kick-off hls client * Refine error response when reject HLS client. * Rename SrsM3u8CtxInfo to SrsHlsVirtualConn * Update release v5.0.139 v6.0.21 --------- Co-authored-by: winlin <winlin@vip.126.com> Co-authored-by: john <hondaxiao@tencent.com>
This commit is contained in:
parent
ef90da352e
commit
7e83874af0
5 changed files with 66 additions and 20 deletions
|
|
@ -13,12 +13,20 @@
|
|||
|
||||
class ISrsFileReaderFactory;
|
||||
|
||||
struct SrsM3u8CtxInfo
|
||||
// HLS virtual connection, build on query string ctx of hls stream.
|
||||
class SrsHlsVirtualConn: public ISrsExpire
|
||||
{
|
||||
public:
|
||||
srs_utime_t request_time;
|
||||
SrsRequest* req;
|
||||
SrsM3u8CtxInfo();
|
||||
virtual ~SrsM3u8CtxInfo();
|
||||
std::string ctx;
|
||||
bool interrupt;
|
||||
public:
|
||||
SrsHlsVirtualConn();
|
||||
virtual ~SrsHlsVirtualConn();
|
||||
// Interface ISrsExpire.
|
||||
public:
|
||||
virtual void expire();
|
||||
};
|
||||
|
||||
// Server HLS streaming.
|
||||
|
|
@ -26,7 +34,7 @@ class SrsHlsStream : public ISrsFastTimer
|
|||
{
|
||||
private:
|
||||
// The period of validity of the ctx
|
||||
std::map<std::string, SrsM3u8CtxInfo*> map_ctx_info_;
|
||||
std::map<std::string, SrsHlsVirtualConn*> map_ctx_info_;
|
||||
public:
|
||||
SrsHlsStream();
|
||||
virtual ~SrsHlsStream();
|
||||
|
|
@ -40,6 +48,7 @@ private:
|
|||
void alive(std::string ctx, SrsRequest* req);
|
||||
srs_error_t http_hooks_on_play(SrsRequest* req);
|
||||
void http_hooks_on_stop(SrsRequest* req);
|
||||
bool is_interrupt(std::string id);
|
||||
// interface ISrsFastTimer
|
||||
private:
|
||||
srs_error_t on_timer(srs_utime_t interval);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue