Keep failed video shutdown joins and rejected cleanup requests retryable
This commit is contained in:
1 parent
878f71e211
commit
826055d08b
2 files changed
+8
-2
No files matched your search
@@ -70,6 +70,7 @@ class CallVideoEngine(private val context: Context, private val id: Long) {
|
||||
private var sessionSerial = 0L
|
||||
private val sessions = mutableMapOf<Long, Pair<CameraDevice, () -> Unit>>()
|
||||
@Volatile private var stopped = false
|
||||
private var stopCleanupPosted = false // Main: RX join/native close и постановка финального camera cleanup подтверждены.
|
||||
private var encoders = emptyMap<Int, CallVideoCodec.Companion.Encoder>()
|
||||
private var caps = ByteArray(64)
|
||||
private var wanted = CallVideoSettings()
|
||||
@@ -580,9 +581,9 @@ class CallVideoEngine(private val context: Context, private val id: Long) {
|
||||
}
|
||||
|
||||
fun stop() {
|
||||
if (stopped) return
|
||||
if (stopCleanupPosted) return
|
||||
stopped = true; player.stop(); CallVideoNative.close(id)
|
||||
handler.post {
|
||||
check(handler.post {
|
||||
observeOrientation(false)
|
||||
mutable.value = mutable.value.copy(transmitting = false, activeCodec = 0)
|
||||
closeCamera(); encoder?.close(); encoder = null; pendingFrames.clear()
|
||||
@@ -590,6 +591,10 @@ class CallVideoEngine(private val context: Context, private val id: Long) {
|
||||
if (camera == null && !opening) thread.quitSafely()
|
||||
else handler.postDelayed({ thread.quitSafely() }, 3000)
|
||||
LogManager.addLog("INFO", "call", "video workers stopped id=$id")
|
||||
}) {
|
||||
LogManager.addLog("ERROR", "call", "video stop cleanup rejected id=$id; stop remains retryable")
|
||||
"Video cleanup worker rejected stop"
|
||||
}
|
||||
stopCleanupPosted = true
|
||||
}
|
||||
}
|
||||
+1
@@ -48,6 +48,7 @@ class CallServiceLifecycleTest {
|
||||
}
|
||||
|
||||
@After fun release() {
|
||||
NativeLib.failActivityRequest = false
|
||||
Handler.rejectImmediate = false; Handler.rejectDelayed = false
|
||||
AppLanguage.failText = false; NotificationCompat.failBuild = false; CallVideoEngine.failCreate = false
|
||||
power.failures = emptySet(); power.locks.forEach { it.failures = emptySet() }
|
||||
|
||||
Reference in new issue
Block a user