mirror of
https://github.com/ossrs/srs.git
synced 2025-02-14 20:31:56 +00:00
SRT: Support SRT to RTMP to WebRTC. v5.0.107 (#3296)
* SRT: Support SRT to RTMP to WebRTC. v5.0.107 Co-authored-by: winlin <winlin@vip.126.com>
This commit is contained in:
parent
539f5975d6
commit
bbe333d3ca
3 changed files with 36 additions and 1 deletions
|
@ -8,6 +8,7 @@ The changelog for SRS.
|
|||
|
||||
## SRS 5.0 Changelog
|
||||
|
||||
* v5.0, 2022-12-09, Merge [#3296](https://github.com/ossrs/srs/pull/3296): SRT: Support SRT to RTMP to WebRTC. v5.0.107
|
||||
* v5.0, 2022-12-08, Merge [#3295](https://github.com/ossrs/srs/pull/3295): API: Parse fragment of URI. v5.0.106
|
||||
* v5.0, 2022-12-04, Cygwin: Enable gb28181 for Windows. v5.0.105
|
||||
* v5.0, 2022-12-04, Asan: Set asan loging callback. v5.0.104
|
||||
|
|
|
@ -19,6 +19,7 @@ using namespace std;
|
|||
#include <srs_app_pithy_print.hpp>
|
||||
#include <srs_app_srt_server.hpp>
|
||||
#include <srs_app_srt_source.hpp>
|
||||
#include <srs_app_rtc_source.hpp>
|
||||
#include <srs_app_statistic.hpp>
|
||||
#include <srs_protocol_rtmp_stack.hpp>
|
||||
#include <srs_kernel_utility.hpp>
|
||||
|
@ -374,6 +375,39 @@ srs_error_t SrsMpegtsSrtConn::acquire_publish()
|
|||
live_source->set_cache(enabled_cache);
|
||||
live_source->set_gop_cache_max_frames(gcmf);
|
||||
|
||||
// srt->rtmp->rtc
|
||||
// TODO: FIXME: the code below is repeat in srs_app_rtmp_conn.cpp, refactor it later, use function instead.
|
||||
|
||||
// Check whether RTC stream is busy.
|
||||
#ifdef SRS_RTC
|
||||
SrsRtcSource *rtc = NULL;
|
||||
bool rtc_server_enabled = _srs_config->get_rtc_server_enabled();
|
||||
bool rtc_enabled = _srs_config->get_rtc_enabled(req_->vhost);
|
||||
bool edge = _srs_config->get_vhost_is_edge(req_->vhost);
|
||||
if (rtc_server_enabled && rtc_enabled && ! edge) {
|
||||
if ((err = _srs_rtc_sources->fetch_or_create(req_, &rtc)) != srs_success) {
|
||||
return srs_error_wrap(err, "create source");
|
||||
}
|
||||
|
||||
if (!rtc->can_publish()) {
|
||||
return srs_error_new(ERROR_SYSTEM_STREAM_BUSY, "rtc stream %s busy", req_->get_stream_url().c_str());
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// Bridge to RTC streaming.
|
||||
#if defined(SRS_RTC) && defined(SRS_FFMPEG_FIT)
|
||||
if (rtc) {
|
||||
SrsRtcFromRtmpBridge *bridge = new SrsRtcFromRtmpBridge(rtc);
|
||||
if ((err = bridge->initialize(req_)) != srs_success) {
|
||||
srs_freep(bridge);
|
||||
return srs_error_wrap(err, "bridge init");
|
||||
}
|
||||
|
||||
live_source->set_bridge(bridge);
|
||||
}
|
||||
#endif
|
||||
|
||||
SrsRtmpFromSrtBridge *bridger = new SrsRtmpFromSrtBridge(live_source);
|
||||
if ((err = bridger->initialize(req_)) != srs_success) {
|
||||
srs_freep(bridger);
|
||||
|
|
|
@ -9,6 +9,6 @@
|
|||
|
||||
#define VERSION_MAJOR 5
|
||||
#define VERSION_MINOR 0
|
||||
#define VERSION_REVISION 106
|
||||
#define VERSION_REVISION 107
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue