diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dee76de2..ace858df 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -41,7 +41,7 @@ jobs: runs-on: ${{ matrix.platform.runs_on }} timeout-minutes: 60 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - run: | sudo apt-get update sudo apt-get -y install libva-dev libdrm-dev @@ -113,7 +113,7 @@ jobs: - "3.10" - "3.11" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: "${{ matrix.python_version }}" @@ -190,7 +190,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 60 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: ./.github/actions/download with: {"platform":"ubuntu-22.04_x86_64", "python_version":"3.8"} - uses: ./.github/actions/download diff --git a/CHANGES.md b/CHANGES.md index da4a8004..5c24671e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -13,14 +13,17 @@ - [CHANGE] SoraAudioSource.on_data, SoraVideoSource.on_captured, SoraVAD.analyze の引数名を変更 - @tnoho +- [UPDATE] SoraMediaTrack を追加し、 SoraConnection.on_track の引数を SoraMediaTrack に変更 + - @tnoho - [ADD] 発話区間の検出が可能な SoraVAD の追加 - @tnoho - [ADD] リアルタイム性を重視した AudioStreamSink の追加 - @tnoho - [ADD] AudioStreamSink が返す音声フレームとして pickel が可能な AudioFrame を追加 - @tnoho -- [UPDATE] Sora C++ SDK のバージョンを 2023.10.0 に上げる - - @voluntas +- [UPDATE] Sora C++ SDK のバージョンを 2023.13.1 に上げる + - WebRTC m116 で cricket::Codec は protected になったので cricket::CreateVideoCodec に修正する + - @voluntas @miosakuma ## 2023.3.1 diff --git a/VERSION b/VERSION index 9637ddb2..cb55efe1 100644 --- a/VERSION +++ b/VERSION @@ -1,5 +1,5 @@ -SORA_CPP_SDK_VERSION=2023.10.0 -WEBRTC_BUILD_VERSION=m115.5790.7.0 +SORA_CPP_SDK_VERSION=2023.13.1 +WEBRTC_BUILD_VERSION=m116.5845.6.1 BOOST_VERSION=1.82.0 LYRA_VERSION=1.3.0 CMAKE_VERSION=3.26.4 diff --git a/pyproject.toml b/pyproject.toml index 551a1939..2a7aa012 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "sora_sdk" authors = [{ name = "Shiguredo Inc.", email = "contact+pypi@shiguredo.jp" }] -version = "2023.3.1" +version = "2023.4.0.dev0" description = "WebRTC SFU Sora Python SDK" readme = "README.md" license = { file = "LICENSE" } diff --git a/src/sora_connection.cpp b/src/sora_connection.cpp index eef52d6e..428aae24 100644 --- a/src/sora_connection.cpp +++ b/src/sora_connection.cpp @@ -160,8 +160,9 @@ void SoraConnection::OnTrack( rtc::scoped_refptr transceiver) { if (on_track_) { // shared_ptr になってないとリークする - auto track = std::make_shared( - this, transceiver->receiver()->track()); + auto track = std::make_shared( + this, transceiver->receiver()->track(), + transceiver->receiver()->stream_ids()[0]); AddSubscriber(track.get()); on_track_(track); } diff --git a/src/sora_connection.h b/src/sora_connection.h index 0008789c..d99eb696 100644 --- a/src/sora_connection.h +++ b/src/sora_connection.h @@ -105,7 +105,7 @@ class SoraConnection : public sora::SoraSignalingObserver, std::function on_notify_; std::function on_push_; std::function on_message_; - std::function)> on_track_; + std::function)> on_track_; std::function on_data_channel_; private: diff --git a/src/sora_factory.cpp b/src/sora_factory.cpp index 0a64829c..a9708b08 100644 --- a/src/sora_factory.cpp +++ b/src/sora_factory.cpp @@ -66,7 +66,7 @@ SoraFactory::SoraFactory(std::optional use_hardware_encoder, [openh264 = openh264]( auto format) -> std::unique_ptr { return webrtc::DynamicH264Encoder::Create( - cricket::VideoCodec(format), *openh264); + cricket::CreateVideoCodec(format), *openh264); })); media_dependencies.video_encoder_factory = absl::make_unique( diff --git a/src/sora_sdk_ext.cpp b/src/sora_sdk_ext.cpp index 5b35a9fe..483bcf38 100644 --- a/src/sora_sdk_ext.cpp +++ b/src/sora_sdk_ext.cpp @@ -178,6 +178,9 @@ NB_MODULE(sora_sdk_ext, m) { .def_prop_ro("state", &SoraTrackInterface::state) .def("set_enabled", &SoraTrackInterface::set_enabled, "enable"_a); + nb::class_(m, "SoraMediaTrack") + .def_prop_ro("stream_id", &SoraMediaTrack::stream_id); + nb::class_(m, "SoraAudioSource") .def("on_data", nb::overload_cast( diff --git a/src/sora_track_interface.h b/src/sora_track_interface.h index ec642ceb..5314a1ef 100644 --- a/src/sora_track_interface.h +++ b/src/sora_track_interface.h @@ -63,4 +63,28 @@ class SoraTrackInterface : public DisposePublisher, public DisposeSubscriber { rtc::scoped_refptr track_; }; +/** + * SoraConnection の on_track で渡されるリモートトラックを格納する SoraTrackInterface です。 + * + * webrtc::MediaStreamTrackInterface のメンバーにはない stream_id を on_track で渡すために追加しました。 + */ +class SoraMediaTrack : public SoraTrackInterface { + public: + SoraMediaTrack(DisposePublisher* publisher, + rtc::scoped_refptr track, + std::string stream_id) + : SoraTrackInterface(publisher, track), stream_id_(stream_id) {} + + /** + * この Track の Stream ID を std::string で返します。 + * + * Python で呼び出すための関数です。 + * 本来 Track には複数の Stream ID を紐づけることができるのですが、 + * Sora の使用上 Track には Stream ID が 1 つしか紐づかないため Track のメンバーとしました。 + */ + std::string stream_id() const { return stream_id_; } + + private: + std::string stream_id_; +}; #endif \ No newline at end of file