diff --git a/jvb/src/main/kotlin/org/jitsi/videobridge/cc/allocation/AllocationSettings.kt b/jvb/src/main/kotlin/org/jitsi/videobridge/cc/allocation/AllocationSettings.kt index 73ca5fb400..c9a1762e65 100644 --- a/jvb/src/main/kotlin/org/jitsi/videobridge/cc/allocation/AllocationSettings.kt +++ b/jvb/src/main/kotlin/org/jitsi/videobridge/cc/allocation/AllocationSettings.kt @@ -16,6 +16,8 @@ */ package org.jitsi.videobridge.cc.allocation +import org.jitsi.config.JitsiConfig +import org.jitsi.metaconfig.config import org.jitsi.nlj.util.bps import org.jitsi.utils.OrderedJsonObject import org.jitsi.utils.logging2.Logger @@ -35,7 +37,7 @@ data class AllocationSettings @JvmOverloads constructor( val onStageSources: List = emptyList(), val selectedSources: List = emptyList(), val videoConstraints: Map = emptyMap(), - val lastN: Int = -1, + val lastN: Int = defaultInitialLastN, val defaultConstraints: VideoConstraints, /** A non-negative value is assumed as the available bandwidth in bps. A negative value is ignored. */ val assumedBandwidthBps: Long = -1 @@ -52,6 +54,12 @@ data class AllocationSettings @JvmOverloads constructor( override fun toString(): String = toJson().toJSONString() fun getConstraints(endpointId: String) = videoConstraints.getOrDefault(endpointId, defaultConstraints) + + companion object { + val defaultInitialLastN: Int by config { + "videobridge.cc.initial-last-n".from(JitsiConfig.newConfig) + } + } } /** @@ -68,7 +76,7 @@ internal class AllocationSettingsWrapper( */ private var selectedSources = emptyList() - internal var lastN: Int = -1 + internal var lastN: Int = AllocationSettings.defaultInitialLastN private var videoConstraints: Map = emptyMap() diff --git a/jvb/src/main/resources/reference.conf b/jvb/src/main/resources/reference.conf index cb49a9d49a..7f6f6748e8 100644 --- a/jvb/src/main/resources/reference.conf +++ b/jvb/src/main/resources/reference.conf @@ -67,6 +67,10 @@ videobridge { # no last-n limit) jvb-last-n = -1 + // The initial value for the client-configured last-n setting. This applies before it is overriden by colibri or + // data channel signaling (-1 implies no last-n limit). + initial-last-n = -1 + # If set allows receivers to override bandwidth estimation (BWE) with a specific value signaled over the bridge # channel (limited to the configured value). If not set, receivers are not allowed to override BWE. // assumed-bandwidth-limit = 10 Mbps