Skip to content

Commit

Permalink
[fix] fix one camera demo can't recovery
Browse files Browse the repository at this point in the history
  • Loading branch information
jiangdg committed Jul 25, 2022
1 parent 3099d11 commit 24c7b7d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 1 addition & 2 deletions app/src/main/java/com/jiangdg/demo/DemoFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -602,10 +602,9 @@ class DemoFragment : CameraFragment(), View.OnClickListener, CaptureMediaView.On
}
}
})
mMultiCameraDialog?.show(childFragmentManager, "")
mMultiCameraDialog?.show(childFragmentManager, "multiRoadCameras")
val currentCamera = getCurrentCameraStrategy()
if (currentCamera is CameraUvcStrategy) {
closeCamera()
currentCamera.unRegister()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,11 @@ class CameraUvcStrategy(ctx: Context) : ICameraStrategy(ctx) {
mDevSettableFuture = SettableFuture()
mCtrlBlockSettableFuture = SettableFuture()
getRequest()?.apply {
startPreview(this, getSurfaceTexture())
if (getSurfaceTexture() != null) {
startPreview(this, getSurfaceTexture())
} else {
startPreview(this, getSurfaceHolder())
}
}
mDevSettableFuture?.set(device)
mCtrlBlockSettableFuture?.set(ctrlBlock)
Expand Down

0 comments on commit 24c7b7d

Please sign in to comment.