mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
always enable http and hls
This commit is contained in:
parent
11e8fe5bc0
commit
8e5d4dc73d
7 changed files with 10 additions and 71 deletions
|
@ -4045,11 +4045,9 @@ int SrsConfig::check_config()
|
|||
srs_warn("dvr of vhost %s is disabled by configure", vhost->arg0().c_str());
|
||||
}
|
||||
#endif
|
||||
#ifndef SRS_AUTO_HLS
|
||||
if (get_hls_enabled(vhost->arg0())) {
|
||||
srs_warn("hls of vhost %s is disabled by configure", vhost->arg0().c_str());
|
||||
}
|
||||
#endif
|
||||
#ifndef SRS_AUTO_TRANSCODE
|
||||
if (get_transcode_enabled(get_transcode(vhost->arg0(), ""))) {
|
||||
srs_warn("transcode of vhost %s is disabled by configure", vhost->arg0().c_str());
|
||||
|
|
|
@ -61,11 +61,6 @@ using namespace std;
|
|||
// reset the piece id when deviation overflow this.
|
||||
#define SRS_JUMP_WHEN_PIECE_DEVIATION 20
|
||||
|
||||
/**
|
||||
* * the HLS section, only available when HLS enabled.
|
||||
* */
|
||||
#ifdef SRS_AUTO_HLS
|
||||
|
||||
SrsHlsCacheWriter::SrsHlsCacheWriter(bool write_cache, bool write_file)
|
||||
{
|
||||
should_write_cache = write_cache;
|
||||
|
@ -1408,6 +1403,4 @@ void SrsHls::hls_show_mux_log()
|
|||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
@ -54,11 +54,6 @@ class SrsHlsSegment;
|
|||
class SrsTsCache;
|
||||
class SrsTsContext;
|
||||
|
||||
/**
|
||||
* * the HLS section, only available when HLS enabled.
|
||||
* */
|
||||
#ifdef SRS_AUTO_HLS
|
||||
|
||||
/**
|
||||
* write to file and cache.
|
||||
*/
|
||||
|
@ -420,5 +415,3 @@ private:
|
|||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -544,11 +544,7 @@ int SrsGoApiFeatures::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessage* r)
|
|||
#else
|
||||
features->set("ssl", SrsJsonAny::boolean(false));
|
||||
#endif
|
||||
#ifdef SRS_AUTO_HLS
|
||||
features->set("hls", SrsJsonAny::boolean(true));
|
||||
#else
|
||||
features->set("hls", SrsJsonAny::boolean(false));
|
||||
#endif
|
||||
#ifdef SRS_AUTO_HDS
|
||||
features->set("hds", SrsJsonAny::boolean(true));
|
||||
#else
|
||||
|
|
|
@ -842,9 +842,7 @@ SrsOriginHub::SrsOriginHub(SrsSource* s)
|
|||
req = NULL;
|
||||
is_active = false;
|
||||
|
||||
#ifdef SRS_AUTO_HLS
|
||||
hls = new SrsHls();
|
||||
#endif
|
||||
#ifdef SRS_AUTO_DVR
|
||||
dvr = new SrsDvr();
|
||||
#endif
|
||||
|
@ -873,9 +871,7 @@ SrsOriginHub::~SrsOriginHub()
|
|||
}
|
||||
srs_freep(ng_exec);
|
||||
|
||||
#ifdef SRS_AUTO_HLS
|
||||
srs_freep(hls);
|
||||
#endif
|
||||
#ifdef SRS_AUTO_DVR
|
||||
srs_freep(dvr);
|
||||
#endif
|
||||
|
@ -893,11 +889,9 @@ int SrsOriginHub::initialize(SrsRequest* r)
|
|||
|
||||
req = r;
|
||||
|
||||
#ifdef SRS_AUTO_HLS
|
||||
if ((ret = hls->initialize(this, req)) != ERROR_SUCCESS) {
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef SRS_AUTO_DVR
|
||||
if ((ret = dvr->initialize(this, req)) != ERROR_SUCCESS) {
|
||||
|
@ -910,20 +904,16 @@ int SrsOriginHub::initialize(SrsRequest* r)
|
|||
|
||||
void SrsOriginHub::dispose()
|
||||
{
|
||||
#ifdef SRS_AUTO_HLS
|
||||
hls->dispose();
|
||||
#endif
|
||||
}
|
||||
|
||||
int SrsOriginHub::cycle()
|
||||
{
|
||||
int ret = ERROR_SUCCESS;
|
||||
|
||||
#ifdef SRS_AUTO_HLS
|
||||
if ((ret = hls->cycle()) != ERROR_SUCCESS) {
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -960,7 +950,6 @@ int SrsOriginHub::on_audio(SrsSharedPtrMessage* shared_audio)
|
|||
|
||||
SrsSharedPtrMessage* msg = shared_audio;
|
||||
|
||||
#ifdef SRS_AUTO_HLS
|
||||
if ((ret = hls->on_audio(msg)) != ERROR_SUCCESS) {
|
||||
// apply the error strategy for hls.
|
||||
// @see https://github.com/ossrs/srs/issues/264
|
||||
|
@ -985,7 +974,6 @@ int SrsOriginHub::on_audio(SrsSharedPtrMessage* shared_audio)
|
|||
return ret;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef SRS_AUTO_DVR
|
||||
if ((ret = dvr->on_audio(msg)) != ERROR_SUCCESS) {
|
||||
|
@ -1031,7 +1019,6 @@ int SrsOriginHub::on_video(SrsSharedPtrMessage* shared_video, bool is_sequence_h
|
|||
|
||||
SrsSharedPtrMessage* msg = shared_video;
|
||||
|
||||
#ifdef SRS_AUTO_HLS
|
||||
if ((ret = hls->on_video(msg, is_sequence_header)) != ERROR_SUCCESS) {
|
||||
// apply the error strategy for hls.
|
||||
// @see https://github.com/ossrs/srs/issues/264
|
||||
|
@ -1056,7 +1043,6 @@ int SrsOriginHub::on_video(SrsSharedPtrMessage* shared_video, bool is_sequence_h
|
|||
return ret;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef SRS_AUTO_DVR
|
||||
if ((ret = dvr->on_video(msg)) != ERROR_SUCCESS) {
|
||||
|
@ -1114,12 +1100,10 @@ int SrsOriginHub::on_publish()
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef SRS_AUTO_HLS
|
||||
if ((ret = hls->on_publish(false)) != ERROR_SUCCESS) {
|
||||
srs_error("start hls failed. ret=%d", ret);
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef SRS_AUTO_DVR
|
||||
if ((ret = dvr->on_publish(false)) != ERROR_SUCCESS) {
|
||||
|
@ -1158,9 +1142,7 @@ void SrsOriginHub::on_unpublish()
|
|||
encoder->on_unpublish();
|
||||
#endif
|
||||
|
||||
#ifdef SRS_AUTO_HLS
|
||||
hls->on_unpublish();
|
||||
#endif
|
||||
|
||||
#ifdef SRS_AUTO_DVR
|
||||
dvr->on_unpublish();
|
||||
|
@ -1206,7 +1188,6 @@ int SrsOriginHub::on_hls_start()
|
|||
SrsSharedPtrMessage* cache_sh_video = source->meta->vsh();
|
||||
SrsSharedPtrMessage* cache_sh_audio = source->meta->ash();
|
||||
|
||||
#ifdef SRS_AUTO_HLS
|
||||
// feed the hls the metadata/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.
|
||||
|
@ -1219,7 +1200,6 @@ int SrsOriginHub::on_hls_start()
|
|||
srs_error("hls process audio sequence header message failed. ret=%d", ret);
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -1292,7 +1272,6 @@ int SrsOriginHub::on_reload_vhost_hls(string vhost)
|
|||
|
||||
// TODO: FIXME: maybe should ignore when publish already stopped?
|
||||
|
||||
#ifdef SRS_AUTO_HLS
|
||||
hls->on_unpublish();
|
||||
|
||||
// Don't start forwarders when source is not active.
|
||||
|
@ -1305,7 +1284,6 @@ int SrsOriginHub::on_reload_vhost_hls(string vhost)
|
|||
return ret;
|
||||
}
|
||||
srs_trace("vhost %s hls reload success", vhost.c_str());
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -54,9 +54,7 @@ class SrsMessageArray;
|
|||
class SrsNgExec;
|
||||
class SrsConnection;
|
||||
class SrsMessageHeader;
|
||||
#ifdef SRS_AUTO_HLS
|
||||
class SrsHls;
|
||||
#endif
|
||||
#ifdef SRS_AUTO_DVR
|
||||
class SrsDvr;
|
||||
#endif
|
||||
|
@ -425,9 +423,7 @@ private:
|
|||
bool is_active;
|
||||
private:
|
||||
// hls handler.
|
||||
#ifdef SRS_AUTO_HLS
|
||||
SrsHls* hls;
|
||||
#endif
|
||||
// dvr handler.
|
||||
#ifdef SRS_AUTO_DVR
|
||||
SrsDvr* dvr;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue