in amazon-chime-sdk/src/main/java/com/amazonaws/services/chime/sdk/meetings/internal/video/DefaultVideoClientController.kt [216:247]
override fun updateVideoSourceSubscriptions(
addedOrUpdated: Map<RemoteVideoSource, VideoSubscriptionConfiguration>,
removed: Array<RemoteVideoSource>
) {
if (!videoClientStateController.canAct(VideoClientState.INITIALIZED)) return
for (key in addedOrUpdated.keys) {
logger.info(
TAG,
"Adding/updating video sources subscription: ${key.attendeeId} with priority: ${addedOrUpdated[key]?.priority} " +
"targetResolution: ${addedOrUpdated[key]?.targetResolution}"
)
}
for (key in removed) {
logger.info(
TAG,
"Removing video source subscription: ${key.attendeeId}"
)
}
val addedOrUpdatedInternal: MutableMap<RemoteVideoSourceInternal, VideoSubscriptionConfigurationInternal> =
mutableMapOf()
for ((source, config) in addedOrUpdated) {
addedOrUpdatedInternal[RemoteVideoSourceInternal(source.attendeeId)] =
VideoSubscriptionConfigurationInternal(
VideoPriorityInternal(config.priority.value),
VideoResolutionInternal(config.targetResolution.width, config.targetResolution.height)
)
}
val removedInternal = removed.map { source -> RemoteVideoSourceInternal(source.attendeeId) }
videoClient?.updateVideoSourceSubscriptions(addedOrUpdatedInternal, removedInternal)
}