From 717a2d8ef410a65b3f26f7c512adec502011253a Mon Sep 17 00:00:00 2001 From: zztkm Date: Fri, 13 Dec 2024 12:01:13 +0900 Subject: [PATCH] =?UTF-8?q?forwarding=5Ffiters=20=E3=81=AB=E5=AF=BE?= =?UTF-8?q?=E5=BF=9C=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jp/shiguredo/sora/sdk/channel/SoraMediaChannel.kt | 6 +++++- .../sora/sdk/channel/option/SoraForwardingFilterOption.kt | 4 ++++ .../sora/sdk/channel/signaling/SignalingChannel.kt | 4 +++- .../shiguredo/sora/sdk/channel/signaling/message/Catalog.kt | 3 ++- .../sora/sdk/channel/signaling/message/MessageConverter.kt | 2 ++ 5 files changed, 16 insertions(+), 3 deletions(-) diff --git a/sora-android-sdk/src/main/kotlin/jp/shiguredo/sora/sdk/channel/SoraMediaChannel.kt b/sora-android-sdk/src/main/kotlin/jp/shiguredo/sora/sdk/channel/SoraMediaChannel.kt index dd7857b9..13aeeea8 100644 --- a/sora-android-sdk/src/main/kotlin/jp/shiguredo/sora/sdk/channel/SoraMediaChannel.kt +++ b/sora-android-sdk/src/main/kotlin/jp/shiguredo/sora/sdk/channel/SoraMediaChannel.kt @@ -69,6 +69,7 @@ import kotlin.concurrent.schedule * @param dataChannels connect メッセージに含める `data_channels` * @param bundleId connect メッセージに含める `bundle_id` * @param forwardingFilterOption 転送フィルター機能の設定 + * @param forwardingFiltersOption マルチ転送フィルター機能の設定 */ class SoraMediaChannel @JvmOverloads constructor( private val context: Context, @@ -87,6 +88,7 @@ class SoraMediaChannel @JvmOverloads constructor( dataChannels: List>? = null, private var bundleId: String? = null, private val forwardingFilterOption: SoraForwardingFilterOption? = null, + private val forwardingFiltersOption: List? = null, ) { companion object { private val TAG = SoraMediaChannel::class.simpleName @@ -672,6 +674,7 @@ class SoraMediaChannel @JvmOverloads constructor( |bundleId = ${this.bundleId} |signalingNotifyMetadata = ${this.signalingNotifyMetadata} |forwardingFilter = ${this.forwardingFilterOption} + |forwardingFilters = ${this.forwardingFiltersOption} """.trimMargin() ) @@ -781,7 +784,8 @@ class SoraMediaChannel @JvmOverloads constructor( signalingNotifyMetadata = signalingNotifyMetadata, connectDataChannels = connectDataChannels, redirect = redirectLocation != null, - forwardingFilterOption = forwardingFilterOption + forwardingFilterOption = forwardingFilterOption, + forwardingFiltersOption = forwardingFiltersOption ) signaling!!.connect() } diff --git a/sora-android-sdk/src/main/kotlin/jp/shiguredo/sora/sdk/channel/option/SoraForwardingFilterOption.kt b/sora-android-sdk/src/main/kotlin/jp/shiguredo/sora/sdk/channel/option/SoraForwardingFilterOption.kt index 72246757..5c1f57fd 100644 --- a/sora-android-sdk/src/main/kotlin/jp/shiguredo/sora/sdk/channel/option/SoraForwardingFilterOption.kt +++ b/sora-android-sdk/src/main/kotlin/jp/shiguredo/sora/sdk/channel/option/SoraForwardingFilterOption.kt @@ -9,6 +9,8 @@ package jp.shiguredo.sora.sdk.channel.option * @param metadata 転送フィルターのメタデータ */ class SoraForwardingFilterOption( + var name: String? = null, + var priority: Int? = null, val action: Action? = null, val rules: List>, val version: String? = null, @@ -66,6 +68,8 @@ class SoraForwardingFilterOption( internal val signaling: Any get() { return mapOf( + "name" to name, + "priority" to priority, "action" to (action?.name?.lowercase() ?: null), "rules" to rules.map { outerRule -> outerRule.map { rule -> diff --git a/sora-android-sdk/src/main/kotlin/jp/shiguredo/sora/sdk/channel/signaling/SignalingChannel.kt b/sora-android-sdk/src/main/kotlin/jp/shiguredo/sora/sdk/channel/signaling/SignalingChannel.kt index fa071e43..b20799ec 100644 --- a/sora-android-sdk/src/main/kotlin/jp/shiguredo/sora/sdk/channel/signaling/SignalingChannel.kt +++ b/sora-android-sdk/src/main/kotlin/jp/shiguredo/sora/sdk/channel/signaling/SignalingChannel.kt @@ -69,6 +69,7 @@ class SignalingChannelImpl @JvmOverloads constructor( private val connectDataChannels: List>? = null, private val redirect: Boolean = false, private val forwardingFilterOption: SoraForwardingFilterOption? = null, + private val forwardingFiltersOption: List? = null, ) : SignalingChannel { companion object { @@ -260,7 +261,8 @@ class SignalingChannelImpl @JvmOverloads constructor( signalingNotifyMetadata = signalingNotifyMetadata, dataChannels = connectDataChannels, redirect = redirect, - forwardingFilterOption = forwardingFilterOption + forwardingFilterOption = forwardingFilterOption, + forwardingFiltersOption = forwardingFiltersOption ) it.send(message) } diff --git a/sora-android-sdk/src/main/kotlin/jp/shiguredo/sora/sdk/channel/signaling/message/Catalog.kt b/sora-android-sdk/src/main/kotlin/jp/shiguredo/sora/sdk/channel/signaling/message/Catalog.kt index 0648ac3d..502b04c5 100644 --- a/sora-android-sdk/src/main/kotlin/jp/shiguredo/sora/sdk/channel/signaling/message/Catalog.kt +++ b/sora-android-sdk/src/main/kotlin/jp/shiguredo/sora/sdk/channel/signaling/message/Catalog.kt @@ -49,7 +49,8 @@ data class ConnectMessage( @SerializedName("audio_streaming_language_code") val audioStreamingLanguageCode: String? = null, @SerializedName("redirect") var redirect: Boolean? = null, - @SerializedName("forwarding_filter") val forwardingFilter: Any? = null + @SerializedName("forwarding_filter") val forwardingFilter: Any? = null, + @SerializedName("forwarding_filters") val forwardingFilters: List? = null ) data class VideoSetting( diff --git a/sora-android-sdk/src/main/kotlin/jp/shiguredo/sora/sdk/channel/signaling/message/MessageConverter.kt b/sora-android-sdk/src/main/kotlin/jp/shiguredo/sora/sdk/channel/signaling/message/MessageConverter.kt index b224f9b2..995c8870 100644 --- a/sora-android-sdk/src/main/kotlin/jp/shiguredo/sora/sdk/channel/signaling/message/MessageConverter.kt +++ b/sora-android-sdk/src/main/kotlin/jp/shiguredo/sora/sdk/channel/signaling/message/MessageConverter.kt @@ -44,6 +44,7 @@ class MessageConverter { dataChannels: List>? = null, redirect: Boolean = false, forwardingFilterOption: SoraForwardingFilterOption? = null, + forwardingFiltersOption: List? = null, ): String { val msg = ConnectMessage( @@ -60,6 +61,7 @@ class MessageConverter { signalingNotifyMetadata = signalingNotifyMetadata, audioStreamingLanguageCode = mediaOption.audioStreamingLanguageCode, forwardingFilter = forwardingFilterOption?.signaling, + forwardingFilters = forwardingFiltersOption?.map { it.signaling } ) if (mediaOption.upstreamIsRequired) {