Skip to content

Commit 8947916

Browse files
committed
Merge branch 'develop' into feature/windows-2025
2 parents 938fd2f + a585350 commit 8947916

File tree

9 files changed

+93
-148
lines changed

9 files changed

+93
-148
lines changed

CHANGES.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111

1212
## develop
1313

14-
- [CHANGE] 対応 Python バージョンの 3.10 のサポートを終了する
14+
- [CHANGE] Python 3.10 のサポートを終了する
1515
- [SPEC 0 — Minimum Supported Dependencies](https://scientific-python.org/specs/spec-0000/) を参考に直近 3 バージョンのサポートに変更する
1616
- @voluntas
17+
- [CHANGE] macOS Sonoma 13 のサポートを終了する
18+
- @voluntas
1719
- [CHANGE] シグナリング接続時の ``"type": "connect"`` 時に ``multistream`` 項目を送らないようにする
1820
- Sora 2022.1.0 以前には接続できなくなる
1921
- @voluntas
20-
- [CHANGE] macOS Sonoma 13 のサポートを終了する
21-
- @voluntas
2222
- [CHANGE] `client_cert``client_key` の指定にはパスではなく中身の文字列を指定するようにする
2323
- C++ SDK 側の仕様変更に追従する
2424
- @voluntas
@@ -30,9 +30,9 @@
3030
- @melpon
3131
- [UPDATE] GitHub Actions の Windows ビルドで Windows 2025 を利用する
3232
- @voluntas
33-
- [ADD] Windows で OpenH264 が利用できるようにする
33+
- [ADD] OpenH264 を Windows x86_64 に対応する
3434
- @melpon
35-
- [ADD] AMD AMF に対応する
35+
- [ADD] AMD AMF を Ubuntu x86_64 と Windows x86_64 に対応する
3636
- @melpon
3737
- [ADD] エンコード時の劣化の優先順位を指定できるようにする
3838
- `Sora.create_connection()` の引数に `degradation_preference` を追加する
@@ -68,9 +68,9 @@
6868
- @tnoho
6969
- [ADD] `Sora.create_connection()` の引数に `audio_opus_params` を追加する
7070
- @melpon
71-
- [ADD] data_channels の要素に `header` を指定可能にする
71+
- [ADD] `data_channels` の要素に `header` を指定可能にする
7272
- @melpon
73-
- [ADD] Encoded Transform に対応する
73+
- [ADD] `WebRTC Encoded Transform` に対応する
7474
- @tnoho
7575
- [ADD] `Sora()` の引数に `video_codec_preference` を追加
7676
- @melpon
@@ -85,9 +85,9 @@
8585
- @voluntas
8686
- [UPDATE] Sora C++ SDK のバージョンを `2025.2.0` に上げる
8787
- WEBRTC_BUILD_VERSION を `m132.6834.5.8` に上げる
88-
- libwebrtc のモジュール分割に追従するため rtc::CreateRandomString のヘッダを追加
89-
- Sora CPP SDK の absl::optional を std::optional に変更した仕様に追従する
90-
- Sora CPP SDK の absl::nullopt を std::nullopt に変更した仕様に追従する
88+
- libwebrtc のモジュール分割に追従するため `rtc::CreateRandomString` のヘッダを追加
89+
- Sora CPP SDK の `absl::optional``std::optional` に変更した仕様に追従する
90+
- Sora CPP SDK の `absl::nullopt``std::nullopt` に変更した仕様に追従する
9191
- CMAKE_VERSION を `3.31.6` に上げる
9292
- BOOST_VERSION を `1.87.0` に上げる
9393
- OPENH264_VERSION を `v2.6.0` に上げる

VERSION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
SORA_CPP_SDK_VERSION=2025.2.0-canary.14
1+
SORA_CPP_SDK_VERSION=2025.2.0-canary.15
22
WEBRTC_BUILD_VERSION=m132.6834.5.8
33
BOOST_VERSION=1.87.0
44
CMAKE_VERSION=3.31.6
5-
OPENH264_VERSION=v2.6.0
5+
OPENH264_VERSION=v2.6.0

pyproject.toml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[project]
22
name = "sora_sdk"
33
authors = [{ name = "Shiguredo Inc.", email = "[email protected]" }]
4-
version = "2025.1.0.dev15"
4+
version = "2025.1.0.dev17"
55
description = "WebRTC SFU Sora Python SDK"
66
readme = "README.md"
77
license = { file = "LICENSE" }
@@ -12,24 +12,24 @@ classifiers = [
1212
"Programming Language :: Python :: 3.12",
1313
"Programming Language :: Python :: 3.13",
1414
]
15-
requires-python = ">= 3.10"
15+
requires-python = ">= 3.11"
1616

1717
[project.urls]
1818
Source = "https://github.com/shiguredo/sora-python-sdk"
1919
Documentation = "https://sora-python-sdk.shiguredo.jp"
2020
Discord = "https://discord.gg/shiguredo"
2121

2222
[build-system]
23-
requires = ["setuptools~=76.0", "wheel~=0.45.1"]
23+
requires = ["setuptools==76.0", "wheel==0.45.1"]
2424
build-backend = "setuptools.build_meta"
2525

2626
[tool.uv]
2727
python-preference = "only-managed"
2828
dev-dependencies = [
29-
"nanobind~=2.5.0",
30-
"setuptools~=76.0",
31-
"build~=1.2.2.post1",
32-
"wheel~=0.45.1",
29+
"nanobind==2.5.0",
30+
"setuptools==76.0",
31+
"build==1.2.2.post1",
32+
"wheel==0.45.1",
3333
"typing-extensions",
3434
"python-dotenv",
3535
"numpy",
@@ -39,10 +39,11 @@ dev-dependencies = [
3939
"mypy",
4040
"pyjwt",
4141
"pytest-repeat",
42+
"psutil",
4243
]
4344

4445
[tool.ruff]
45-
target-version = "py310"
46+
target-version = "py311"
4647
line-length = 100
4748

4849

src/dummy_audio_mixer.cpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#include "dummy_audio_mixer.h"
22

3+
#include <future>
4+
35
struct DummyAudioMixer::SourceStatus {
46
SourceStatus(Source* audio_source) : audio_source(audio_source) {}
57
Source* audio_source = nullptr;
@@ -55,13 +57,23 @@ DummyAudioMixer::DummyAudioMixer(webrtc::TaskQueueFactory* task_queue_factory)
5557
task_queue_ = task_queue_factory_->CreateTaskQueue(
5658
"TestAudioDeviceModuleImpl", webrtc::TaskQueueFactory::Priority::NORMAL);
5759

58-
webrtc::RepeatingTaskHandle::Start(task_queue_.get(), [this]() {
60+
handle_ = webrtc::RepeatingTaskHandle::Start(task_queue_.get(), [this]() {
5961
ProcessAudio();
6062
// オーディオフレームは 10 ms ごとに処理するため 10000 us を指定する
6163
return webrtc::TimeDelta::Micros(10000);
6264
});
6365
}
6466

67+
DummyAudioMixer::~DummyAudioMixer() {
68+
std::promise<void> promise;
69+
std::future<void> future = promise.get_future();
70+
task_queue_->PostTask([&]() {
71+
handle_.Stop();
72+
promise.set_value();
73+
});
74+
future.wait();
75+
}
76+
6577
void DummyAudioMixer::ProcessAudio() {
6678
// 意味はないけど呼ばないと AudioSinkInterface::OnData が発火しない
6779
Mix(0, nullptr);

src/dummy_audio_mixer.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ class DummyAudioMixer : public webrtc::AudioMixer {
3030
struct SourceStatus;
3131
static rtc::scoped_refptr<DummyAudioMixer> Create(
3232
webrtc::TaskQueueFactory* task_queue_factory);
33+
~DummyAudioMixer();
3334

3435
// AudioMixer functions
3536
bool AddSource(Source* audio_source) override;
@@ -46,6 +47,7 @@ class DummyAudioMixer : public webrtc::AudioMixer {
4647
void ProcessAudio();
4748
const webrtc::TaskQueueFactory* task_queue_factory_;
4849
std::unique_ptr<webrtc::TaskQueueBase, webrtc::TaskQueueDeleter> task_queue_;
50+
webrtc::RepeatingTaskHandle handle_;
4951

5052
mutable webrtc::Mutex mutex_;
5153
std::vector<std::unique_ptr<SourceStatus>> audio_source_list_

src/sora_factory.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,10 @@ SoraFactory::SoraFactory(
5151
[openh264](webrtc::PeerConnectionFactoryDependencies& dependencies) {
5252
// 通常の AudioMixer を使うと use_audio_device が false のとき、音声のループは全て止まってしまうので自前の AudioMixer を使う
5353
dependencies.audio_mixer =
54-
DummyAudioMixer::Create(dependencies.task_queue_factory.get());
54+
dependencies.worker_thread->BlockingCall([&]() {
55+
return DummyAudioMixer::Create(
56+
dependencies.task_queue_factory.get());
57+
});
5558
// アンチエコーやゲインコントロール、ノイズサプレッションが必要になる用途は想定していないため nullptr
5659
dependencies.audio_processing = nullptr;
5760
};

tests/client.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -203,17 +203,14 @@ def __init__(
203203

204204
def __enter__(self) -> "SoraClient":
205205
if self._role == SoraRole.RECVONLY:
206-
self.connect()
207-
return self
206+
return self.connect()
208207

209-
self.connect(fake_audio=bool(self._audio), fake_video=bool(self._video))
210-
211-
return self
208+
return self.connect(fake_audio=bool(self._audio), fake_video=bool(self._video))
212209

213210
def __exit__(self, exc_type, exc_value, traceback) -> None:
214211
self.disconnect()
215212

216-
def connect(self, fake_audio=False, fake_video=False) -> None:
213+
def connect(self, fake_audio=False, fake_video=False) -> "SoraClient":
217214
# スレッドは connect 前に起動する
218215
if fake_audio:
219216
self._fake_audio_thread = threading.Thread(target=self._fake_audio_loop, daemon=True)
@@ -229,6 +226,8 @@ def connect(self, fake_audio=False, fake_video=False) -> None:
229226
"Could not connect to Sora."
230227
)
231228

229+
return self
230+
232231
def disconnect(self) -> None:
233232
self._connection.disconnect()
234233

tests/test_intel_vpl.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import os
2+
import platform
23
import sys
34
import time
45
import uuid
@@ -113,6 +114,11 @@ def test_intel_vpl_simulcast(
113114
if not is_codec_supported(video_codec_type, SoraVideoCodecImplementation.INTEL_VPL):
114115
pytest.skip(f"このチップでは {video_codec_type} のエンコードがサポートされていません")
115116

117+
if platform.system() == "Windows" and simulcast_count == 1:
118+
pytest.skip(
119+
f"Windows では {video_codec_type} の simulcast_count が 1 の場合は失敗するので skip する"
120+
)
121+
116122
signaling_urls = setup.get("signaling_urls")
117123
channel_id_prefix = setup.get("channel_id_prefix")
118124
metadata = setup.get("metadata")

0 commit comments

Comments
 (0)