Skip to content

Commit

Permalink
Merge branch 'develop' into feature/update-webrtc-m130.6723.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
torikizi committed Nov 25, 2024
2 parents 9025734 + a0f9f3b commit b5c46fb
Show file tree
Hide file tree
Showing 25 changed files with 438 additions and 113 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,12 @@ jobs:
sudo apt-get install libx11-dev libxext-dev
# CUDA
source /etc/os-release
# 20.04 は自前の libssl1.1 があるので不要
if [ $VERSION_ID != "20.04" ]; then
wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.0g-2ubuntu4_amd64.deb
sudo dpkg -i libssl1.1_1.1.0g-2ubuntu4_amd64.deb
fi
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-keyring_1.0-1_all.deb
sudo dpkg -i cuda-keyring_*all.deb
sudo apt-get update
Expand Down
20 changes: 18 additions & 2 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@

## develop

- [CHANGE] `boost::optional` を利用していた部分を全て `std::optional` に変更
- @melpon
- [UPDATE] VPL を v2.13.0 に上げる
- @voluntas
- [UPDATE] CMake を 3.30.4 にあげる
- [UPDATE] CMake を 3.30.5 にあげる
- @voluntas
- [UPDATE] Boost を 1.86.0 にあげる
- @voluntas
Expand All @@ -25,7 +27,7 @@
- `nvcodec_video_decoder.h``vpl_video_decoder.h``#include <optional>` を追加
- `nvcodec_video_decoder.cpp``vpl_video_decoder.cpp``absl::nullopt``std::nullopt` に変更
- Android の test アプリの cmake バージョンを VERSION と合わせる
- @tnoho @torikizi
- @tnoho @torikizi @melpon
- [UPDATE] Xcode のバージョンを 15.4 にあげる
- @tnoho
- [UPDATE] SDL を 2.30.8 に上げる
Expand All @@ -34,6 +36,8 @@
- @torikizi
- [UPDATE] ASMJIT_VERSION を上げる
- @torikizi
- [UPDATE] OpenH264 を v2.5.0 に上げる
- @voluntas
- [ADD] シグナリングメッセージを取得できるよう OnSignalingMessage を SoraSignalingObserver に追加する
- @tnoho
- [ADD] Intel VPL で AV1 エンコーダを動くようにする
Expand All @@ -46,6 +50,16 @@
- @melpon
- [ADD] WebSocket の Close を取得できるよう SendOnWsClose を SoraSignalingObserver に追加する
- @tnoho
- [ADD] DataChannel のみの接続で type: close がやってきた場合に正しく切断されるようにする
- @melpon
- [ADD] SoraSignalingConfig に audio_opus_params を追加
- @melpon
- [ADD] SoraSignalingConfig::DataChennel に header を追加
- @melpon
- [ADD] SoraSignalingConfig::ForwardingFilter に name と priority を追加
- @melpon
- [ADD] SoraSignalingConfig に forwarding_filters を追加
- @melpon
- [FIX] HTTP Proxy 利用時の Websocket 初期化で insecure_ メンバ変数が初期化されていなかったのを修正
- @melpon
- [FIX] SoraSignalingConfig の client_cert と client_key に渡す必要がある値を、ファイルパスからファイルの内容に修正
Expand All @@ -56,6 +70,8 @@

### misc

- [UPDATE] CATCH2 を v3.7.1 にあげる
- @voluntas
- [UPDATE] SDL2 を 2.30.7 にあげる
- @voluntas
- [ADD] sumomo に証明書に関するオプションを追加する
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ elseif (SORA_TARGET_OS STREQUAL "ubuntu")
third_party/NvCodec/NvCodec/NvDecoder/NvDecoder.cpp
third_party/NvCodec/NvCodec/NvEncoder/NvEncoderCuda.cpp
PROPERTIES
COMPILE_OPTIONS "-xcuda;--cuda-gpu-arch=sm_35;-std=gnu++17"
COMPILE_OPTIONS "-xcuda;--cuda-gpu-arch=sm_35;-std=gnu++17;-Wno-tautological-constant-out-of-range-compare"
)

# CUDA を要求したくないので libsora.a に含める
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ _hololens2 は無視してください_
- 動作未検証です
- Ubuntu 22.04 x86_64
- Ubuntu 24.04 x86_64
- Ubuntu 24.04 arm64
- Android 7 arm64 以降
- iOS 13 arm64 以降

Expand Down
8 changes: 4 additions & 4 deletions VERSION
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
SORA_CPP_SDK_VERSION=2024.8.0-canary.13
SORA_CPP_SDK_VERSION=2024.8.0-canary.25
WEBRTC_BUILD_VERSION=m130.6723.2.0
BOOST_VERSION=1.86.0
CMAKE_VERSION=3.30.4
CMAKE_VERSION=3.30.5
CUDA_VERSION=11.8.0-1
ANDROID_NDK_VERSION=r26b
ANDROID_NATIVE_API_LEVEL=29
ANDROID_SDK_CMDLINE_TOOLS_VERSION=9862592
VPL_VERSION=v2.13.0
OPENH264_VERSION=v2.4.1
OPENH264_VERSION=v2.5.0
BLEND2D_VERSION=ca5403c1d02b2bc9d2de581e4cb13e5e80f33860
ASMJIT_VERSION=2e93826348d6cd1325a8b1f7629e193c58332da9
CATCH2_VERSION=v3.5.3
CATCH2_VERSION=v3.7.1
99 changes: 99 additions & 0 deletions canary.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
import argparse
import re
import subprocess

VERSION_FILE = "VERSION"
EXAMPLES_VERSION_FILE = "examples/VERSION"


def update_sdk_version(version_content):
updated_content = []
sdk_version_updated = False
new_version = None

for line in version_content:
line = line.strip() # 前後の余分なスペースや改行を削除
if line.startswith("SORA_CPP_SDK_VERSION="):
version_match = re.match(
r"SORA_CPP_SDK_VERSION=(\d{4}\.\d+\.\d+)(-canary\.(\d+))?", line
)
if version_match:
major_minor_patch = version_match.group(1)
canary_suffix = version_match.group(2)
if canary_suffix is None:
new_version = f"{major_minor_patch}-canary.0"
else:
canary_number = int(version_match.group(3))
new_version = f"{major_minor_patch}-canary.{canary_number + 1}"

updated_content.append(f"SORA_CPP_SDK_VERSION={new_version}")
sdk_version_updated = True
else:
updated_content.append(line)
else:
updated_content.append(line)

if not sdk_version_updated:
raise ValueError("SORA_CPP_SDK_VERSION not found in VERSION file.")

return updated_content, new_version


def write_version_file(filename, updated_content, dry_run):
if dry_run:
print(f"Dry run: The following changes would be written to {filename}:")
for line in updated_content:
print(line.strip())
else:
with open(filename, "w") as file:
file.write("\n".join(updated_content) + "\n")
print(f"{filename} updated.")


def git_operations(new_version, dry_run):
if dry_run:
print("Dry run: Would execute git commit -am '[canary] Update VERSION and examples/VERSION'")
print(f"Dry run: Would execute git tag {new_version}")
print("Dry run: Would execute git push")
print(f"Dry run: Would execute git push origin {new_version}")
else:
print("Executing: git commit -am 'Update VERSION and examples/VERSION'")
subprocess.run(["git", "commit", "-am", "[canary] Update VERSION and examples/VERSION"], check=True)

print(f"Executing: git tag {new_version}")
subprocess.run(["git", "tag", new_version], check=True)

print("Executing: git push")
subprocess.run(["git", "push"], check=True)

print(f"Executing: git push origin {new_version}")
subprocess.run(["git", "push", "origin", new_version], check=True)


def main():
parser = argparse.ArgumentParser(
description="Update VERSION and examples/VERSION file and push changes with git."
)
parser.add_argument(
"--dry-run", action="store_true", help="Perform a dry run without making any changes."
)
args = parser.parse_args()

# Read and update the VERSION file
with open(VERSION_FILE, "r") as file:
version_content = file.readlines()
updated_version_content, new_version = update_sdk_version(version_content)
write_version_file(VERSION_FILE, updated_version_content, args.dry_run)

# Read and update the examples/VERSION file
with open(EXAMPLES_VERSION_FILE, "r") as file:
examples_version_content = file.readlines()
updated_examples_version_content, _ = update_sdk_version(examples_version_content)
write_version_file(EXAMPLES_VERSION_FILE, updated_examples_version_content, args.dry_run)

# Perform git operations
git_operations(new_version, args.dry_run)


if __name__ == "__main__":
main()
4 changes: 4 additions & 0 deletions doc/maintenance_policy.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ P1 が一番プライオリティが高いです。
- ブランチ: `support/hololens2`
- タグ: `{sora-cpp-sdk-version}-hololens2.{release}`
- `2024.1.0-hololens2.0`
- Raspberry Pi OS
- ブランチ: `support/raspberry-pi`
- タグ: `{sora-cpp-sdk-version}-raspberry-pi.{release}`
- `2024.1.0-raspberry-pi.0`

### 方針

Expand Down
4 changes: 2 additions & 2 deletions examples/VERSION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
SORA_CPP_SDK_VERSION=2024.8.0-canary.13
SORA_CPP_SDK_VERSION=2024.8.0-canary.25
WEBRTC_BUILD_VERSION=m130.6723.2.0
BOOST_VERSION=1.86.0
CMAKE_VERSION=3.30.4
CMAKE_VERSION=3.30.5
SDL2_VERSION=2.30.8
CLI11_VERSION=v2.4.2
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
#include <optional>

// Sora
#include <sora/sora_client_context.h>

// CLI11
#include <CLI/CLI.hpp>

// Boost
#include <boost/optional/optional.hpp>

#ifdef _WIN32
#include <rtc_base/win/scoped_com_initializer.h>
#endif
Expand Down Expand Up @@ -109,15 +108,15 @@ class MessagingRecvOnlySample

void add_optional_bool(CLI::App& app,
const std::string& option_name,
boost::optional<bool>& v,
std::optional<bool>& v,
const std::string& help_text) {
auto f = [&v](const std::string& input) {
if (input == "true") {
v = true;
} else if (input == "false") {
v = false;
} else if (input == "none") {
v = boost::none;
v = std::nullopt;
} else {
throw CLI::ConversionError(input, "optional<bool>");
}
Expand Down
11 changes: 5 additions & 6 deletions examples/sdl_sample/src/sdl_sample.cpp
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
#include <optional>

// Sora
#include <sora/camera_device_capturer.h>
#include <sora/sora_client_context.h>

// CLI11
#include <CLI/CLI.hpp>

// Boost
#include <boost/optional/optional.hpp>

// WebRTC
#include <rtc_base/crypto_random.h>

Expand All @@ -25,7 +24,7 @@ struct SDLSampleConfig {
std::string role;
std::string video_codec_type;
std::string audio_codec_type;
boost::optional<bool> multistream;
std::optional<bool> multistream;
int width = 640;
int height = 480;
boost::json::value metadata;
Expand Down Expand Up @@ -155,15 +154,15 @@ class SDLSample : public std::enable_shared_from_this<SDLSample>,

void add_optional_bool(CLI::App& app,
const std::string& option_name,
boost::optional<bool>& v,
std::optional<bool>& v,
const std::string& help_text) {
auto f = [&v](const std::string& input) {
if (input == "true") {
v = true;
} else if (input == "false") {
v = false;
} else if (input == "none") {
v = boost::none;
v = std::nullopt;
} else {
throw CLI::ConversionError(input, "optional<bool>");
}
Expand Down
22 changes: 10 additions & 12 deletions examples/sumomo/src/sumomo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@
#include <sora/srtp_keying_material_exporter.h>

#include <fstream>
#include <optional>
#include <regex>
#include <sstream>

// CLI11
#include <CLI/CLI.hpp>

// Boost
#include <boost/optional/optional.hpp>

// WebRTC
#include <rtc_base/crypto_random.h>

Expand All @@ -38,12 +36,12 @@ struct SumomoConfig {
boost::json::value video_h264_params;
boost::json::value video_h265_params;
boost::json::value metadata;
boost::optional<bool> multistream;
boost::optional<bool> spotlight;
std::optional<bool> multistream;
std::optional<bool> spotlight;
int spotlight_number = 0;
boost::optional<bool> simulcast;
boost::optional<bool> data_channel_signaling;
boost::optional<bool> ignore_disconnect_websocket;
std::optional<bool> simulcast;
std::optional<bool> data_channel_signaling;
std::optional<bool> ignore_disconnect_websocket;

std::string proxy_url;
std::string proxy_username;
Expand Down Expand Up @@ -299,15 +297,15 @@ class Sumomo : public std::enable_shared_from_this<Sumomo>,

void add_optional_bool(CLI::App& app,
const std::string& option_name,
boost::optional<bool>& v,
std::optional<bool>& v,
const std::string& help_text) {
auto f = [&v](const std::string& input) {
if (input == "true") {
v = true;
} else if (input == "false") {
v = false;
} else if (input == "none") {
v = boost::none;
v = std::nullopt;
} else {
throw CLI::ConversionError(input, "optional<bool>");
}
Expand Down Expand Up @@ -443,7 +441,7 @@ int main(int argc, char* argv[]) {
app.add_option("--ca-cert", config.ca_cert, "CA certificate file")->check(CLI::ExistingFile);

// SoraClientContextConfig に関するオプション
boost::optional<bool> use_hardware_encoder;
std::optional<bool> use_hardware_encoder;
add_optional_bool(app, "--use-hardware-encoder", use_hardware_encoder,
"Use hardware encoder");
std::string openh264;
Expand Down Expand Up @@ -475,7 +473,7 @@ int main(int argc, char* argv[]) {
}

auto context_config = sora::SoraClientContextConfig();
if (use_hardware_encoder != boost::none) {
if (use_hardware_encoder != std::nullopt) {
context_config.use_hardware_encoder = *use_hardware_encoder;
}
context_config.openh264 = openh264;
Expand Down
1 change: 1 addition & 0 deletions include/sora/data_channel.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class DataChannel : public std::enable_shared_from_this<DataChannel> {
void Close(const webrtc::DataBuffer& disconnect_message,
std::function<void(boost::system::error_code)> on_close,
double disconnect_wait_timeout);
void SetOnClose(std::function<void(boost::system::error_code)> on_close);

void AddDataChannel(
rtc::scoped_refptr<webrtc::DataChannelInterface> data_channel);
Expand Down
3 changes: 2 additions & 1 deletion include/sora/device_video_capturer.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#define SORA_DEVICE_VIDEO_CAPTURER_H_

#include <memory>
#include <optional>
#include <vector>

// Boost
Expand All @@ -33,7 +34,7 @@ struct DeviceVideoCapturerConfig : ScalableVideoTrackSourceConfig {
std::string device_name;
// これが非noneならデバイスインデックスから検索する
// device_name と device_index どちらも指定が無い場合は 0 番から順に作成していく
boost::optional<int> device_index = 0;
std::optional<int> device_index = 0;
};

// webrtc::VideoCaptureModule を使ったデバイスキャプチャラ。
Expand Down
Loading

0 comments on commit b5c46fb

Please sign in to comment.