Closed millerf closed 7 months ago
Hi, Could you add the "enablePhysicalButton: true," property and test again plz ?
Hi, Could you add the "enablePhysicalButton: true," property and test again plz ?
No difference. I actually tried before (and just tried again).
My logs from Android in debug, before/after clicking the "shutter" button (the big white "take a photo" button)
D/ImageCapture( 7767): clearPipeline
D/ImageCapture( 7767): createPipeline(cameraId: 0, streamSpec: StreamSpec{resolution=1280x720, dynamicRange=DynamicRange@9649b9{encoding=SDR, bitDepth=8}, expectedFrameRateRange=[0, 0], implementationOptions=androidx.camera.camera2.impl.Camera2ImplConfig@fcbf2af})
D/SessionLifecycleClient( 7767): Sending lifecycle 2 to service
D/SessionLifecycleService( 7767): Activity backgrounding at 209886840
D/ImageCapture( 7767): clearPipeline
D/ImageCapture( 7767): createPipeline(cameraId: 0, streamSpec: StreamSpec{resolution=1280x720, dynamicRange=DynamicRange@9649b9{encoding=SDR, bitDepth=8}, expectedFrameRateRange=[0, 0], implementationOptions=androidx.camera.camera2.impl.Camera2ImplConfig@fb78833})
W/omad.park.front( 7767): Long monitor contention with owner CameraX-core_camera_0 (8096) at void android.hardware.camera2.impl.CameraDeviceImpl.close()(CameraDeviceImpl.java:1434) waiters=0 in void android.hardware.camera2.impl.CameraDeviceImpl$CameraDeviceCallbacks.onCaptureStarted(android.hardware.camera2.impl.CaptureResultExtras, long) for 134ms
D/EGL_emulation( 7767): app_time_stats: avg=22.07ms min=0.84ms max=414.71ms count=38
D/com.apparence.camerawesome.cameraX.CameraPermissions( 7767): _onRequestPermissionsResult: received permissions but the EventSink is closed
D/SessionLifecycleClient( 7767): Sending lifecycle 1 to service
D/SessionLifecycleService( 7767): Activity foregrounding at 209888019.
D/EGL_emulation( 7767): app_time_stats: avg=389443.62ms min=0.94ms max=5841633.00ms count=15
D/SessionLifecycleClient( 7767): Sending lifecycle 2 to service
D/SessionLifecycleService( 7767): Activity backgrounding at 209888338
D/com.apparence.camerawesome.cameraX.CameraPermissions( 7767): _onRequestPermissionsResult: received permissions but the EventSink is closed
D/SessionLifecycleClient( 7767): Sending lifecycle 1 to service
D/SessionLifecycleService( 7767): Activity foregrounding at 209888486.
D/EGL_emulation( 7767): app_time_stats: avg=39.28ms min=2.06ms max=132.14ms count=25
D/EGL_emulation( 7767): app_time_stats: avg=33.33ms min=32.48ms max=34.16ms count=30
D/EGL_emulation( 7767): app_time_stats: avg=33.88ms min=17.35ms max=49.71ms count=30
D/EGL_emulation( 7767): app_time_stats: avg=33.89ms min=31.09ms max=49.90ms count=30
D/EGL_emulation( 7767): app_time_stats: avg=33.90ms min=18.20ms max=49.81ms count=30
D/EGL_emulation( 7767): app_time_stats: avg=33.88ms min=31.83ms max=49.47ms count=30
D/EGL_emulation( 7767): app_time_stats: avg=33.89ms min=31.81ms max=50.46ms count=30
D/ImageCapture( 7767): takePictureInternal
D/TakePictureManager( 7767): Issue the next TakePictureRequest.
D/TakePictureManager( 7767): Issue the next TakePictureRequest.
D/TakePictureManager( 7767): No new request.
D/EGL_emulation( 7767): app_time_stats: avg=28.68ms min=1.62ms max=103.68ms count=31
D/EGL_emulation( 7767): app_time_stats: avg=33.87ms min=31.50ms max=50.51ms count=30
D/EGL_emulation( 7767): app_time_stats: avg=33.88ms min=19.14ms max=65.46ms count=30
D/EGL_emulation( 7767): app_time_stats: avg=33.88ms min=31.33ms max=50.94ms count=30
D/EGL_emulation( 7767): app_time_stats: avg=33.87ms min=17.95ms max=51.03ms count=30
D/EGL_emulation( 7767): app_time_stats: avg=33.87ms min=10.83ms max=55.94ms count=30
D/EGL_emulation( 7767): app_time_stats: avg=33.89ms min=32.28ms max=50.69ms count=30
D/EGL_emulation( 7767): app_time_stats: avg=33.89ms min=31.55ms max=50.59ms count=30
D/EGL_emulation( 7767): app_time_stats: avg=33.90ms min=31.78ms max=50.24ms count=30
Screenshot:
PLease try this on a real device. Emulator is quite buggy with cameraX
I found the "issue"... I tried with a minimal setup:
Scaffold(
body: CameraAwesomeBuilder.awesome(
enablePhysicalButton: true,
saveConfig: SaveConfig.photo(),
onMediaTap: (MediaCapture mediaCapture) {
getLogger().w('MediaTap');
mediaCapture.captureRequest.when(single: (single) {
onMediaTap(File(single.file!.path));
});
},
)
);
And got it to trigger when "tapping on the small media preview" 😅
I guess I got confused before.
So how can I retrieve the captured file if I do not want the preview to be displayed?
Found it. For the record, the data is in the state.captureState$
stream...
CameraAwesomeBuilder.custom(
saveConfig: SaveConfig.photo(),
builder: (state, previewSize, previewRect) {
state.captureState$.listen(
/// Do stuff here
)
},
)
Please try this on a real device. Emulator is quite buggy with cameraX
I also tried on IOS simulator and real iOS device. Same issue. I believe you should trigger onMediaTap if AwesomeMediaPreview
is not displayed...
Do you want to do it that way? If so, I am happy to do a PR... There is some great work in this lib!
Steps to Reproduce
Smaller issue: AwesomeZoomSelector is not displayed on iOS, but it is on Android...
Expected results
Actual results
About your device
CameraAwesome version
Your flutter version
Run this in your command line
Test widget