From cca192930d96847178c4ab5ab340687fc0af90b6 Mon Sep 17 00:00:00 2001 From: SUZUKI Tetsuya Date: Tue, 5 Feb 2019 16:22:47 +0900 Subject: [PATCH 01/16] =?UTF-8?q?=E9=9D=9E=E5=AF=BE=E5=BF=9C=E3=81=AE?= =?UTF-8?q?=E3=82=B7=E3=82=B0=E3=83=8A=E3=83=AA=E3=83=B3=E3=82=B0=E3=83=A1?= =?UTF-8?q?=E3=83=83=E3=82=BB=E3=83=BC=E3=82=B8=E3=82=92=E5=8F=97=E4=BF=A1?= =?UTF-8?q?=E3=81=97=E3=81=9F=E3=82=89=E4=BE=8B=E5=A4=96=E3=82=92=E7=99=BA?= =?UTF-8?q?=E7=94=9F=E3=81=95=E3=81=9B=E3=82=8B=20(fatal=20error=20?= =?UTF-8?q?=E3=81=AB=E3=81=97=E3=81=AA=E3=81=84)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sora/SignalingChannel.swift | 3 +-- Sora/SignalingMessage.swift | 20 ++++++++------------ Sora/SoraError.swift | 11 ++++++++--- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Sora/SignalingChannel.swift b/Sora/SignalingChannel.swift index c1d39150..c00189f8 100644 --- a/Sora/SignalingChannel.swift +++ b/Sora/SignalingChannel.swift @@ -215,7 +215,6 @@ class BasicSignalingChannel: SignalingChannel { } catch { Logger.debug(type: .signalingChannel, message: "JSON encoding failed") - fatalError() } } @@ -245,7 +244,7 @@ class BasicSignalingChannel: SignalingChannel { sigMessage = try SignalingMessage.decode(from: data) } catch let error { Logger.error(type: .signalingChannel, - message: "decode failed (\(error.localizedDescription))") + message: "decode failed (\(error.localizedDescription)) => \(text)") } Logger.debug(type: .signalingChannel, message: "call onMessageHandler") diff --git a/Sora/SignalingMessage.swift b/Sora/SignalingMessage.swift index c66cd224..c0c90b47 100644 --- a/Sora/SignalingMessage.swift +++ b/Sora/SignalingMessage.swift @@ -286,7 +286,7 @@ extension SignalingConnectMessage: Codable { } public init(from decoder: Decoder) throws { - fatalError("not supported") + throw SoraError.invalidSignalingMessage } public func encode(to encoder: Encoder) throws { @@ -389,7 +389,7 @@ extension SignalingOfferMessage: Codable { } public func encode(to encoder: Encoder) throws { - fatalError("not supported") + throw SoraError.invalidSignalingMessage } } @@ -407,7 +407,7 @@ extension SignalingUpdateOfferMessage: Codable { } public func encode(to encoder: Encoder) throws { - fatalError("not supported") + throw SoraError.invalidSignalingMessage } } @@ -475,7 +475,7 @@ extension SignalingNotifyMessage: Codable { } public func encode(to encoder: Encoder) throws { - fatalError("not supported") + throw SoraError.invalidSignalingMessage } } @@ -505,7 +505,7 @@ extension SignalingPushMessage: Codable { } public func encode(to encoder: Encoder) throws { - fatalError("not supported") + throw SoraError.invalidSignalingMessage } } @@ -549,7 +549,7 @@ extension SignalingMessage: Codable { case "push": self = .push(message: try SignalingPushMessage(from: decoder)) default: - fatalError("not supported decoding '\(type)'") + throw SoraError.unknownSignalingMessageType(type: type) } } @@ -571,16 +571,12 @@ extension SignalingMessage: Codable { case .update(sdp: let sdp): try container.encode(MessageType.update.rawValue, forKey: .type) try container.encode(sdp, forKey: .sdp) - case .notify(message: _): - fatalError("not supported encoding 'notify'") - case .ping: - fatalError("not supported encoding 'ping'") case .pong: try container.encode(MessageType.pong.rawValue, forKey: .type) case .disconnect: try container.encode(MessageType.disconnect.rawValue, forKey: .type) - case .push: - fatalError("not supported encoding 'push'") + default: + throw SoraError.invalidSignalingMessage } } diff --git a/Sora/SoraError.swift b/Sora/SoraError.swift index fa9673b7..ce7c6e03 100644 --- a/Sora/SoraError.swift +++ b/Sora/SoraError.swift @@ -25,8 +25,11 @@ public enum SoraError: Error { case signalingChannelError(reason: String) /// シグナリングメッセージのフォーマットが無効 - case invalidSignalingMessage(text: String) + case invalidSignalingMessage + /// 非対応のシグナリングメッセージ種別 + case unknownSignalingMessageType(type: String) + /// ``PeerChannel`` で発生したエラー case peerChannelError(reason: String) @@ -57,8 +60,10 @@ extension SoraError: LocalizedError { return "WebSocket error (\(error.localizedDescription))" case .signalingChannelError(reason: let reason): return "SignalingChannel error (\(reason))" - case .invalidSignalingMessage(text: let text): - return "Invalid signaling message format (\"\(text)\")" + case .invalidSignalingMessage: + return "Invalid signaling message format" + case .unknownSignalingMessageType(type: let type): + return "Unknown signaling message type \(type)" case .peerChannelError(reason: let reason): return "PeerChannel error (\(reason))" } From d450bd3d52a5a089739990db61862852c60dc381 Mon Sep 17 00:00:00 2001 From: SUZUKI Tetsuya Date: Thu, 4 Apr 2019 17:11:41 +0900 Subject: [PATCH 02/16] =?UTF-8?q?WebRTCConfiguration=20=E3=81=AE=20JSON=20?= =?UTF-8?q?=E3=83=87=E3=82=B3=E3=83=BC=E3=83=89/=E3=82=A8=E3=83=B3?= =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E3=82=92=E5=AE=9F=E8=A3=85=E3=81=99?= =?UTF-8?q?=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sora/Configuration.swift | 10 ++++++++- Sora/WebRTCConfigration.swift | 42 +++++++++++++++++++++++++++++------ 2 files changed, 44 insertions(+), 8 deletions(-) diff --git a/Sora/Configuration.swift b/Sora/Configuration.swift index 52c9af8d..e80c410d 100644 --- a/Sora/Configuration.swift +++ b/Sora/Configuration.swift @@ -189,7 +189,15 @@ extension Configuration: Codable { maxNumberOfSpeakers = try container.decode(Int.self, forKey: .maxNumberOfSpeakers) } - // TODO: others + webRTCConfiguration = try container.decode(WebRTCConfiguration.self, + forKey: .webRTCConfiguration) + publisherStreamId = try container.decode(String.self, + forKey: .publisherStreamId) + publisherVideoTrackId = try container.decode(String.self, + forKey: .publisherVideoTrackId) + publisherAudioTrackId = try container.decode(String.self, + forKey: .publisherAudioTrackId) + // TODO: channel types } public func encode(to encoder: Encoder) throws { diff --git a/Sora/WebRTCConfigration.swift b/Sora/WebRTCConfigration.swift index 485e718d..9e0d52c4 100644 --- a/Sora/WebRTCConfigration.swift +++ b/Sora/WebRTCConfigration.swift @@ -110,6 +110,22 @@ public struct WebRTCConfiguration { } +private var sdpSemanticsTable: PairTable = + PairTable(pairs: [("planB", .planB), + ("unifiedPlan", .unifiedPlan)]) + +/// :nodoc: +extension SDPSemantics: Codable { + + public init(from decoder: Decoder) throws { + self = try sdpSemanticsTable.decode(from: decoder) + } + + public func encode(to encoder: Encoder) throws { + try sdpSemanticsTable.encode(self, to: encoder) + } + +} /// :nodoc: extension MediaConstraints: Codable { @@ -120,8 +136,11 @@ extension MediaConstraints: Codable { } public init(from decoder: Decoder) throws { - // TODO - assertionFailure("not yet implemented") + let container = try decoder.container(keyedBy: CodingKeys.self) + mandatory = try container.decode([String: String].self, + forKey: .mandatory) + optional = try container.decode([String: String].self, + forKey: .optional) } public func encode(to encoder: Encoder) throws { @@ -136,15 +155,23 @@ extension MediaConstraints: Codable { extension WebRTCConfiguration: Codable { enum CodingKeys: String, CodingKey { - case constraints - case iceServerInfos - case iceTransportPolicy + case constraints + case iceServerInfos + case iceTransportPolicy + case sdpSemantics } public init(from decoder: Decoder) throws { - // TODO - assertionFailure("not yet implemented") self.init() + let container = try decoder.container(keyedBy: CodingKeys.self) + constraints = try container.decode(MediaConstraints.self, + forKey: .constraints) + iceServerInfos = try container.decode([ICEServerInfo].self, + forKey: .iceServerInfos) + iceTransportPolicy = try container.decode(ICETransportPolicy.self, + forKey: .iceTransportPolicy) + sdpSemantics = try container.decode(SDPSemantics.self, + forKey: .sdpSemantics) } public func encode(to encoder: Encoder) throws { @@ -152,6 +179,7 @@ extension WebRTCConfiguration: Codable { try container.encode(constraints, forKey: .constraints) try container.encode(iceServerInfos, forKey: .iceServerInfos) try container.encode(iceTransportPolicy, forKey: .iceTransportPolicy) + try container.encode(sdpSemantics, forKey: .sdpSemantics) } } From 634619bbdb0849a4863456fb3accc0753962ddb7 Mon Sep 17 00:00:00 2001 From: SUZUKI Tetsuya Date: Fri, 5 Apr 2019 17:16:40 +0900 Subject: [PATCH 03/16] =?UTF-8?q?Optional=20=E3=81=AE=E5=80=A4=E3=81=A8?= =?UTF-8?q?=E3=81=97=E3=81=A6=E6=89=B1=E3=82=8F=E3=82=8C=E3=81=A6=E3=81=84?= =?UTF-8?q?=E3=81=AA=E3=81=8B=E3=81=A3=E3=81=9F=E3=81=AE=E3=81=A7=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sora/ICEServerInfo.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sora/ICEServerInfo.swift b/Sora/ICEServerInfo.swift index d6de55d2..2ea29249 100644 --- a/Sora/ICEServerInfo.swift +++ b/Sora/ICEServerInfo.swift @@ -67,8 +67,8 @@ extension ICEServerInfo: Codable { public convenience init(from decoder: Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) let urls = try container.decode([URL].self, forKey: .urls) - let userName = try container.decode(String.self, forKey: .userName) - let credential = try container.decode(String.self, forKey: .credential) + let userName = try container.decodeIfPresent(String.self, forKey: .userName) + let credential = try container.decodeIfPresent(String.self, forKey: .credential) self.init(urls: urls, userName: userName, credential: credential, From a7f30eaa1be5a48c4edb5644a804b7f241fd9d5f Mon Sep 17 00:00:00 2001 From: SUZUKI Tetsuya Date: Mon, 8 Apr 2019 16:47:57 +0900 Subject: [PATCH 04/16] =?UTF-8?q?"spotlight.changed"=20=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E3=81=AB=E5=AF=BE=E5=BF=9C=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sora/SignalingMessage.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Sora/SignalingMessage.swift b/Sora/SignalingMessage.swift index c0c90b47..6410d641 100644 --- a/Sora/SignalingMessage.swift +++ b/Sora/SignalingMessage.swift @@ -85,6 +85,8 @@ public enum SignalingNotificationEventType: String { /// "connection.destroyed" case connectionDestroyed = "connection.destroyed" + /// "spotlight.changed" + case spotlightChanged = "spotlight.changed" } /** From 7203b8fb2bd8e69f2f7f58c8027438acb2bd5c6f Mon Sep 17 00:00:00 2001 From: SUZUKI Tetsuya Date: Mon, 8 Apr 2019 17:02:57 +0900 Subject: [PATCH 05/16] =?UTF-8?q?"network.status"=20=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E3=81=AB=E5=AF=BE=E5=BF=9C=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sora/SignalingMessage.swift | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/Sora/SignalingMessage.swift b/Sora/SignalingMessage.swift index 6410d641..f33a3d75 100644 --- a/Sora/SignalingMessage.swift +++ b/Sora/SignalingMessage.swift @@ -87,6 +87,10 @@ public enum SignalingNotificationEventType: String { /// "spotlight.changed" case spotlightChanged = "spotlight.changed" + + /// "network.status" + case networkStatus = "network.status" + } /** @@ -131,7 +135,7 @@ public struct SignalingNotifyMessage { /// 映像の可否 public let videoEnabled: Bool? - // MARK: 統計情報 + // MARK: 接続状態 /// 接続時間 public let connectionTime: Int? @@ -145,6 +149,9 @@ public struct SignalingNotifyMessage { /// 接続中のサブスクライバーの数 public let subscriberCount: Int? + /// ネットワークの不安定度 + public let unstableLevel: Int? + // MARK: スポットライト機能 /// スポットライト ID @@ -308,7 +315,8 @@ extension SignalingConnectMessage: Codable { try container.encode(true, forKey: .multistream) try container.encode(true, forKey: .plan_b) } - + try container.encode(true, forKey: .plan_b) + if videoEnabled { if videoCodec != .default || videoBitRate != nil { var videoContainer = container @@ -430,6 +438,7 @@ extension SignalingNotifyMessage: Codable { case audio = "audio" case video = "video" case fixed = "fixed" + case unstableLevel = "unstable_level" case metadata = "metadata" case metadataList = "metadata_list" } @@ -455,7 +464,8 @@ extension SignalingNotifyMessage: Codable { videoEnabled = try container.decodeIfPresent(Bool.self, forKey: .video) spotlightId = try container.decodeIfPresent(String.self, forKey: .spotlightId) isFixed = try container.decodeIfPresent(Bool.self, forKey: .fixed) - + unstableLevel = try container.decodeIfPresent(Int.self, forKey: .unstableLevel) + // metadata には任意のデータが入るため、 Decoder ではデコードできない } From 8be3736a60cb8e64c2c0ae4a27d70c91b9e795b6 Mon Sep 17 00:00:00 2001 From: SUZUKI Tetsuya Date: Tue, 9 Apr 2019 16:30:19 +0900 Subject: [PATCH 06/16] =?UTF-8?q?=E6=98=A0=E5=83=8F=E3=82=B3=E3=83=BC?= =?UTF-8?q?=E3=83=87=E3=83=83=E3=82=AF=E3=81=AE=20enc/dec=20=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sora/NativePeerChannelFactory.swift | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/Sora/NativePeerChannelFactory.swift b/Sora/NativePeerChannelFactory.swift index 28f16e02..e5917eb0 100644 --- a/Sora/NativePeerChannelFactory.swift +++ b/Sora/NativePeerChannelFactory.swift @@ -9,7 +9,23 @@ class NativePeerChannelFactory { init() { Logger.debug(type: .peerChannel, message: "create native peer channel factory") - nativeFactory = RTCPeerConnectionFactory() + + // 映像コーデックのエンコーダーとデコーダーを用意する + // Sora iOS SDK では VP8, VP9, H.264 が有効 + let encoder = RTCDefaultVideoEncoderFactory() + let decoder = RTCDefaultVideoDecoderFactory() + nativeFactory = + RTCPeerConnectionFactory(encoderFactory: encoder, + decoderFactory: decoder) + + for info in encoder.supportedCodecs() { + Logger.debug(type: .peerChannel, + message: "supported video encoder: \(info.name) \(info.parameters)") + } + for info in decoder.supportedCodecs() { + Logger.debug(type: .peerChannel, + message: "supported video decoder: \(info.name) \(info.parameters)") + } } func createNativePeerChannel(configuration: WebRTCConfiguration, From 26bb0670ce5ee6962474520e106d1db5b9f0cedb Mon Sep 17 00:00:00 2001 From: SUZUKI Tetsuya Date: Wed, 10 Apr 2019 16:01:17 +0900 Subject: [PATCH 07/16] =?UTF-8?q?=E4=B8=8D=E8=A6=81=E3=81=AA=E3=82=AD?= =?UTF-8?q?=E3=83=BC=E3=83=AF=E3=83=BC=E3=83=89=E3=82=92=E6=B6=88=E3=81=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sora/CameraVideoCapturer.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sora/CameraVideoCapturer.swift b/Sora/CameraVideoCapturer.swift index 66267609..77ef04c1 100644 --- a/Sora/CameraVideoCapturer.swift +++ b/Sora/CameraVideoCapturer.swift @@ -203,7 +203,7 @@ public extension CameraVideoCapturer { /** `CameraVideoCapturer` の設定を表すオブジェクトです。 */ - public struct Settings: CustomStringConvertible { + struct Settings: CustomStringConvertible { /** デフォルトの設定。 */ public static let `default` = Settings( From 89c8e9da40e097ee86f620c9109c19fda3146d86 Mon Sep 17 00:00:00 2001 From: SUZUKI Tetsuya Date: Wed, 10 Apr 2019 16:02:55 +0900 Subject: [PATCH 08/16] =?UTF-8?q?Swift5=20=E5=90=91=E3=81=91=E3=81=AB?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .jazzy.yaml | 2 +- Sora.xcodeproj/project.pbxproj | 9 +++++---- Sora/ConnectionTimer.swift | 2 +- Sora/Extensions/RTC+Description.swift | 6 ++++++ Sora/Utilities.swift | 2 +- Sora/VideoFrame.swift | 2 +- Sora/VideoView.swift | 10 +++++----- 7 files changed, 20 insertions(+), 13 deletions(-) diff --git a/.jazzy.yaml b/.jazzy.yaml index 0e816e6a..41eed77b 100644 --- a/.jazzy.yaml +++ b/.jazzy.yaml @@ -9,7 +9,7 @@ min_acl: public sdk: iphoneos module: Sora module_version: 2.2.1 -swift_version: 4.2.1 +swift_version: 5.0 xcodebuild_arguments: - -parallelizeTargets - -scheme diff --git a/Sora.xcodeproj/project.pbxproj b/Sora.xcodeproj/project.pbxproj index 7c3c589b..514377c2 100644 --- a/Sora.xcodeproj/project.pbxproj +++ b/Sora.xcodeproj/project.pbxproj @@ -329,6 +329,7 @@ developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( + English, en, Base, ); @@ -589,7 +590,7 @@ SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_SWIFT3_OBJC_INFERENCE = Off; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; VALID_ARCHS = "arm64 armv7"; }; name = Debug; @@ -623,7 +624,7 @@ PROVISIONING_PROFILE_SPECIFIER = ""; SKIP_INSTALL = YES; SWIFT_SWIFT3_OBJC_INFERENCE = Off; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; VALID_ARCHS = "arm64 armv7"; }; name = Release; @@ -645,7 +646,7 @@ PROVISIONING_PROFILE = ""; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -666,7 +667,7 @@ PROVISIONING_PROFILE = ""; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Release; }; diff --git a/Sora/ConnectionTimer.swift b/Sora/ConnectionTimer.swift index 284651db..82612d96 100644 --- a/Sora/ConnectionTimer.swift +++ b/Sora/ConnectionTimer.swift @@ -72,7 +72,7 @@ class ConnectionTimer { } Logger.debug(type: .connectionTimer, message: "all OK") } - RunLoop.main.add(timer!, forMode: .commonModes) + RunLoop.main.add(timer!, forMode: RunLoop.Mode.common) isRunning = true } diff --git a/Sora/Extensions/RTC+Description.swift b/Sora/Extensions/RTC+Description.swift index 7cc02a3f..0008c48c 100644 --- a/Sora/Extensions/RTC+Description.swift +++ b/Sora/Extensions/RTC+Description.swift @@ -13,6 +13,8 @@ extension RTCSignalingState: CustomStringConvertible { case .haveRemoteOffer: return "haveRemoteOffer" case .haveRemotePrAnswer: return "haveRemotePrAnswer" case .closed: return "closed" + @unknown default: + fatalError("unknown state") } } } @@ -33,6 +35,8 @@ extension RTCIceConnectionState: CustomStringConvertible { case .disconnected: return "disconnected" case .closed: return "closed" case .count: return "count" + @unknown default: + fatalError("unknown state") } } } @@ -48,6 +52,8 @@ extension RTCIceGatheringState: CustomStringConvertible { case .new: return "new" case .gathering: return "gathering" case .complete: return "complete" + @unknown default: + fatalError("unknown state") } } } diff --git a/Sora/Utilities.swift b/Sora/Utilities.swift index 6852fafd..f14f44fe 100644 --- a/Sora/Utilities.swift +++ b/Sora/Utilities.swift @@ -38,7 +38,7 @@ public struct Utilities { public func run() { seconds = 0 - RunLoop.main.add(timer, forMode: .commonModes) + RunLoop.main.add(timer, forMode: RunLoop.Mode.common) timer.fire() } diff --git a/Sora/VideoFrame.swift b/Sora/VideoFrame.swift index f0943632..757a6ddc 100644 --- a/Sora/VideoFrame.swift +++ b/Sora/VideoFrame.swift @@ -45,7 +45,7 @@ public enum VideoFrame { get { switch self { case .native(capturer: _, frame: let frame): - return CMTimeMake(frame.timeStampNs, 1_000_000_000) + return CMTimeMake(value: frame.timeStampNs, timescale: 1_000_000_000) } } } diff --git a/Sora/VideoView.swift b/Sora/VideoView.swift index 0c07c282..0da50e8c 100644 --- a/Sora/VideoView.swift +++ b/Sora/VideoView.swift @@ -154,9 +154,9 @@ public class VideoView: UIView { if !isRendering { DispatchQueue.main.async { if let bgView = self.backgroundView { - self.bringSubview(toFront: bgView) + self.bringSubviewToFront(bgView) } else { - self.bringSubview(toFront: self.defaultBackgroundView) + self.bringSubviewToFront(self.defaultBackgroundView) } } } @@ -168,7 +168,7 @@ public class VideoView: UIView { public func start() { if !isRendering { DispatchQueue.main.async { - self.bringSubview(toFront: self.contentView) + self.bringSubviewToFront(self.contentView) self.isRendering = true } } @@ -317,7 +317,7 @@ class VideoViewContentView: UIView { } } - private var renderingContentMode: UIViewContentMode { + private var renderingContentMode: UIView.ContentMode { // superView に指定されている contentMode を優先的に使用する。 // 万一指定がない場合はデフォルトの aspect fit を使用する。 return self.superview?.contentMode ?? .scaleAspectFit @@ -361,7 +361,7 @@ class VideoViewContentView: UIView { } -private func viewSize(for videoFrameSize: CGSize, containerSize: CGSize, mode: UIViewContentMode) -> CGSize { +private func viewSize(for videoFrameSize: CGSize, containerSize: CGSize, mode: UIView.ContentMode) -> CGSize { switch mode { case .scaleToFill: // scale to fill モードの場合はアスペクト比を尊重する必要が無いので、 From 2d5c4391ef396221541a777733c4a3d5a57ddcf4 Mon Sep 17 00:00:00 2001 From: SUZUKI Tetsuya Date: Wed, 10 Apr 2019 16:06:28 +0900 Subject: [PATCH 09/16] =?UTF-8?q?Xcode=2010.2=20=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sora.xcodeproj/project.pbxproj | 7 ++++--- Sora.xcodeproj/xcshareddata/xcschemes/Sora.xcscheme | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Sora.xcodeproj/project.pbxproj b/Sora.xcodeproj/project.pbxproj index 514377c2..d645cd7f 100644 --- a/Sora.xcodeproj/project.pbxproj +++ b/Sora.xcodeproj/project.pbxproj @@ -308,7 +308,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0900; - LastUpgradeCheck = 1000; + LastUpgradeCheck = 1020; ORGANIZATIONNAME = "Shiguredo Inc."; TargetAttributes = { 91C7B0881D54636A006F5FA2 = { @@ -326,10 +326,9 @@ }; buildConfigurationList = 91C7B0831D54636A006F5FA2 /* Build configuration list for PBXProject "Sora" */; compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( - English, en, Base, ); @@ -445,6 +444,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -507,6 +507,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; diff --git a/Sora.xcodeproj/xcshareddata/xcschemes/Sora.xcscheme b/Sora.xcodeproj/xcshareddata/xcschemes/Sora.xcscheme index b8a048a5..a7a6132b 100644 --- a/Sora.xcodeproj/xcshareddata/xcschemes/Sora.xcscheme +++ b/Sora.xcodeproj/xcshareddata/xcschemes/Sora.xcscheme @@ -1,6 +1,6 @@ Date: Tue, 16 Apr 2019 16:33:23 +0900 Subject: [PATCH 10/16] =?UTF-8?q?=E3=83=9E=E3=83=AB=E3=83=81=E3=82=B9?= =?UTF-8?q?=E3=83=88=E3=83=AA=E3=83=BC=E3=83=A0=E6=99=82=E3=81=AE=20Plan?= =?UTF-8?q?=20B=20=E5=BC=B7=E5=88=B6=E4=BD=BF=E7=94=A8=E3=82=92=E6=AD=A2?= =?UTF-8?q?=E3=82=81=E3=80=81=20Plan=20B=20=E3=82=92=E4=BB=BB=E6=84=8F?= =?UTF-8?q?=E3=81=AB=E6=8C=87=E5=AE=9A=E3=81=A7=E3=81=8D=E3=82=8B=E3=82=88?= =?UTF-8?q?=E3=81=86=E3=81=AB=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sora/PeerChannel.swift | 1 + Sora/SignalingMessage.swift | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Sora/PeerChannel.swift b/Sora/PeerChannel.swift index 9a43e384..a3e8d006 100644 --- a/Sora/PeerChannel.swift +++ b/Sora/PeerChannel.swift @@ -462,6 +462,7 @@ class BasicPeerChannelContext: NSObject, RTCPeerConnectionDelegate { metadata: configuration.metadata, sdp: sdp, multistreamEnabled: multistream, + planBEnabled: webRTCConfiguration.sdpSemantics == .planB, videoEnabled: configuration.videoEnabled, videoCodec: configuration.videoCodec, videoBitRate: configuration.videoBitRate, diff --git a/Sora/SignalingMessage.swift b/Sora/SignalingMessage.swift index f33a3d75..fe0348ab 100644 --- a/Sora/SignalingMessage.swift +++ b/Sora/SignalingMessage.swift @@ -21,6 +21,9 @@ public struct SignalingConnectMessage { /// マルチストリームの可否 public var multistreamEnabled: Bool + /// Plan B の可否 + public var planBEnabled: Bool + /// 映像の可否 public var videoEnabled: Bool @@ -313,9 +316,11 @@ extension SignalingConnectMessage: Codable { if multistreamEnabled { try container.encode(true, forKey: .multistream) - try container.encode(true, forKey: .plan_b) } - try container.encode(true, forKey: .plan_b) + + if planBEnabled { + try container.encode(planBEnabled, forKey: .plan_b) + } if videoEnabled { if videoCodec != .default || videoBitRate != nil { From 448d35e878c9c8447df1a33eaa9c38e147ef12d2 Mon Sep 17 00:00:00 2001 From: SUZUKI Tetsuya Date: Tue, 16 Apr 2019 16:59:07 +0900 Subject: [PATCH 11/16] =?UTF-8?q?CircleCI=20=E3=81=A7=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E3=81=99=E3=82=8B=20Xcode=20=E3=81=AE=E3=83=90=E3=83=BC?= =?UTF-8?q?=E3=82=B8=E3=83=A7=E3=83=B3=E3=82=92=E4=B8=8A=E3=81=92=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index fd045969..55e70dbe 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,7 +2,7 @@ version: 2 jobs: build: macos: - xcode: "10.0.0" + xcode: "10.2.0" working_directory: ~/sora-ios-sdk environment: CIRCLE_ARTIFACTS: /tmp/circleci-artifacts From 7cd5aacb64773cc0e293b108c2b0410ba188f8dc Mon Sep 17 00:00:00 2001 From: SUZUKI Tetsuya Date: Tue, 16 Apr 2019 17:16:27 +0900 Subject: [PATCH 12/16] =?UTF-8?q?Copyright=20=E3=82=92=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1feec336..ea7be34e 100644 --- a/README.md +++ b/README.md @@ -51,4 +51,4 @@ Xcode と Swift のバージョンによっては、 Carthage と CocoaPods で # Copyright -Copyright 2017-2018, Shiguredo Inc. and Masashi Ono (akisute) +Copyright 2017-2019, Shiguredo Inc. and Masashi Ono (akisute) From 261b7ca663419a8ad31fe2e554e1b04293e642b8 Mon Sep 17 00:00:00 2001 From: SUZUKI Tetsuya Date: Tue, 16 Apr 2019 17:16:51 +0900 Subject: [PATCH 13/16] =?UTF-8?q?=E3=82=B7=E3=82=B9=E3=83=86=E3=83=A0?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6=E3=82=92=E6=9B=B4=E6=96=B0=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index ea7be34e..51695bc2 100644 --- a/README.md +++ b/README.md @@ -24,11 +24,11 @@ Sora iOS SDK に対する有償のサポートについては現在提供して - iOS 10.0 以降 - アーキテクチャ arm64, armv7 (シミュレーターは非対応) -- macOS 10.14 以降 -- Xcode 10.1 -- Swift 4.2.1 -- Carthage 0.29.0 以降、または CocoaPods 1.5.2 以降 -- WebRTC SFU Sora 18.10.0 以降 +- macOS 10.14.4 以降 +- Xcode 10.2 +- Swift 5.0 +- Carthage 0.33.0 以降、または CocoaPods 1.6.1 以降 +- WebRTC SFU Sora 19.04.0 以降 Xcode と Swift のバージョンによっては、 Carthage と CocoaPods で取得できるバイナリに互換性がない可能性があります。詳しくはドキュメントを参照してください。 From cb99dbae20feee5c644ae82e18029351b8ed9904 Mon Sep 17 00:00:00 2001 From: SUZUKI Tetsuya Date: Tue, 16 Apr 2019 21:35:24 +0900 Subject: [PATCH 14/16] =?UTF-8?q?=E3=83=90=E3=83=BC=E3=82=B8=E3=83=A7?= =?UTF-8?q?=E3=83=B3=E3=82=92=E4=B8=8A=E3=81=92=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sora/Info.plist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sora/Info.plist b/Sora/Info.plist index 51c40676..344518fa 100644 --- a/Sora/Info.plist +++ b/Sora/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 2.2.1 + 2.3.0 CFBundleSignature ???? CFBundleVersion From ff92aac1c31e6faabc2976f9d4eebbf1fcd5a725 Mon Sep 17 00:00:00 2001 From: SUZUKI Tetsuya Date: Tue, 16 Apr 2019 22:09:21 +0900 Subject: [PATCH 15/16] =?UTF-8?q?=E5=A4=89=E6=9B=B4=E7=82=B9=E3=82=92?= =?UTF-8?q?=E6=9B=B8=E3=81=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGES.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index b3148711..2b6eaa42 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -9,6 +9,30 @@ - FIX - バグ修正 +## 2.3.0 + +### CHANGE + +- システム条件を更新した + + - WebRTC SFU Sora 19.04.0 以降 + + - macOS 10.14.4 以降 + + - Xcode 10.2 + + - Swift 5 + +- マルチストリーム時に強制的に Plan B に設定していたのを止めた + +- 未知のシグナリングメッセージを受信したら例外を発生するように変更した + +- シグナリング "notify" の次のイベントに対応した + + - "spotlight.changed" + + - "network.status" + ## 2.2.1 ### CHANGE From 11d937a1c4ed0df0b551acbad2eebbb1bc0823d5 Mon Sep 17 00:00:00 2001 From: SUZUKI Tetsuya Date: Tue, 16 Apr 2019 22:10:38 +0900 Subject: [PATCH 16/16] =?UTF-8?q?=E3=83=90=E3=83=BC=E3=82=B8=E3=83=A7?= =?UTF-8?q?=E3=83=B3=E3=82=92=E6=9B=B4=E6=96=B0=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sora.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sora.podspec b/Sora.podspec index e21d5353..ea8a3594 100644 --- a/Sora.podspec +++ b/Sora.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "Sora" - s.version = "2.2.1" + s.version = "2.3.0" s.summary = "Sora iOS SDK" s.description = <<-DESC A library to develop Sora client applications.