mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
merge from srs2
This commit is contained in:
commit
5796e4bf89
2 changed files with 26 additions and 0 deletions
24
trunk/src/app/srs_app_http_stream.cpp
Normal file → Executable file
24
trunk/src/app/srs_app_http_stream.cpp
Normal file → Executable file
|
@ -79,6 +79,17 @@ SrsBufferCache::~SrsBufferCache()
|
||||||
srs_freep(req);
|
srs_freep(req);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int SrsBufferCache::update(SrsSource* s, SrsRequest* r)
|
||||||
|
{
|
||||||
|
int ret = ERROR_SUCCESS;
|
||||||
|
|
||||||
|
srs_freep(req);
|
||||||
|
req = r->copy();
|
||||||
|
source = s;
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
int SrsBufferCache::start()
|
int SrsBufferCache::start()
|
||||||
{
|
{
|
||||||
return pthread->start();
|
return pthread->start();
|
||||||
|
@ -452,6 +463,17 @@ SrsLiveStream::~SrsLiveStream()
|
||||||
srs_freep(req);
|
srs_freep(req);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int SrsLiveStream::update(SrsSource* s, SrsRequest* r)
|
||||||
|
{
|
||||||
|
int ret = ERROR_SUCCESS;
|
||||||
|
|
||||||
|
srs_freep(req);
|
||||||
|
source = s;
|
||||||
|
req = r->copy();
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
int SrsLiveStream::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessage* r)
|
int SrsLiveStream::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessage* r)
|
||||||
{
|
{
|
||||||
int ret = ERROR_SUCCESS;
|
int ret = ERROR_SUCCESS;
|
||||||
|
@ -840,6 +862,8 @@ int SrsHttpStreamServer::http_mount(SrsSource* s, SrsRequest* r)
|
||||||
srs_trace("http: mount flv stream for vhost=%s, mount=%s", sid.c_str(), mount.c_str());
|
srs_trace("http: mount flv stream for vhost=%s, mount=%s", sid.c_str(), mount.c_str());
|
||||||
} else {
|
} else {
|
||||||
entry = sflvs[sid];
|
entry = sflvs[sid];
|
||||||
|
entry->stream->update(s, r);
|
||||||
|
entry->cache->update(s, r);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (entry->stream) {
|
if (entry->stream) {
|
||||||
|
|
2
trunk/src/app/srs_app_http_stream.hpp
Normal file → Executable file
2
trunk/src/app/srs_app_http_stream.hpp
Normal file → Executable file
|
@ -51,6 +51,7 @@ private:
|
||||||
public:
|
public:
|
||||||
SrsBufferCache(SrsSource* s, SrsRequest* r);
|
SrsBufferCache(SrsSource* s, SrsRequest* r);
|
||||||
virtual ~SrsBufferCache();
|
virtual ~SrsBufferCache();
|
||||||
|
virtual int update(SrsSource* s, SrsRequest* r);
|
||||||
public:
|
public:
|
||||||
virtual int start();
|
virtual int start();
|
||||||
virtual int dump_cache(SrsConsumer* consumer, SrsRtmpJitterAlgorithm jitter);
|
virtual int dump_cache(SrsConsumer* consumer, SrsRtmpJitterAlgorithm jitter);
|
||||||
|
@ -227,6 +228,7 @@ private:
|
||||||
public:
|
public:
|
||||||
SrsLiveStream(SrsSource* s, SrsRequest* r, SrsBufferCache* c);
|
SrsLiveStream(SrsSource* s, SrsRequest* r, SrsBufferCache* c);
|
||||||
virtual ~SrsLiveStream();
|
virtual ~SrsLiveStream();
|
||||||
|
virtual int update(SrsSource* s, SrsRequest* r);
|
||||||
public:
|
public:
|
||||||
virtual int serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessage* r);
|
virtual int serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessage* r);
|
||||||
private:
|
private:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue