Skip to content

Commit

Permalink
revert back to using string/conversion for enums (see jitsi/jitsi-met…
Browse files Browse the repository at this point in the history
  • Loading branch information
bbaldino committed Jul 24, 2020
1 parent f18250e commit 1b378c4
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 12 deletions.
23 changes: 15 additions & 8 deletions jvb/src/main/kotlin/org/jitsi/videobridge/ice/IceConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class IceConfig {
}

/**
* The additional port to advertise, or [null] if none is configured.
* The additional port to advertise, or null if none is configured.
*/
val tcpMappedPort: Int? by optionalconfig {
retrieve("org.jitsi.videobridge.TCP_HARVESTER_MAPPED_PORT".from(JitsiConfig.legacyConfig))
Expand Down Expand Up @@ -76,11 +76,15 @@ class IceConfig {

val keepAliveStrategy: KeepAliveStrategy by config {
retrieve("org.jitsi.videobridge.KEEP_ALIVE_STRATEGY"
.from(JitsiConfig.legacyConfig)
.asType<String>()
.andConvertBy { KeepAliveStrategy.fromString(it) }
.from(JitsiConfig.legacyConfig)
.asType<String>()
.andConvertBy { KeepAliveStrategy.fromString(it) }
)
retrieve("videobridge.ice.keep-alive-strategy"
.from(JitsiConfig.newConfig)
.asType<String>()
.andConvertBy { KeepAliveStrategy.fromString(it) }
)
retrieve("videobridge.ice.keep-alive-strategy".from(JitsiConfig.newConfig))
}

/**
Expand All @@ -98,7 +102,10 @@ class IceConfig {
/**
* The ice4j nomination strategy policy.
*/
val nominationStrategy: NominationStrategy by config(
"videobridge.ice.nomination-strategy".from(JitsiConfig.newConfig)
)
val nominationStrategy: NominationStrategy by config {
"videobridge.ice.nomination-strategy"
.from(JitsiConfig.newConfig)
.asType<String>()
.andConvertBy { NominationStrategy.fromString(it) }
}
}
8 changes: 4 additions & 4 deletions jvb/src/main/resources/reference.conf
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ videobridge {
#ufrag-prefix = "jvb-123:"

# Which candidate pairs to keep alive. The accepted values are defined in ice4j's KeepAliveStrategy:
# "SELECTED_AND_TCP", "SELECTED_ONLY", or "ALL_SUCCEEDED".
keep-alive-strategy = "SELECTED_AND_TCP"
# "selected_and_tcp", "selected_only", or "all_succeeded".
keep-alive-strategy = "selected_and_tcp"

# Whether to use the "component socket" feature of ice4j.
use-component-socket = true
Expand All @@ -153,8 +153,8 @@ videobridge {
resolve-remote-candidates = false

# The nomination strategy to use for ICE. THe accepted values are defined in ice4j's NominationStrategy:
# "NOMINATE_FIRST_VALID", "NOMINATE_HIGHEST_PRIORITY", "NOMINATE_FIRST_HOST_OR_REFLEXIVE_VALID", or "NOMINATE_BEST_RTT".
nomination-strategy = "NOMINATE_FIRST_VALID"
# "NominateFirstValid", "NominateHighestPriority", "NominateFirstHostOrReflexiveValid", or "NominateBestRTT".
nomination-strategy = "NominateFirstValid"
}

transport {
Expand Down

0 comments on commit 1b378c4

Please sign in to comment.