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

Switch camera during recording video throws NullPointerException #520

Open
shoebkhan88 opened this issue Oct 4, 2024 · 0 comments
Open

Comments

@shoebkhan88
Copy link

Detail Log:
E/BufferQueueProducer( 5617): SurfaceTexture-0-5617-33 dequeueBuffer: attempting to exceed the max dequeued buffer count (4)
E/BufferQueueProducer( 5617): SurfaceTexture-0-5617-33 dequeueBuffer: attempting to exceed the max dequeued buffer count (4)
D/CCodec ( 5617): ISConfig not changed
D/CCodecConfig( 5617): c2 config diff is c2::u32 coding.request-sync-frame.value = 1
D/CCodec ( 5617): ISConfig not changed
E/BufferQueueProducer( 5617): SurfaceTexture-0-5617-33 dequeueBuffer: attempting to exceed the max dequeued buffer count (4)
D/MPEG4Writer( 5617): PreAllocation enabled
D/MPEG4Writer( 5617): fpathconf _PC_FILESIZEBITS:64
D/MPEG4Writer( 5617): File size limit set to 4503599627370495 bytes implicitly
D/MPEG4Writer( 5617): MP4WtrCtrlHlpLooper Started
I/MPEG4Writer( 5617): limits: 4503599627370495/0 bytes/us, bit rate: -1 bps and the estimated moov size 3192 bytes
D/EGL_emulation( 5617): app_time_stats: avg=36.45ms min=23.98ms max=104.75ms count=28
I/MPEG4Writer( 5617): setStartTimestampUs: 1341186140
I/MPEG4Writer( 5617): Earliest track starting time: 1341186140
I/MPEG4Writer( 5617): setStartTimestampUs: 1341224164
D/EGL_emulation( 5617): app_time_stats: avg=18.45ms min=2.56ms max=108.75ms count=43
D/BufferPoolAccessor2.0( 5617): bufferpool2 0xb400007dd6d42618 : 5(40960 size) total buffers - 4(32768 size) used buffers - 78/83 (recycle/alloc) - 6/157 (fetch/transfer)
D/EGL_emulation( 5617): app_time_stats: avg=37.62ms min=14.49ms max=152.30ms count=27
D/EGL_emulation( 5617): app_time_stats: avg=12.80ms min=2.07ms max=122.85ms count=53
I/flutter ( 5617): .....................switched camera
D/MediaCodecList( 5617): codecHandlesFormat: no format, so no extra checks
D/CCodec ( 5617): allocate(c2.android.hevc.encoder)
I/CCodec ( 5617): setting up 'default' as default (vendor) store
I/CCodec ( 5617): Created component [c2.android.hevc.encoder]
D/CCodecConfig( 5617): read media type: video/hevc
D/ReflectedParamUpdater( 5617): extent() != 1 for single value type: algo.buffers.max-count.values
D/ReflectedParamUpdater( 5617): extent() != 1 for single value type: output.subscribed-indices.values
D/ReflectedParamUpdater( 5617): extent() != 1 for single value type: input.buffers.allocator-ids.values
D/ReflectedParamUpdater( 5617): extent() != 1 for single value type: output.buffers.allocator-ids.values
D/ReflectedParamUpdater( 5617): extent() != 1 for single value type: algo.buffers.allocator-ids.values
D/ReflectedParamUpdater( 5617): extent() != 1 for single value type: output.buffers.pool-ids.values
D/ReflectedParamUpdater( 5617): extent() != 1 for single value type: algo.buffers.pool-ids.values
D/ReflectedParamUpdater( 5617): ignored struct field coding.gop.values
D/ReflectedParamUpdater( 5617): ignored struct field coding.qp.values
D/CCodecConfig( 5617): ignoring local param raw.color (0xc2001809) as it is already supported
I/CCodecConfig( 5617): query failed after returning 14 values (BAD_INDEX)
D/CCodecConfig( 5617): c2 config diff is Dict {
D/CCodecConfig( 5617): c2::u32 algo.bitrate-mode.value = 3
D/CCodecConfig( 5617): c2::u32 algo.complexity.value = 0
D/CCodecConfig( 5617): c2::u32 algo.quality.value = 80
D/CCodecConfig( 5617): c2::i32 coded.average-qp.value = 0
D/CCodecConfig( 5617): c2::u32 coded.bitrate.value = 64000
D/CCodecConfig( 5617): c2::float coded.frame-rate.value = 1
D/CCodecConfig( 5617): c2::u32 coded.picture-type.value = 0
D/CCodecConfig( 5617): c2::u32 coded.pl.level = 24576
D/CCodecConfig( 5617): c2::u32 coded.pl.profile = 24576
D/CCodecConfig( 5617): c2::u32 coded.vui.color.matrix = 0
D/CCodecConfig( 5617): c2::u32 coded.vui.color.primaries = 0
D/CCodecConfig( 5617): c2::u32 coded.vui.color.range = 0
D/CCodecConfig( 5617): c2::u32 coded.vui.color.transfer = 0
D/CCodecConfig( 5617): c2::u32 coding.request-sync-frame.value = 0
D/CCodecConfig( 5617): c2::i64 coding.sync-frame-interval.value = 1000000
D/CCodecConfig( 5617): c2::u32 input.delay.value = 0
D/CCodecConfig( 5617): string input.media-type.value = "video/raw"
D/CCodecConfig( 5617): string output.media-type.value = "video/hevc"
D/CCodecConfig( 5617): c2::u32 raw.color.matrix = 0
D/CCodecConfig( 5617): c2::u32 raw.color.primaries = 0
D/CCodecConfig( 5617): c2::u32 raw.color.range = 0
D/CCodecConfig( 5617): c2::u32 raw.color.transfer = 0
D/CCodecConfig( 5617): c2::u32 raw.size.height = 64
D/CCodecConfig( 5617): c2::u32 raw.size.width = 64
D/CCodecConfig( 5617): }
............................................
D/CCodec ( 5617): ISConfig not changed
I/hw-BpHwBinder( 5617): onLastStrongRef automatically unlinking death recipients
I/hw-BpHwBinder( 5617): onLastStrongRef automatically unlinking death recipients
E/com.apparence.camerawesome.CamerawesomePlugin( 5617): Video capture ends with error: 4
D/EGL_emulation( 5617): app_time_stats: avg=21.09ms min=6.73ms max=81.28ms count=48
I/flutter ( 5617): timer stopped
I/flutter ( 5617): totalTimeElapsed so far 8000
E/BasicMessageChannel#dev.flutter.pigeon.CameraInterface.stopRecordingVideo( 5617): Failed to handle message
E/BasicMessageChannel#dev.flutter.pigeon.CameraInterface.stopRecordingVideo( 5617): java.lang.NullPointerException
E/BasicMessageChannel#dev.flutter.pigeon.CameraInterface.stopRecordingVideo( 5617): at com.apparence.camerawesome.cameraX.CameraAwesomeX.stopRecordingVideo(CameraAwesomeX.kt:526)
E/BasicMessageChannel#dev.flutter.pigeon.CameraInterface.stopRecordingVideo( 5617): at com.apparence.camerawesome.cameraX.CameraInterface$Companion.setUp$lambda$20$lambda$19(Pigeon.kt:1000)
E/BasicMessageChannel#dev.flutter.pigeon.CameraInterface.stopRecordingVideo( 5617): at com.apparence.camerawesome.cameraX.CameraInterface$Companion.$r8$lambda$x5kDa3WXsAv6fsYQXjUQDgnVgn4(Unknown Source:0)
E/BasicMessageChannel#dev.flutter.pigeon.CameraInterface.stopRecordingVideo( 5617): at com.apparence.camerawesome.cameraX.CameraInterface$Companion$$ExternalSyntheticLambda30.onMessage(Unknown Source:2)
E/BasicMessageChannel#dev.flutter.pigeon.CameraInterface.stopRecordingVideo( 5617): at io.flutter.plugin.common.BasicMessageChannel$IncomingMessageHandler.onMessage(BasicMessageChannel.java:261)
E/BasicMessageChannel#dev.flutter.pigeon.CameraInterface.stopRecordingVideo( 5617): at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:292)
E/BasicMessageChannel#dev.flutter.pigeon.CameraInterface.stopRecordingVideo( 5617): at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:319)
E/BasicMessageChannel#dev.flutter.pigeon.CameraInterface.stopRecordingVideo( 5617): at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12)
E/BasicMessageChannel#dev.flutter.pigeon.CameraInterface.stopRecordingVideo( 5617): at android.os.Handler.handleCallback(Handler.java:942)
E/BasicMessageChannel#dev.flutter.pigeon.CameraInterface.stopRecordingVideo( 5617): at android.os.Handler.dispatchMessage(Handler.java:99)
E/BasicMessageChannel#dev.flutter.pigeon.CameraInterface.stopRecordingVideo( 5617): at android.os.Looper.loopOnce(Looper.java:201)
E/BasicMessageChannel#dev.flutter.pigeon.CameraInterface.stopRecordingVideo( 5617): at android.os.Looper.loop(Looper.java:288)
E/BasicMessageChannel#dev.flutter.pigeon.CameraInterface.stopRecordingVideo( 5617): at android.app.ActivityThread.main(ActivityThread.java:7872)
E/BasicMessageChannel#dev.flutter.pigeon.CameraInterface.stopRecordingVideo( 5617): at java.lang.reflect.Method.invoke(Native Method)
E/BasicMessageChannel#dev.flutter.pigeon.CameraInterface.stopRecordingVideo( 5617): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
E/BasicMessageChannel#dev.flutter.pigeon.CameraInterface.stopRecordingVideo( 5617): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
E/flutter ( 5617): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(channel-error, Unable to establish connection on channel., null, null)
E/flutter ( 5617): #0 CameraInterface.stopRecordingVideo (package:camerawesome/pigeon.dart:984:7)
E/flutter ( 5617):
E/flutter ( 5617): #1 VideoRecordingCameraState.stopRecording (package:camerawesome/src/orchestrator/states/video_camera_recording_state.dart:87:20)
E/flutter ( 5617):
E/flutter ( 5617):
D/EGL_emulation( 5617): app_time_stats: avg=17.18ms min=13.82ms max=52.22ms count=59
D/EGL_emulation( 5617): app_time_stats: avg=34.49ms min=32.21ms max=51.08ms count=29
D/EGL_emulation( 5617): app_time_stats: avg=26.71ms min=13.52ms max=49.24ms count=38
D/BufferPoolAccessor2.0( 5617): bufferpool2 0xb400007dd6d42618 : 0(0 size) total buffers - 0(0 size) used buffers - 88/93 (recycle/alloc) - 6/178 (fetch/transfer)
D/BufferPoolAccessor2.0( 5617): evictor expired: 1, evicted: 1
D/EGL_emulation( 5617): app_time_stats: avg=33.93ms min=31.70ms max=51.65ms count=30
I/hw-BpHwBinder( 5617): onLastStrongRef automatically unlinking death recipients
W/.com.app.example( 5617): Long monitor contention with owner CameraX-core_camera_1 (6033) at void android.hardware.camera2.impl.CameraDeviceImpl.close()(CameraDeviceImpl.java:1433) waiters=0 in void android.hardware.camera2.impl.CameraDeviceImpl$CameraDeviceCallbacks.onCaptureStarted(android.hardware.camera2.impl.CaptureResultExtras, long) for 147ms

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant