Skip to content

Commit

Permalink
Merge branch 'release/2023.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
miosakuma committed Apr 13, 2023
2 parents 2bcd13b + c054d95 commit 28455f1
Show file tree
Hide file tree
Showing 13 changed files with 252 additions and 73 deletions.
13 changes: 13 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:base",
":timezone(Asia/Tokyo)",
":combinePatchMinorReleases",
":prHourlyLimitNone",
":prConcurrentLimit10",
"group:recommended",
"group:allNonMajor",
"schedule:weekly"
]
}
40 changes: 24 additions & 16 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ jobs:
- windows_x86_64
runs-on: windows-2019
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Cache
id: cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: _install
key: ${{ matrix.name }}-v3-${{ hashFiles('VERSIONS') }}
Expand All @@ -33,8 +33,10 @@ jobs:
Copy-Item _build\windows_x86_64\release\sora_unity_sdk\Release\SoraUnitySdk.dll ${{ matrix.name }}
# ソースコード(生成した分も含む)も一緒に入れておく
Copy-Item -Recurse Sora ${{ matrix.name }}\Sora
# Lyra のモデルデータも一緒に入れておく
Copy-Item -Recurse _install\windows_x86_64\release\lyra\share\model_coeffs ${{ matrix.name }}\model_coeffs
- name: Upload ${{ matrix.name }} Artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.name }}
path: ${{ matrix.name }}
Expand All @@ -47,10 +49,10 @@ jobs:
- ios
runs-on: macos-12
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Cache
id: cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: _install
key: ${{ matrix.name }}-v7-${{ hashFiles('VERSIONS') }}
Expand All @@ -65,7 +67,7 @@ jobs:
cp -r _build/macos_arm64/release/sora_unity_sdk/SoraUnitySdk.bundle/ macos_arm64/SoraUnitySdk.bundle/
- name: Upload macOS arm64 Artifact
if: matrix.name == 'macos_arm64'
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: macos_arm64
path: macos_arm64/
Expand All @@ -76,11 +78,13 @@ jobs:
mkdir ios/
cp _install/ios/release/webrtc/lib/libwebrtc.a ios/
cp _install/ios/release/boost/lib/libboost_json.a ios/
cp _install/ios/release/boost/lib/libboost_filesystem.a ios/
cp _install/ios/release/sora/lib/libsora.a ios/
cp _install/ios/release/lyra/lib/liblyra.a ios/
cp _build/ios/release/sora_unity_sdk/libSoraUnitySdk.a ios/
- name: Upload iOS Artifact
if: matrix.name == 'ios'
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: ios
path: ios/
Expand All @@ -93,10 +97,10 @@ jobs:
- ubuntu-20.04_x86_64
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Cache
id: cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: _install
key: ${{ matrix.name }}-v1-${{ hashFiles('VERSIONS') }}
Expand All @@ -116,7 +120,7 @@ jobs:
cp _build/android/release/sora_unity_sdk/libSoraUnitySdk.so android/
- name: Upload Android Artifact
if: matrix.name == 'android'
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: android
path: android/
Expand All @@ -128,7 +132,7 @@ jobs:
cp _build/ubuntu-20.04_x86_64/release/sora_unity_sdk/libSoraUnitySdk.so ubuntu-20.04_x86_64/
- name: Upload Ubuntu x86_64 Artifact
if: matrix.name == 'ubuntu-20.04_x86_64'
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: ubuntu-20.04_x86_64
path: ubuntu-20.04_x86_64/
Expand All @@ -139,9 +143,9 @@ jobs:
- build-macos
- build-ubuntu
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Download artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
- name: Packaging
run: |
set -ex
Expand All @@ -150,22 +154,26 @@ jobs:
mkdir -p SoraUnitySdk/Plugins/SoraUnitySdk/ios
mkdir -p SoraUnitySdk/Plugins/SoraUnitySdk/android/arm64-v8a
mkdir -p SoraUnitySdk/Plugins/SoraUnitySdk/linux/x86_64
mkdir -p SoraUnitySdk/StreamingAssets/SoraUnitySdk
cp windows_x86_64/SoraUnitySdk.dll SoraUnitySdk/Plugins/SoraUnitySdk/windows/x86_64/
cp -r windows_x86_64/Sora/ SoraUnitySdk/SoraUnitySdk/
cp -r windows_x86_64/model_coeffs SoraUnitySdk/StreamingAssets/SoraUnitySdk/model_coeffs
cp -r macos_arm64/SoraUnitySdk.bundle SoraUnitySdk/Plugins/SoraUnitySdk/macos/arm64/SoraUnitySdk.bundle
cp android/libSoraUnitySdk.so SoraUnitySdk/Plugins/SoraUnitySdk/android/arm64-v8a/
cp android/webrtc.jar SoraUnitySdk/Plugins/SoraUnitySdk/android/
cp ios/libSoraUnitySdk.a SoraUnitySdk/Plugins/SoraUnitySdk/ios/
cp ios/libwebrtc.a SoraUnitySdk/Plugins/SoraUnitySdk/ios/
cp ios/libboost_json.a SoraUnitySdk/Plugins/SoraUnitySdk/ios/
cp ios/libsora.a SoraUnitySdk/Plugins/SoraUnitySdk/ios/
cp ios/libboost_filesystem.a SoraUnitySdk/Plugins/SoraUnitySdk/ios/
cp ios/liblyra.a SoraUnitySdk/Plugins/SoraUnitySdk/ios/
cp ubuntu-20.04_x86_64/libSoraUnitySdk.so SoraUnitySdk/Plugins/SoraUnitySdk/linux/x86_64/
cp LICENSE SoraUnitySdk/SoraUnitySdk/
cp NOTICE.md SoraUnitySdk/SoraUnitySdk/
- name: Upload SoraUnitySdk
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: SoraUnitySdk
path: SoraUnitySdk
Expand All @@ -176,9 +184,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Download SoraUnitySdk
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: SoraUnitySdk
path: SoraUnitySdk
Expand Down
25 changes: 25 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,31 @@

## develop

## 2023.1.0 (2023-04-13)

- [UPDATE] Sora C++ SDK を `2023.4.0` に上げる
- @melpon @miosakuma
- [UPDATE] libwebrtc を `m111.5563.4.4` に上げる
- @melpon
- [UPDATE] Boost を `1.81.0` に上げる
- @melpon
- [UPDATE] CMake を `3.25.1` に上げる
- @melpon
- [UPDATE] actions/checkout@v2 と actions/cache@v2 を @v3 に上げる
- @melpon
- [UPDATE] actions/upload-artifact@v2 と actions/download-artifact@v2 を @v3 に上げる
- @melpon
- [ADD] `Sora.Config``AudioStreamingLanguageCode` を追加
- @melpon
- [ADD] `Sora.Config``SignalingNotifyMetadata` を追加
- @melpon
- [ADD] offer 設定時のコールバック関数 `OnSetOffer` を追加
- @melpon
- [ADD] オーディオコーデックに Lyra を追加
- @melpon
- [ADD] `Sora.Config``check_lyra_version` を追加
- @torikizi

## 2022.6.2 (2023-03-25)

- [FIX] IPHONE_DEPLOYMENT_TARGET を 13 に上げる
Expand Down
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE NEVER)

find_package(Boost REQUIRED COMPONENTS json)
find_package(Boost REQUIRED COMPONENTS json filesystem)
find_package(Lyra REQUIRED)
find_package(WebRTC REQUIRED)
find_package(Sora REQUIRED)
find_package(Threads REQUIRED)
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Sora Unity SDK

[![libwebrtc](https://img.shields.io/badge/libwebrtc-105.5195-blue.svg)](https://chromium.googlesource.com/external/webrtc/+/branch-heads/5195)
[![libwebrtc](https://img.shields.io/badge/libwebrtc-111.5563-blue.svg)](https://chromium.googlesource.com/external/webrtc/+/branch-heads/5563)
[![GitHub tag](https://img.shields.io/github/tag/shiguredo/sora-unity-sdk.svg)](https://github.com/shiguredo/sora-unity-sdk)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![Actions Status](https://github.com/shiguredo/sora-unity-sdk/workflows/build/badge.svg)](https://github.com/shiguredo/sora-unity-sdk/actions)
Expand Down Expand Up @@ -38,14 +38,14 @@ Please read https://github.com/shiguredo/oss/blob/master/README.en.md before use

## システム条件

- WebRTC SFU Sora 2022.1.3 以降
- WebRTC SFU Sora 2022.2.0 以降

## 対応プラットフォーム

- Windows 10 1809 x86_64 以降
- macOS 12.4 M1 以降
- macOS 13.3 M1 以降
- Android 7 以降
- iOS 12 以降
- iOS 13 以降
- Ubuntu 20.04

## 対応機能
Expand Down Expand Up @@ -94,6 +94,7 @@ Please read https://github.com/shiguredo/oss/blob/master/README.en.md before use
- Windows 版
- H.264 のハードウェアエンコードへの対応
- H.264 のハードウェアデコードへの対応
- ミュート機能

## Sora Unity SDK for MS Hololens2

Expand All @@ -114,6 +115,8 @@ Please read https://github.com/shiguredo/oss/blob/master/README.en.md before use
- 企業名非公開
- Microsoft HoloLens 2 対応
- [NTTコノキュー](https://www.nttqonoq.com/)
- ミュート機能
- [NTTコノキュー](https://www.nttqonoq.com/)

## 有償での優先実装が可能な機能一覧

Expand All @@ -125,7 +128,6 @@ Please read https://github.com/shiguredo/oss/blob/master/README.en.md before use

### 機能

- ミュート機能
- デバイスをつかまないようにする機能
- 音声のみ送受信機能
- サイマルキャスト rid 指定対応
Expand All @@ -145,8 +147,8 @@ Please read https://github.com/shiguredo/oss/blob/master/README.en.md before use
Apache License 2.0

```
Copyright 2019-2022, Wandbox LLC (Original Author)
Copyright 2019-2022, Shiguredo Inc.
Copyright 2019-2023, Wandbox LLC (Original Author)
Copyright 2019-2023, 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 All @@ -160,5 +162,3 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```


51 changes: 51 additions & 0 deletions Sora/Sora.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public enum VideoCodecType
public enum AudioCodecType
{
OPUS,
LYRA,
}
// SimulcastRid のためのパラメータ
public enum SimulcastRidType
Expand Down Expand Up @@ -70,6 +71,7 @@ public class Config
public string ClientId = "";
public string BundleId = "";
public string Metadata = "";
public string SignalingNotifyMetadata = "";
public Role Role = Sora.Role.Sendonly;
public bool? Multistream;
public bool? Spotlight;
Expand All @@ -94,7 +96,12 @@ public class Config
public string AudioRecordingDevice = "";
public string AudioPlayoutDevice = "";
public AudioCodecType AudioCodecType = AudioCodecType.OPUS;
// AudioCodecType.LYRA の場合は必須
public int AudioCodecLyraBitrate = 0;
public bool? AudioCodecLyraUsedtx;
public bool CheckLyraVersion = false;
public int AudioBitRate = 0;
public string AudioStreamingLanguageCode = "";

// DataChannelSignaling を有効にするかどうか
public bool EnableDataChannelSignaling = false;
Expand Down Expand Up @@ -126,6 +133,7 @@ public class Config
IntPtr p;
GCHandle onAddTrackHandle;
GCHandle onRemoveTrackHandle;
GCHandle onSetOfferHandle;
GCHandle onNotifyHandle;
GCHandle onPushHandle;
GCHandle onMessageHandle;
Expand Down Expand Up @@ -154,6 +162,11 @@ public void Dispose()
onRemoveTrackHandle.Free();
}

if (onSetOfferHandle.IsAllocated)
{
onSetOfferHandle.Free();
}

if (onNotifyHandle.IsAllocated)
{
onNotifyHandle.Free();
Expand Down Expand Up @@ -229,6 +242,7 @@ public void Connect(Config config)
cc.client_id = config.ClientId;
cc.bundle_id = config.BundleId;
cc.metadata = config.Metadata;
cc.signaling_notify_metadata = config.SignalingNotifyMetadata;
cc.role = role;
cc.enable_multistream = config.Multistream != null;
cc.multistream = config.Multistream == null ? false : config.Multistream.Value;
Expand Down Expand Up @@ -256,7 +270,12 @@ public void Connect(Config config)
cc.audio_recording_device = config.AudioRecordingDevice;
cc.audio_playout_device = config.AudioPlayoutDevice;
cc.audio_codec_type = config.AudioCodecType.ToString();
cc.audio_codec_lyra_bitrate = config.AudioCodecLyraBitrate;
cc.enable_audio_codec_lyra_usedtx = config.AudioCodecLyraUsedtx != null;
cc.audio_codec_lyra_usedtx = config.AudioCodecLyraUsedtx == null ? false : config.AudioCodecLyraUsedtx.Value;
cc.check_lyra_version = config.CheckLyraVersion;
cc.audio_bit_rate = config.AudioBitRate;
cc.audio_streaming_language_code = config.AudioStreamingLanguageCode;
cc.enable_data_channel_signaling = config.EnableDataChannelSignaling;
cc.data_channel_signaling = config.DataChannelSignaling;
cc.data_channel_signaling_timeout = config.DataChannelSignalingTimeout;
Expand Down Expand Up @@ -363,6 +382,29 @@ public Action<uint, string> OnRemoveTrack
}
}

private delegate void SetOfferCallbackDelegate(string json, IntPtr userdata);

[AOT.MonoPInvokeCallback(typeof(SetOfferCallbackDelegate))]
static private void SetOfferCallback(string json, IntPtr userdata)
{
var callback = GCHandle.FromIntPtr(userdata).Target as Action<string>;
callback(json);
}

public Action<string> OnSetOffer
{
set
{
if (onSetOfferHandle.IsAllocated)
{
onSetOfferHandle.Free();
}

onSetOfferHandle = GCHandle.Alloc(value);
sora_set_on_set_offer(p, SetOfferCallback, GCHandle.ToIntPtr(onSetOfferHandle));
}
}

private delegate void NotifyCallbackDelegate(string json, IntPtr userdata);

[AOT.MonoPInvokeCallback(typeof(NotifyCallbackDelegate))]
Expand Down Expand Up @@ -652,6 +694,11 @@ public static bool IsH264Supported()
return sora_is_h264_supported() != 0;
}

public static void Setenv(string name, string value)
{
sora_setenv(name, value);
}

public bool AudioEnabled
{
get { return sora_get_audio_enabled(p) != 0; }
Expand All @@ -677,6 +724,8 @@ public bool VideoEnabled
[DllImport(DllName)]
private static extern void sora_set_on_remove_track(IntPtr p, TrackCallbackDelegate on_remove_track, IntPtr userdata);
[DllImport(DllName)]
private static extern void sora_set_on_set_offer(IntPtr p, SetOfferCallbackDelegate on_set_offer, IntPtr userdata);
[DllImport(DllName)]
private static extern void sora_set_on_notify(IntPtr p, NotifyCallbackDelegate on_notify, IntPtr userdata);
[DllImport(DllName)]
private static extern void sora_set_on_push(IntPtr p, PushCallbackDelegate on_push, IntPtr userdata);
Expand Down Expand Up @@ -719,6 +768,8 @@ public bool VideoEnabled
[DllImport(DllName)]
private static extern int sora_is_h264_supported();
[DllImport(DllName)]
private static extern void sora_setenv(string name, string value);
[DllImport(DllName)]
private static extern int sora_get_audio_enabled(IntPtr p);
[DllImport(DllName)]
private static extern void sora_set_audio_enabled(IntPtr p, int enabled);
Expand Down
Loading

0 comments on commit 28455f1

Please sign in to comment.