feat: Upgrade CameraX to 1.4.0-beta02 #2986
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What
Upgrades CameraX on Android to beta02. Changes:
Version 1.4.0-beta02
June 12, 2024
androidx.camera:camera-*:1.4.0-beta02 is released. Version 1.4.0-beta02 contains these commits.
API Changes
Similar to VideoCapture, add setMirrorMode for Preview use case. It will support mirror mode ON and OFF for Preview stream via OutputConfiguration.setMirrorMode from API 33 and above, for older APIs, it will be no-op. (I821f4)
Bug Fixes
Fixed the issue that apps can't take pictures successfully on Samsung Tab A8 when ImageCapture selects 1920x1080 under Preview + VideoCapture + ImageCapture UseCase combination. (I5a463, b/336925549)
Fixed persistent recording may fail to continue recording after switching camera. (Icb0a1)
Version 1.4.0-beta01
May 14, 2024
androidx.camera:camera-*:1.4.0-beta01 is released. Version 1.4.0-beta01 contains these commits.
API Changes
Added ZoomGestureDetector.ZoomEvent to encapsulates the states of a zoom gesture. (I84cdf)
Bug Fixes
Fixed a bug that still capture and tap-to-focus do not use the repeating request FPS/stabilization mode values which may recreate capture session and cause latency issues or Preview freeze in some devices. (I7dc0b)
Fixed a bug where High Resolutions can not be selected when CameraEffect is enabled on some devices. (e.g. 4000x3000 on Samsung A32 5G). (Ie3ed3, b/337336152)
Fixed a crash when taking picture with Preview, ImageCapture and VideoCapture(UHD) are bound on Pixel 4XL API29. (I5b288)
Support virtual devices: Context passed into ProcessCameraProvider will preserve the device ID to ensure the functionality in a virtual device environment. (I5ba48)
Version 1.4.0-alpha05
April 17, 2024
androidx.camera:camera-*:1.4.0-alpha05 is released. Version 1.4.0-alpha05 contains these commits.
New Features
Converted ProcessCameraProvider into Kotlin implementation. (I46d4f)
Added ImageCapture.takePicture suspend functions to allow it to be called in a Kotlin-idiomatic way. (I920be)
API Changes
Add output format APIs to ImageCapture, and add getSupportedOutputFormats method to ImageCaptureCapabilities for querying device capability. The default output format value is OUTPUT_FORMAT_JPEG, which captures SDR images in JPEG format. When the device supports Ultra HDR and the output format is set to OUTPUT_FORMAT_JPEG_ULTRA_HDR, CameraX will capture Ultra HDR compressed images using the JPEG/R image format. The format is backwards compatible with SDR JPEG format and supports HDR rendering of content. This means that on older apps or devices, images appear seamlessly as regular JPEG; on apps and devices that have been updated to fully support the format, images appear as HDR. (I5de50)
Add PhysicalCameraInfo in CameraInfo to query physical camera information and add physical camera id setter/getter in CameraSelector (Ic5b90)
Replace CameraController#COORDINATE_SYSTEM_VIEW_REFERENCED with ImageAnalysis#COORDINATE_SYSTEM_VIEW_REFERENCED. The value of the constant remains the same. This is for consolidating all the constants into one place. (I890bb)
New RetryPolicy API empowers developers to customize retry behavior for CameraX initialization. (I36dd2)
Enable creation of ImageCaptureLatencyEstimate object to assist with testability (Iaba99)
Add a ImageAnalysis#COORDINATE_SYSTEM_SENSOR. When this is used, the MlKitAnalyzer returns coordinates in the camera sensor coordinate system. (I3ec61)
Exposed extensions metadata API. New CameraExtensionsInfo and CameraExtensionsControl interfaces allow applications to monitor and adjust extension strength settings. Applications can obtain the CameraExtensionsInfo or CameraExtensionsControl instance via the newly added ExtensionsManager#getCameraExtensionsInfo() or ExtensionsManager#getCameraExtensionsControl() methods. (I28e1a)
Added ProcessCameraProvider.awaitInstance which is a suspending version of ProcessCameraProvider.getInstance (Ib22b9)
Add a PreviewView#getSensorToViewTransform() API. The Matrix represents the transformation from camera sensor coordinates to the PreviewView's coordinates. This can be used to transform coordinates from one UseCase to another. For example, transforming the coordinates of detected objects in ImageAnalysis to PreviewView overlay. (I947ab)
Make camera-viewfinder-core API more generic so it can be used by camera-viewfinder and camera-viewfinder-compose. (I1e295)
Add getSurface function to ViewfinderSurfaceRequest. (I781a0)
Use camera-viewfinder-core in camera-viewfinder and deprecate ViewfinderSurfaceRequest and CameraViewfinder. (I6198c)
Added ZoomGestureDetector that interprets scaling gestures specifically configured for pinch-to-zoom activity. (Ifafbf)
Bug Fixes
Fixed ImageAnalysis' resolution selection issue related to the analyzer default target resolution setting: target resolution was incorrectly kept as 640x480 even if applications has set a different analyzer default resolution setting. If applications encounter this issue (1.3.0 ~ 1.3.2) and can't upgrade to use the newer version releases which contain the solution, directly setting a ResolutionSelector with the preferred resolution and a matching AspectRatioStrategy to the ImageAnalysis UseCase can workaround this issue. (I81f72, b/330091012)
Fixed an issue that queued takePicture request might fail to run if the current request is failed. (Ie0801)
Make the invalid JPEG data check applied to Vivo X60 and X60 Pro devices. This can fix abnormally large image issue on these devices. (I82247, b/288828159)
Fixed the incorrect JPEG image metadata issue on Samsung A24 devices. With the fix, CameraX can successfully save the JPEG image, or correct Bitmap objects can be returned when calling the ImageProxy.toBitmap() function on Samsung A24 devices. (I8d6eb, b/309005680)
Make the invalid JPEG data check applied to all Samsung devices if the captured image is larger than 10 MB. This can fix abnormally large iamge issue on Samsung devices. (Ic2a65, b/288828159)
Removed ImageAnalysis support on CameraX Extensions as many OEMs' Extensions implementations don't work with ImageAnalysis well and might cause inconsistent issues. (I2d926)
ful changelog here
Changes
Tested on
Related issues