Skip to content

Commit

Permalink
SignalingNotify に項目を追加する
Browse files Browse the repository at this point in the history
  • Loading branch information
miosakuma committed Jan 16, 2024
1 parent 24595b7 commit 91d12ec
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
9 changes: 9 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@
- @enm10k @miosakuma
- [UPDATE] ForwardingFilter の action を未指定にできるようにする
- @miosakuma
- [FIX] NotificationMessage に項目を追加する
- session_id
- kind
- destination_connection_id
- source_connection_id
- recv_connection_id
- send_connection_id
- stream_id
- @miosakuma

## 2023.3.1

Expand Down
41 changes: 41 additions & 0 deletions Sora/Signaling.swift
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,9 @@ public struct SignalingNotify {
/// ロール
public var role: SignalingRole?

/// セッション ID
public var sessionId: String?

/// クライアント ID
public var clientId: String?

Expand Down Expand Up @@ -569,6 +572,24 @@ public struct SignalingNotify {

/// TURN が利用しているトランスポート層のプロトコル
public var turnTransportType: String?

/// 転送フィルターで block または allow となった対象 (audio または video)
public var kind: String?

/// 転送フィルターで block または allow となった送信先の接続 ID
public var destinationConnectionId: String?

/// 転送フィルターで block または allow となった送信元の接続 ID
public var sourceConnectionId: String?

/// RTP で RTP ストリーム停止となった送信先の接続 ID
public var recvConnectionId: String?

/// RTP で RTP ストリーム停止となった送信元の接続 ID
public var sendConnectionId: String?

/// RTP で RTP ストリーム再開となったストリームの ID
public var streamId: String?
}

/**
Expand Down Expand Up @@ -1052,6 +1073,7 @@ extension SignalingNotify: Codable {
enum CodingKeys: String, CodingKey {
case event_type
case role
case session_id
case client_id
case bundle_id
case connection_id
Expand All @@ -1068,13 +1090,20 @@ extension SignalingNotify: Codable {
case fixed
case unstable_level
case turn_transport_type
case kind
case destination_connection_id
case source_connection_id
case recv_connection_id
case send_connection_id
case stream_id
}

public init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
eventType = try container.decode(String.self,
forKey: .event_type)
role = try container.decodeIfPresent(SignalingRole.self, forKey: .role)
sessionId = try container.decodeIfPresent(String.self, forKey: .session_id)
clientId = try container.decodeIfPresent(String.self, forKey: .client_id)
bundleId = try container.decodeIfPresent(String.self, forKey: .bundle_id)
connectionId = try container.decodeIfPresent(String.self,
Expand All @@ -1098,6 +1127,18 @@ extension SignalingNotify: Codable {
try container.decodeIfPresent(Int.self, forKey: .unstable_level)
turnTransportType =
try container.decodeIfPresent(String.self, forKey: .turn_transport_type)
kind =
try container.decodeIfPresent(String.self, forKey: .kind)
destinationConnectionId =
try container.decodeIfPresent(String.self, forKey: .destination_connection_id)
sourceConnectionId =
try container.decodeIfPresent(String.self, forKey: .source_connection_id)
recvConnectionId =
try container.decodeIfPresent(String.self, forKey: .recv_connection_id)
sendConnectionId =
try container.decodeIfPresent(String.self, forKey: .send_connection_id)
streamId =
try container.decodeIfPresent(String.self, forKey: .stream_id)
}

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

0 comments on commit 91d12ec

Please sign in to comment.