1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

for #513, remove hls ram from srs2 to srs3+. 2.0.224

This commit is contained in:
winlin 2016-12-15 14:48:38 +08:00
parent 34e5cdcd12
commit 759c84a395
17 changed files with 26 additions and 556 deletions

View file

@ -53,39 +53,6 @@ class SrsHlsSegment;
class SrsTsCache;
class SrsTsContext;
/**
* the handler for hls event.
* for example, we use memory only hls for
*/
class ISrsHlsHandler
{
public:
ISrsHlsHandler();
virtual ~ISrsHlsHandler();
public:
/**
* when publish stream
*/
virtual int on_hls_publish(SrsRequest* req) = 0;
/**
* when update the m3u8 file.
*/
virtual int on_update_m3u8(SrsRequest* r, std::string m3u8) = 0;
/**
* when reap new ts file.
*/
virtual int on_update_ts(SrsRequest* r, std::string uri, std::string ts) = 0;
/**
* when remove the specified ts file,
* for the hls to remove the expired ts not in hls window.
*/
virtual int on_remove_ts(SrsRequest* r, std::string uri) = 0;
/**
* when unpublish stream
*/
virtual int on_hls_unpublish(SrsRequest* req) = 0;
};
/**
* * the HLS section, only available when HLS enabled.
* */
@ -239,8 +206,7 @@ private:
std::string m3u8;
std::string m3u8_url;
private:
ISrsHlsHandler* handler;
// TODO: FIXME: supports reload.
// TODO: FIXME: remove it.
bool should_write_cache;
bool should_write_file;
private:
@ -277,7 +243,7 @@ public:
/**
* initialize the hls muxer.
*/
virtual int initialize(ISrsHlsHandler* h);
virtual int initialize();
/**
* when publish, update the config for muxer.
*/
@ -390,7 +356,6 @@ class SrsHls
private:
SrsHlsMuxer* muxer;
SrsHlsCache* hls_cache;
ISrsHlsHandler* handler;
private:
SrsRequest* _req;
bool hls_enabled;
@ -426,7 +391,7 @@ public:
/**
* initialize the hls by handler and source.
*/
virtual int initialize(SrsSource* s, ISrsHlsHandler* h);
virtual int initialize(SrsSource* s);
/**
* publish stream event, continue to write the m3u8,
* for the muxer object not destroyed.