diff --git a/CHANGES.md b/CHANGES.md index 90fb8d5a..3621d8db 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -11,6 +11,15 @@ ## develop +## 2022.7.0 (2022-07-11) + +- [ADD] run.py に --relwithdebinfo フラグを追加 + - @melpon +- [UPDATE] libwebrtc を m103.5060.5.0 に上げる + - @voluntas @melpon +- [FIX] boost::asio::post に strand を渡してなかったのを修正 + - @melpon + ## 2022.6.2 (2022-07-03) - [FIX] DataChannel が有効だと切断時にエラーが起きていたのを修正 diff --git a/VERSION b/VERSION index 4b0c4187..820287aa 100644 --- a/VERSION +++ b/VERSION @@ -1,5 +1,5 @@ SORA_CPP_SDK_VERSION=2022.6.2 -WEBRTC_BUILD_VERSION=m102.5005.7.5 +WEBRTC_BUILD_VERSION=m103.5060.5.0 BOOST_VERSION=1.79.0 CMAKE_VERSION=3.23.1 CUDA_VERSION=10.2.89-1 diff --git a/run.py b/run.py index bc6f1014..7bf00fc7 100644 --- a/run.py +++ b/run.py @@ -1217,6 +1217,7 @@ def main(): parser = argparse.ArgumentParser() parser.add_argument("target", choices=AVAILABLE_TARGETS) parser.add_argument("--debug", action='store_true') + parser.add_argument("--relwithdebinfo", action='store_true') parser.add_argument("--webrtcbuild", action='store_true') parser.add_argument("--webrtcbuild-fetch", action='store_true') parser.add_argument("--webrtcbuild-fetch-force", action='store_true') @@ -1266,7 +1267,11 @@ def main(): install_deps(platform, source_dir, build_dir, install_dir, args.debug, webrtcbuild=args.webrtcbuild, webrtc_config=args) - configuration = 'Debug' if args.debug else 'Release' + configuration = 'Release' + if args.debug: + configuration = 'Debug' + if args.relwithdebinfo: + configuration = 'RelWithDebInfo' sora_build_dir = os.path.join(build_dir, 'sora') mkdir_p(sora_build_dir) diff --git a/src/hwenc_jetson/jetson_video_encoder.cpp b/src/hwenc_jetson/jetson_video_encoder.cpp index ca62cd7d..de150d37 100644 --- a/src/hwenc_jetson/jetson_video_encoder.cpp +++ b/src/hwenc_jetson/jetson_video_encoder.cpp @@ -150,13 +150,14 @@ int32_t JetsonVideoEncoder::InitEncode(const webrtc::VideoCodec* codec_settings, RTC_LOG(LS_INFO) << "interLayerPred: " << codec_settings->VP9().interLayerPred; } else if (codec_settings->codecType == webrtc::kVideoCodecAV1) { - absl::string_view scalability_mode = codec_settings->ScalabilityMode(); - if (scalability_mode.empty()) { + auto scalability_mode = codec_settings->GetScalabilityMode(); + if (!scalability_mode) { RTC_LOG(LS_WARNING) << "Scalability mode is not set, using 'L1T1'."; - scalability_mode = "L1T1"; + scalability_mode = webrtc::ScalabilityMode::kL1T1; } - RTC_LOG(LS_INFO) << "InitEncode scalability_mode:" << scalability_mode; - svc_controller_ = webrtc::CreateScalabilityStructure(scalability_mode); + RTC_LOG(LS_INFO) << "InitEncode scalability_mode:" + << (int)*scalability_mode; + svc_controller_ = webrtc::CreateScalabilityStructure(*scalability_mode); } framerate_ = codec_settings->maxFramerate; diff --git a/src/session_description.cpp b/src/session_description.cpp index 0be99b36..20324b87 100644 --- a/src/session_description.cpp +++ b/src/session_description.cpp @@ -72,7 +72,8 @@ void SessionDescription::SetOffer(webrtc::PeerConnectionInterface* pc, return; } pc->SetRemoteDescription(SetSessionDescriptionThunk::Create( - std::move(on_success), std::move(on_failure)), + std::move(on_success), std::move(on_failure)) + .get(), session_description.release()); } @@ -86,13 +87,14 @@ void SessionDescription::CreateAnswer(webrtc::PeerConnectionInterface* pc, desc->ToString(&sdp); RTC_LOG(LS_INFO) << "Created session description : " << sdp; rpc->SetLocalDescription( - SetSessionDescriptionThunk::Create(nullptr, nullptr), desc); + SetSessionDescriptionThunk::Create(nullptr, nullptr).get(), desc); if (on_success) { on_success(desc); } }; rpc->CreateAnswer(CreateSessionDescriptionThunk::Create( - std::move(with_set_local_desc), std::move(on_failure)), + std::move(with_set_local_desc), std::move(on_failure)) + .get(), webrtc::PeerConnectionInterface::RTCOfferAnswerOptions()); } @@ -113,7 +115,8 @@ void SessionDescription::SetAnswer(webrtc::PeerConnectionInterface* pc, return; } pc->SetRemoteDescription(SetSessionDescriptionThunk::Create( - std::move(on_success), std::move(on_failure)), + std::move(on_success), std::move(on_failure)) + .get(), session_description.release()); } diff --git a/src/sora_signaling.cpp b/src/sora_signaling.cpp index 1c9960d9..d466fa75 100644 --- a/src/sora_signaling.cpp +++ b/src/sora_signaling.cpp @@ -787,7 +787,7 @@ void SoraSignaling::OnRead(boost::system::error_code ec, const std::string sdp = m.at("sdp").as_string().c_str(); SessionDescription::SetOffer( - pc_, sdp, + pc_.get(), sdp, [self = shared_from_this(), m]() { boost::asio::post(*self->config_.io_context, [self, m]() { if (self->state_ != State::Connected) { @@ -861,7 +861,7 @@ void SoraSignaling::OnRead(boost::system::error_code ec, } SessionDescription::CreateAnswer( - self->pc_, + self->pc_.get(), [self](webrtc::SessionDescriptionInterface* desc) { std::string sdp; desc->ToString(&sdp); @@ -889,7 +889,7 @@ void SoraSignaling::OnRead(boost::system::error_code ec, std::string answer_type = type == "update" ? "update" : "re-answer"; const std::string sdp = m.at("sdp").as_string().c_str(); SessionDescription::SetOffer( - pc_, sdp, + pc_.get(), sdp, [self = shared_from_this(), type, answer_type]() { boost::asio::post(*self->config_.io_context, [self, type, answer_type]() { @@ -903,7 +903,7 @@ void SoraSignaling::OnRead(boost::system::error_code ec, } SessionDescription::CreateAnswer( - self->pc_, + self->pc_.get(), [self, answer_type](webrtc::SessionDescriptionInterface* desc) { std::string sdp; desc->ToString(&sdp); @@ -936,15 +936,18 @@ void SoraSignaling::OnRead(boost::system::error_code ec, } else if (type == "ping") { auto it = m.as_object().find("stats"); if (it != m.as_object().end() && it->value().as_bool()) { - pc_->GetStats(RTCStatsCallback::Create( - [self = shared_from_this()]( - const rtc::scoped_refptr& report) { - if (self->state_ != State::Connected) { - return; - } + pc_->GetStats( + RTCStatsCallback::Create( + [self = shared_from_this()]( + const rtc::scoped_refptr& + report) { + if (self->state_ != State::Connected) { + return; + } - self->DoSendPong(report); - })); + self->DoSendPong(report); + }) + .get()); } else { DoSendPong(); } @@ -1287,22 +1290,24 @@ void SoraSignaling::OnIceCandidateError(const std::string& address, void SoraSignaling::OnTrack( rtc::scoped_refptr transceiver) { - boost::asio::post([self = shared_from_this(), transceiver]() { - auto ob = self->config_.observer.lock(); - if (ob != nullptr) { - ob->OnTrack(transceiver); - } - }); + boost::asio::post(*config_.io_context, + [self = shared_from_this(), transceiver]() { + auto ob = self->config_.observer.lock(); + if (ob != nullptr) { + ob->OnTrack(transceiver); + } + }); } void SoraSignaling::OnRemoveTrack( rtc::scoped_refptr receiver) { - boost::asio::post([self = shared_from_this(), receiver]() { - auto ob = self->config_.observer.lock(); - if (ob != nullptr) { - ob->OnRemoveTrack(receiver); - } - }); + boost::asio::post(*config_.io_context, + [self = shared_from_this(), receiver]() { + auto ob = self->config_.observer.lock(); + if (ob != nullptr) { + ob->OnRemoveTrack(receiver); + } + }); } // ----------------------------- @@ -1356,7 +1361,7 @@ void SoraSignaling::OnMessage( if (type == "re-offer") { const std::string sdp = json.at("sdp").as_string().c_str(); SessionDescription::SetOffer( - pc_, sdp, + pc_.get(), sdp, [self = shared_from_this()]() { boost::asio::post(*self->config_.io_context, [self]() { if (self->state_ != State::Connected) { @@ -1369,7 +1374,7 @@ void SoraSignaling::OnMessage( } SessionDescription::CreateAnswer( - self->pc_, + self->pc_.get(), [self](webrtc::SessionDescriptionInterface* desc) { std::string sdp; desc->ToString(&sdp); @@ -1391,14 +1396,17 @@ void SoraSignaling::OnMessage( } if (label == "stats") { - pc_->GetStats(RTCStatsCallback::Create( - [self = shared_from_this()]( - const rtc::scoped_refptr& report) { - if (self->state_ != State::Connected) { - return; - } - self->DoSendPong(report); - })); + pc_->GetStats( + RTCStatsCallback::Create( + [self = shared_from_this()]( + const rtc::scoped_refptr& + report) { + if (self->state_ != State::Connected) { + return; + } + self->DoSendPong(report); + }) + .get()); return; } diff --git a/test/connect_disconnect.cpp b/test/connect_disconnect.cpp index be33dbc8..c671dee6 100644 --- a/test/connect_disconnect.cpp +++ b/test/connect_disconnect.cpp @@ -50,8 +50,10 @@ class SoraClient : public std::enable_shared_from_this, std::string audio_track_id = rtc::CreateRandomString(16); std::string video_track_id = rtc::CreateRandomString(16); audio_track_ = factory()->CreateAudioTrack( - audio_track_id, factory()->CreateAudioSource(cricket::AudioOptions())); - video_track_ = factory()->CreateVideoTrack(video_track_id, video_source_); + audio_track_id, + factory()->CreateAudioSource(cricket::AudioOptions()).get()); + video_track_ = + factory()->CreateVideoTrack(video_track_id, video_source_.get()); ioc_.reset(new boost::asio::io_context(1)); diff --git a/test/hello.cpp b/test/hello.cpp index c2215384..5bd2488c 100644 --- a/test/hello.cpp +++ b/test/hello.cpp @@ -49,8 +49,10 @@ void HelloSora::Run() { std::string audio_track_id = rtc::CreateRandomString(16); std::string video_track_id = rtc::CreateRandomString(16); audio_track_ = factory()->CreateAudioTrack( - audio_track_id, factory()->CreateAudioSource(cricket::AudioOptions())); - video_track_ = factory()->CreateVideoTrack(video_track_id, video_source_); + audio_track_id, + factory()->CreateAudioSource(cricket::AudioOptions()).get()); + video_track_ = + factory()->CreateVideoTrack(video_track_id, video_source_.get()); ioc_.reset(new boost::asio::io_context(1));