Status Update
Comments
xi...@google.com <xi...@google.com> #2
ca...@gmail.com <ca...@gmail.com> #3
Are we getting a crop mode here? Thanks!
sp...@gmail.com <sp...@gmail.com> #4
Thanks for raising this up. May we know did you set aspect ratio or resolution for Preview use case? And could you also attach the captured image file?
xi...@google.com <xi...@google.com> #5
I did not set anything on the Preview use case other than the lens facing.
```
val cameraPreview = Preview(Builder()
.setLensFacing(CameraX.LensFacing.BACK)
.build())
cameraPreview.setOnPreviewOutputUpdateListener {
// Every time the viewfinder is updated, recompute the layout. By removing and re-adding it.
val parent = parent as ViewGroup
parent.removeView(this)
parent.addView(this, 0)
surfaceTexture = it.surfaceTexture
updateTransform()
}
CameraX.bindToLifecycle(lifecycleOwner, cameraPreview, *useCase)
```
sp...@gmail.com <sp...@gmail.com> #6
xi...@google.com <xi...@google.com> #7
Hi There,
It's been just over a month and we are clearing out issues without response. If you have any feedback please feel free to reopen or file another issue. Thanks!
sp...@gmail.com <sp...@gmail.com> #8
There is default aspect ratio custom set to ImageCapture use case but it is not updated to match the new target rotation value.
xi...@google.com <xi...@google.com> #9
I have received my Galaxy Tab A (2016), model number SM-T580. I still couldn't reproduce the issue. Could you help me check the following:
- What is the model number of your device?
- Could you take a screenshot of the stretched preview?
- Could you upgrade to the latest version, enable logging(see below), take a bugreport, and attach it here?
adb shell setprop log.tag.PreviewTransform DEBUG
adb shell setprop log.tag.PreviewView DEBUG
sp...@gmail.com <sp...@gmail.com> #10
Mine is also SM-T580, build number M1AJQ.T580UE4CSC1
Update to the latest version of what?
I've attached a screen shot with two identical sheets of paper with a different orientation, and a bug report. I've never make a bug report on android before, so let me know if this is correct.
xi...@google.com <xi...@google.com> #11
Thanks for a report. Now I can reproduce the issue. It's likely Samsung HAL bug. Another known device that has this issue is SM-J710MN. We will be looking for adding a fix in CameraX.
In the mean time, you can workaround the issue by setting the target aspect ratio to 16:9
Preview.setTargetAspectRtatio(AspectRatio.RATIO_16_9)
We will update this bug once the fix is in place.
ap...@google.com <ap...@google.com> #12
Branch: androidx-master-dev
commit e795d051f9043d22b4de468d723349cf7af8835f
Author: Xi Zhang <xizh@google.com>
Date: Wed Oct 14 10:48:33 2020
Workaround for Samsung preview aspect ratio quirk
Added quirk and workaround for Samsung preview aspect ratio.
Bug: 169471824,170762209
Test: manual test and ./gradlew bOS
Change-Id: I26a43e8e310476531ebb421d54566f93313788c6
M camera/camera-camera2/src/main/java/androidx/camera/camera2/internal/SupportedSurfaceCombination.java
M camera/camera-camera2/src/main/java/androidx/camera/camera2/internal/compat/quirk/device/DeviceQuirks.java
A camera/camera-camera2/src/main/java/androidx/camera/camera2/internal/compat/quirk/device/SamsungPreviewTargetAspectRatioQuirk.java
A camera/camera-camera2/src/main/java/androidx/camera/camera2/internal/compat/workaround/TargetAspectRatio.java
xi...@google.com <xi...@google.com> #13
We added a workaround in the next release. The workaround is simply forcing to use 16:9 preview for the devices that have the issue.
ap...@google.com <ap...@google.com> #14
Branch: androidx-master-dev
commit b4a0441cee565576243ad84996c013009263017c
Author: husaynhakeem <husaynhakeem@google.com>
Date: Fri Oct 16 09:50:22 2020
Add unit tests for Samsung preview aspect ratio workaround
Bug:
Test: TargetAspectRatioTest.java
Change-Id: Id950a15ad252792a956343c85fd375e05a0ec20c
A camera/camera-camera2/src/test/java/androidx/camera/camera2/internal/compat/workaround/TargetAspectRatioTest.java
ap...@google.com <ap...@google.com> #15
Branch: androidx-master-dev
commit b279e1b70d1f6f5e3bdc0f62b693f09ace7df8f6
Author: Xi Zhang <xizh@google.com>
Date: Sat Oct 31 10:24:14 2020
Document about Samsung preview aspect ratio quirk
Bug: 169471824
Test: manual test and ./gradlew bOS
Change-Id: I632467dde56762e12440aeb166c4a39f9e5c7d2c
M camera/camera-core/src/main/java/androidx/camera/core/Preview.java
Description
CAMERAX VERSION 1.0.0-beta08 and 1.0.0-beta10 (and some earlier versions, I didn't keep track of which versions I tried, but I was unable to find a working version, but I didn't go back too far)
CAMERA APPLICATION NAME AND VERSION: CameraXBasic
ANDROID OS BUILD NUMBER: 8.1.0 M1AJQ.T580UE4CSC1
DEVICE NAME: Samsung Galaxy Tab A 10.1 (2016)
DESCRIPTION:
LIST ANY EXPERIMENTAL FEATURES: I think none.
STEPS TO REPRODUCE:
OBSERVED RESULTS:
Preview is stretched along the longer dimensions regardless of orientation. Captured image maintains correct aspect ratio, but cuts off some of the image visible in preview. The preview seems to be setting the camera to 16:9 and stretching it to fit 9:16.
EXPECTED RESULTS:
Preview displays the same image that is captured.
REPRODUCIBILITY: 5/5 on this device
ADDITIONAL INFORMATION:
Camera2Basic works as expected