mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 19:38:08 +00:00
Improved show video stats in call condition
This commit is contained in:
parent
3343b728fa
commit
b880578f99
1 changed files with 9 additions and 1 deletions
|
|
@ -25,6 +25,7 @@ import kotlin.math.roundToInt
|
|||
import org.linphone.R
|
||||
import org.linphone.core.Call
|
||||
import org.linphone.core.CallStats
|
||||
import org.linphone.core.MediaDirection
|
||||
import org.linphone.core.StreamType
|
||||
import org.linphone.utils.AppUtils
|
||||
|
||||
|
|
@ -41,7 +42,14 @@ class CallStatsModel @WorkerThread constructor() {
|
|||
@WorkerThread
|
||||
fun update(call: Call, stats: CallStats?) {
|
||||
stats ?: return
|
||||
isVideoEnabled.postValue(call.params.isVideoEnabled)
|
||||
|
||||
val videoEnabled = call.currentParams.isVideoEnabled
|
||||
val remoteParamsVideoDirection = call.remoteParams?.videoDirection
|
||||
val remoteSendsVideo = remoteParamsVideoDirection == MediaDirection.SendRecv || remoteParamsVideoDirection == MediaDirection.SendOnly
|
||||
val localParamsVideoDirection = call.params.videoDirection
|
||||
val localSendsVideo = localParamsVideoDirection == MediaDirection.SendRecv || localParamsVideoDirection == MediaDirection.SendOnly
|
||||
val showVideoStats = videoEnabled && (remoteSendsVideo || localSendsVideo)
|
||||
isVideoEnabled.postValue(showVideoStats)
|
||||
|
||||
when (stats.type) {
|
||||
StreamType.Audio -> {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue