DeepARSDK / videocall-android-java

Video call using Agora.io SDK with face masks provided by DeepAR SDK
https://developer.deepar.ai
MIT License
14 stars 7 forks source link

Local video not showing when app start, only black screen #8

Open huynhdq91 opened 3 years ago

huynhdq91 commented 3 years ago

Hi guys, I run this demo and faced an issue. Everytime when I start the app, the local video is just a black screen. But when I press recent button, then go back to the app, it shows the local view normally. The issue happened on Samsung tablet running Android 9, Xiaomi phone running Android 11 But on Xiaomi phone running android 9, its OK, I start app and it shows local video without any issue. I have debugged and no luck. I don't know what is the root cause. Here is the log on the Samsung tablet running android 9 when issue happened at start app. Hope anyone can help me fix this. Thanks.

2021-09-26 01:45:34.935 27565-27565/===com.example=== W/ActivityThread: handleWindowVisibility: no activity for token android.os.BinderProxy@40e52cc 2021-09-26 01:45:35.015 27565-27565/===com.example=== I/DecorView: createDecorCaptionView >> DecorView@211993[], isFloating: false, isApplication: true, hasWindowDecorCaption: false, hasWindowControllerCallback: true 2021-09-26 01:45:35.146 27565-27565/===com.example=== D/SensorManager: registerListener :: 0, LIS2DS Accelerometer, 66667, 0,
2021-09-26 01:45:35.163 27565-27565/===com.example=== D/BluetoothHeadset: BTStateChangeCB is registed (27565 @ ===com.example===) 2021-09-26 01:45:35.172 27565-27565/===com.example=== D/agora-jni: android bridge create done... 2021-09-26 01:45:35.180 27565-28643/===com.example=== E/libc: Access denied finding property "net.dns1" 2021-09-26 01:45:35.180 27565-28643/===com.example=== E/libc: Access denied finding property "net.dns2" 2021-09-26 01:45:35.181 27565-28643/===com.example=== E/libc: Access denied finding property "net.dns3" 2021-09-26 01:45:35.181 27565-28643/===com.example=== E/libc: Access denied finding property "net.dns4" 2021-09-26 01:45:35.279 27565-27565/===com.example=== D/InputTransport: Input channel constructed: fd=141 2021-09-26 01:45:35.280 27565-27565/===com.example=== D/ViewRootImpl@b96ff3a[MainActivity]: setView = DecorView@211993[MainActivity] TM=true MM=false 2021-09-26 01:45:35.333 27565-27565/===com.example=== D/CameraOrientationUtil: getRelativeImageRotation: destRotationDegrees=90, sourceRotationDegrees=270, isOppositeFacing=false, result=0 2021-09-26 01:45:35.335 27565-27565/===com.example=== D/CameraOrientationUtil: getRelativeImageRotation: destRotationDegrees=90, sourceRotationDegrees=270, isOppositeFacing=false, result=0 2021-09-26 01:45:35.339 27565-27574/===com.example=== W/System: A resource failed to call release. 2021-09-26 01:45:35.342 27565-27565/===com.example=== D/CameraOrientationUtil: getRelativeImageRotation: destRotationDegrees=90, sourceRotationDegrees=270, isOppositeFacing=false, result=0 2021-09-26 01:45:35.344 27565-27565/===com.example=== D/DeferrableSurface: Surface created[total_surfaces=1, used_surfaces=0](androidx.camera.core.impl.ImmediateSurface@39e0963} 2021-09-26 01:45:35.348 27565-27636/===com.example=== D/Camera2CameraImpl: {Camera@4903de6[id=1]} Use case androidx.camera.core.ImageAnalysis-22e9e53f-5df6-4b5b-8cb2-9bb54a31eb2a39988509 ACTIVE 2021-09-26 01:45:35.348 27565-27636/===com.example=== D/UseCaseAttachState: Active and attached use case: [] for camera: 1 2021-09-26 01:45:35.353 27565-27565/===com.example=== E/libc: Access denied finding property "net.dns1" 2021-09-26 01:45:35.353 27565-27636/===com.example=== D/Camera2CameraImpl: {Camera@4903de6[id=1]} Use cases [androidx.camera.core.ImageAnalysis-22e9e53f-5df6-4b5b-8cb2-9bb54a31eb2a39988509] now ATTACHED 2021-09-26 01:45:35.354 27565-27565/===com.example=== E/libc: Access denied finding property "net.dns2" 2021-09-26 01:45:35.354 27565-27565/===com.example=== E/libc: Access denied finding property "net.dns3" 2021-09-26 01:45:35.354 27565-27565/===com.example=== E/libc: Access denied finding property "net.dns4" 2021-09-26 01:45:35.355 27565-27636/===com.example=== D/UseCaseAttachState: All use case: [androidx.camera.core.ImageAnalysis-22e9e53f-5df6-4b5b-8cb2-9bb54a31eb2a39988509] for camera: 1 2021-09-26 01:45:35.356 27565-27636/===com.example=== D/UseCaseAttachState: Active and attached use case: [androidx.camera.core.ImageAnalysis-22e9e53f-5df6-4b5b-8cb2-9bb54a31eb2a39988509] for camera: 1 2021-09-26 01:45:35.362 27565-27636/===com.example=== D/Camera2CameraImpl: {Camera@4903de6[id=1]} Resetting Capture Session 2021-09-26 01:45:35.363 27565-27636/===com.example=== D/Camera2CameraImpl: {Camera@4903de6[id=1]} Releasing session in state INITIALIZED 2021-09-26 01:45:35.363 27565-27636/===com.example=== D/Camera2CameraImpl: {Camera@4903de6[id=1]} Attempting to force open the camera. 2021-09-26 01:45:35.364 27565-27636/===com.example=== D/CameraStateRegistry: tryOpenCamera(Camera@4903de6[id=1]) [Available Cameras: 1, Already Open: false (Previous state: CLOSED)] --> SUCCESS 2021-09-26 01:45:35.366 27565-27636/===com.example=== D/CameraStateRegistry: Recalculating open cameras: Camera State

Camera@4903de6[id=1] OPENING
Camera@f6e50c5[id=0] UNKNOWN

Open count: 1 (Max allowed: 1) 2021-09-26 01:45:35.367 27565-27636/===com.example=== D/Camera2CameraImpl: {Camera@4903de6[id=1]} Opening camera. 2021-09-26 01:45:35.367 27565-27636/===com.example=== D/Camera2CameraImpl: {Camera@4903de6[id=1]} Transitioning camera internal state: INITIALIZED --> OPENING 2021-09-26 01:45:35.368 27565-27636/===com.example=== D/CameraStateMachine: New public camera state CameraState{type=OPENING, error=null} from OPENING and null 2021-09-26 01:45:35.368 27565-27636/===com.example=== D/CameraStateMachine: Publishing new public camera state CameraState{type=OPENING, error=null} 2021-09-26 01:45:35.369 27565-27636/===com.example=== D/UseCaseAttachState: All use case: [androidx.camera.core.ImageAnalysis-22e9e53f-5df6-4b5b-8cb2-9bb54a31eb2a39988509] for camera: 1 2021-09-26 01:45:35.375 27565-27565/===com.example=== D/SurfaceView: onWindowVisibilityChanged(0) true android.opengl.GLSurfaceView{61ae2d5 V.E...... ......I. 0,0-0,0} of ViewRootImpl@b96ff3a[MainActivity] 2021-09-26 01:45:35.400 27565-27636/===com.example=== D/Camera2CameraImpl: {Camera@4903de6[id=1]} Use case androidx.camera.core.ImageAnalysis-22e9e53f-5df6-4b5b-8cb2-9bb54a31eb2a39988509 ACTIVE 2021-09-26 01:45:35.402 27565-27636/===com.example=== D/UseCaseAttachState: Active and attached use case: [androidx.camera.core.ImageAnalysis-22e9e53f-5df6-4b5b-8cb2-9bb54a31eb2a39988509] for camera: 1 2021-09-26 01:45:35.412 27565-27565/===com.example=== D/ViewRootImpl@b96ff3a[MainActivity]: Relayout returned: old=[0,0][1920,1200] new=[0,0][1920,1200] result=0x7 surface={true 3295903744} changed=true 2021-09-26 01:45:35.417 27565-27652/===com.example=== D/mali_winsys: EGLint new_window_surface(egl_winsys_display , void , EGLSurface, EGLConfig, egl_winsys_surface **, EGLBoolean) returns 0x3000 2021-09-26 01:45:35.417 27565-27652/===com.example=== D/OpenGLRenderer: eglCreateWindowSurface = 0xe2d70e20, 0xc4738008 2021-09-26 01:45:35.419 27565-27636/===com.example=== D/Camera2CameraImpl: {Camera@4903de6[id=1]} CameraDevice.onOpened() 2021-09-26 01:45:35.419 27565-27636/===com.example=== D/Camera2CameraImpl: {Camera@4903de6[id=1]} Transitioning camera internal state: OPENING --> OPENED 2021-09-26 01:45:35.421 27565-27636/===com.example=== D/CameraStateRegistry: Recalculating open cameras: Camera State

Camera@4903de6[id=1] OPEN
Camera@f6e50c5[id=0] UNKNOWN

Open count: 1 (Max allowed: 1) 2021-09-26 01:45:35.421 27565-27636/===com.example=== D/CameraStateMachine: New public camera state CameraState{type=OPEN, error=null} from OPEN and null 2021-09-26 01:45:35.421 27565-27636/===com.example=== D/CameraStateMachine: Publishing new public camera state CameraState{type=OPEN, error=null} 2021-09-26 01:45:35.422 27565-27636/===com.example=== D/UseCaseAttachState: All use case: [androidx.camera.core.ImageAnalysis-22e9e53f-5df6-4b5b-8cb2-9bb54a31eb2a39988509] for camera: 1 2021-09-26 01:45:35.424 27565-27636/===com.example=== D/UseCaseAttachState: Active and attached use case: [androidx.camera.core.ImageAnalysis-22e9e53f-5df6-4b5b-8cb2-9bb54a31eb2a39988509] for camera: 1 2021-09-26 01:45:35.430 27565-27636/===com.example=== D/SyncCaptureSessionBase: [androidx.camera.camera2.internal.SynchronizedCaptureSessionBaseImpl@104ad42] getSurface...done 2021-09-26 01:45:35.430 27565-27636/===com.example=== D/CaptureSession: Opening capture session. 2021-09-26 01:45:35.433 27565-27636/===com.example=== D/DeferrableSurface: New surface in use[total_surfaces=1, used_surfaces=1](androidx.camera.core.impl.ImmediateSurface@39e0963} 2021-09-26 01:45:35.433 27565-27636/===com.example=== D/DeferrableSurface: use count+1, useCount=1 androidx.camera.core.impl.ImmediateSurface@39e0963 2021-09-26 01:45:35.446 27565-27565/===com.example=== D/SurfaceView: show() Surface(name=SurfaceView - ===com.example===/ai.deepar.videocall.MainActivity@61ae2d5@0[27565])/@0x6c4da90 android.opengl.GLSurfaceView{61ae2d5 V.E...... ......ID 0,0-1920,996} 2021-09-26 01:45:35.448 27565-27565/===com.example=== D/SurfaceView: surfaceCreated 1 #8 android.opengl.GLSurfaceView{61ae2d5 V.E...... ......ID 0,0-1920,996} 2021-09-26 01:45:35.448 27565-27565/===com.example=== D/SurfaceView: surfaceChanged (1920,996) 1 #8 android.opengl.GLSurfaceView{61ae2d5 V.E...... ......ID 0,0-1920,996} 2021-09-26 01:45:35.448 27565-28665/===com.example=== W/GLSurfaceView: Warning, !readyToDraw() but waiting for draw finished! Early reporting draw finished. 2021-09-26 01:45:35.476 27565-27565/===com.example=== D/ViewRootImpl@b96ff3a[MainActivity]: Relayout returned: old=[0,0][1920,1200] new=[0,0][1920,1200] result=0x3 surface={true 3295903744} changed=false 2021-09-26 01:45:35.487 27565-27636/===com.example=== D/CaptureSession: Attempting to send capture request onConfigured 2021-09-26 01:45:35.487 27565-27636/===com.example=== D/CaptureSession: Issuing request for session. 2021-09-26 01:45:35.495 27565-27636/===com.example=== D/CaptureSession: CameraCaptureSession.onConfigured() mState=OPENED 2021-09-26 01:45:35.496 27565-27636/===com.example=== D/CaptureSession: CameraCaptureSession.onReady() OPENED 2021-09-26 01:45:35.496 27565-27565/===com.example=== D/ViewRootImpl@b96ff3a[MainActivity]: MSG_RESIZED: frame=[0,0][1920,1200] ci=[0,36][0,72] vi=[0,36][0,72] or=2 2021-09-26 01:45:35.499 27565-27565/===com.example=== D/ViewRootImpl@b96ff3a[MainActivity]: stopped(false) old=false 2021-09-26 01:45:35.500 27565-27565/===com.example=== D/DeferrableSurface: surface closed, useCount=1 closed=true androidx.camera.core.impl.ImmediateSurface@39e0963 2021-09-26 01:45:35.500 27565-27631/===com.example=== D/Camera2CameraImpl: {Camera@4903de6[id=1]} Use cases [androidx.camera.core.ImageAnalysis-22e9e53f-5df6-4b5b-8cb2-9bb54a31eb2a39988509] now DETACHED for camera 2021-09-26 01:45:35.500 27565-27631/===com.example=== D/UseCaseAttachState: All use case: [] for camera: 1 2021-09-26 01:45:35.501 27565-27631/===com.example=== D/Camera2CameraImpl: {Camera@4903de6[id=1]} Resetting Capture Session 2021-09-26 01:45:35.504 27565-27631/===com.example=== D/Camera2CameraImpl: {Camera@4903de6[id=1]} Releasing session in state OPENED 2021-09-26 01:45:35.505 27565-27631/===com.example=== D/UseCaseAttachState: Active and attached use case: [] for camera: 1 2021-09-26 01:45:35.505 27565-28665/===com.example=== D/mali_winsys: EGLint new_window_surface(egl_winsys_display , void , EGLSurface, EGLConfig, egl_winsys_surface **, EGLBoolean) returns 0x3000 2021-09-26 01:45:35.506 27565-27565/===com.example=== D/ViewRootImpl@b96ff3a[MainActivity]: MSG_WINDOW_FOCUS_CHANGED 1 1 2021-09-26 01:45:35.507 27565-27565/===com.example=== D/InputMethodManager: prepareNavigationBarInfo() DecorView@211993[MainActivity] 2021-09-26 01:45:35.507 27565-27565/===com.example=== D/InputMethodManager: getNavigationBarColor() -855310 2021-09-26 01:45:35.510 27565-27565/===com.example=== D/InputMethodManager: prepareNavigationBarInfo() DecorView@211993[MainActivity] 2021-09-26 01:45:35.510 27565-27565/===com.example=== D/InputMethodManager: getNavigationBarColor() -855310 2021-09-26 01:45:35.510 27565-27565/===com.example=== V/InputMethodManager: Starting input: tba====com.example=== ic=null mNaviBarColor -855310 mIsGetNaviBarColorSuccess true , NavVisible : true , NavTrans : false 2021-09-26 01:45:35.510 27565-27565/===com.example=== D/InputMethodManager: startInputInner - Id : 0 2021-09-26 01:45:35.510 27565-27565/===com.example=== I/InputMethodManager: startInputInner - mService.startInputOrWindowGainedFocus 2021-09-26 01:45:35.516 27565-27565/===com.example=== D/InputTransport: Input channel constructed: fd=138 2021-09-26 01:45:35.516 27565-27631/===com.example=== D/UseCaseAttachState: Active and attached use case: [] for camera: 1 2021-09-26 01:45:35.520 27565-27631/===com.example=== D/Camera2CameraImpl: {Camera@4903de6[id=1]} Closing camera. 2021-09-26 01:45:35.521 27565-27631/===com.example=== D/Camera2CameraImpl: {Camera@4903de6[id=1]} Transitioning camera internal state: OPENED --> CLOSING 2021-09-26 01:45:35.522 27565-27631/===com.example=== D/CameraStateRegistry: Recalculating open cameras: Camera State

Camera@4903de6[id=1] CLOSING
Camera@f6e50c5[id=0] UNKNOWN

Open count: 1 (Max allowed: 1) 2021-09-26 01:45:35.522 27565-27631/===com.example=== D/CameraStateMachine: New public camera state CameraState{type=CLOSING, error=null} from CLOSING and null 2021-09-26 01:45:35.522 27565-27631/===com.example=== D/CameraStateMachine: Publishing new public camera state CameraState{type=CLOSING, error=null} 2021-09-26 01:45:35.523 27565-27631/===com.example=== D/Camera2CameraImpl: {Camera@4903de6[id=1]} Resetting Capture Session 2021-09-26 01:45:35.524 27565-27631/===com.example=== D/Camera2CameraImpl: {Camera@4903de6[id=1]} Releasing session in state CLOSING 2021-09-26 01:45:35.524 27565-28688/===com.example=== D/Surface: setPackageUsesOwnResolution() (native) for "n0xc7566000" (): true 2021-09-26 01:45:35.524 27565-27631/===com.example=== D/CaptureSession: onSessionFinished() 2021-09-26 01:45:35.524 27565-28688/===com.example=== D/mali_winsys: EGLint new_window_surface(egl_winsys_display , void , EGLSurface, EGLConfig, egl_winsys_surface , EGLBoolean) returns 0x3000 2021-09-26 01:45:35.529 27565-28665/===com.example=== W/GLThread: eglSwapBuffers failed: EGL_BAD_SURFACE 2021-09-26 01:45:35.556 27565-28688/===com.example=== D/Surface: setPackageUsesOwnResolution() (native) for "n0xc7566000" (SurfaceTexture-1-27565-4): false 2021-09-26 01:45:35.558 27565-28688/===com.example=== D/Surface: setPackageUsesOwnResolution() (native) for "n0xc7566000" (SurfaceTexture-1-27565-4): false 2021-09-26 01:45:35.558 27565-28688/===com.example=== E/BufferQueueProducer: [SurfaceTexture-1-27565-4] disconnect: not connected (req=1) 2021-09-26 01:45:35.558 27565-28688/===com.example=== W/libEGL: EGLNativeWindowType 0xc7566008 disconnect failed 2021-09-26 01:45:35.560 27565-28688/===com.example=== D/mali_winsys: EGLint new_window_surface(egl_winsys_display , void , EGLSurface, EGLConfig, egl_winsys_surface , EGLBoolean) returns 0x3000 2021-09-26 01:45:35.570 27565-27565/===com.example=== D/CameraOrientationUtil: getRelativeImageRotation: destRotationDegrees=90, sourceRotationDegrees=270, isOppositeFacing=false, result=0 2021-09-26 01:45:35.573 27565-27565/===com.example=== D/CameraOrientationUtil: getRelativeImageRotation: destRotationDegrees=90, sourceRotationDegrees=270, isOppositeFacing=false, result=0 2021-09-26 01:45:35.586 27565-27565/===com.example=== D/CameraOrientationUtil: getRelativeImageRotation: destRotationDegrees=90, sourceRotationDegrees=270, isOppositeFacing=false, result=0 2021-09-26 01:45:35.588 27565-27565/===com.example=== D/DeferrableSurface: Surface created[total_surfaces=2, used_surfaces=1](androidx.camera.core.impl.ImmediateSurface@ec9dfec} 2021-09-26 01:45:35.622 27565-28688/===com.example=== D/Surface: setPackageUsesOwnResolution() (native) for "n0xc7566000" (SurfaceTexture-1-27565-4): false 2021-09-26 01:45:35.625 27565-28688/===com.example=== D/Surface: setPackageUsesOwnResolution() (native) for "n0xc7566000" (SurfaceTexture-1-27565-4): false 2021-09-26 01:45:35.625 27565-28688/===com.example=== E/BufferQueueProducer: [SurfaceTexture-1-27565-4] disconnect: not connected (req=1) 2021-09-26 01:45:35.625 27565-28688/===com.example=== W/libEGL: EGLNativeWindowType 0xc7566008 disconnect failed 2021-09-26 01:45:35.625 27565-28688/===com.example=== D/mali_winsys: EGLint new_window_surface(egl_winsys_display , void , EGLSurface, EGLConfig, egl_winsys_surface **, EGLBoolean) returns 0x3000 2021-09-26 01:45:35.627 27565-28688/===com.example=== D/Surface: setPackageUsesOwnResolution() (native) for "n0xc7566000" (SurfaceTexture-1-27565-4): true 2021-09-26 01:45:36.072 27565-27631/===com.example=== D/UseCaseAttachState: Active and attached use case: [] for camera: 1 2021-09-26 01:45:36.074 27565-27631/===com.example=== D/Camera2CameraImpl: {Camera@4903de6[id=1]} Use case androidx.camera.core.ImageAnalysis-38a57a15-849d-4388-9a9b-8dfebc1f16f3204784702 ACTIVE 2021-09-26 01:45:36.074 27565-27631/===com.example=== D/UseCaseAttachState: Active and attached use case: [] for camera: 1 2021-09-26 01:45:36.075 27565-27631/===com.example=== D/Camera2CameraImpl: {Camera@4903de6[id=1]} Use cases [androidx.camera.core.ImageAnalysis-38a57a15-849d-4388-9a9b-8dfebc1f16f3204784702] now ATTACHED 2021-09-26 01:45:36.076 27565-27631/===com.example=== D/UseCaseAttachState: All use case: [androidx.camera.core.ImageAnalysis-38a57a15-849d-4388-9a9b-8dfebc1f16f3204784702] for camera: 1 2021-09-26 01:45:36.077 27565-27631/===com.example=== D/UseCaseAttachState: Active and attached use case: [androidx.camera.core.ImageAnalysis-38a57a15-849d-4388-9a9b-8dfebc1f16f3204784702] for camera: 1 2021-09-26 01:45:36.080 27565-27631/===com.example=== D/Camera2CameraImpl: {Camera@4903de6[id=1]} Resetting Capture Session 2021-09-26 01:45:36.081 27565-27631/===com.example=== D/Camera2CameraImpl: {Camera@4903de6[id=1]} Releasing session in state CLOSING 2021-09-26 01:45:36.081 27565-27631/===com.example=== D/Camera2CameraImpl: {Camera@4903de6[id=1]} Transitioning camera internal state: CLOSING --> REOPENING 2021-09-26 01:45:36.082 27565-27631/===com.example=== D/CameraStateRegistry: Recalculating open cameras: Camera State

Camera@4903de6[id=1] OPENING
Camera@f6e50c5[id=0] UNKNOWN

Open count: 1 (Max allowed: 1) 2021-09-26 01:45:36.082 27565-27631/===com.example=== D/CameraStateMachine: New public camera state CameraState{type=OPENING, error=null} from OPENING and null 2021-09-26 01:45:36.083 27565-27631/===com.example=== D/CameraStateMachine: Publishing new public camera state CameraState{type=OPENING, error=null} 2021-09-26 01:45:36.083 27565-27631/===com.example=== D/Camera2CameraImpl: {Camera@4903de6[id=1]} Use case androidx.camera.core.ImageAnalysis-38a57a15-849d-4388-9a9b-8dfebc1f16f3204784702 ACTIVE 2021-09-26 01:45:36.084 27565-27631/===com.example=== D/UseCaseAttachState: Active and attached use case: [androidx.camera.core.ImageAnalysis-38a57a15-849d-4388-9a9b-8dfebc1f16f3204784702] for camera: 1 2021-09-26 01:45:36.086 27565-27631/===com.example=== D/DeferrableSurface: use count-1, useCount=0 closed=true androidx.camera.core.impl.ImmediateSurface@39e0963 2021-09-26 01:45:36.087 27565-27631/===com.example=== D/DeferrableSurface: Surface no longer in use[total_surfaces=2, used_surfaces=0](androidx.camera.core.impl.ImmediateSurface@39e0963} 2021-09-26 01:45:36.087 27565-27631/===com.example=== D/DeferrableSurface: Surface terminated[total_surfaces=1, used_surfaces=0](androidx.camera.core.impl.ImmediateSurface@39e0963} 2021-09-26 01:45:36.087 27565-27631/===com.example=== D/Camera2CameraImpl: {Camera@4903de6[id=1]} CameraDevice.onClosed() 2021-09-26 01:45:36.088 27565-27631/===com.example=== D/Camera2CameraImpl: {Camera@4903de6[id=1]} Attempting to open the camera. 2021-09-26 01:45:36.088 27565-27631/===com.example=== D/CameraStateRegistry: tryOpenCamera(Camera@4903de6[id=1]) [Available Cameras: 0, Already Open: true (Previous state: OPENING)] --> SUCCESS 2021-09-26 01:45:36.089 27565-27631/===com.example=== D/CameraStateRegistry: Recalculating open cameras: Camera State

Camera@4903de6[id=1] OPENING
Camera@f6e50c5[id=0] UNKNOWN

Open count: 1 (Max allowed: 1) 2021-09-26 01:45:36.089 27565-27631/===com.example=== D/Camera2CameraImpl: {Camera@4903de6[id=1]} Opening camera. 2021-09-26 01:45:36.089 27565-27631/===com.example=== D/Camera2CameraImpl: {Camera@4903de6[id=1]} Transitioning camera internal state: REOPENING --> OPENING 2021-09-26 01:45:36.090 27565-27631/===com.example=== D/CameraStateMachine: New public camera state CameraState{type=OPENING, error=null} from OPENING and null 2021-09-26 01:45:36.090 27565-27631/===com.example=== D/UseCaseAttachState: All use case: [androidx.camera.core.ImageAnalysis-38a57a15-849d-4388-9a9b-8dfebc1f16f3204784702] for camera: 1 2021-09-26 01:45:36.111 27565-27631/===com.example=== D/Camera2CameraImpl: {Camera@4903de6[id=1]} CameraDevice.onOpened() 2021-09-26 01:45:36.112 27565-27631/===com.example=== D/Camera2CameraImpl: {Camera@4903de6[id=1]} Transitioning camera internal state: OPENING --> OPENED 2021-09-26 01:45:36.113 27565-27631/===com.example=== D/CameraStateRegistry: Recalculating open cameras: Camera State

Camera@4903de6[id=1] OPEN
Camera@f6e50c5[id=0] UNKNOWN

Open count: 1 (Max allowed: 1) 2021-09-26 01:45:36.113 27565-27631/===com.example=== D/CameraStateMachine: New public camera state CameraState{type=OPEN, error=null} from OPEN and null 2021-09-26 01:45:36.113 27565-27631/===com.example=== D/CameraStateMachine: Publishing new public camera state CameraState{type=OPEN, error=null} 2021-09-26 01:45:36.114 27565-27631/===com.example=== D/UseCaseAttachState: All use case: [androidx.camera.core.ImageAnalysis-38a57a15-849d-4388-9a9b-8dfebc1f16f3204784702] for camera: 1 2021-09-26 01:45:36.115 27565-27631/===com.example=== D/UseCaseAttachState: Active and attached use case: [androidx.camera.core.ImageAnalysis-38a57a15-849d-4388-9a9b-8dfebc1f16f3204784702] for camera: 1 2021-09-26 01:45:36.118 27565-27631/===com.example=== D/SyncCaptureSessionBase: [androidx.camera.camera2.internal.SynchronizedCaptureSessionBaseImpl@f0429a1] getSurface...done 2021-09-26 01:45:36.119 27565-27631/===com.example=== D/CaptureSession: Opening capture session. 2021-09-26 01:45:36.122 27565-27631/===com.example=== D/DeferrableSurface: New surface in use[total_surfaces=1, used_surfaces=1](androidx.camera.core.impl.ImmediateSurface@ec9dfec} 2021-09-26 01:45:36.123 27565-27631/===com.example=== D/DeferrableSurface: use count+1, useCount=1 androidx.camera.core.impl.ImmediateSurface@ec9dfec 2021-09-26 01:45:36.171 27565-27631/===com.example=== D/CaptureSession: Attempting to send capture request onConfigured 2021-09-26 01:45:36.171 27565-27631/===com.example=== D/CaptureSession: Issuing request for session. 2021-09-26 01:45:36.177 27565-27631/===com.example=== D/CaptureSession: CameraCaptureSession.onConfigured() mState=OPENED 2021-09-26 01:45:36.177 27565-27631/===com.example=== D/CaptureSession: CameraCaptureSession.onReady() OPENED

djaviya118389 commented 2 years ago

Try this, it's works for me...

Use frame layout in Xml

surfaceView = GLSurfaceView(this)
        surfaceView!!.setEGLContextClientVersion(2)
        surfaceView!!.setEGLConfigChooser(8, 8, 8, 8, 16, 0)
        renderer = DeepARRenderer(deepAR, mRtcEngine!!)
        val contextFactory=MyContextFactory(renderer)
        surfaceView!!.setEGLContextFactory(contextFactory)
        surfaceView!!.setRenderer(renderer)
        surfaceView!!.renderMode = GLSurfaceView.RENDERMODE_CONTINUOUSLY

below above code set

lifecycleScope.launch {
            delay(1000)
            surfaceView!!.onPause()
            surfaceView!!.onResume()
        }

Late answer but this works Spend a lot of time to find this.

huynhdq91 commented 2 years ago

Try this, it's works for me...

Use frame layout in Xml

surfaceView = GLSurfaceView(this)
        surfaceView!!.setEGLContextClientVersion(2)
        surfaceView!!.setEGLConfigChooser(8, 8, 8, 8, 16, 0)
        renderer = DeepARRenderer(deepAR, mRtcEngine!!)
        val contextFactory=MyContextFactory(renderer)
        surfaceView!!.setEGLContextFactory(contextFactory)
        surfaceView!!.setRenderer(renderer)
        surfaceView!!.renderMode = GLSurfaceView.RENDERMODE_CONTINUOUSLY

below above code set

lifecycleScope.launch {
            delay(1000)
            surfaceView!!.onPause()
            surfaceView!!.onResume()
        }

Late answer but this works Spend a lot of time to find this.

Thank you so much. I'll try your solution, hope it works for me too.

djaviya118389 commented 2 years ago

Try this, it's works for me... Use frame layout in Xml

surfaceView = GLSurfaceView(this)
        surfaceView!!.setEGLContextClientVersion(2)
        surfaceView!!.setEGLConfigChooser(8, 8, 8, 8, 16, 0)
        renderer = DeepARRenderer(deepAR, mRtcEngine!!)
        val contextFactory=MyContextFactory(renderer)
        surfaceView!!.setEGLContextFactory(contextFactory)
        surfaceView!!.setRenderer(renderer)
        surfaceView!!.renderMode = GLSurfaceView.RENDERMODE_CONTINUOUSLY

below above code set

lifecycleScope.launch {
            delay(1000)
            surfaceView!!.onPause()
            surfaceView!!.onResume()
        }

Late answer but this works Spend a lot of time to find this.

Thank you so much. I'll try your solution, hope it works for me too.

My Pleasure ! please inform it's working or not for you.

hasnentai commented 1 year ago

In case someone looking to make this work here is the solution

add this inside setup method in java

new Handler(Looper.getMainLooper()).postDelayed(new Runnable() {
            @Override
            public void run() {
                surfaceView.onPause();
                surfaceView.onResume();
            }
        }, 1000);