Allow simultaneous stream publication and radio in Android UI
This commit is contained in:
1 parent
2038e33d8d
commit
b523282e8e
2 files changed
+3
-4
No files matched your search
@@ -39,8 +39,8 @@ object StreamController {
|
||||
if (mutable.value?.ongoing == true) { LogManager.addLog("WARN", "stream", "publisher already owned"); return }
|
||||
val id = nextId()
|
||||
if (!NativeLib.isReady() || group == 0L || CallController.state.value?.ongoing == true ||
|
||||
RadioAudioEngine.instance().isActive() || NativeLib.voiceIsActive()) {
|
||||
LogManager.addLog("WARN", "stream", "start rejected: core/call/radio/voice busy group=$group")
|
||||
NativeLib.voiceIsActive()) {
|
||||
LogManager.addLog("WARN", "stream", "start rejected: core/call/voice busy group=$group")
|
||||
mutable.value = StreamState(id, group, StreamPhase.FAILED, R.string.stream_resources_busy); return
|
||||
}
|
||||
capturing = true; mutable.value = StreamState(id, group, StreamPhase.STARTING, pendingConfig = config)
|
||||
@@ -119,7 +119,7 @@ object StreamController {
|
||||
}
|
||||
}
|
||||
|
||||
/** Звонок/рация/голосовое не отбирают микрофон у foreground-трансляции. */
|
||||
/** Звонок/голосовое не отбирают микрофон у foreground-трансляции; рация использует общий захват. */
|
||||
fun blocksCapture(): Boolean {
|
||||
if (!capturing) return false
|
||||
LogManager.addLog("WARN", "stream", "microphone/camera owned by stream id=${mutable.value?.id}")
|
||||
|
||||
@@ -944,7 +944,6 @@ class ChatViewModel : ViewModel() {
|
||||
val groupId = ch.id.toULongOrNull()?.toLong() ?: return
|
||||
val wasOnHere = radioChannelId == ch.id
|
||||
val next = !wasOnHere
|
||||
if (next && com.utun.chat.data.StreamController.blocksCapture()) return
|
||||
radioToggleCount++
|
||||
val caller = Throwable().stackTrace.drop(1).take(8)
|
||||
.joinToString(" <- ") { "${it.className.substringAfterLast('.')}.${it.methodName}:${it.lineNumber}" }
|
||||
|
||||
Reference in new issue
Block a user