mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
1. Modify rtc.conf to support Bframe discard.
2. Rename srs_app_rtp.cpp to srs_app_rtc.cpp
This commit is contained in:
parent
68ad006b73
commit
fa700dad64
10 changed files with 129 additions and 69 deletions
|
|
@ -33,7 +33,7 @@ using namespace std;
|
|||
#include <srs_kernel_codec.hpp>
|
||||
#include <srs_kernel_rtp.hpp>
|
||||
#include <srs_app_hls.hpp>
|
||||
#include <srs_app_rtp.hpp>
|
||||
#include <srs_app_rtc.hpp>
|
||||
#include <srs_app_forward.hpp>
|
||||
#include <srs_app_config.hpp>
|
||||
#include <srs_app_encoder.hpp>
|
||||
|
|
@ -875,7 +875,7 @@ SrsOriginHub::SrsOriginHub()
|
|||
dash = new SrsDash();
|
||||
dvr = new SrsDvr();
|
||||
encoder = new SrsEncoder();
|
||||
rtp = new SrsRtp();
|
||||
rtc = new SrsRtc();
|
||||
#ifdef SRS_AUTO_HDS
|
||||
hds = new SrsHds();
|
||||
#endif
|
||||
|
|
@ -920,8 +920,8 @@ srs_error_t SrsOriginHub::initialize(SrsSource* s, SrsRequest* r)
|
|||
return srs_error_wrap(err, "format initialize");
|
||||
}
|
||||
|
||||
if ((err = rtp->initialize(this, req)) != srs_success) {
|
||||
return srs_error_wrap(err, "rtp initialize");
|
||||
if ((err = rtc->initialize(this, req)) != srs_success) {
|
||||
return srs_error_wrap(err, "rtc initialize");
|
||||
}
|
||||
|
||||
if ((err = hls->initialize(this, req)) != srs_success) {
|
||||
|
|
@ -1022,10 +1022,10 @@ srs_error_t SrsOriginHub::on_audio(SrsSharedPtrMessage* shared_audio)
|
|||
srs_flv_srates[c->sound_rate]);
|
||||
}
|
||||
|
||||
if ((err = rtp->on_audio(msg, format)) != srs_success) {
|
||||
srs_warn("rtp: ignore audio error %s", srs_error_desc(err).c_str());
|
||||
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);
|
||||
rtp->on_unpublish();
|
||||
rtc->on_unpublish();
|
||||
}
|
||||
|
||||
if ((err = hls->on_audio(msg, format)) != srs_success) {
|
||||
|
|
@ -1122,11 +1122,11 @@ srs_error_t SrsOriginHub::on_video(SrsSharedPtrMessage* shared_video, bool is_se
|
|||
}
|
||||
|
||||
// Parse RTMP message to RTP packets, in FU-A if too large.
|
||||
if ((err = rtp->on_video(msg, format)) != srs_success) {
|
||||
if ((err = rtc->on_video(msg, format)) != srs_success) {
|
||||
// TODO: We should support more strategies.
|
||||
srs_warn("rtp: ignore video error %s", srs_error_desc(err).c_str());
|
||||
srs_warn("rtc: ignore video error %s", srs_error_desc(err).c_str());
|
||||
srs_error_reset(err);
|
||||
rtp->on_unpublish();
|
||||
rtc->on_unpublish();
|
||||
}
|
||||
|
||||
// TODO: FIXME: Refactor to move to rtp?
|
||||
|
|
@ -1201,8 +1201,8 @@ srs_error_t SrsOriginHub::on_publish()
|
|||
return srs_error_wrap(err, "encoder publish");
|
||||
}
|
||||
|
||||
if ((err = rtp->on_publish()) != srs_success) {
|
||||
return srs_error_wrap(err, "rtp publish");
|
||||
if ((err = rtc->on_publish()) != srs_success) {
|
||||
return srs_error_wrap(err, "rtc publish");
|
||||
}
|
||||
|
||||
if ((err = hls->on_publish()) != srs_success) {
|
||||
|
|
@ -1242,7 +1242,7 @@ void SrsOriginHub::on_unpublish()
|
|||
destroy_forwarders();
|
||||
|
||||
encoder->on_unpublish();
|
||||
rtp->on_unpublish();
|
||||
rtc->on_unpublish();
|
||||
hls->on_unpublish();
|
||||
dash->on_unpublish();
|
||||
dvr->on_unpublish();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue