Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

suspend_fun_to_async is blocked sometime #1850

Open
yanshouwang opened this issue Dec 31, 2024 · 0 comments
Open

suspend_fun_to_async is blocked sometime #1850

yanshouwang opened this issue Dec 31, 2024 · 0 comments

Comments

@yanshouwang
Copy link

yanshouwang commented Dec 31, 2024

I have wrapped the CameraX APIs and generated the Dart code with jnigen. I found the code is blocked when await the futures for the first time. But if I click the hot reload button, the futures will complete as expected. I dont' know what caused this hanging and how can I resolve it.

The kotlin wrapper methods

class LifecycleCameraController : CameraController {
    constructor(context: Context) {
        this.obj = androidx.camera.view.LifecycleCameraController(context)
    }

    internal constructor(obj: androidx.camera.view.LifecycleCameraController) {
        this.obj = obj
    }

    override val obj: androidx.camera.view.LifecycleCameraController

    suspend fun bindToLifecycle(lifecycleOwner: LifecycleOwner) {
        Log.i("TAG", "begin bindToLifecycle")
        withContext(Dispatchers.Main) {
            obj.bindToLifecycle(lifecycleOwner)
        }
        Log.i("TAG", "end bindToLifecycle")
    }

    suspend fun unbind() {
        withContext(Dispatchers.Main) {
            obj.unbind()
        }
    }
}


abstract class CameraController {
    internal abstract val obj: androidx.camera.view.CameraController

    suspend fun initialize() {
        Log.i("TAG", "begin initialize")
        val obj = obj.initializationFuture.await()
        Log.i("TAG", "end initialize")
    }

    suspend fun hasCamera(cameraSelector: CameraSelector): Boolean {
        return withContext(Dispatchers.Main) {
            obj.hasCamera(cameraSelector.obj)
        }
    }

    suspend fun getCameraSelector(): CameraSelector {
        return withContext(Dispatchers.Main) {
            CameraSelector(obj.cameraSelector)
        }
    }

    suspend fun setCameraSelector(cameraSelector: CameraSelector) {
        Log.i("TAG", "begin setCameraSelector")
        withContext(Dispatchers.Main) {
            obj.cameraSelector = cameraSelector.obj
        }
        Log.i("TAG", "end setCameraSelector")
    }
}

The Dart caller

    try {
      logger.info('initialize');
      await controller.initialize();
      logger.info('setCameraSelector');
      await controller.setCameraSelector(CameraSelector.back);
      logger.info('bind');
      await bind();
      logger.info('complete');
    } catch (e, stack) {
      logger.severe(e, stack);
    }

Logs when running for the first time.

Launching lib/main.dart on PHP110 in debug mode...
✓ Built build/app/outputs/flutter-apk/app-debug.apk
I/flutter ( 5839): [IMPORTANT:flutter/shell/platform/android/android_context_vk_impeller.cc(60)] Using the Impeller rendering backend (Vulkan).
Connecting to VM Service at ws://127.0.0.1:60417/qL_0L0FJ5W4=/ws
Connected to the VM Service.
D/VRI[MainActivity]( 5839):  debugCancelDraw some OnPreDrawListener onPreDraw return false,cancelDraw=true,count=50,android.view.ViewRootImpl@f5af05a
D/ViewRootImplExtImpl( 5839): wrapConfigInfoIntoFlags rotation=0, smallestScreenWidthDp=354, relayoutAsync=false, newFlags=23199744, title=dev.hebei.camerax_android_example/dev.hebei.camerax_android_example.MainActivity
D/VRI[MainActivity]( 5839): relayoutWindow result, sizeChanged:false, surfaceControlChanged:false, transformHintChanged:false, mSurfaceSize:Point(1240, 2772), mLastSurfaceSize:Point(1240, 2772), mWidth:1240, mHeight:2772, requestedWidth:1240, requestedHeight:2772, transformHint:0, lastTransformHint:0, installOrientation:0, displayRotation:0, isSurfaceValid:true, attr.flag:-2122252032, useBlast:true, tmpFrames:ClientWindowFrames{frame=[0,0][1240,2772] display=[0,0][1240,2772] parentFrame=[0,0][0,0]}
W/VRI[MainActivity]( 5839): updateBlastSurfaceIfNeeded, surfaceSize:Point(1240, 2772), lastSurfaceSize:Point(1240, 2772), format:-3, blastBufferQueue:android.graphics.BLASTBufferQueue@9f1a3ba
D/SurfaceView( 5839): 108235438 handleSyncNoBuffer
D/SurfaceView( 5839): 108235438 finishedDrawing
D/SurfaceView( 5839): 108235438 performDrawFinished mAttachedToWindow true
D/QuirkSettingsLoader( 5839): QuirkSettings$MetadataHolderService is not found.
D/CameraX ( 5839): QuirkSettings from app metadata: null
D/CameraX ( 5839): QuirkSettings by default: QuirkSettings{enabledWhenDeviceHasQuirk=true, forceEnabledQuirks=[], forceDisabledQuirks=[]}
I/CameraManagerExtImpl( 5839): getInstance success!
I/CameraManagerExtImpl( 5839): packagename is dev.hebei.camerax_android_example
I/OplusCameraManager( 5839): saveOpPackageName, mOpPackageName: dev.hebei.camerax_android_example
D/DeviceQuirks( 5839): camera2 DeviceQuirks =
I/OplusCameraManagerGlobal( 5839): setClientInfo, packageName: dev.hebei.camerax_android_example, uid: 10337, pid: 5839
I/OplusCameraManagerGlobal( 5839): Connecting to camera service
I/CameraManagerGlobal( 5839): Connecting to camera service
D/DeviceQuirks( 5839): video DeviceQuirks =
D/OplusCameraUtils( 5839): new OplusCameraUtils!
I/OplusCameraManagerGlobal( 5839): setClientInfo, packageName: dev.hebei.camerax_android_example, uid: 10337, pid: 5839
I/OplusCameraManagerGlobal( 5839): setClientInfo, packageName: dev.hebei.camerax_android_example, uid: 10337, pid: 5839
I/TAG     ( 5839): begin initialize
I/OplusCameraManagerGlobal( 5839): setClientInfo, packageName: dev.hebei.camerax_android_example, uid: 10337, pid: 5839
[HomeViewModel] initialize
I/OplusCameraManagerGlobal( 5839): setClientInfo, packageName: dev.hebei.camerax_android_example, uid: 10337, pid: 5839
I/PlatformViewsController( 5839): Using hybrid composition for platform view: 0
D/CameraRepository( 5839): Added camera: 0
D/CameraQuirks( 5839): camera2 CameraQuirks =
I/Camera2CameraInfo( 5839): Device Level: INFO_SUPPORTED_HARDWARE_LEVEL_FULL
I/OplusCameraManagerGlobal( 5839): setClientInfo, packageName: dev.hebei.camerax_android_example, uid: 10337, pid: 5839
D/CameraRepository( 5839): Added camera: 1
D/CameraQuirks( 5839): camera2 CameraQuirks =
I/Camera2CameraInfo( 5839): Device Level: INFO_SUPPORTED_HARDWARE_LEVEL_FULL
I/OplusCameraManagerGlobal( 5839): setClientInfo, packageName: dev.hebei.camerax_android_example, uid: 10337, pid: 5839
D/CameraRepository( 5839): Added camera: 2
D/CameraQuirks( 5839): camera2 CameraQuirks =
I/Camera2CameraInfo( 5839): Device Level: INFO_SUPPORTED_HARDWARE_LEVEL_FULL
I/OplusCameraManagerGlobal( 5839): setClientInfo, packageName: dev.hebei.camerax_android_example, uid: 10337, pid: 5839
D/CameraValidator( 5839): Verifying camera lens facing on OP5927, lensFacingInteger: null
D/ImageCapture( 5839): setFlashMode: flashMode = 2
D/CamLifecycleController( 5839): Lifecycle is not set.
D/CameraController( 5839): Use cases not attached to camera.
I/TAG     ( 5839): end initialize
[HomeViewModel] setCameraSelector
I/TAG     ( 5839): begin setCameraSelector
D/CamLifecycleController( 5839): Lifecycle is not set.
D/CameraController( 5839): Use cases not attached to camera.
I/TAG     ( 5839): end setCameraSelector
D/CameraController( 5839): Set ScreenFlash instance to ImageCapture, provided by PREVIEW_VIEW
E/gralloc4( 5839): ERROR: Format allocation info not found for format: 38
E/gralloc4( 5839): ERROR: Format allocation info not found for format: 0
E/gralloc4( 5839): Invalid base format! req_base_format = 0x0, req_format = 0x38, type = 0x0
E/gralloc4( 5839): ERROR: Unrecognized and/or unsupported format 0x38 and usage 0xb00
E/Gralloc4( 5839): isSupported(1, 1, 56, 1, ...) failed with 5
E/GraphicBufferAllocator( 5839): Failed to allocate (4 x 4) layerCount 1 format 56 usage b00: 5
E/AHardwareBuffer( 5839): GraphicBuffer(w=4, h=4, lc=1) failed (Unknown error -5), handle=0x0
E/gralloc4( 5839): ERROR: Format allocation info not found for format: 3b
E/gralloc4( 5839): ERROR: Format allocation info not found for format: 0
E/gralloc4( 5839): Invalid base format! req_base_format = 0x0, req_format = 0x3b, type = 0x0
E/gralloc4( 5839): ERROR: Unrecognized and/or unsupported format 0x3b and usage 0xb00
E/Gralloc4( 5839): isSupported(1, 1, 59, 1, ...) failed with 5
E/GraphicBufferAllocator( 5839): Failed to allocate (4 x 4) layerCount 1 format 59 usage b00: 5
E/AHardwareBuffer( 5839): GraphicBuffer(w=4, h=4, lc=1) failed (Unknown error -5), handle=0x0
E/gralloc4( 5839): ERROR: Format allocation info not found for format: 38
E/gralloc4( 5839): ERROR: Format allocation info not found for format: 0
E/gralloc4( 5839): Invalid base format! req_base_format = 0x0, req_format = 0x38, type = 0x0
E/gralloc4( 5839): ERROR: Unrecognized and/or unsupported format 0x38 and usage 0xb00
E/Gralloc4( 5839): isSupported(1, 1, 56, 1, ...) failed with 5
E/GraphicBufferAllocator( 5839): Failed to allocate (4 x 4) layerCount 1 format 56 usage b00: 5
E/AHardwareBuffer( 5839): GraphicBuffer(w=4, h=4, lc=1) failed (Unknown error -5), handle=0x0
E/gralloc4( 5839): ERROR: Format allocation info not found for format: 3b
E/gralloc4( 5839): ERROR: Format allocation info not found for format: 0
E/gralloc4( 5839): Invalid base format! req_base_format = 0x0, req_format = 0x3b, type = 0x0
E/gralloc4( 5839): ERROR: Unrecognized and/or unsupported format 0x3b and usage 0xb00
E/Gralloc4( 5839): isSupported(1, 1, 59, 1, ...) failed with 5
E/GraphicBufferAllocator( 5839): Failed to allocate (4 x 4) layerCount 1 format 59 usage b00: 5
E/AHardwareBuffer( 5839): GraphicBuffer(w=4, h=4, lc=1) failed (Unknown error -5), handle=0x0
E/Surface ( 5839): freeAllBuffers: 1 buffers were freed while being dequeued!
D/CompatibilityChangeReporter( 5839): Compat change id reported: 236825255; UID 10337; state: ENABLED
D/BufferQueueConsumer( 5839): [](id:16cf00000002,api:0,p:-1,c:5839) connect: controlledByApp=true
E/gralloc4( 5839): ERROR: Format allocation info not found for format: 38
E/gralloc4( 5839): ERROR: Format allocation info not found for format: 0
E/gralloc4( 5839): Invalid base format! req_base_format = 0x0, req_format = 0x38, type = 0x0
E/gralloc4( 5839): ERROR: Unrecognized and/or unsupported format 0x38 and usage 0x300
E/Gralloc4( 5839): isSupported(1, 1, 56, 1, ...) failed with 5
E/GraphicBufferAllocator( 5839): Failed to allocate (4 x 4) layerCount 1 format 56 usage 300: 5
E/AHardwareBuffer( 5839): GraphicBuffer(w=4, h=4, lc=1) failed (Unknown error -5), handle=0x0
E/gralloc4( 5839): ERROR: Format allocation info not found for format: 3b
E/gralloc4( 5839): ERROR: Format allocation info not found for format: 0
E/gralloc4( 5839): Invalid base format! req_base_format = 0x0, req_format = 0x3b, type = 0x0
E/gralloc4( 5839): ERROR: Unrecognized and/or unsupported format 0x3b and usage 0x300
E/Gralloc4( 5839): isSupported(1, 1, 59, 1, ...) failed with 5
E/GraphicBufferAllocator( 5839): Failed to allocate (4 x 4) layerCount 1 format 59 usage 300: 5
E/AHardwareBuffer( 5839): GraphicBuffer(w=4, h=4, lc=1) failed (Unknown error -5), handle=0x0
E/gralloc4( 5839): ERROR: Format allocation info not found for format: 38
E/gralloc4( 5839): ERROR: Format allocation info not found for format: 0
E/gralloc4( 5839): Invalid base format! req_base_format = 0x0, req_format = 0x38, type = 0x0
E/gralloc4( 5839): ERROR: Unrecognized and/or unsupported format 0x38 and usage 0x300
E/Gralloc4( 5839): isSupported(1, 1, 56, 1, ...) failed with 5
E/GraphicBufferAllocator( 5839): Failed to allocate (4 x 4) layerCount 1 format 56 usage 300: 5
E/AHardwareBuffer( 5839): GraphicBuffer(w=4, h=4, lc=1) failed (Unknown error -5), handle=0x0
E/gralloc4( 5839): ERROR: Format allocation info not found for format: 3b
E/gralloc4( 5839): ERROR: Format allocation info not found for format: 0
E/gralloc4( 5839): Invalid base format! req_base_format = 0x0, req_format = 0x3b, type = 0x0
E/gralloc4( 5839): ERROR: Unrecognized and/or unsupported format 0x3b and usage 0x300
E/Gralloc4( 5839): isSupported(1, 1, 59, 1, ...) failed with 5
E/GraphicBufferAllocator( 5839): Failed to allocate (4 x 4) layerCount 1 format 59 usage 300: 5
E/AHardwareBuffer( 5839): GraphicBuffer(w=4, h=4, lc=1) failed (Unknown error -5), handle=0x0
D/SurfaceView( 5839): 108235438 handleSyncNoBuffer
D/SurfaceView( 5839): 108235438 finishedDrawing
D/SurfaceView( 5839): 108235438 performDrawFinished mAttachedToWindow true
W/libc    ( 5839): Access denied finding property "persist.vendor.debug.gpud.enable"
I/Quality ( 5839): Skipped: false 3 cost 55.154137 refreshRate 16510688 bit true processName dev.hebei.camerax_android_example
V/SystemSensorManagerExtImpl( 5839): RegisterListener bmi2xy acc type:1 delay:200000us by android.view.OrientationEventListener$SensorEventListenerImpl@626b635 from dev.hebei.camerax_android_example
D/ImageCapture( 5839): setFlashMode: flashMode = 2
D/CamLifecycleController( 5839): Lifecycle is not set.
D/CameraController( 5839): Use cases not attached to camera.
D/VRI[MainActivity]( 5839):  debugCancelDraw  cancelDraw=false,count = 101,android.view.ViewRootImpl@f5af05a
I/SurfaceControl( 5839):  setExtendedRangeBrightness sc=Surface(name=dev.hebei.camerax_android_example/dev.hebei.camerax_android_example.MainActivity)/@0x612e758,currentBufferRatio=1.0,desiredRatio=1.0
D/SurfaceView( 5839): 108235438 dispatchDraw mDrawFinished true isAboveParent false (mPrivateFlags & PFLAG_SKIP_DRAW) 128
D/SurfaceView( 5839): 108235438 clearSurfaceViewPort mCornerRadius 0.0
D/BLASTBufferQueue( 5839): [VRI[MainActivity]#0](f:0,a:1) acquireNextBufferLocked size=1240x2772 mFrameNumber=1 applyTransaction=true mTimestamp=126582026758313(auto) mPendingTransactions.size=0 graphicBufferId=25078314041409 transform=0
D/VRI[MainActivity]( 5839): Received frameCommittedCallback lastAttemptedDrawFrameNum=1 didProduceBuffer=true syncBuffer=false
D/VRI[MainActivity]( 5839): draw finished.
D/VRI[MainActivity]( 5839): reportDrawFinished
D/VRI[MainActivity]( 5839): onFocusEvent true
D/OplusScrollToTopManager( 5839): dev.hebei.camerax_android_example/dev.hebei.camerax_android_example.MainActivity,This DecorView@1f48650[MainActivity] change focus to true
D/ProfileInstaller( 5839): Installing profile for dev.hebei.camerax_android_example

Logs after hot reload.

V/SystemSensorManagerExtImpl( 5839): unRegisterListener by android.view.OrientationEventListener$SensorEventListenerImpl@626b635
Restarted application in 1,197ms.
[HomeViewModel] initialize
I/TAG     ( 5839): begin initialize
D/ImageCapture( 5839): setFlashMode: flashMode = 2
D/CamLifecycleController( 5839): Lifecycle is not set.
D/CameraController( 5839): Use cases not attached to camera.
I/TAG     ( 5839): end initialize
I/PlatformViewsController( 5839): Using hybrid composition for platform view: 0
[HomeViewModel] setCameraSelector
I/TAG     ( 5839): begin setCameraSelector
D/CamLifecycleController( 5839): Lifecycle is not set.
D/CameraController( 5839): Use cases not attached to camera.
I/TAG     ( 5839): end setCameraSelector
[HomeViewModel] bind
I/TAG     ( 5839): begin bindToLifecycle
D/CameraController( 5839): PreviewView not attached to CameraController.
D/CameraController( 5839): Use cases not attached to camera.
I/TAG     ( 5839): end bindToLifecycle
D/CameraController( 5839): Set ScreenFlash instance to ImageCapture, provided by PREVIEW_VIEW
[HomeViewModel] complete
V/SystemSensorManagerExtImpl( 5839): RegisterListener bmi2xy acc type:1 delay:200000us by android.view.OrientationEventListener$SensorEventListenerImpl@f91b607 from dev.hebei.camerax_android_example
D/ImageCapture( 5839): setFlashMode: flashMode = 2
D/DynamicRangeResolver( 5839): Resolved dynamic range for use case androidx.camera.core.Preview-5ea331ae-2df1-4000-8c23-9d2949adceda to no compatible HDR dynamic ranges.
D/DynamicRangeResolver( 5839): DynamicRange@2544b85{encoding=UNSPECIFIED, bitDepth=0}
D/DynamicRangeResolver( 5839): ->
D/DynamicRangeResolver( 5839): DynamicRange@22988fc{encoding=SDR, bitDepth=8}
D/CameraQuirks( 5839): camera2 CameraQuirks = 
D/CameraQuirks( 5839): camera2 CameraQuirks = 
D/CameraQuirks( 5839): camera2 CameraQuirks =
D/DeferrableSurface( 5839): Surface created[total_surfaces=1, used_surfaces=0](androidx.camera.core.processing.SurfaceEdge$SettableSurface@6a2fda6}
D/DeferrableSurface( 5839): Surface created[total_surfaces=2, used_surfaces=0](androidx.camera.core.SurfaceRequest$2@8f14e32}
D/DeferrableSurface( 5839): New surface in use[total_surfaces=2, used_surfaces=1](androidx.camera.core.SurfaceRequest$2@8f14e32}
D/DeferrableSurface( 5839): use count+1, useCount=1 androidx.camera.core.SurfaceRequest$2@8f14e32
D/ImageCapture( 5839): createPipeline(cameraId: 0, streamSpec: StreamSpec{resolution=4624x3468, dynamicRange=DynamicRange@22988fc{encoding=SDR, bitDepth=8}, expectedFrameRateRange=[0, 0], implementationOptions=androidx.camera.camera2.impl.Camera2ImplConfig@9a48df, zslDisabled=false})
D/DeviceQuirks( 5839): core DeviceQuirks = SurfaceOrderQuirk
D/BufferQueueConsumer( 5839): [](id:16cf00000003,api:0,p:-1,c:5839) connect: controlledByApp=true
D/DeferrableSurface( 5839): Surface created[total_surfaces=3, used_surfaces=1](androidx.camera.core.impl.ImmediateSurface@e181ff5}
D/BufferQueueConsumer( 5839): [](id:16cf00000004,api:0,p:-1,c:5839) connect: controlledByApp=true
D/BufferQueueConsumer( 5839): [](id:16cf00000005,api:0,p:-1,c:5839) connect: controlledByApp=true
D/Camera2CameraImpl( 5839): {Camera@87d8bd3[id=0]} Use case androidx.camera.core.ImageCapture-822e8930-8ef9-48f2-a0b9-73efe4f5da1734390931 ACTIVE
D/DeferrableSurface( 5839): Surface created[total_surfaces=4, used_surfaces=1](androidx.camera.core.impl.ImmediateSurface@20493fb}
D/UseCaseAttachState( 5839): Active and attached use case: [] for camera: 0
D/ImageCapture( 5839): onCameraControlReady
D/Camera2CameraControlImp( 5839): setFlashMode: mFlashMode = 2
D/Camera2CameraImpl( 5839): {Camera@87d8bd3[id=0]} Use case androidx.camera.core.Preview-5ea331ae-2df1-4000-8c23-9d2949adceda37994626 ACTIVE
D/UseCaseAttachState( 5839): Active and attached use case: [] for camera: 0
D/Camera2CameraImpl( 5839): {Camera@87d8bd3[id=0]} Use case androidx.camera.core.ImageCapture-822e8930-8ef9-48f2-a0b9-73efe4f5da1734390931 ACTIVE
D/UseCaseAttachState( 5839): Active and attached use case: [] for camera: 0
D/PreviewView( 5839): Surface requested by Preview.
D/DeviceQuirks( 5839): view DeviceQuirks =
D/Camera2CameraImpl( 5839): {Camera@87d8bd3[id=0]} Use case androidx.camera.core.ImageAnalysis-6f55b854-998b-49ca-8113-0846540dd0fc163069904 INACTIVE
D/UseCaseAttachState( 5839): Active and attached use case: [] for camera: 0
I/SurfaceView( 5839): 21727091 onAttachedToWindow
D/UseCaseAttachState( 5839): Active and attached use case: [] for camera: 0
D/BufferQueueConsumer( 5839): [](id:16cf00000006,api:0,p:-1,c:5839) connect: controlledByApp=false
I/SurfaceView( 5839): 21727091 visibleChanged -- surfaceCreated
D/SurfaceViewImpl( 5839): Surface created.
D/SurfaceViewImpl( 5839): Surface changed. Size: 1440x1080
D/SurfaceView( 5839): 21727091 handleSyncNoBuffer
D/Camera2CameraImpl( 5839): {Camera@87d8bd3[id=0]} Use cases [androidx.camera.core.Preview-5ea331ae-2df1-4000-8c23-9d2949adceda37994626, androidx.camera.core.ImageCapture-822e8930-8ef9-48f2-a0b9-73efe4f5da1734390931, androidx.camera.core.ImageAnalysis-6f55b854-998b-49ca-8113-0846540dd0fc163069904] now ATTACHED
D/Camera2CameraControlImp( 5839): setActive: isActive = true
D/SurfaceView( 5839): 21727091 finishedDrawing
D/SurfaceView( 5839): 21727091 performDrawFinished mAttachedToWindow true
D/SurfaceView( 5839): 21727091 dispatchDraw mDrawFinished true isAboveParent false (mPrivateFlags & PFLAG_SKIP_DRAW) 128
D/SurfaceView( 5839): 21727091 clearSurfaceViewPort mCornerRadius 0.0
D/PreviewView( 5839): Preview transformation info updated. TransformationInfo{getCropRect=Rect(0, 88 - 1440, 992), getRotationDegrees=90, getTargetRotation=-1, hasCameraTransform=true, getSensorToBufferTransform=Matrix{[0.31141868, 0.0, -0.0][0.0, 0.31141868, -0.0][0.0, 0.0, 1.0]}, isMirroring=false}
D/PreviewTransform( 5839): Transformation info set: TransformationInfo{getCropRect=Rect(0, 88 - 1440, 992), getRotationDegrees=90, getTargetRotation=-1, hasCameraTransform=true, getSensorToBufferTransform=Matrix{[0.31141868, 0.0, -0.0][0.0, 0.31141868, -0.0][0.0, 0.0, 1.0]}, isMirroring=false} 1440x1080 false
D/SurfaceViewImpl( 5839): Surface set on Preview.
D/UseCaseAttachState( 5839): All use case: [androidx.camera.core.ImageCapture-822e8930-8ef9-48f2-a0b9-73efe4f5da1734390931, androidx.camera.core.Preview-5ea331ae-2df1-4000-8c23-9d2949adceda37994626, androidx.camera.core.ImageAnalysis-6f55b854-998b-49ca-8113-0846540dd0fc163069904] for camera: 0
D/UseCaseAttachState( 5839): Active and attached use case: [androidx.camera.core.ImageCapture-822e8930-8ef9-48f2-a0b9-73efe4f5da1734390931, androidx.camera.core.Preview-5ea331ae-2df1-4000-8c23-9d2949adceda37994626] for camera: 0
D/Camera2CameraImpl( 5839): {Camera@87d8bd3[id=0]} Resetting Capture Session
D/Camera2CameraImpl( 5839): {Camera@87d8bd3[id=0]} Skipping Capture Session state check due to current camera state: INITIALIZED and previous session status: false
D/Camera2CameraImpl( 5839): {Camera@87d8bd3[id=0]} Releasing session in state INITIALIZED
D/Camera2CameraImpl( 5839): {Camera@87d8bd3[id=0]} Attempting to force open the camera.
D/CameraStateRegistry( 5839): tryOpenCamera(Camera@87d8bd3[id=0]) [Available Cameras: 1, Already Open: false (Previous state: null)] --> SUCCESS
D/CameraStateRegistry( 5839): Recalculating open cameras:
D/CameraStateRegistry( 5839): Camera                                       State
D/CameraStateRegistry( 5839): -------------------------------------------------------------------
D/CameraStateRegistry( 5839): Camera@598747d[id=2]                         UNKNOWN
D/CameraStateRegistry( 5839): Camera@87d8bd3[id=0]                         OPENING
D/CameraStateRegistry( 5839): Camera@125871a[id=1]                         UNKNOWN
D/CameraStateRegistry( 5839): -------------------------------------------------------------------
D/CameraStateRegistry( 5839): Open count: 1 (Max allowed: 1)
D/Camera2CameraImpl( 5839): {Camera@87d8bd3[id=0]} Opening camera.
D/Camera2CameraImpl( 5839): {Camera@87d8bd3[id=0]} Transitioning camera internal state: INITIALIZED --> OPENING
D/CameraStateMachine( 5839): New public camera state CameraState{type=OPENING, error=null} from OPENING and null
D/CameraStateMachine( 5839): Publishing new public camera state CameraState{type=OPENING, error=null}
D/UseCaseAttachState( 5839): All use case: [androidx.camera.core.ImageCapture-822e8930-8ef9-48f2-a0b9-73efe4f5da1734390931, androidx.camera.core.Preview-5ea331ae-2df1-4000-8c23-9d2949adceda37994626, androidx.camera.core.ImageAnalysis-6f55b854-998b-49ca-8113-0846540dd0fc163069904] for camera: 0
I/OplusCameraManagerGlobal( 5839): setClientInfo, packageName: dev.hebei.camerax_android_example, uid: 10337, pid: 5839
I/CameraDeviceImplExtImpl( 5839): getInstance success!
I/OplusCameraManagerGlobal( 5839): setClientInfo, packageName: dev.hebei.camerax_android_example, uid: 10337, pid: 5839
I/OplusCameraUtils( 5839): current activityName: dev.hebei.camerax_android_example.MainActivity
I/OplusCameraUtils( 5839): getComponentName, componentName: dev.hebei.camerax_android_example/dev.hebei.camerax_android_example.MainActivity, packageName:dev.hebei.camerax_android_example, activityName:dev.hebei.camerax_android_example.MainActivity
I/CameraManager( 5839): openCameraDeviceUserAsync, use componentName: dev.hebei.camerax_android_example/dev.hebei.camerax_android_example.MainActivity
I/OplusCameraUtils( 5839): current activityName: dev.hebei.camerax_android_example.MainActivity
I/OplusCameraUtils( 5839): getComponentName, componentName: dev.hebei.camerax_android_example/dev.hebei.camerax_android_example.MainActivity, packageName:dev.hebei.camerax_android_example, activityName:dev.hebei.camerax_android_example.MainActivity
E/CameraManagerGlobal( 5839): Camera 4 is not present. Ignore physical camera status change
D/Camera2CameraImpl( 5839): {Camera@87d8bd3[id=0]} Use case androidx.camera.core.Preview-5ea331ae-2df1-4000-8c23-9d2949adceda37994626 ACTIVE
D/UseCaseAttachState( 5839): Active and attached use case: [androidx.camera.core.ImageCapture-822e8930-8ef9-48f2-a0b9-73efe4f5da1734390931, androidx.camera.core.Preview-5ea331ae-2df1-4000-8c23-9d2949adceda37994626] for camera: 0
D/Camera2CameraImpl( 5839): {Camera@87d8bd3[id=0]} Use case androidx.camera.core.ImageCapture-822e8930-8ef9-48f2-a0b9-73efe4f5da1734390931 ACTIVE
D/UseCaseAttachState( 5839): Active and attached use case: [androidx.camera.core.ImageCapture-822e8930-8ef9-48f2-a0b9-73efe4f5da1734390931, androidx.camera.core.Preview-5ea331ae-2df1-4000-8c23-9d2949adceda37994626] for camera: 0
D/Camera2CameraImpl( 5839): {Camera@87d8bd3[id=0]} Use case androidx.camera.core.ImageAnalysis-6f55b854-998b-49ca-8113-0846540dd0fc163069904 INACTIVE
D/UseCaseAttachState( 5839): Active and attached use case: [androidx.camera.core.ImageCapture-822e8930-8ef9-48f2-a0b9-73efe4f5da1734390931, androidx.camera.core.Preview-5ea331ae-2df1-4000-8c23-9d2949adceda37994626] for camera: 0
D/Camera2CameraImpl( 5839): {Camera@87d8bd3[id=0]} CameraDevice.onOpened()
D/Camera2CameraImpl( 5839): {Camera@87d8bd3[id=0]} Transitioning camera internal state: OPENING --> OPENED
D/CameraStateRegistry( 5839): Recalculating open cameras:
D/CameraStateRegistry( 5839): Camera                                       State
D/CameraStateRegistry( 5839): -------------------------------------------------------------------
D/CameraStateRegistry( 5839): Camera@598747d[id=2]                         UNKNOWN
D/CameraStateRegistry( 5839): Camera@87d8bd3[id=0]                         OPEN
D/CameraStateRegistry( 5839): Camera@125871a[id=1]                         UNKNOWN
D/CameraStateRegistry( 5839): -------------------------------------------------------------------
D/CameraStateRegistry( 5839): Open count: 1 (Max allowed: 1)
D/CameraStateMachine( 5839): New public camera state CameraState{type=OPEN, error=null} from OPEN and null
D/CameraStateMachine( 5839): Publishing new public camera state CameraState{type=OPEN, error=null}
D/UseCaseAttachState( 5839): All use case: [androidx.camera.core.ImageCapture-822e8930-8ef9-48f2-a0b9-73efe4f5da1734390931, androidx.camera.core.Preview-5ea331ae-2df1-4000-8c23-9d2949adceda37994626, androidx.camera.core.ImageAnalysis-6f55b854-998b-49ca-8113-0846540dd0fc163069904] for camera: 0
D/UseCaseAttachState( 5839): Active and attached use case: [androidx.camera.core.ImageCapture-822e8930-8ef9-48f2-a0b9-73efe4f5da1734390931, androidx.camera.core.Preview-5ea331ae-2df1-4000-8c23-9d2949adceda37994626] for camera: 0
D/SyncCaptureSessionBase( 5839): [androidx.camera.camera2.internal.SynchronizedCaptureSessionImpl@88f7cea] getSurface done with results: [Surface(name=null)/@0xb4d27cf, Surface(name=null)/@0xc3ead8c, Surface(name=null)/@0x5d8bcd5]
D/CaptureSession( 5839): Opening capture session.
D/Camera2CaptureRequestBuilder( 5839): template type = 1
I/OplusCameraUtils( 5839): current activityName: dev.hebei.camerax_android_example.MainActivity
D/SyncCaptureSessionImpl( 5839): [androidx.camera.camera2.internal.SynchronizedCaptureSessionImpl@88f7cea] start openCaptureSession
D/DeferrableSurface( 5839): use count+1, useCount=2 androidx.camera.core.SurfaceRequest$2@8f14e32
D/DeferrableSurface( 5839): New surface in use[total_surfaces=4, used_surfaces=2](androidx.camera.core.impl.ImmediateSurface@e181ff5}
D/DeferrableSurface( 5839): use count+1, useCount=1 androidx.camera.core.impl.ImmediateSurface@e181ff5
D/DeferrableSurface( 5839): New surface in use[total_surfaces=4, used_surfaces=3](androidx.camera.core.impl.ImmediateSurface@20493fb}
D/DeferrableSurface( 5839): use count+1, useCount=1 androidx.camera.core.impl.ImmediateSurface@20493fb
I/OplusCameraManagerGlobal( 5839): setIsCameraUnitSession E
D/OplusStatistics--( 5839): newThread.ThreadFactory
D/SyncCaptureSessionImpl( 5839): [androidx.camera.camera2.internal.SynchronizedCaptureSessionImpl@88f7cea] Session onConfigured()
D/CaptureSession( 5839): Attempting to send capture request onConfigured
D/CaptureSession( 5839): Issuing request for session.
D/Camera2CaptureRequestBuilder( 5839): createCaptureRequest
D/CaptureSession( 5839): CameraCaptureSession.onConfigured() mState=OPENED
D/CaptureSession( 5839): CameraCaptureSession.onReady() OPENED
D/BLASTBufferQueue( 5839): [SurfaceView[dev.hebei.camerax_android_example/dev.hebei.camerax_android_example.MainActivity]#2](f:0,a:1) acquireNextBufferLocked size=1440x1080 mFrameNumber=1 applyTransaction=true mTimestamp=126719554729700 mPendingTransactions.size=0 graphicBufferId=25078314041414 transform=4
D/StreamStateObserver( 5839): Update Preview stream state to STREAMING
I/OplusCameraUtils( 5839): current activityName: dev.hebei.camerax_android_example.MainActivity
E/ActivityThread( 5839): Failed to find provider info for com.oplus.statistics.provider
D/OplusStatistics--( 5839): get provider client failed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant