Skip to content

Commit

Permalink
Merge branch 'develop' into feature/test
Browse files Browse the repository at this point in the history
  • Loading branch information
voluntas committed Jan 15, 2024
2 parents 6c48b35 + 1a5a4df commit 67e3119
Show file tree
Hide file tree
Showing 16 changed files with 125 additions and 61 deletions.
2 changes: 1 addition & 1 deletion .github/actions/download/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ inputs:
runs:
using: composite
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: ${{ inputs.platform }}_python-${{ inputs.python_version }}
path: ${{ inputs.platform }}_python-${{ inputs.python_version }}
Expand Down
61 changes: 37 additions & 24 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
exclude:
# Jetson は Python 3.8 のみ作成する
- platform: { name: ubuntu-20.04_armv8_jetson }
Expand All @@ -40,10 +41,12 @@ jobs:
python_version: "3.10"
- platform: { name: ubuntu-20.04_armv8_jetson }
python_version: "3.11"
- platform: { name: ubuntu-20.04_armv8_jetson }
python_version: "3.12"
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 @@ -75,7 +78,7 @@ jobs:
# Jetson 向け
- name: Set up QEMU
if: ${{ matrix.platform.name == 'ubuntu-20.04_armv8_jetson' }}
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3
- run: |
sudo apt-get install -y multistrap binutils-aarch64-linux-gnu
# multistrap に insecure なリポジトリからの取得を許可する設定を入れる
Expand All @@ -98,13 +101,13 @@ jobs:
ARCHFLAGS: ${{ matrix.platform.archflags }}
- name: Upload Artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.platform.name }}_python-${{ matrix.python_version }}
path: "dist/"

build_windows:
runs-on: windows-2019
runs-on: windows-2022
timeout-minutes: 60
strategy:
fail-fast: false
Expand All @@ -114,9 +117,10 @@ jobs:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "${{ matrix.python_version }}"
cache: "pip"
Expand All @@ -125,7 +129,7 @@ jobs:
- run: python -m build

- name: Upload Artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: windows-2019_python-${{ matrix.python_version }}
path: dist/
Expand All @@ -148,17 +152,20 @@ jobs:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
exclude:
- platform: { name: ubuntu-20.04_armv8_jetson }
python_version: "3.9"
- platform: { name: ubuntu-20.04_armv8_jetson }
python_version: "3.10"
- platform: { name: ubuntu-20.04_armv8_jetson }
python_version: "3.11"
- platform: { name: ubuntu-20.04_armv8_jetson }
python_version: "3.12"
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: ${{ matrix.platform.name }}_python-${{ matrix.python_version }}
path: dist
Expand Down Expand Up @@ -192,33 +199,40 @@ 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
with: {"platform":"ubuntu-22.04_x86_64", "python_version":"3.8"}
with: { "platform": "ubuntu-22.04_x86_64", "python_version": "3.9" }
- uses: ./.github/actions/download
with: {"platform":"ubuntu-22.04_x86_64", "python_version":"3.9"}
with: { "platform": "ubuntu-22.04_x86_64", "python_version": "3.10" }
- uses: ./.github/actions/download
with: {"platform":"ubuntu-22.04_x86_64", "python_version":"3.10"}
with: { "platform": "ubuntu-22.04_x86_64", "python_version": "3.11" }
- uses: ./.github/actions/download
with: { "platform": "ubuntu-22.04_x86_64", "python_version": "3.12" }
- uses: ./.github/actions/download
with:
{ "platform": "ubuntu-20.04_armv8_jetson", "python_version": "3.8" }
- uses: ./.github/actions/download
with: {"platform":"ubuntu-22.04_x86_64", "python_version":"3.11"}
with: { "platform": "macos-13_arm64", "python_version": "3.8" }
- uses: ./.github/actions/download
with: {"platform":"ubuntu-20.04_armv8_jetson", "python_version":"3.8"}
with: { "platform": "macos-13_arm64", "python_version": "3.9" }
- uses: ./.github/actions/download
with: {"platform":"macos-13_arm64", "python_version":"3.8"}
with: { "platform": "macos-13_arm64", "python_version": "3.10" }
- uses: ./.github/actions/download
with: {"platform":"macos-13_arm64", "python_version":"3.9"}
with: { "platform": "macos-13_arm64", "python_version": "3.11" }
- uses: ./.github/actions/download
with: {"platform":"macos-13_arm64", "python_version":"3.10"}
with: { "platform": "macos-13_arm64", "python_version": "3.12" }
- uses: ./.github/actions/download
with: {"platform":"macos-13_arm64", "python_version":"3.11"}
with: { "platform": "windows-2019", "python_version": "3.8" }
- uses: ./.github/actions/download
with: {"platform":"windows-2019", "python_version":"3.8"}
with: { "platform": "windows-2019", "python_version": "3.9" }
- uses: ./.github/actions/download
with: {"platform":"windows-2019", "python_version":"3.9"}
with: { "platform": "windows-2019", "python_version": "3.10" }
- uses: ./.github/actions/download
with: {"platform":"windows-2019", "python_version":"3.10"}
with: { "platform": "windows-2019", "python_version": "3.11" }
- uses: ./.github/actions/download
with: {"platform":"windows-2019", "python_version":"3.11"}
with: { "platform": "windows-2019", "python_version": "3.12" }
- name: Env to output
run: |
echo "package_paths<<EOF" >> $GITHUB_OUTPUT
Expand All @@ -228,5 +242,4 @@ jobs:
- name: Release
uses: softprops/action-gh-release@v1
with:
files:
${{ steps.env.outputs.package_paths }}
files: ${{ steps.env.outputs.package_paths }}
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"editor.formatOnSave": true,
"editor.formatOnSaveMode": "file",
"editor.codeActionsOnSave": {
"source.organizeImports": true
"source.organizeImports": "explicit"
},
"editor.defaultFormatter": "ms-python.autopep8"
},
Expand Down
18 changes: 16 additions & 2 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,28 @@

## develop

- [UPDATE] nanobind を 1.8.0 に上げる
- @voluntas
- [UPDATE] actions/setup-python@v5 に上げる
- @voluntas
- [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.17.0 に上げる
- WebRTC m116 で cricket::Codec は protected になったので cricket::CreateVideoCodec に修正する
- WebRTC m118 でパッケージディレクトリが変更されたためそれに追従する
- WebRTC m120 の webrtc::EncodedImage API の変更に追従する
- WEBRTC_BUILD_VERSION を `m120.6099.1.2` に上げる
- BOOST_VERSION を `1.83.0` に上げる
- CMAKE_VERSION を `3.27.7` に上げる
- @voluntas @miosakuma

## 2023.3.1

Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ $ rye sync

## システム条件

- WebRTC SFU Sora 2023.1.0 以降
- WebRTC SFU Sora 2023.2.0 以降
- Python 3.8 以上

## 対応プラットフォーム
Expand Down Expand Up @@ -109,9 +109,9 @@ Discord へお願いします。
Apache License 2.0

```
Copyright 2023-2023, tnoho (Original Author)
Copyright 2023-2023, Wandbox LLC (Original Author)
Copyright 2023-2023, Shiguredo Inc.
Copyright 2023-2024, tnoho (Original Author)
Copyright 2023-2024, Wandbox LLC (Original Author)
Copyright 2023-2024, Shiguredo Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
8 changes: 4 additions & 4 deletions VERSION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
SORA_CPP_SDK_VERSION=2023.10.0
WEBRTC_BUILD_VERSION=m115.5790.7.0
BOOST_VERSION=1.82.0
SORA_CPP_SDK_VERSION=2023.17.0
WEBRTC_BUILD_VERSION=m120.6099.1.2
BOOST_VERSION=1.83.0
LYRA_VERSION=1.3.0
CMAKE_VERSION=3.26.4
CMAKE_VERSION=3.27.7
OPENH264_VERSION=v2.3.1
3 changes: 2 additions & 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 = "[email protected]" }]
version = "2023.3.1"
version = "2023.4.0.dev5"
description = "WebRTC SFU Sora Python SDK"
readme = "README.md"
license = { file = "LICENSE" }
Expand All @@ -12,6 +12,7 @@ classifiers = [
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
requires-python = ">= 3.8"

Expand Down
12 changes: 6 additions & 6 deletions requirements-dev.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
-e file:.
auditwheel==5.4.0
build==0.10.0
exceptiongroup==1.1.1
exceptiongroup==1.2.0
iniconfig==2.0.0
nanobind==1.4.0
packaging==23.1
pluggy==1.0.0
pyelftools==0.29
nanobind==1.8.0
packaging==23.2
pluggy==1.3.0
pyelftools==0.30
pyproject-hooks==1.0.0
pytest==7.3.2
tomli==2.0.1
wheel==0.40.0
# The following packages are considered to be unsafe in a requirements file:
setuptools==67.8.0
setuptools==69.0.3
6 changes: 3 additions & 3 deletions run.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ def get_webrtc_info(webrtcbuild: bool, source_dir: str, build_dir: str, install_
webrtc_library_dir=os.path.join(webrtc_build_dir, 'obj')
if platform.system() == 'Windows' else webrtc_build_dir, clang_dir=os.path.join(
webrtc_source_dir, 'src', 'third_party', 'llvm-build', 'Release+Asserts'),
libcxx_dir=os.path.join(webrtc_source_dir, 'src', 'buildtools', 'third_party', 'libc++', 'trunk'),)
libcxx_dir=os.path.join(webrtc_source_dir, 'src', 'third_party', 'libc++', 'src'),)
else:
return WebrtcInfo(
version_file=os.path.join(webrtc_install_dir, 'VERSIONS'),
Expand Down Expand Up @@ -548,8 +548,8 @@ def install_deps(build_platform: PlatformTarget, target_platform: PlatformTarget
# LLVM
tools_url = webrtc_version['WEBRTC_SRC_TOOLS_URL']
tools_commit = webrtc_version['WEBRTC_SRC_TOOLS_COMMIT']
libcxx_url = webrtc_version['WEBRTC_SRC_BUILDTOOLS_THIRD_PARTY_LIBCXX_TRUNK_URL']
libcxx_commit = webrtc_version['WEBRTC_SRC_BUILDTOOLS_THIRD_PARTY_LIBCXX_TRUNK_COMMIT']
libcxx_url = webrtc_version['WEBRTC_SRC_THIRD_PARTY_LIBCXX_SRC_URL']
libcxx_commit = webrtc_version['WEBRTC_SRC_THIRD_PARTY_LIBCXX_SRC_COMMIT']
buildtools_url = webrtc_version['WEBRTC_SRC_BUILDTOOLS_URL']
buildtools_commit = webrtc_version['WEBRTC_SRC_BUILDTOOLS_COMMIT']
install_llvm_args = {
Expand Down
2 changes: 1 addition & 1 deletion src/dynamic_h264_decoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ int32_t DynamicH264Decoder::Decode(const EncodedImage& input_image,
webrtc::VideoFrame video_frame =
webrtc::VideoFrame::Builder()
.set_video_frame_buffer(i420_buffer)
.set_timestamp_rtp(input_image.Timestamp())
.set_timestamp_rtp(input_image.RtpTimestamp())
.build();
if (input_image.ColorSpace() != nullptr) {
video_frame.set_color_space(*input_image.ColorSpace());
Expand Down
2 changes: 1 addition & 1 deletion src/dynamic_h264_encoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ int32_t DynamicH264Encoder::Encode(

encoded_images_[i]._encodedWidth = configurations_[i].width;
encoded_images_[i]._encodedHeight = configurations_[i].height;
encoded_images_[i].SetTimestamp(input_frame.timestamp());
encoded_images_[i].SetRtpTimestamp(input_frame.timestamp());
encoded_images_[i].SetColorSpace(input_frame.color_space());
encoded_images_[i]._frameType = ConvertToVideoFrameType(info.eFrameType);
encoded_images_[i].SetSimulcastIndex(configurations_[i].simulcast_idx);
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
Loading

0 comments on commit 67e3119

Please sign in to comment.