Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,8 @@
- RPC メソッドを表す列挙型 `RPCMethod` を追加する
- `SignalingOffer` に以下の項目を追加する
- `rpcMethods: [String]?`
- `simulcastRpcRids: [Rid]?` を追加する
- `MediaChannel` に `rpc` メソッドを追加する
- `MediaChannel` に以下の項目を追加する
- `rpcMethods: [RPCMethod]`
- `rpcSimulcastRids: [Rid]`
- `MediaChannel` に `rpcMethods: [RPCMethod]` を追加する
- RPC メソッドを定義するための `RPCMethodProtocol` プロトコルを追加する
- `RPCMethodProtocol` に準拠した型を追加する
- `RequestSimulcastRid`
Expand Down
9 changes: 0 additions & 9 deletions Sora/MediaChannel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -175,15 +175,6 @@ public final class MediaChannel {
peerChannel.rpcChannel?.allowedMethods.compactMap { RPCMethod(name: $0) } ?? []
}

/// RPC で利用可能なサイマルキャスト rid の一覧
///
/// Sora サーバーから通知された、RPC で操作可能なサイマルキャスト rid が取得できます。
///
/// - Returns: 利用可能なサイマルキャスト rid の一覧。RPC が初期化されていない場合は空配列を返します
public var rpcSimulcastRids: [Rid] {
peerChannel.rpcChannel?.simulcastRpcRids ?? []
}

// MARK: 接続チャネル

/// シグナリングチャネル
Expand Down
10 changes: 1 addition & 9 deletions Sora/PeerChannel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ class PeerChannel: NSObject, RTCPeerConnectionDelegate {
var switchedToDataChannel: Bool = false
var signalingOfferMessageDataChannels: [[String: Any]] = []
var rpcAllowedMethods: [String] = []
var rpcSimulcastRids: [Rid] = []
var rpcChannel: RPCChannel?

weak var mediaChannel: MediaChannel?
Expand Down Expand Up @@ -955,12 +954,6 @@ class PeerChannel: NSObject, RTCPeerConnectionDelegate {
rpcAllowedMethods = []
}

if let simulcastRpcRids = offer.simulcastRpcRids {
rpcSimulcastRids = simulcastRpcRids
} else {
rpcSimulcastRids = []
}

// offer.simulcast が設定されている場合、WrapperVideoEncoderFactory.shared.simulcastEnabled を上書きする
if let simulcast = offer.simulcast {
WrapperVideoEncoderFactory.shared.simulcastEnabled = simulcast
Expand Down Expand Up @@ -1405,8 +1398,7 @@ class PeerChannel: NSObject, RTCPeerConnectionDelegate {
if label == "rpc" {
rpcChannel = RPCChannel(
dataChannel: dc,
rpcMethods: rpcAllowedMethods,
simulcastRpcRids: rpcSimulcastRids)
rpcMethods: rpcAllowedMethods)
}
}
}
Expand Down
6 changes: 1 addition & 5 deletions Sora/RPC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,15 @@ public final class RPCChannel {
let allowedMethods: [String]
private let allowedMethodNames: Set<String>

/// Sora から払い出されたサイマルキャスト rid の一覧
let simulcastRpcRids: [Rid]

init?(
dataChannel: DataChannel, rpcMethods: [String], simulcastRpcRids: [Rid]
dataChannel: DataChannel, rpcMethods: [String]
) {
guard !rpcMethods.isEmpty else {
return nil
}
self.dataChannel = dataChannel
self.allowedMethods = rpcMethods
self.allowedMethodNames = Set(rpcMethods)
self.simulcastRpcRids = simulcastRpcRids
}

/// RPC が利用可能かを返す。
Expand Down
5 changes: 0 additions & 5 deletions Sora/Signaling.swift
Original file line number Diff line number Diff line change
Expand Up @@ -478,9 +478,6 @@ public struct SignalingOffer {
/// RPC で利用可能なメソッド
public var rpcMethods: [String]?

/// RPC 経由で切り替えられるサイマルキャストの rid
public var simulcastRpcRids: [Rid]?

/// audio
public let audio: Bool?

Expand Down Expand Up @@ -1134,7 +1131,6 @@ extension SignalingOffer: Codable {
case video_codec_type
case video_bit_rate
case rpc_methods
case simulcast_rpc_rids
}

public init(from decoder: Decoder) throws {
Expand Down Expand Up @@ -1167,7 +1163,6 @@ extension SignalingOffer: Codable {
videoCodecType = try container.decodeIfPresent(String.self, forKey: .video_codec_type)
videoBitRate = try container.decodeIfPresent(Int.self, forKey: .video_bit_rate)
rpcMethods = try container.decodeIfPresent([String].self, forKey: .rpc_methods)
simulcastRpcRids = try container.decodeIfPresent([Rid].self, forKey: .simulcast_rpc_rids)
}

public func encode(to encoder: Encoder) throws {
Expand Down
3 changes: 1 addition & 2 deletions Sora/Types.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/// 映像の rid を表します。
/// type: offer の simulcastRpcRids や RPC で利用される汎用 rid 型です。
/// サイマルキャストの rid を表す汎用型
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sonnetに指摘されて「映像の」から「サイマルキャストの」としました。

public enum Rid: Equatable {
/// 映像を受信しない
case none
Expand Down
66 changes: 0 additions & 66 deletions SoraTests/SignalingOfferTests.swift
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不要になったので削除しました。

This file was deleted.