@@ -388,6 +388,9 @@ public struct SignalingOffer {
388388 /// 映像解像度を送信前に下げる度合
389389 public let scaleResolutionDownBy : Double ?
390390
391+ /// 解像度の
392+ public let scaleResolutionDownTo : RTCResolutionRestriction ?
393+
391394 /// scalability mode
392395 public let scalabilityMode : String ?
393396
@@ -404,6 +407,9 @@ public struct SignalingOffer {
404407 if let value = scaleResolutionDownBy {
405408 params. scaleResolutionDownBy = NSNumber ( value: value)
406409 }
410+ if let value = scaleResolutionDownTo {
411+ params. scaleResolutionDownTo = value
412+ }
407413 params. scalabilityMode = scalabilityMode
408414 return params
409415 }
@@ -981,6 +987,24 @@ extension SignalingOffer.Configuration: Codable {
981987 }
982988}
983989
990+ fileprivate struct ScaleResolutionDownTo {
991+ fileprivate let maxWidth : Int
992+ fileprivate let maxHeight : Int
993+ }
994+
995+ extension ScaleResolutionDownTo : Codable {
996+ enum CodingKeys : String , CodingKey {
997+ case maxWidth
998+ case maxHeight
999+ }
1000+
1001+ public init ( from decoder: Decoder ) throws {
1002+ let container = try decoder. container ( keyedBy: CodingKeys . self)
1003+ maxWidth = try container. decode ( Int . self, forKey: . maxWidth)
1004+ maxHeight = try container. decode ( Int . self, forKey: . maxHeight)
1005+ }
1006+ }
1007+
9841008/// :nodoc:
9851009extension SignalingOffer . Encoding : Codable {
9861010 enum CodingKeys : String , CodingKey {
@@ -989,19 +1013,28 @@ extension SignalingOffer.Encoding: Codable {
9891013 case maxBitrate
9901014 case maxFramerate
9911015 case scaleResolutionDownBy
1016+ case scaleResolutionDownTo
9921017 case scalabilityMode
9931018 }
994-
1019+
9951020 public init ( from decoder: Decoder ) throws {
9961021 let container = try decoder. container ( keyedBy: CodingKeys . self)
9971022 rid = try container. decodeIfPresent ( String . self, forKey: . rid)
9981023 active = try container. decodeIfPresent ( Bool . self, forKey: . active) ?? true
9991024 maxBitrate = try container. decodeIfPresent ( Int . self, forKey: . maxBitrate)
10001025 maxFramerate = try container. decodeIfPresent ( Double . self, forKey: . maxFramerate)
1001- scaleResolutionDownBy = try container. decodeIfPresent ( Double . self,
1002- forKey: . scaleResolutionDownBy)
1003- scalabilityMode = try container. decodeIfPresent ( String . self,
1004- forKey: . scalabilityMode)
1026+ scaleResolutionDownBy = try container. decodeIfPresent ( Double . self, forKey: . scaleResolutionDownBy)
1027+
1028+ if let _scleResolutionDownTo = try container. decodeIfPresent ( ScaleResolutionDownTo . self, forKey: . scaleResolutionDownTo) {
1029+ let restriction = RTCResolutionRestriction ( )
1030+ restriction. maxWidth = NSNumber ( value: _scleResolutionDownTo. maxWidth)
1031+ restriction. maxHeight = NSNumber ( value: _scleResolutionDownTo. maxHeight)
1032+ scaleResolutionDownTo = restriction
1033+ } else {
1034+ scaleResolutionDownTo = nil
1035+ }
1036+
1037+ scalabilityMode = try container. decodeIfPresent ( String . self, forKey: . scalabilityMode)
10051038 }
10061039
10071040 public func encode( to encoder: Encoder ) throws {
0 commit comments