From 079965b2afffee875325d2de5507bced0e4ded22 Mon Sep 17 00:00:00 2001 From: melpon Date: Tue, 2 Apr 2024 18:17:09 +0900 Subject: [PATCH 01/14] =?UTF-8?q?libwebrtc=20=E3=82=92=20m122.6261.1.1=20?= =?UTF-8?q?=E3=81=AB=E4=B8=8A=E3=81=92=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGES.md | 4 ++-- VERSION | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 81dd5362..9f7bd0a0 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -22,9 +22,9 @@ - [CHANGE] 別リポジトリに分かれていた Sora C++ SDK のサンプル集を examples/ 以下のディレクトリに統合する - @melpon -- [UPDATE] libwebrtc を `m122.6261.1.0` にあげる +- [UPDATE] libwebrtc を `m122.6261.1.1` にあげる - Ubuntu のビルドを通すために、 __assertion_handler というファイルをコピーする必要があった - - @miosakuma @enm10k + - @miosakuma @enm10k @melpon - [UPDATE] libvpl を v2.10.1 にあげる - @enm10k - [ADD] OpenH264 エンコーダを追加 diff --git a/VERSION b/VERSION index 3a142326..182bd86c 100644 --- a/VERSION +++ b/VERSION @@ -1,5 +1,5 @@ SORA_CPP_SDK_VERSION=2024.6.0 -WEBRTC_BUILD_VERSION=m122.6261.1.0 +WEBRTC_BUILD_VERSION=m122.6261.1.1 BOOST_VERSION=1.84.0 CMAKE_VERSION=3.28.1 CUDA_VERSION=11.8.0-1 From 056cd2214127c843471e2730799cc017cdea799c Mon Sep 17 00:00:00 2001 From: melpon Date: Tue, 2 Apr 2024 20:32:05 +0900 Subject: [PATCH 02/14] =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMakeLists.txt | 3 +++ examples/VERSION | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 01d67cf9..ba049f15 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -332,6 +332,7 @@ elseif (SORA_TARGET_OS STREQUAL "macos") PUBLIC WEBRTC_POSIX WEBRTC_MAC + RTC_ENABLE_H265 ) target_link_libraries(sora @@ -376,6 +377,7 @@ elseif (SORA_TARGET_OS STREQUAL "ios") WEBRTC_MAC WEBRTC_IOS OPENSSL_IS_BORINGSSL + RTC_ENABLE_H265 ) elseif (SORA_TARGET_OS STREQUAL "android") @@ -396,6 +398,7 @@ elseif (SORA_TARGET_OS STREQUAL "android") WEBRTC_POSIX WEBRTC_LINUX WEBRTC_ANDROID + RTC_ENABLE_H265 _LIBCPP_ABI_NAMESPACE=Cr _LIBCPP_ABI_VERSION=2 _LIBCPP_DISABLE_AVAILABILITY diff --git a/examples/VERSION b/examples/VERSION index 160602cb..11ba44ae 100644 --- a/examples/VERSION +++ b/examples/VERSION @@ -1,5 +1,5 @@ SORA_CPP_SDK_VERSION=2024.6.0 -WEBRTC_BUILD_VERSION=m122.6261.1.0 +WEBRTC_BUILD_VERSION=m122.6261.1.1 BOOST_VERSION=1.84.0 CMAKE_VERSION=3.28.1 SDL2_VERSION=2.30.0 From a9057f5e721e7371b1b9fe49b56c851a6685f9e3 Mon Sep 17 00:00:00 2001 From: melpon Date: Thu, 18 Apr 2024 12:08:06 +0900 Subject: [PATCH 03/14] =?UTF-8?q?sumomo=20=E3=81=AB=20--simulcast-multicod?= =?UTF-8?q?ec=20=E3=82=AA=E3=83=97=E3=82=B7=E3=83=A7=E3=83=B3=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGES.md | 3 +++ examples/sumomo/src/sumomo.cpp | 4 ++++ include/sora/sora_signaling.h | 1 + src/sora_signaling.cpp | 4 ++++ 4 files changed, 12 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 9f7bd0a0..a2a56e03 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -11,6 +11,9 @@ ## develop +- [ADD] sumomo に --simulcast-multicodec オプションを追加 + - @melpon + ## 2024.6.0 (2024-04-01) - [CHANGE] `VplVideoDecoderImpl` の `ImplementationName` を `oneVPL` から `libvpl` に変更する diff --git a/examples/sumomo/src/sumomo.cpp b/examples/sumomo/src/sumomo.cpp index 6f519e7d..239c9cd8 100644 --- a/examples/sumomo/src/sumomo.cpp +++ b/examples/sumomo/src/sumomo.cpp @@ -37,6 +37,7 @@ struct MomoSampleConfig { boost::optional spotlight; int spotlight_number = 0; boost::optional simulcast; + boost::optional simulcast_multicodec; boost::optional data_channel_signaling; boost::optional ignore_disconnect_websocket; @@ -142,6 +143,7 @@ class MomoSample : public std::enable_shared_from_this, config.spotlight = config_.spotlight; config.spotlight_number = config_.spotlight_number; config.simulcast = config_.simulcast; + config.simulcast_multicodec = config_.simulcast_multicodec; config.data_channel_signaling = config_.data_channel_signaling; config.ignore_disconnect_websocket = config_.ignore_disconnect_websocket; config.proxy_agent = "Momo Sample for Sora C++ SDK"; @@ -375,6 +377,8 @@ int main(int argc, char* argv[]) { ->check(CLI::Range(0, 8)); add_optional_bool(app, "--simulcast", config.simulcast, "Use simulcast (default: none)"); + add_optional_bool(app, "--simulcast-multicodec", config.simulcast_multicodec, + "Use simulcast multi-codec (default: none)"); add_optional_bool(app, "--data-channel-signaling", config.data_channel_signaling, "Use DataChannel for Sora signaling (default: none)"); diff --git a/include/sora/sora_signaling.h b/include/sora/sora_signaling.h index 89383e00..f2727b6b 100644 --- a/include/sora/sora_signaling.h +++ b/include/sora/sora_signaling.h @@ -89,6 +89,7 @@ struct SoraSignalingConfig { std::string spotlight_focus_rid; std::string spotlight_unfocus_rid; boost::optional simulcast; + boost::optional simulcast_multicodec; std::string simulcast_rid; boost::optional data_channel_signaling; int data_channel_signaling_timeout = 180; diff --git a/src/sora_signaling.cpp b/src/sora_signaling.cpp index eb1e2daa..78ecb88c 100644 --- a/src/sora_signaling.cpp +++ b/src/sora_signaling.cpp @@ -265,6 +265,10 @@ void SoraSignaling::DoSendConnect(bool redirect) { m["simulcast"] = *config_.simulcast; } + if (config_.simulcast_multicodec) { + m["simulcast_multicodec"] = *config_.simulcast_multicodec; + } + if (!config_.simulcast_rid.empty()) { m["simulcast_rid"] = config_.simulcast_rid; } From 6db1671cc09f47ae04e3d35db901e1b9990e671f Mon Sep 17 00:00:00 2001 From: melpon Date: Sat, 20 Apr 2024 20:42:04 +0900 Subject: [PATCH 04/14] =?UTF-8?q?hello=20=E3=82=A2=E3=83=97=E3=83=AA?= =?UTF-8?q?=E3=82=92=20simulcast=5Fencoder=20=E3=81=AB=E5=AF=BE=E5=BF=9C?= =?UTF-8?q?=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/hello.cpp | 4 ++++ test/hello.h | 1 + 2 files changed, 5 insertions(+) diff --git a/test/hello.cpp b/test/hello.cpp index 1e5ebf4e..348065d4 100644 --- a/test/hello.cpp +++ b/test/hello.cpp @@ -70,6 +70,7 @@ void HelloSora::Run() { config.video_bit_rate = config_.video_bit_rate; config.multistream = true; config.simulcast = config_.simulcast; + config.simulcast_multicodec = config_.simulcast_multicodec; conn_ = sora::SoraSignaling::Create(config); boost::asio::executor_work_guard @@ -169,6 +170,9 @@ int main(int argc, char* argv[]) { if (auto it = v.as_object().find("simulcast"); it != v.as_object().end()) { config.simulcast = it->value().as_bool(); } + if (auto it = v.as_object().find("simulcast_multicodec"); it != v.as_object().end()) { + config.simulcast_multicodec = it->value().as_bool(); + } sora::SoraClientContextConfig context_config; context_config.get_android_application_context = GetAndroidApplicationContext; diff --git a/test/hello.h b/test/hello.h index 67b99432..e43a7d9d 100644 --- a/test/hello.h +++ b/test/hello.h @@ -14,6 +14,7 @@ struct HelloSoraConfig { int video_bit_rate = 0; std::string video_codec_type = "H264"; bool simulcast = false; + bool simulcast_multicodec = false; }; class HelloSora : public std::enable_shared_from_this, From 2194a05e958299d05f4221612e73ec396ace0388 Mon Sep 17 00:00:00 2001 From: melpon Date: Thu, 25 Apr 2024 07:28:56 +0900 Subject: [PATCH 05/14] =?UTF-8?q?H264=20=E3=81=AE=E3=82=B5=E3=83=9D?= =?UTF-8?q?=E3=83=BC=E3=83=88=E3=83=95=E3=82=A9=E3=83=BC=E3=83=9E=E3=83=83?= =?UTF-8?q?=E3=83=88=E3=82=92=E5=A2=97=E3=82=84=E3=81=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/default_video_formats.cpp | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/src/default_video_formats.cpp b/src/default_video_formats.cpp index 2421e508..712f2e72 100644 --- a/src/default_video_formats.cpp +++ b/src/default_video_formats.cpp @@ -26,16 +26,26 @@ std::vector GetDefaultVideoFormats( cricket::kAv1CodecName, webrtc::SdpVideoFormat::Parameters(), webrtc::LibaomAv1EncoderSupportedScalabilityModes())); } else if (codec == webrtc::kVideoCodecH264) { - r.push_back(CreateH264Format(webrtc::H264Profile::kProfileBaseline, - webrtc::H264Level::kLevel3_1, "1")); - r.push_back(CreateH264Format(webrtc::H264Profile::kProfileBaseline, - webrtc::H264Level::kLevel3_1, "0")); - r.push_back( - CreateH264Format(webrtc::H264Profile::kProfileConstrainedBaseline, - webrtc::H264Level::kLevel3_1, "1")); - r.push_back( - CreateH264Format(webrtc::H264Profile::kProfileConstrainedBaseline, - webrtc::H264Level::kLevel3_1, "0")); + for (auto profile : { + webrtc::H264Profile::kProfileBaseline, + webrtc::H264Profile::kProfileConstrainedBaseline, + webrtc::H264Profile::kProfileMain, + }) { + for (auto level : { + webrtc::H264Level::kLevel3_1, + webrtc::H264Level::kLevel3_2, + webrtc::H264Level::kLevel4, + webrtc::H264Level::kLevel4_1, + webrtc::H264Level::kLevel4_2, + webrtc::H264Level::kLevel5, + webrtc::H264Level::kLevel5_1, + webrtc::H264Level::kLevel5_2, + }) { + for (auto mode : {0, 1}) { + r.push_back(CreateH264Format(profile, level, std::to_string(mode))); + } + } + } } else if (codec == webrtc::kVideoCodecH265) { r.push_back(webrtc::SdpVideoFormat(cricket::kH265CodecName)); } From 8c5f77dcf1ed0c985cb6cac9b58cd962fbfd22a9 Mon Sep 17 00:00:00 2001 From: melpon Date: Thu, 25 Apr 2024 07:30:31 +0900 Subject: [PATCH 06/14] =?UTF-8?q?webrtc-build=20=E3=81=AE=E3=83=90?= =?UTF-8?q?=E3=83=BC=E3=82=B8=E3=83=A7=E3=83=B3=E3=82=92=E4=B8=8A=E3=81=92?= =?UTF-8?q?=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- VERSION | 2 +- examples/VERSION | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 182bd86c..a8fda112 100644 --- a/VERSION +++ b/VERSION @@ -1,5 +1,5 @@ SORA_CPP_SDK_VERSION=2024.6.0 -WEBRTC_BUILD_VERSION=m122.6261.1.1 +WEBRTC_BUILD_VERSION=m122.6261.1.3 BOOST_VERSION=1.84.0 CMAKE_VERSION=3.28.1 CUDA_VERSION=11.8.0-1 diff --git a/examples/VERSION b/examples/VERSION index 11ba44ae..93ed84f0 100644 --- a/examples/VERSION +++ b/examples/VERSION @@ -1,5 +1,5 @@ SORA_CPP_SDK_VERSION=2024.6.0 -WEBRTC_BUILD_VERSION=m122.6261.1.1 +WEBRTC_BUILD_VERSION=m122.6261.1.3 BOOST_VERSION=1.84.0 CMAKE_VERSION=3.28.1 SDL2_VERSION=2.30.0 From 3f7a4b1985ba6adce5e5624515b24b9469ea56f9 Mon Sep 17 00:00:00 2001 From: melpon Date: Thu, 25 Apr 2024 07:31:02 +0900 Subject: [PATCH 07/14] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/.testparam.example.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/.testparam.example.json b/test/.testparam.example.json index f24a9f96..f78da896 100644 --- a/test/.testparam.example.json +++ b/test/.testparam.example.json @@ -23,7 +23,7 @@ "capture_width": 1024, "capture_height": 768, "video_bit_rate": 0, - "video_codec_type": "H264", + "video_codec_type": null, "simulcast": false, "use_hardware_encoder": true, "openh264": null, From eb9d8d79deab306a2b14cc7d43a631804c88ab11 Mon Sep 17 00:00:00 2001 From: melpon Date: Thu, 25 Apr 2024 07:32:48 +0900 Subject: [PATCH 08/14] =?UTF-8?q?log=5Flevel=20=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/.testparam.example.json | 1 + test/hello.cpp | 3 +++ 2 files changed, 4 insertions(+) diff --git a/test/.testparam.example.json b/test/.testparam.example.json index f78da896..381712e9 100644 --- a/test/.testparam.example.json +++ b/test/.testparam.example.json @@ -27,6 +27,7 @@ "simulcast": false, "use_hardware_encoder": true, "openh264": null, + "log_level": 2, }, "signaling_urls": ["必須"], diff --git a/test/hello.cpp b/test/hello.cpp index 348065d4..411304c8 100644 --- a/test/hello.cpp +++ b/test/hello.cpp @@ -173,6 +173,9 @@ int main(int argc, char* argv[]) { if (auto it = v.as_object().find("simulcast_multicodec"); it != v.as_object().end()) { config.simulcast_multicodec = it->value().as_bool(); } + if (auto it = v.as_object().find("log_level"); it != v.as_object().end()) { + rtc::LogMessage::LogToDebug((rtc::LoggingSeverity)boost::json::value_to(it->value())); + } sora::SoraClientContextConfig context_config; context_config.get_android_application_context = GetAndroidApplicationContext; From b4421be78bd8fb56a96a1bc8c0777f2ba73a9fb8 Mon Sep 17 00:00:00 2001 From: melpon Date: Thu, 25 Apr 2024 07:46:10 +0900 Subject: [PATCH 09/14] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/.testparam.example.json | 1 + 1 file changed, 1 insertion(+) diff --git a/test/.testparam.example.json b/test/.testparam.example.json index 381712e9..45a34bfb 100644 --- a/test/.testparam.example.json +++ b/test/.testparam.example.json @@ -25,6 +25,7 @@ "video_bit_rate": 0, "video_codec_type": null, "simulcast": false, + "simulcast_multicodec": false, "use_hardware_encoder": true, "openh264": null, "log_level": 2, From 01758177456ccd5549b239ef0d9df13937630c39 Mon Sep 17 00:00:00 2001 From: melpon Date: Wed, 1 May 2024 11:13:30 +0900 Subject: [PATCH 10/14] =?UTF-8?q?=E3=83=AC=E3=83=99=E3=83=AB=E3=81=AF?= =?UTF-8?q?=EF=BC=91=E5=80=8B=E3=81=A7=E3=82=82=E8=89=AF=E3=81=95=E3=81=9D?= =?UTF-8?q?=E3=81=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/default_video_formats.cpp | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/default_video_formats.cpp b/src/default_video_formats.cpp index 712f2e72..42478015 100644 --- a/src/default_video_formats.cpp +++ b/src/default_video_formats.cpp @@ -31,16 +31,7 @@ std::vector GetDefaultVideoFormats( webrtc::H264Profile::kProfileConstrainedBaseline, webrtc::H264Profile::kProfileMain, }) { - for (auto level : { - webrtc::H264Level::kLevel3_1, - webrtc::H264Level::kLevel3_2, - webrtc::H264Level::kLevel4, - webrtc::H264Level::kLevel4_1, - webrtc::H264Level::kLevel4_2, - webrtc::H264Level::kLevel5, - webrtc::H264Level::kLevel5_1, - webrtc::H264Level::kLevel5_2, - }) { + for (auto level : {webrtc::H264Level::kLevel3_1}) { for (auto mode : {0, 1}) { r.push_back(CreateH264Format(profile, level, std::to_string(mode))); } From 28a15ef0bce40cc8f47c1e4384413c37bdb1adac Mon Sep 17 00:00:00 2001 From: melpon Date: Thu, 11 Jul 2024 21:42:33 +0900 Subject: [PATCH 11/14] =?UTF-8?q?libwebrtc=20=E3=82=92=20m126.6478.1.1=20?= =?UTF-8?q?=E3=81=AB=E4=B8=8A=E3=81=92=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- VERSION | 2 +- examples/VERSION | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 46cfe9b4..233bd816 100644 --- a/VERSION +++ b/VERSION @@ -1,5 +1,5 @@ SORA_CPP_SDK_VERSION=2024.7.0-canary.5 -WEBRTC_BUILD_VERSION=m125.6422.2.5 +WEBRTC_BUILD_VERSION=m126.6478.1.1 BOOST_VERSION=1.85.0 CMAKE_VERSION=3.29.6 CUDA_VERSION=11.8.0-1 diff --git a/examples/VERSION b/examples/VERSION index 88cc5161..1df418c2 100644 --- a/examples/VERSION +++ b/examples/VERSION @@ -1,5 +1,5 @@ SORA_CPP_SDK_VERSION=2024.7.0-canary.4 -WEBRTC_BUILD_VERSION=m125.6422.2.5 +WEBRTC_BUILD_VERSION=m126.6478.1.1 BOOST_VERSION=1.85.0 CMAKE_VERSION=3.28.1 SDL2_VERSION=2.30.3 From 129a28cab82aaca353a0b05c189361bac42ef695 Mon Sep 17 00:00:00 2001 From: melpon Date: Mon, 5 Aug 2024 19:28:38 +0900 Subject: [PATCH 12/14] =?UTF-8?q?libwebrtc=20=E3=81=AE=E3=83=90=E3=83=BC?= =?UTF-8?q?=E3=82=B8=E3=83=A7=E3=83=B3=E3=82=92=E5=A4=89=E3=81=88=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 233bd816..78bdd4b6 100644 --- a/VERSION +++ b/VERSION @@ -1,5 +1,5 @@ SORA_CPP_SDK_VERSION=2024.7.0-canary.5 -WEBRTC_BUILD_VERSION=m126.6478.1.1 +WEBRTC_BUILD_VERSION=m126.6478.1.0-simulcast-multi-codec.0 BOOST_VERSION=1.85.0 CMAKE_VERSION=3.29.6 CUDA_VERSION=11.8.0-1 From 3bf2e9e141d19527f55264e99a50aaa97663901a Mon Sep 17 00:00:00 2001 From: melpon Date: Mon, 9 Sep 2024 18:46:55 +0900 Subject: [PATCH 13/14] =?UTF-8?q?m129=20=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hwenc_nvcodec/nvcodec_video_encoder.cpp | 2 +- src/hwenc_vpl/vpl_video_encoder.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hwenc_nvcodec/nvcodec_video_encoder.cpp b/src/hwenc_nvcodec/nvcodec_video_encoder.cpp index 3ac6a6ad..1da4c834 100644 --- a/src/hwenc_nvcodec/nvcodec_video_encoder.cpp +++ b/src/hwenc_nvcodec/nvcodec_video_encoder.cpp @@ -351,7 +351,7 @@ int32_t NvCodecVideoEncoderImpl::Encode( ? webrtc::VideoContentType::SCREENSHARE : webrtc::VideoContentType::UNSPECIFIED; encoded_image_.timing_.flags = webrtc::VideoSendTiming::kInvalid; - encoded_image_.SetRtpTimestamp(frame.timestamp()); + encoded_image_.SetRtpTimestamp(frame.rtp_timestamp()); encoded_image_.ntp_time_ms_ = frame.ntp_time_ms(); encoded_image_.capture_time_ms_ = frame.render_time_ms(); encoded_image_.rotation_ = frame.rotation(); diff --git a/src/hwenc_vpl/vpl_video_encoder.cpp b/src/hwenc_vpl/vpl_video_encoder.cpp index 8136146b..53d2519c 100644 --- a/src/hwenc_vpl/vpl_video_encoder.cpp +++ b/src/hwenc_vpl/vpl_video_encoder.cpp @@ -519,7 +519,7 @@ int32_t VplVideoEncoderImpl::Encode( ? webrtc::VideoContentType::SCREENSHARE : webrtc::VideoContentType::UNSPECIFIED; encoded_image_.timing_.flags = webrtc::VideoSendTiming::kInvalid; - encoded_image_.SetRtpTimestamp(frame.timestamp()); + encoded_image_.SetRtpTimestamp(frame.rtp_timestamp()); encoded_image_.ntp_time_ms_ = frame.ntp_time_ms(); encoded_image_.capture_time_ms_ = frame.render_time_ms(); encoded_image_.rotation_ = frame.rotation(); From 4d99f9117f23ab74372bb0f86d97287d1442769c Mon Sep 17 00:00:00 2001 From: melpon Date: Thu, 14 Nov 2024 16:06:54 +0900 Subject: [PATCH 14/14] WIP --- .vscode/launch.json | 13 +++++++++++++ .vscode/settings.json | 14 +++++++++++++- src/sora_signaling.cpp | 38 ++++++++++++++++++++++++++++++++++++-- 3 files changed, 62 insertions(+), 3 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index dbdb5040..74157fbd 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -52,6 +52,19 @@ "externalConsole": false, "MIMode": "lldb" }, + { + "name": "Ubuntu 24.04 デバッグビルドのデバッグ", + "type": "lldb-dap", + "request": "launch", + "program": "${workspaceFolder}/_build/ubuntu-24.04_x86_64/debug/test/hello", + "args": ["${workspaceFolder}/test/.testparam.json"], + "cwd": "${fileDirname}", + "sourceMap": [["../../../../_source/ubuntu-24.04_x86_64/webrtc/src/", "/home/melpon/dev/webrtc-build-simulcast-multicodec/_source/ubuntu-24.04_x86_64/webrtc/src/"]], + "initCommands": [ + "settings append target.debug-file-search-paths /home/melpon/dev/webrtc-build-simulcast-multicodec/_build/ubuntu-24.04_x86_64/debug/webrtc/" + ], + "runInTerminal": true, + }, ] } \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index 993e94f2..e8884a86 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -20,6 +20,7 @@ "allowTrailingCommas": true, } }], + "lldb-dap.executable-path": "/usr/bin/lldb-dap-18", "files.associations": { "*.cs": "csharp", "CMakeLists.txt": "cmake", @@ -145,6 +146,17 @@ "__threading_support": "cpp", "__verbose_abort": "cpp", "string_view": "cpp", - "*.tcc": "cpp" + "*.tcc": "cpp", + "__assertion_handler": "cpp", + "cuchar": "cpp", + "propagate_const": "cpp", + "print": "cpp", + "expected": "cpp", + "netfwd": "cpp", + "rope": "cpp", + "slist": "cpp", + "spanstream": "cpp", + "stacktrace": "cpp", + "stdfloat": "cpp" } } diff --git a/src/sora_signaling.cpp b/src/sora_signaling.cpp index 10452b5d..5c850316 100644 --- a/src/sora_signaling.cpp +++ b/src/sora_signaling.cpp @@ -7,6 +7,10 @@ #include #include +// Boost +#include +#include + #include "sora/data_channel.h" #include "sora/rtc_ssl_verifier.h" #include "sora/rtc_stats.h" @@ -394,7 +398,8 @@ void SoraSignaling::DoSendConnect(bool redirect) { m["data_channels"] = ar; } - auto forwarding_filter_to_json = [](const SoraSignalingConfig::ForwardingFilter& f) -> boost::json::value { + auto forwarding_filter_to_json = + [](const SoraSignalingConfig::ForwardingFilter& f) -> boost::json::value { boost::json::object obj; if (f.name) { obj["name"] = *f.name; @@ -430,7 +435,8 @@ void SoraSignaling::DoSendConnect(bool redirect) { }; if (config_.forwarding_filter) { - m["forwarding_filter"] = forwarding_filter_to_json(*config_.forwarding_filter); + m["forwarding_filter"] = + forwarding_filter_to_json(*config_.forwarding_filter); } if (config_.forwarding_filters) { @@ -934,6 +940,7 @@ void SoraSignaling::OnRead(boost::system::error_code ec, SoraSignalingDirection::RECEIVED, text); const std::string sdp = m.at("sdp").as_string().c_str(); + RTC_LOG(LS_ERROR) << "received sdp: " << sdp; std::string video_mid; std::string audio_mid; @@ -1054,6 +1061,32 @@ void SoraSignaling::OnRead(boost::system::error_code ec, params.scalability_mode = p["scalabilityMode"].as_string().c_str(); } + if (p.count("codec") != 0) { + const auto& c = p["codec"].as_object(); + // video/VP8 のような形式で、video は確定なので後ろのコーデック部分だけ見る + std::string mime_type = c.at("mimeType").as_string().c_str(); + auto& codec = params.codec.emplace(); + codec.kind = cricket::MEDIA_TYPE_VIDEO; + codec.name = mime_type.substr(mime_type.find('/') + 1); + if (c.count("clockRate") != 0) { + codec.clock_rate = c.at("clockRate").to_number(); + } + if (c.count("sdpFmtpLine") != 0) { + // sdpFmtpLine は + // level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e02a + // のような文字列になってるはず + std::vector xs; + boost::algorithm::split( + xs, c.at("sdpFmtpLine").as_string().c_str(), + boost::algorithm::is_any_of(";")); + for (const auto& x : xs) { + std::vector kv; + boost::algorithm::split(kv, x, + boost::algorithm::is_any_of("=")); + codec.parameters[kv[0]] = kv[1]; + } + } + } encoding_parameters.push_back(params); } @@ -1073,6 +1106,7 @@ void SoraSignaling::OnRead(boost::system::error_code ec, } boost::json::value m = {{"type", "answer"}, {"sdp", sdp}}; + RTC_LOG(LS_ERROR) << sdp; self->WsWriteSignaling( boost::json::serialize(m), [self](boost::system::error_code, size_t) {});