mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 11:28:06 +00:00
Trying to fix lost remote video upon rotation
This commit is contained in:
parent
3e845b32b6
commit
c0b0ef66ff
2 changed files with 15 additions and 14 deletions
|
|
@ -336,18 +336,14 @@ class ActiveCallFragment : GenericCallFragment() {
|
|||
}
|
||||
|
||||
callViewModel.isSendingVideo.observe(viewLifecycleOwner) { sending ->
|
||||
coreContext.core.nativePreviewWindowId = if (sending) {
|
||||
binding.localPreviewVideoSurface
|
||||
} else {
|
||||
null
|
||||
}
|
||||
}
|
||||
|
||||
callViewModel.isReceivingVideo.observe(viewLifecycleOwner) { receiving ->
|
||||
coreContext.core.nativeVideoWindowId = if (receiving) {
|
||||
binding.remoteVideoSurface
|
||||
} else {
|
||||
null
|
||||
coreContext.postOnCoreThread { core ->
|
||||
core.nativePreviewWindowId = if (sending) {
|
||||
Log.i("$TAG We are sending video, setting capture preview surface")
|
||||
binding.localPreviewVideoSurface
|
||||
} else {
|
||||
Log.i("$TAG We are not sending video, clearing capture preview surface")
|
||||
null
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -384,6 +380,8 @@ class ActiveCallFragment : GenericCallFragment() {
|
|||
super.onResume()
|
||||
|
||||
coreContext.postOnCoreThread { core ->
|
||||
core.nativeVideoWindowId = binding.remoteVideoSurface
|
||||
|
||||
binding.localPreviewVideoSurface.setOnTouchListener(previewTouchListener)
|
||||
|
||||
// Need to be done manually
|
||||
|
|
|
|||
|
|
@ -1070,12 +1070,15 @@ class CurrentCallViewModel @UiThread constructor() : ViewModel() {
|
|||
|
||||
@WorkerThread
|
||||
private fun updateVideoDirection(direction: MediaDirection) {
|
||||
val isSending = direction == MediaDirection.SendRecv || direction == MediaDirection.SendOnly
|
||||
val isReceived = direction == MediaDirection.SendRecv || direction == MediaDirection.RecvOnly
|
||||
isSendingVideo.postValue(
|
||||
direction == MediaDirection.SendRecv || direction == MediaDirection.SendOnly
|
||||
isSending
|
||||
)
|
||||
isReceivingVideo.postValue(
|
||||
direction == MediaDirection.SendRecv || direction == MediaDirection.RecvOnly
|
||||
isReceived
|
||||
)
|
||||
Log.i("$TAG Is video being sent? [$isSending] Is video being received? [$isReceived]")
|
||||
}
|
||||
|
||||
@AnyThread
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue