Skip to content

Commit

Permalink
Merge pull request #199 from shiguredo/feature/fix-type-offer-simulca…
Browse files Browse the repository at this point in the history
…st-overwrite

simulcast の判定を type: offer の simulcast の値で判定するように修正する
  • Loading branch information
zztkm authored Jul 19, 2024
2 parents 1cececb + cebc951 commit 37b64ba
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,13 @@
- CocoaPods 1.8 からソースリポジトリのデフォルトが `https://cdn.cocoapods.org/` になった
- https://blog.cocoapods.org/CocoaPods-1.8.0-beta/
- @zztkm
- [UPDATE] `SignalingOffer``simulcast` を追加する
- @zztkm
- [FIX] SignalingConnect の `metadata`, `signaling_notify_metadata` が nil の場合に {} として送信されてしまう問題を修正する
- @zztkm
- [FIX] `WrapperVideoEncoderFactory.shared.simulcastEnabled` の値を type: offer の際に設定される simulcast の値で上書きする
- 認証ウェブフック成功時に払い出された type: offer の `simulcast` の値が反映されない不具合への対応
- @zztkm

## 2024.2.0

Expand Down
5 changes: 5 additions & 0 deletions Sora/PeerChannel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -828,6 +828,11 @@ class PeerChannel: NSObject, RTCPeerConnectionDelegate {
signalingOfferMessageDataChannels = dataChannels
}

// offer.simulcast が設定されている場合、WrapperVideoEncoderFactory.shared.simulcastEnabled を上書きする
if let simulcast = offer.simulcast {
WrapperVideoEncoderFactory.shared.simulcastEnabled = simulcast
}

createAndSendAnswer(offer: offer)
case let .update(update):
if configuration.isMultistream {
Expand Down
5 changes: 5 additions & 0 deletions Sora/Signaling.swift
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,9 @@ public struct SignalingOffer {

/// mid
public let mid: [String: String]?

/// サイマルキャスト有効 / 無効フラグ
public let simulcast: Bool?
}

/**
Expand Down Expand Up @@ -958,6 +961,7 @@ extension SignalingOffer: Codable {
case config
case encodings
case mid
case simulcast
}

public init(from decoder: Decoder) throws {
Expand All @@ -973,6 +977,7 @@ extension SignalingOffer: Codable {
try container.decodeIfPresent([Encoding].self,
forKey: .encodings)
mid = try container.decodeIfPresent([String: String].self, forKey: .mid)
simulcast = try container.decodeIfPresent(Bool.self, forKey: .simulcast)
}

public func encode(to encoder: Encoder) throws {
Expand Down

0 comments on commit 37b64ba

Please sign in to comment.