davidliu
Committed by GitHub

Update to m125 (#436)

* Fix compile errors with m125

* Update default encryption option values

* Update webrtc to m125.6422.02

* spotless
[versions]
webrtc = "114.5735.09"
webrtc = "125.6422.02"
androidJainSipRi = "1.3.0-91"
androidx-activity = "1.9.0"
... ...
/*
* Copyright 2023 LiveKit, Inc.
* Copyright 2023-2024 LiveKit, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
... ... @@ -18,10 +18,12 @@ package io.livekit.android.e2ee
import livekit.LivekitModels.Encryption
var defaultRatchetSalt = "LKFrameEncryptionKey"
var defaultMagicBytes = "LK-ROCKS"
var defaultRatchetWindowSize = 0
var defaultFaultTolerance = -1
internal const val defaultRatchetSalt = "LKFrameEncryptionKey"
internal const val defaultMagicBytes = "LK-ROCKS"
internal const val defaultRatchetWindowSize = 16
internal const val defaultFailureTolerance = -1
internal const val defaultKeyRingSize = 16
internal const val defaultDiscardFrameWhenCryptorNotReady = false
class E2EEOptions
constructor(
... ... @@ -30,7 +32,9 @@ constructor(
defaultMagicBytes,
defaultRatchetWindowSize,
true,
defaultFaultTolerance,
defaultFailureTolerance,
defaultKeyRingSize,
defaultDiscardFrameWhenCryptorNotReady,
),
encryptionType: Encryption.Type = Encryption.Type.GCM,
) {
... ...
... ... @@ -43,13 +43,14 @@ public interface KeyProvider {
class BaseKeyProvider
constructor(
private var ratchetSalt: String,
private var uncryptedMagicBytes: String,
private var ratchetWindowSize: Int,
private var ratchetSalt: String = defaultRatchetSalt,
private var uncryptedMagicBytes: String = defaultMagicBytes,
private var ratchetWindowSize: Int = defaultRatchetWindowSize,
override var enableSharedKey: Boolean = true,
private var failureTolerance: Int,
) :
KeyProvider {
private var failureTolerance: Int = defaultFailureTolerance,
private var keyRingSize: Int = defaultKeyRingSize,
private var discardFrameWhenCryptorNotReady: Boolean = defaultDiscardFrameWhenCryptorNotReady,
) : KeyProvider {
private var keys: MutableMap<String, MutableMap<Int, String>> = mutableMapOf()
override fun setSharedKey(key: String, keyIndex: Int?): Boolean {
return rtcKeyProvider.setSharedKey(keyIndex ?: 0, key.toByteArray())
... ... @@ -109,6 +110,8 @@ constructor(
ratchetWindowSize,
uncryptedMagicBytes.toByteArray(),
failureTolerance,
keyRingSize,
discardFrameWhenCryptorNotReady,
)
}
}
... ...
... ... @@ -82,12 +82,10 @@ fun RTCConfiguration.copyFrom(config: RTCConfiguration) {
enableCpuOveruseDetection = config.enableCpuOveruseDetection
suspendBelowMinBitrate = config.suspendBelowMinBitrate
screencastMinBitrate = config.screencastMinBitrate
combinedAudioVideoBwe = config.combinedAudioVideoBwe
networkPreference = config.networkPreference
sdpSemantics = config.sdpSemantics
turnCustomizer = config.turnCustomizer
activeResetSrtpParams = config.activeResetSrtpParams
allowCodecSwitching = config.allowCodecSwitching
cryptoOptions = config.cryptoOptions
turnLoggingId = config.turnLoggingId
enableImplicitRollback = config.enableImplicitRollback
... ...
... ... @@ -17,7 +17,17 @@
package io.livekit.android.webrtc
import io.livekit.android.util.LKLog
import livekit.org.webrtc.*
import livekit.org.webrtc.EglBase
import livekit.org.webrtc.HardwareVideoEncoderFactory
import livekit.org.webrtc.SimulcastVideoEncoderFactory
import livekit.org.webrtc.SoftwareVideoEncoderFactory
import livekit.org.webrtc.VideoCodecInfo
import livekit.org.webrtc.VideoCodecStatus
import livekit.org.webrtc.VideoEncoder
import livekit.org.webrtc.VideoEncoderFactory
import livekit.org.webrtc.VideoEncoderFallback
import livekit.org.webrtc.VideoFrame
import livekit.org.webrtc.WrappedNativeVideoEncoder
import java.util.concurrent.Callable
import java.util.concurrent.ExecutorService
import java.util.concurrent.Executors
... ... @@ -194,8 +204,8 @@ open class SimulcastVideoEncoderFactoryWrapper(
return future.get()
}
override fun createNativeVideoEncoder(): Long {
val future = executor.submit(Callable { return@Callable encoder.createNativeVideoEncoder() })
override fun createNative(webrtcEnvRef: Long): Long {
val future = executor.submit(Callable { return@Callable encoder.createNative(webrtcEnvRef) })
return future.get()
}
... ...
... ... @@ -78,7 +78,6 @@ dependencies {
implementation libs.timber
implementation libs.coroutines.lib
implementation libs.kotlinx.serialization.json
api libs.webrtc
api libs.okhttp
api libs.audioswitch
implementation libs.androidx.annotation
... ...