|
|
|
@ -50,10 +50,6 @@ using namespace std;
|
|
|
|
|
#include <srs_app_ng_exec.hpp>
|
|
|
|
|
#include <srs_app_dash.hpp>
|
|
|
|
|
#include <srs_protocol_format.hpp>
|
|
|
|
|
#ifdef SRS_RTC
|
|
|
|
|
#include <srs_app_rtc.hpp>
|
|
|
|
|
#include <srs_app_rtc_conn.hpp>
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#define CONST_MAX_JITTER_MS 250
|
|
|
|
|
#define CONST_MAX_JITTER_MS_NEG -250
|
|
|
|
@ -867,9 +863,6 @@ SrsOriginHub::SrsOriginHub()
|
|
|
|
|
dash = new SrsDash();
|
|
|
|
|
dvr = new SrsDvr();
|
|
|
|
|
encoder = new SrsEncoder();
|
|
|
|
|
#ifdef SRS_RTC
|
|
|
|
|
rtc = new SrsRtc();
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef SRS_HDS
|
|
|
|
|
hds = new SrsHds();
|
|
|
|
|
#endif
|
|
|
|
@ -913,12 +906,6 @@ srs_error_t SrsOriginHub::initialize(SrsSource* s, SrsRequest* r)
|
|
|
|
|
if ((err = format->initialize()) != srs_success) {
|
|
|
|
|
return srs_error_wrap(err, "format initialize");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#ifdef SRS_RTC
|
|
|
|
|
if ((err = rtc->initialize(req)) != srs_success) {
|
|
|
|
|
return srs_error_wrap(err, "rtc initialize");
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
if ((err = hls->initialize(this, req)) != srs_success) {
|
|
|
|
|
return srs_error_wrap(err, "hls initialize");
|
|
|
|
@ -1018,15 +1005,6 @@ srs_error_t SrsOriginHub::on_audio(SrsSharedPtrMessage* shared_audio)
|
|
|
|
|
flv_sample_sizes[c->sound_size], flv_sound_types[c->sound_type],
|
|
|
|
|
srs_flv_srates[c->sound_rate]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#ifdef SRS_RTC
|
|
|
|
|
// TODO: FIXME: Support parsing OPUS for RTC.
|
|
|
|
|
if ((err = rtc->on_audio(msg, format)) != srs_success) {
|
|
|
|
|
srs_warn("rtc: ignore audio error %s", srs_error_desc(err).c_str());
|
|
|
|
|
srs_error_reset(err);
|
|
|
|
|
rtc->on_unpublish();
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
if ((err = hls->on_audio(msg, format)) != srs_success) {
|
|
|
|
|
// apply the error strategy for hls.
|
|
|
|
@ -1120,16 +1098,6 @@ srs_error_t SrsOriginHub::on_video(SrsSharedPtrMessage* shared_video, bool is_se
|
|
|
|
|
if (format->vcodec && !format->vcodec->is_avc_codec_ok()) {
|
|
|
|
|
return err;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#ifdef SRS_RTC
|
|
|
|
|
// Parse RTMP message to RTP packets, in FU-A if too large.
|
|
|
|
|
if ((err = rtc->on_video(msg, format)) != srs_success) {
|
|
|
|
|
// TODO: We should support more strategies.
|
|
|
|
|
srs_warn("rtc: ignore video error %s", srs_error_desc(err).c_str());
|
|
|
|
|
srs_error_reset(err);
|
|
|
|
|
rtc->on_unpublish();
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
if ((err = hls->on_video(msg, format)) != srs_success) {
|
|
|
|
|
// TODO: We should support more strategies.
|
|
|
|
@ -1199,12 +1167,6 @@ srs_error_t SrsOriginHub::on_publish()
|
|
|
|
|
return srs_error_wrap(err, "encoder publish");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#ifdef SRS_RTC
|
|
|
|
|
if ((err = rtc->on_publish()) != srs_success) {
|
|
|
|
|
return srs_error_wrap(err, "rtc publish");
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
if ((err = hls->on_publish()) != srs_success) {
|
|
|
|
|
return srs_error_wrap(err, "hls publish");
|
|
|
|
|
}
|
|
|
|
@ -1242,9 +1204,6 @@ void SrsOriginHub::on_unpublish()
|
|
|
|
|
destroy_forwarders();
|
|
|
|
|
|
|
|
|
|
encoder->on_unpublish();
|
|
|
|
|
#ifdef SRS_RTC
|
|
|
|
|
rtc->on_unpublish();
|
|
|
|
|
#endif
|
|
|
|
|
hls->on_unpublish();
|
|
|
|
|
dash->on_unpublish();
|
|
|
|
|
dvr->on_unpublish();
|
|
|
|
@ -1922,10 +1881,6 @@ SrsSource::SrsSource()
|
|
|
|
|
|
|
|
|
|
_srs_config->subscribe(this);
|
|
|
|
|
atc = false;
|
|
|
|
|
|
|
|
|
|
#ifdef SRS_RTC
|
|
|
|
|
rtc_publisher_ = NULL;
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SrsSource::~SrsSource()
|
|
|
|
@ -2703,26 +2658,3 @@ string SrsSource::get_curr_origin()
|
|
|
|
|
return play_edge->get_curr_origin();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#ifdef SRS_RTC
|
|
|
|
|
SrsMetaCache* SrsSource::cached_meta()
|
|
|
|
|
{
|
|
|
|
|
return meta;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SrsRtcPublisher* SrsSource::rtc_publisher()
|
|
|
|
|
{
|
|
|
|
|
return rtc_publisher_;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SrsSource::set_rtc_publisher(SrsRtcPublisher* v)
|
|
|
|
|
{
|
|
|
|
|
rtc_publisher_ = v;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
srs_error_t SrsSource::on_rtc_audio(SrsSharedPtrMessage* audio)
|
|
|
|
|
{
|
|
|
|
|
// TODO: FIXME: Merge with on_audio.
|
|
|
|
|
// TODO: FIXME: Print key information.
|
|
|
|
|
return on_audio_imp(audio);
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|