Skip to content

Commit

Permalink
for #742, refine source, meta and origin hub. 3.0.16
Browse files Browse the repository at this point in the history
  • Loading branch information
winlinvip committed Jan 19, 2017
1 parent 6209945 commit 4cff49a
Show file tree
Hide file tree
Showing 10 changed files with 1,156 additions and 884 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ Please select your language:

### V3 changes

* v3.0, 2017-01-19, for [#742][bug #742] refine source, meta and origin hub. 3.0.16
* v3.0, 2017-01-17, for [#742][bug #742] refine source, timeout, live cycle. 3.0.15
* v3.0, 2017-01-11, fix [#735][bug #735] config transform refer_publish invalid. 3.0.14
* v3.0, 2017-01-06, for [#730][bug #730] support config in/out ack size. 3.0.13
Expand Down Expand Up @@ -872,13 +873,13 @@ Remark:
| Input | SRS(Simple RTMP Server) | Output |
+----------------------+-------------------------+----------------+
| Encoder(1) | +-> RTMP/HDS --------+-> Flash player |
| (FMLE,FFMPEG, -rtmp-+->-+-> HLS/HTTP ---------+-> M3u8 player |
| (FMLE,FFMPEG, -rtmp-+->-+-> HLS/HTTP ---------+-> M3U8 player |
| Flash,XSPLIT, | +-> FLV/MP3/Aac/Ts ---+-> HTTP player |
| ......) | +-> Fowarder ---------+-> RTMP server |
| | +-> Transcoder -------+-> RTMP server |
| | +-> EXEC(5) ----------+-> External app |
| | +-> DVR --------------+-> Flv file |
| | +-> BandwidthTest ----+-> flash |
| | +-> DVR --------------+-> FLV file |
| | +-> BandwidthTest ----+-> Flash |
+----------------------+ | |
| MediaSource(2) | | |
| (RTSP,FILE, | | |
Expand Down
8 changes: 4 additions & 4 deletions trunk/src/app/srs_app_dvr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -970,7 +970,7 @@ int SrsDvrSegmentPlan::update_duration(SrsSharedPtrMessage* msg)

SrsDvr::SrsDvr()
{
source = NULL;
hub = NULL;
plan = NULL;
req = NULL;
actived = false;
Expand All @@ -985,12 +985,12 @@ SrsDvr::~SrsDvr()
srs_freep(plan);
}

int SrsDvr::initialize(SrsSource* s, SrsRequest* r)
int SrsDvr::initialize(SrsOriginHub* h, SrsRequest* r)
{
int ret = ERROR_SUCCESS;

req = r;
source = s;
hub = h;

SrsConfDirective* conf = _srs_config->get_dvr_apply(r->vhost);
actived = srs_config_apply_filter(conf, r);
Expand Down Expand Up @@ -1018,7 +1018,7 @@ int SrsDvr::on_publish(bool fetch_sequence_header)
return ret;
}

if (fetch_sequence_header && (ret = source->on_dvr_request_sh()) != ERROR_SUCCESS) {
if (fetch_sequence_header && (ret = hub->on_dvr_request_sh()) != ERROR_SUCCESS) {
return ret;
}

Expand Down
5 changes: 3 additions & 2 deletions trunk/src/app/srs_app_dvr.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#ifdef SRS_AUTO_DVR

class SrsSource;
class SrsOriginHub;
class SrsRequest;
class SrsBuffer;
class SrsRtmpJitter;
Expand Down Expand Up @@ -300,7 +301,7 @@ class SrsDvrSegmentPlan : public SrsDvrPlan
class SrsDvr : public ISrsReloadHandler
{
private:
SrsSource* source;
SrsOriginHub* hub;
SrsDvrPlan* plan;
SrsRequest* req;
private:
Expand All @@ -317,7 +318,7 @@ class SrsDvr : public ISrsReloadHandler
* when system initialize(encoder publish at first time, or reload),
* initialize the dvr will reinitialize the plan, the whole dvr framework.
*/
virtual int initialize(SrsSource* s, SrsRequest* r);
virtual int initialize(SrsOriginHub* h, SrsRequest* r);
/**
* publish stream event,
* when encoder start to publish RTMP stream.
Expand Down
6 changes: 3 additions & 3 deletions trunk/src/app/srs_app_forward.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ using namespace std;
// when error, forwarder sleep for a while and retry.
#define SRS_FORWARDER_CIMS (3000)

SrsForwarder::SrsForwarder(SrsSource* s)
SrsForwarder::SrsForwarder(SrsOriginHub* h)
{
source = s;
hub = h;

req = NULL;
sh_video = sh_audio = NULL;
Expand Down Expand Up @@ -250,7 +250,7 @@ int SrsForwarder::cycle()
return ret;
}

if ((ret = source->on_forwarder_start(this)) != ERROR_SUCCESS) {
if ((ret = hub->on_forwarder_start(this)) != ERROR_SUCCESS) {
srs_error("callback the source to feed the sequence header failed. ret=%d", ret);
return ret;
}
Expand Down
5 changes: 3 additions & 2 deletions trunk/src/app/srs_app_forward.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class SrsRtmpJitter;
class SrsRtmpClient;
class SrsRequest;
class SrsSource;
class SrsOriginHub;
class SrsKbps;
class SrsSimpleRtmpClient;

Expand All @@ -58,7 +59,7 @@ class SrsForwarder : public ISrsReusableThread2Handler
private:
SrsReusableThread2* pthread;
private:
SrsSource* source;
SrsOriginHub* hub;
SrsSimpleRtmpClient* sdk;
SrsRtmpJitter* jitter;
SrsMessageQueue* queue;
Expand All @@ -69,7 +70,7 @@ class SrsForwarder : public ISrsReusableThread2Handler
SrsSharedPtrMessage* sh_audio;
SrsSharedPtrMessage* sh_video;
public:
SrsForwarder(SrsSource* _source);
SrsForwarder(SrsOriginHub* h);
virtual ~SrsForwarder();
public:
virtual int initialize(SrsRequest* r, std::string ep);
Expand Down
8 changes: 4 additions & 4 deletions trunk/src/app/srs_app_hls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1125,7 +1125,7 @@ int SrsHlsCache::reap_segment(string log_desc, SrsHlsMuxer* muxer, int64_t segme
SrsHls::SrsHls()
{
req = NULL;
source = NULL;
hub = NULL;

hls_enabled = false;
hls_can_dispose = false;
Expand Down Expand Up @@ -1197,11 +1197,11 @@ int SrsHls::cycle()
return ret;
}

int SrsHls::initialize(SrsSource* s, SrsRequest* r)
int SrsHls::initialize(SrsOriginHub* h, SrsRequest* r)
{
int ret = ERROR_SUCCESS;

source = s;
hub = h;
req = r;

if ((ret = muxer->initialize()) != ERROR_SUCCESS) {
Expand Down Expand Up @@ -1244,7 +1244,7 @@ int SrsHls::on_publish(bool fetch_sequence_header)
// notice the source to get the cached sequence header.
// when reload to start hls, hls will never get the sequence header in stream,
// use the SrsSource.on_hls_start to push the sequence header to HLS.
if ((ret = source->on_hls_start()) != ERROR_SUCCESS) {
if ((ret = hub->on_hls_start()) != ERROR_SUCCESS) {
srs_error("callback source hls start failed. ret=%d", ret);
return ret;
}
Expand Down
5 changes: 3 additions & 2 deletions trunk/src/app/srs_app_hls.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class SrsAvcAacCodec;
class SrsRequest;
class SrsPithyPrint;
class SrsSource;
class SrsOriginHub;
class SrsFileWriter;
class SrsSimpleStream;
class SrsTsAacJitter;
Expand Down Expand Up @@ -362,7 +363,7 @@ class SrsHls
bool hls_can_dispose;
int64_t last_update_time;
private:
SrsSource* source;
SrsOriginHub* hub;
SrsAvcAacCodec* codec;
SrsCodecSample* sample;
SrsRtmpJitter* jitter;
Expand Down Expand Up @@ -391,7 +392,7 @@ class SrsHls
/**
* initialize the hls by handler and source.
*/
virtual int initialize(SrsSource* s, SrsRequest* r);
virtual int initialize(SrsOriginHub* h, SrsRequest* r);
/**
* publish stream event, continue to write the m3u8,
* for the muxer object not destroyed.
Expand Down
Loading

0 comments on commit 4cff49a

Please sign in to comment.