Use verified Android encoder levels and expose negotiated frame rate

This commit is contained in:
evgeny committed 2026-10-20 00:21:21 +02:00
1 parent 3037c5fa87
commit 521dce5528
3 files changed
+12 -6

No files matched your search

@@ -283,7 +283,9 @@ class CallVideoEngine(private val context: Context, private val id: Long) {
val selected = CallVideoNative.choose(caps, peer, desired.array()) ?: continue
var candidate: CallVideoCodec? = null
try {
candidate = CallVideoCodec(CallVideoFormat.from(selected), bitrate, implementation.name)
val verified = CallVideoFormat.from(selected).let { it.copy(level = maxOf(it.level, implementation.level)) }
check(CallVideoNative.supported(caps, peer, verified.array())) { "Verified encoder level exceeds peer capabilities" }
candidate = CallVideoCodec(verified, bitrate, implementation.name)
candidate.prepare()
check(CallVideoNative.supported(caps, peer, candidate.format.array())) { "Actual encoder format exceeds peer capabilities" }
return candidate