Skip to content

Commit

Permalink
Merge branch 'develop' into feature/overhaul
Browse files Browse the repository at this point in the history
  • Loading branch information
miosakuma authored Sep 21, 2023
2 parents e239371 + a23bbd4 commit c230dad
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 12 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 }}"
Expand Down Expand Up @@ -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
Expand Down
7 changes: 5 additions & 2 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions VERSION
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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" }
Expand Down
5 changes: 3 additions & 2 deletions src/sora_connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,9 @@ void SoraConnection::OnTrack(
rtc::scoped_refptr<webrtc::RtpTransceiverInterface> transceiver) {
if (on_track_) {
// shared_ptr になってないとリークする
auto track = std::make_shared<SoraTrackInterface>(
this, transceiver->receiver()->track());
auto track = std::make_shared<SoraMediaTrack>(
this, transceiver->receiver()->track(),
transceiver->receiver()->stream_ids()[0]);
AddSubscriber(track.get());
on_track_(track);
}
Expand Down
2 changes: 1 addition & 1 deletion src/sora_connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class SoraConnection : public sora::SoraSignalingObserver,
std::function<void(std::string)> on_notify_;
std::function<void(std::string)> on_push_;
std::function<void(std::string, nb::bytes)> on_message_;
std::function<void(std::shared_ptr<SoraTrackInterface>)> on_track_;
std::function<void(std::shared_ptr<SoraMediaTrack>)> on_track_;
std::function<void(std::string)> on_data_channel_;

private:
Expand Down
2 changes: 1 addition & 1 deletion src/sora_factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ SoraFactory::SoraFactory(std::optional<bool> use_hardware_encoder,
[openh264 = openh264](
auto format) -> std::unique_ptr<webrtc::VideoEncoder> {
return webrtc::DynamicH264Encoder::Create(
cricket::VideoCodec(format), *openh264);
cricket::CreateVideoCodec(format), *openh264);
}));
media_dependencies.video_encoder_factory =
absl::make_unique<sora::SoraVideoEncoderFactory>(
Expand Down
3 changes: 3 additions & 0 deletions src/sora_sdk_ext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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_<SoraMediaTrack, SoraTrackInterface>(m, "SoraMediaTrack")
.def_prop_ro("stream_id", &SoraMediaTrack::stream_id);

nb::class_<SoraAudioSource, SoraTrackInterface>(m, "SoraAudioSource")
.def("on_data",
nb::overload_cast<const int16_t*, size_t, double>(
Expand Down
24 changes: 24 additions & 0 deletions src/sora_track_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,28 @@ class SoraTrackInterface : public DisposePublisher, public DisposeSubscriber {
rtc::scoped_refptr<webrtc::MediaStreamTrackInterface> track_;
};

/**
* SoraConnection の on_track で渡されるリモートトラックを格納する SoraTrackInterface です。
*
* webrtc::MediaStreamTrackInterface のメンバーにはない stream_id を on_track で渡すために追加しました。
*/
class SoraMediaTrack : public SoraTrackInterface {
public:
SoraMediaTrack(DisposePublisher* publisher,
rtc::scoped_refptr<webrtc::MediaStreamTrackInterface> 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

0 comments on commit c230dad

Please sign in to comment.