Skip to content

Commit

Permalink
Merge branch 'release/2023.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
miosakuma committed Aug 1, 2023
2 parents 38b7b87 + 4c74cdf commit c0902d4
Show file tree
Hide file tree
Showing 28 changed files with 263 additions and 89 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ on:

jobs:
build:
runs-on: macos-12
runs-on: macos-13
env:
XCODE: /Applications/Xcode_13.4.1.app
XCODE_SDK: iphoneos15.5
XCODE: /Applications/Xcode_14.3.1.app
XCODE_SDK: iphoneos16.4
steps:
- uses: actions/checkout@v3
- name: Select Xcode Version
Expand Down
4 changes: 2 additions & 2 deletions .jazzy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ theme: apple
min_acl: public
sdk: iphoneos
module: Sora
module_version: 2023.1.0
swift_version: 5.8
module_version: 2023.2.0
swift_version: 5.8.1
xcodebuild_arguments:
- -parallelizeTargets
- -sdk
Expand Down
2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.5.1
5.8
22 changes: 21 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,27 @@

## develop

## 2023.1.0
## 2023.2.0

- [UPDATE] システム条件を変更する
- macOS 13.4.1 以降
- WebRTC SFU Sora 2023.2.0 以降
- Xcode 14.3.1
- Swift 5.8.1
- CocoaPods 1.12.1 以降
- @miosakuma
- [UPDATE] WebRTC 115.5790.7.0 に上げる
- @szktty @miosakuma
- [ADD] 転送フィルター機能を追加する
- `Configuration``forwardingFilter` を追加する
- @szktty
- [ADD] 映像コーデックパラメーターの設定を追加する
- `Configuration``videoVp9Params`, `videoAv1Params`, `videoH264Params` を追加する
- @miosakuma
- [ADD] サイマルキャストを VP9 / AV1 に対応する
- @szktty

## 2023.2.0

- [UPDATE] WebRTC 112.5615.1.0 に上げる
- @miosakuma
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# frozen_string_literal: true
source "https://rubygems.org"

gem 'cocoapods' , '1.12.0'
gem 'cocoapods' , '1.12.1'
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import Foundation
import PackageDescription

let file = "WebRTC-112.5615.1.0/WebRTC.xcframework.zip"
let file = "WebRTC-115.5790.7.0/WebRTC.xcframework.zip"

let package = Package(
name: "Sora",
Expand All @@ -16,7 +16,7 @@ let package = Package(
.binaryTarget(
name: "WebRTC",
url: "https://github.com/shiguredo/sora-ios-sdk-specs/releases/download/\(file)",
checksum: "d4cd24535d4a4122cd8734284f398edeee13a9cff785f8c9522bee3689bbaedf"
checksum: "1a852818dc15280f3ded5d16cc52fb30c91515c9f08b26d2dcaea68a7de414fc"
),
.target(
name: "Sora",
Expand Down
2 changes: 1 addition & 1 deletion Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ platform :ios, '13.0'

target 'Sora' do
use_frameworks!
pod 'WebRTC', '112.5615.1.0'
pod 'WebRTC', '115.5790.7.0'
end
6 changes: 3 additions & 3 deletions Podfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ platform :ios, '13.0'

target 'Sora' do
use_frameworks!
pod 'WebRTC', '112.5615.1.0'
pod 'SwiftLint', '0.45.1'
pod 'SwiftFormat/CLI', '0.49.0'
pod 'WebRTC', '115.5790.7.0'
pod 'SwiftLint', '0.51.0'
pod 'SwiftFormat/CLI', '0.51.6'
end
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Sora iOS SDK

[![libwebrtc](https://img.shields.io/badge/libwebrtc-112.5615-blue.svg)](https://chromium.googlesource.com/external/webrtc/+/branch-heads/5615)
[![libwebrtc](https://img.shields.io/badge/libwebrtc-115.5790-blue.svg)](https://chromium.googlesource.com/external/webrtc/+/branch-heads/5790)
[![GitHub tag](https://img.shields.io/github/tag/shiguredo/sora-ios-sdk.svg)](https://github.com/shiguredo/sora-ios-sdk)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)

Expand All @@ -20,11 +20,11 @@ Please read https://github.com/shiguredo/oss before use.

- iOS 13 以降
- アーキテクチャ arm64 (シミュレーターの動作は未保証)
- macOS 13.3 以降
- Xcode 14.3
- Swift 5.8
- CocoaPods 1.12.0 以降
- WebRTC SFU Sora 2022.2.0 以降
- macOS 13.4.1 以降
- Xcode 14.3.1
- Swift 5.8.1
- CocoaPods 1.12.1 以降
- WebRTC SFU Sora 2023.1.0 以降

Xcode と Swift のバージョンによっては、 CocoaPods で取得できるバイナリに互換性がない可能性があります。詳しくはドキュメントを参照してください。

Expand Down
4 changes: 2 additions & 2 deletions Sora.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "Sora"
s.version = "2023.1.0"
s.version = "2023.2.0"
s.summary = "Sora iOS SDK"
s.description = <<-DESC
A library to develop Sora client applications.
Expand All @@ -15,7 +15,7 @@ Pod::Spec.new do |s|
}
s.source_files = "Sora/**/*.swift"
s.resources = ['Sora/*.xib']
s.dependency "WebRTC", '112.5615.1.0'
s.dependency "WebRTC", '115.5790.7.0'
s.pod_target_xcconfig = {
'ARCHS' => 'arm64',
'ARCHS[config=Debug]' => '$(ARCHS_STANDARD)'
Expand Down
8 changes: 6 additions & 2 deletions Sora.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 2023.1.0;
MARKETING_VERSION = 2023.2.0;
PRODUCT_BUNDLE_IDENTIFIER = jp.shiguredo.sora.ios.sdk.Sora;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
Expand All @@ -604,6 +604,7 @@
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 5.0;
VALID_ARCHS = arm64;
WATCHOS_DEPLOYMENT_TARGET = "";
};
name = Debug;
};
Expand All @@ -627,7 +628,7 @@
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 2023.1.0;
MARKETING_VERSION = 2023.2.0;
PRODUCT_BUNDLE_IDENTIFIER = jp.shiguredo.sora.ios.sdk.Sora;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
Expand All @@ -636,6 +637,7 @@
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 5.0;
VALID_ARCHS = arm64;
WATCHOS_DEPLOYMENT_TARGET = "";
};
name = Release;
};
Expand All @@ -657,6 +659,7 @@
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 5.0;
WATCHOS_DEPLOYMENT_TARGET = "";
};
name = Debug;
};
Expand All @@ -678,6 +681,7 @@
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 5.0;
WATCHOS_DEPLOYMENT_TARGET = "";
};
name = Release;
};
Expand Down
10 changes: 6 additions & 4 deletions Sora/CameraVideoCapturer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -237,12 +237,12 @@ public final class CameraVideoCapturer {

/// 停止前と同じ設定でカメラを再起動します。
public func restart(completionHandler: @escaping ((Error?) -> Void)) {
guard let format = format else {
guard let format else {
completionHandler(SoraError.cameraError(reason: "failed to access format"))
return
}

guard let frameRate = frameRate else {
guard let frameRate else {
completionHandler(SoraError.cameraError(reason: "failed to access frame rate"))
return
}
Expand All @@ -255,7 +255,8 @@ public final class CameraVideoCapturer {
}

start(format: format,
frameRate: frameRate) { (error: Error?) in
frameRate: frameRate)
{ (error: Error?) in
guard error == nil else {
completionHandler(error)
return
Expand All @@ -267,7 +268,8 @@ public final class CameraVideoCapturer {
}
} else {
start(format: format,
frameRate: frameRate) { (error: Error?) in
frameRate: frameRate)
{ (error: Error?) in
guard error == nil else {
completionHandler(error)
return
Expand Down
102 changes: 101 additions & 1 deletion Sora/Configuration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public struct Proxy: CustomStringConvertible {
self.username = username
self.password = password

if let agent = agent {
if let agent {
self.agent = agent
}
}
Expand Down Expand Up @@ -216,6 +216,18 @@ public struct Configuration {
/// プロキシに関する設定
public var proxy: Proxy?

/// 転送フィルターの設定
public var forwardingFilter: ForwardingFilter?

/// VP9 向け映像コーデックパラメーター
public var videoVp9Params: Encodable?

/// AV1 向け映像コーデックパラメーター
public var videoAv1Params: Encodable?

/// H264 向け映像コーデックパラメーター
public var videoH264Params: Encodable?

// MARK: - イベントハンドラ

/// WebSocket チャネルに関するイベントハンドラ
Expand Down Expand Up @@ -334,3 +346,91 @@ public struct Configuration {
self.multistreamEnabled = multistreamEnabled
}
}

/**
転送フィルターのルールのフィールドの設定です。
*/
public enum ForwardingFilterRuleField: String, Codable {
/// connection_id
case connectionId = "connection_id"

/// client_id
case clientId = "client_id"

/// kind
case kind
}

/**
転送フィルターのルールの演算子の設定です。
*/
public enum ForwardingFilterRuleOperator: String, Codable {
/// is_in
case isIn = "is_in"

/// is_not_in
case isNotIn = "is_not_in"
}

/**
転送フィルターのルールの設定です。
*/
public struct ForwardingFilterRule: Codable {
/// field
public let field: ForwardingFilterRuleField

/// operator
public let `operator`: ForwardingFilterRuleOperator

/// values
public let values: [String]

/**
初期化します。
- parameter field: field
- parameter operator: operator
- parameter values: values
*/
public init(field: ForwardingFilterRuleField,
operator: ForwardingFilterRuleOperator,
values: [String])
{
self.field = field
self.operator = `operator`
self.values = values
}
}

/**
転送フィルターのアクションの設定です。
*/
public enum ForwardingFilterAction: String, Codable {
/// block
case block

/// allow
case allow
}

/**
転送フィルターに関する設定です。
*/
public struct ForwardingFilter: Codable {
/// action
public let action: ForwardingFilterAction

/// rules
public let rules: [[ForwardingFilterRule]]

/**
初期化します。
- parameter action: action
- parameter rules: rules
*/
public init(action: ForwardingFilterAction, rules: [[ForwardingFilterRule]]) {
self.action = action
self.rules = rules
}
}
2 changes: 1 addition & 1 deletion Sora/ConnectionTimer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class ConnectionTimer {
}

public func run(timeout: Int? = nil, handler: @escaping () -> Void) {
if let timeout = timeout {
if let timeout {
self.timeout = timeout
}
Logger.debug(type: .connectionTimer,
Expand Down
8 changes: 4 additions & 4 deletions Sora/DataChannel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class BasicDataChannelDelegate: NSObject, RTCDataChannelDelegate {
Logger.debug(type: .dataChannel, message: "\(#function): label => \(dataChannel.label), state => \(dataChannel.readyState)")

if dataChannel.readyState == .closed {
if let peerChannel = peerChannel {
if let peerChannel {
// DataChannel が切断されたタイミングで PeerChannel を切断する
// PeerChannel -> DataChannel の順に切断されるパターンも存在するが、
// PeerChannel.disconnect(error:reason:) 側で排他処理が実装されているため問題ない
Expand All @@ -137,7 +137,7 @@ class BasicDataChannelDelegate: NSObject, RTCDataChannelDelegate {
func dataChannel(_ dataChannel: RTCDataChannel, didReceiveMessageWith buffer: RTCDataBuffer) {
Logger.debug(type: .dataChannel, message: "\(#function): label => \(dataChannel.label)")

guard let peerChannel = peerChannel else {
guard let peerChannel else {
Logger.error(type: .dataChannel, message: "peerChannel is unavailable")
return
}
Expand Down Expand Up @@ -173,7 +173,7 @@ class BasicDataChannelDelegate: NSObject, RTCDataChannelDelegate {
Logger.error(type: .dataChannel, message: "failed to encode stats data to json")
}

if let data = data {
if let data {
let ok = dc.send(data)
if !ok {
Logger.error(type: .dataChannel, message: "failed to send stats data over DataChannel")
Expand All @@ -195,7 +195,7 @@ class BasicDataChannelDelegate: NSObject, RTCDataChannelDelegate {
Logger.error(type: .dataChannel, message: "unknown data channel label: \(dataChannel.label)")
}
}
if let mediaChannel = mediaChannel, let handler = mediaChannel.handlers.onDataChannelMessage {
if let mediaChannel, let handler = mediaChannel.handlers.onDataChannelMessage {
handler(mediaChannel, dataChannel.label, data)
}
}
Expand Down
Loading

0 comments on commit c0902d4

Please sign in to comment.