CameraX cost associate in nursing addition to Jetpack that shuffle information technology easy to total television camera capability to your app. The library put up adenine number of compatibility fix and workarounds to avail make the developer experience coherent across many device .
Save and categorize content based on your preferences.
CameraX is an addition to Jetpack that makes it easier to add camera
capabilities to your app. The library provides a number of compatibility fixes
and workarounds to help make the developer experience consistent across many
devices.
This table lists all the artifacts in the androidx.camera
group.
This library was last updated on: July 26, 2023
This library was last updated on: July 26, 2023
CameraX is tested on many devices in our lab. To see a list of the devices
currently in the lab, see CameraX lab-tested
devices.
To add a dependency on CameraX, you must add the Google Maven repository to
your project. Read
Google’s Maven repository for more
information.
Add the dependencies for the artifacts you need in the build.gradle
file for
your app or module:
dependencies { // CameraX core library using the camera2 implementation def camerax_version = "1.3.0-beta02" // The following line is optional, as the core library is included indirectly by camera-camera2 implementation "androidx.camera:camera-core:${camerax_version}" implementation "androidx.camera:camera-camera2:${camerax_version}" // If you want to additionally use the CameraX Lifecycle library implementation "androidx.camera:camera-lifecycle:${camerax_version}" // If you want to additionally use the CameraX VideoCapture library implementation "androidx.camera:camera-video:${camerax_version}" // If you want to additionally use the CameraX View class implementation "androidx.camera:camera-view:${camerax_version}" // If you want to additionally add CameraX ML Kit Vision Integration implementation "androidx.camera:camera-mlkit-vision:${camerax_version}" // If you want to additionally use the CameraX Extensions library implementation "androidx.camera:camera-extensions:${camerax_version}" }
dependencies { // CameraX core library using the camera2 implementation val camerax_version = "1.3.0-beta02" // The following line is optional, as the core library is included indirectly by camera-camera2 implementation("androidx.camera:camera-core:${camerax_version}") implementation("androidx.camera:camera-camera2:${camerax_version}") // If you want to additionally use the CameraX Lifecycle library implementation("androidx.camera:camera-lifecycle:${camerax_version}") // If you want to additionally use the CameraX VideoCapture library implementation("androidx.camera:camera-video:${camerax_version}") // If you want to additionally use the CameraX View class implementation("androidx.camera:camera-view:${camerax_version}") // If you want to additionally add CameraX ML Kit Vision Integration implementation("androidx.camera:camera-mlkit-vision:${camerax_version}") // If you want to additionally use the CameraX Extensions library implementation("androidx.camera:camera-extensions:${camerax_version}") }
Your feedback helps make Jetpack better. Let us know if you discover new issues or have
ideas for improving this library. Please take a look at the
existing issues
in this library before you create a new one. You can add your vote to an existing issue by
clicking the star button.
See the Issue Tracker documentation
for more information.
July 26, 2023
androidx.camera:camera-*:1.3.0-beta02
is released. Version 1.3.0-beta02 contains these commits.
Bug Fixes
CaptureFailedRetryQuirk
. (I7b589)June 21, 2023
androidx.camera:camera-*:1.3.0-beta01
is released. Version 1.3.0-beta01 contains these commits.
API Changes
ResolutionSelector.Builder#setHighResolutionEnabledFlag(int)
function name to setAllowedResolutionMode
and renamed the ResolutionSelector#HIGH_RESOLUTION_FLAG_OFF
/ON
constants to PREFER_CAPTURE_RATE_OVER_HIGHER_RESOLUTION
/PREFER_HIGHER_RESOLUTION_OVER_CAPTURE_RATE
. (If84e8)ImageAnalysis.setTargetRotationDegrees(int)
, ImageCapture.setTargetRotationDegrees(int)
and VideoCapture.setTargetRotationDegrees(int)
. (Id8e77)DynamicRange
class respresent the dynamic range of images. This can be used to select High Dynamic Range formats as the output of VideoCapture
through VideoCapture.Builder#setDynamicRange()
. (Ib0377)isImageAnalysisSupported
API to the ExtensionsManager
which apps can determine if an ImageAnalysis
use case can be bound along with Preview and ImageCapture
when Extensions are enabled. (I1bc63)VideoCapabilities
class obtained from the Recorder
can be used to query supported dynamic ranges and qualities for video recording on the device. QualitySelector
‘s getSupportedQualities()
and isQualitySupported()
methods are being deprecated. Please use VideoCapabilities
‘s getSupportedQualities()
and isQualitySupported()
methods instead. (I04014)CameraController#setVideoCaptureTargetQuality()
is renamed to setVideoCaptureQualitySelector
and takes argument QualitySelector
, which provides more flexibility for video quality setup. CameraController#getVideoCaptureTargetQuality()
is changed to getVideoCaptureQualitySelector
accordingly. (I520ed)Bug Fixes
ImageFormat.JPEG
format support for ImageProxy.toBitmap()
. If the JPEG byte array cannot be decoded, an UnsupportedOperationException
will be thrown. (I81958, b/282057603)May 24, 2023
androidx.camera:camera-*:1.3.0-alpha07
is released. Version 1.3.0-alpha07 contains these commits.
New Features
VideoCapture.Builder# setTargetFrameRate(Range)
API allows video recordings to be captured at other frame rates besides the device default. The available frame rates for recordings can be queried through the new CameraInfo#getSupportedFrameRates()
API.API Changes
ResolutionSelector#HIGH_RESOLUTION_FLAG_OFF
/ON
constants to ALLOWED_RESOLUTIONS_NORMAL
/SLOW
and renamed the builder setHighResolutionEnabledFlag
function name to setAllowedResolutionMode
. (Iae817)CameraInfo#getSupportedFrameRateRanges()
now returns a Set
rather than a List
to better represent that the ranges are unordered. (I02f43)CameraEffect
to handle unrecoverable errors (Ice471)ResolutionInfo
for better testability (If6d1c)UseCase.snapToSurfaceRotation(int)
to replace usage of setTargetRotationDegrees
and deprecate API ImageAnalysis.setTargetRotationDegrees(int)
, ImageCapture.setTargetRotationDegrees(int)
and VideoCapture.setTargetRotationDegrees(int)
. (Ia9010)Preview#getTargetFrameRate
and Preview.Builder#setTargetFrameRate
to be able to set and retrieve target frame rate for Preview use case (If4f22)VideoRecordEvent.Finalize
will now complete with error code ERROR_RECORDING_GARBAGE_COLLECTED
when the Recording
object is stopped due to garbage collection. (Iba974)Bug Fixes
NullPointerException
when the cached output sizes in StreamConfigurationMapCompat
are null. (Idf124, b/282025204)Preview.setSurfaceProvider(null)
doesn’t pause the preview in Extensions (Ia903e)ConcurrentModificationException
is thrown during camera opening when VideoCapture
is bound. (Ic8ac4)April 19, 2023
androidx.camera:camera-*:1.3.0-alpha06
is released. Version 1.3.0-alpha06 contains these commits.
New Features
ResolutionSelector
API which covers the following features:
VideoCapture
mirroring APIs. Videos recorded by VideoCapture
are not mirrored by default. However, the camera preview is mirrored on the front camera by default. VideoCapture
mirroring APIs make it possible to align to the camera preview when using the front camera. There are three MirrorMode
, OFF
, ON
and ON_FRONT_ONLY
. To align to the camera preview, it is recommended to use ON_FRONT_ONLY
which means that mirroring is not enabled for the rear camera but is enabled for the front camera.API Changes
ResolutionSelector
API. Applications can specify aspect ratio and resolution strategies with fallback rules or a custom resolution filter to get the desired results. Applications can specify a flag to enable high resolution capture. This will allow CameraX to select higher resolutions when taking photos or videos. However, please note that using a high resolution may result in slower capture times. (Ibed95)CameraInfo#getSupportedFrameRateRanges()
. (Iaa67f)VideoCapture#getTargetFrameRate()
(I83304)setTargetAspectRatio
and setTargetResolution
API. Please use the new ResolutionSelector
API instead. (I542c3)List> getAvailableConcurrentCameraInfos()
ConcurrentCamera bindToLifecycle(@NonNull ConcurrentCameraConfig concurrentCameraConfig)
boolean isConcurrentCameraModeOn()
ConcurrentCameraConfig
, SingleCameraConfig
and ConcurrentCamera
(Iab1c1)ImageProcessor.Response#getOutputImage
NonNull (Ib9c60)VideoCapture
mirroring APIs, including VideoCapture.Builder.setMirrorMode(int)
and VideoCapture.getMirrorMode()
. The APIs are useful for applications require the video recording to be consistent with common camera preview behavior, i.e. the rear camera preview is not mirrored but the front camera preview is mirrored. (I713b6, b/194634656)setTargetFrameRate()
API in the VideoCapture.Builder
and getTargetFramerate()
API in VideoCapture
(I109d4)SurfaceOutput
extending Closable and hide SurfaceOutput.Event
‘s public constructor. (I60ea8)Recording.mute
to dynamically mute or unmute an in-processing recording. RecordingStats
will contain AudioStats.AUDIO_STATE_MUTED
when the in-processing recording is muted explicitly. (Ie17fc)#setEffects()
parameter non-null. Add a #clearEffects()
API for clearing effects. The app should call #clearEffects()
to remove effects. (I4b4d9)ViewfinderSurfaceRequest.Builder
to take a builder for copy constructor (I621a7)Bug Fixes
VideoCapture
could not work with the front camera on some devices. For example, on Samsung Galaxy S23 and Xiaomi 2107113SG. (Ibec7e, b/270656244)requestLegacyExternalStorage
to true in application tag. (I11b2c)RejectedExecutionException
crash in DefaultSurfaceProcessor
. The crash could happen when VideoCapture
is bound and the activity is paused. (Idb46a, b/273713906)March 22, 2023
androidx.camera:camera-*:1.3.0-alpha05
is released. Version 1.3.0-alpha05 contains these commits.
API Changes
VideoCapture
rotation APIs, including VideoCapture.Builder.setTargetRotation(int)
, VideoCapture.setTargetRotation(int)
, VideoCapture.setTargetRotationDegrees(int)
and VideoCapture.getTargetRotation()
. The APIs are useful for applications that lock the device orientation. ImageCapture.setTargetRotationDegrees(int)
and ImageAnalysis.setTargetRotationDegrees(int)
are also added. (Id3ffe, b/205242781)VIDEO_CAPTURE
and PREVIEW|VIDEO_CAPTURE
as effects target. Effects that targets VIDEO_CAPTURE
will be applied to the VideoCapture
UseCase; Effects that targets PREVIEW|VIDEO_CAPTURE
will be applied to a shared stream before copying to Preview and VideoCapture
stream. (Iee6f3)Bug Fixes
1.2.2
: Fixed the issue where CameraX Extensions don’t work properly when proguard is enabled on some devices such as Pixel (I90aa2)PreviewView
bug that if the app handles screen orientation itself. the preview might become distorted upon rotation. This only happens on certain devices. It can be reproduced on Pixel a4, Pixel 5, and Pixel 6a. (I14340, b/223488673)February 22, 2023
androidx.camera:camera-*:1.3.0-alpha04
is released. Version 1.3.0-alpha04 contains these commits.
New Features
A new feature to support previously unsupported Surface combinations by sharing one stream to multiple UseCases.
IllegalArgumentException
.API Changes
ImageProxy
to Bitmap
. The supported ImageProxy
format is ImageFormat.YUV_420_888
and PixelFormat.RGBA_8888
. If the format is invalid, IllegalArgumentException
will be thrown. (Ic7110)CoroutineCameraViewfinder
to support configuring viewfinder using suspending functions in Kotlin. (I657bc)ViewfinderSurfaceRequest
. It provides the flexibility when user cannot provide CameraCharacteristics
. (Ie6549)Bug Fixes
January 25, 2023
androidx.camera:camera-*:1.3.0-alpha03
is released. Version 1.3.0-alpha03 contains these commits.
API Changes
CameraInfo.getIntrinsicZoomRatio
to provide angle of view information relative to the default camera. (Ib300c)CameraInfo.getLensFacing
to provide lens facing information. Added CameraSelector#LENS_FACING_EXTERNAL
as an experimental feature for selecting external cameras. (Icaf3e)#setEffect()
to CameraController
that allows adding effects to camera output. (I1d21f)invalidate()
method to SurfaceRequest
. The Surface provider can notify that the previously provided surface is no longer valid. (Idc649)ImageProcessor
API. This interface is for inject post-processing effects into the ImageCapture
pipeline. (I575c6)Recorder.Builder.setAspectRatio()
which can be combined with QualitySelector
to support more video resolutions. (I8a082)Recorder.Builder#setTargetVideoEncodingBitRate
to set Target Video Encoding BitRate
and Recorder#getTargetVideoEncodingBitRate
to get Target Video Encoding BitRate. (I5984d)Bug Fixes
ImageCapture
failed when there is no flash unit and flash mode is on. (I9e8b4, b/263391112)CameraController#enableTorch
, the pending action is cached and submitted once the initialization compeltes. (I11e92, b/264157663)December 7, 2022
androidx.camera:camera-*:1.3.0-alpha02
is released. Version 1.3.0-alpha02 contains these commits.
API Changes
OutputOptions.getDurationLimit
to OutputOptions.getDurationLimitMillis
and OutputOptions.setDurationLimit
to OutputOptions.setDurationLimitMillis
. (I91f0c)AudioConfig
class to handle the audio related setting while recording video. The @RequiresPermission
annotation is moved from startRecording
functions to AudioConfig
to avoid unnecessary permission requests for the cases that audio is not needed. (I28755)OnVideoSavedCallback
, OutputFileOptions
and OutputFileResults
classes that are no longer used after applying the new video capture API. (I38cd8)getVideoCaptureTargetSize
and setVideoCaptureTargetSize
methods are replaced with the getVideoCaptureTargetQuality
and the setVideoCaptureTargetQuality
methods accordingly, as setTargetResolution
is no longer supported. (I2a1d5)Bug Fixes
core.VideoCapture
API. (I531e0)onError
callback is not called when taking pictures without the storage permission.(I936db, b/244807669)ViewPort
is enabled on legacy devices. (I16b8a, b/251357665)November 9, 2022
androidx.camera:camera-*:1.3.0-alpha01
is released. Version 1.3.0-alpha01 contains these commits.
New Features
Camera-viewfinder
has been published officially. Camera-viewfinder
provides a base viewfinder widget that can display the camera feed for Camera2. Please check the sample code for an example.API Changes
OutputOptions.setDurationLimit
to allow setting of video duration limit. The recording will be automatically finalized when exceeding the specified duration limit. (I902a0)AudioStats.AUDIO_STATE_SOURCE_ERROR
. Sent when audio source setup fails or some error occurs. (I37410)Bug Fixes
PreviewView
SurfaceView
implementation black screen issue on ViewPager2
. As part of the fix, PreviewView
will reuse its SurfaceView
if the requested resolution is not changed. (Ib3f27)ViewPort
or CameraController
API is used. (Ifbba8, b/201085351)May 24, 2023
androidx.camera:camera-*:1.2.3
is released. Version 1.2.3 contains these commits.
Bug Fixes
VideoCapture
could not work with the front camera on some devices. For example, on Samsung Galaxy S23 and Xiaomi 2107113SG. (Ibec7e, b/270656244)March 22, 2023
androidx.camera:camera-*:1.2.2
is released. Version 1.2.2 contains these commits.
Bug Fixes
January 25, 2023
androidx.camera:camera-*:1.2.1
is released. Version 1.2.1 contains these commits.
Bug Fixes
December 7, 2022
androidx.camera:camera-*:1.2.0
is released. Version 1.2.0 contains these commits.
Important changes since 1.1.0
MLKitAnalyzer
as new APIs.CAPTURE_MODE_ZERO_SHUTTER_LAG
, the latency between the shutter button is clicked and the picture is taken is expected to be minimized, compared with other capture modes. On devices that don’t support ZERO_SHUTTER_LAG
, it’ll fallback to CAPTURE_MODE_MINIMIZE_LATENCY
.android.camera.core.VideoCapture
.setStreamUseCase()
as a public Camera2Interop
API.setOutputImageRotationEnabled
.ImageAnalysis.Analyzer#getTargetResolutionOverride()
to ImageAnalysis.Analyzer#getDefaultTargetResolution()
.VideoCapture
and Preview use cases with 16:9 aspect ratioPreview/VideoCapture
stretched issue on API level 27 devices.October 24, 2022
androidx.camera:camera-*:1.2.0-rc01
is released. Version 1.2.0-rc01 contains these commits.
API Changes
setStreamUseCase
API for OutputConfiguration
. User can specify the Stream Use Case for the stream session, overrding CameraX’s internal logics to choose Stream Use Case in order to optimize according to their need. (Ib1a95)Bug Fixes
Preview/VideoCapture
stretched issue on API level 27 devices. Resolution 1920×1080 causes the Preview/VideoCapture
images to be stretched. Added workaround to not select the 1920×1080 resolution for Preview or VideoCapture
to avoid the image stretched problem. (I0e04e)VideoCapture
and Preview use cases with 16:9 aspect ratio on some Huawei devices. (If8c88, b/223643510)SurfaceProvider
is not set. As part of the fix, Preview with no SurfaceProvider
set will now not be configured into the camera capture session. (I99681)September 21, 2022
androidx.camera:camera-*:1.2.0-beta02
is released. Version 1.2.0-beta02 contains these commits.
API Changes
setOutputImageRotationEnabled
(I26e3e, b/240993561)Bug Fixes
BOKEH
extension is enabled on some Samsung devices and user switches the cameras. (If6168)August 24, 2022
androidx.camera:camera-*:1.2.0-beta01
is released. Version 1.2.0-beta01 contains these commits.
New Features
camera-mlkit-vision
. Easily integrate CameraX with many MLKit features, including barcode scanning, face detection, text detection, etc. Please find the sample code here.ImageAnalysis.Analyzer
and MLKitAnalyzer
as official APIs.ImageAnalysis.Analyzer#getTargetResolutionOverride()
to ImageAnalysis.Analyzer#getDefaultTargetResolution()
.Bug Fixes
ExifInterface
correctly parse the attributes. Capturing the images in YUV format and then compressing them to JPEG output images to workaround this issue. (I45abb)July 27, 2022
androidx.camera:camera-*:1.2.0-alpha04
is released. Version 1.2.0-alpha04 contains these commits.
API Changes
ImageAnalysis.Analyzer#getTargetResolutionOverride()
to ImageAnalysis.Analyzer#getDefaultTargetResolution()
. The behavior is also changed so that the value returned by this method can be overridden by the value of ImageAnalysis#setTargetResolution()
. (If1d36)android.location.Location
object can be set via new API androidx.camera.video.OutputOptions.Builder.setLocation(Location)
. (I313a0, b/204197544)Bug Fixes
Recorder
when attempting to record while audio source is unavailable. (I9f652)June 29, 2022
androidx.camera:camera-*:1.2.0-alpha03
is released. Version 1.2.0-alpha03 contains these commits.
API Changes
ImageAnalysis.Analyzer
and MLKitAnalyzer
. (I0ff22)Bug Fixes
isFocusSuccessful
false if the FocusMeteringAction
is not cancelled and the AF part is not converged in the duration. (Ibc2e3)June 1, 2022
androidx.camera:camera-*:1.2.0-alpha02
is released. Version 1.2.0-alpha02 contains these commits.
New Features
API Changes
CAPTURE_MODE_ZERO_SHUTTER_LAG
in ImageCapture
and add isZslSupported
in CameraInfo
to query the device capability. CAPTURE_MODE_ZERO_SHUTTER_LAG
mode is aiming to provide the minimum latency for instant capture. It is implemented based on a ring buffer, which caches intermediate capture results for later reprocessing when the user presses buttons to take pictures. If {@link VideoCapture} is bound or flash mode is not OFF or OEM Extension is ON, this mode will be disabled automatically. (I9ae74)ImageAnalysis.getBackgroundExecutor()
method (Icc945)Bug Fixes
ImageCapture
takePicture method turns torch off on the reported devices. (Ib5eb5, b/228272227)AssertionError
not being handled when getting the CONTROL_ZOOM_RATIO_RANGE
characteristic.(/Ia248a, b/231701345)May 18, 2022
androidx.camera:camera-*:1.2.0-alpha01
is released. Version 1.2.0-alpha01 contains these commits.
New Features
Bug Fixes
QualitySelector
fails to record a UHD video when a fallback strategy is enabled. The issue happens when VideoCapture
is bound with ImageCapture
and Preview on a FULL or higher hardware level camera device. A fallback strategy of QualitySelector
causes VideoCapture
incorrectly to get a FHD resolution. UHD resolution is actually supported for this use case combination and should be adopted. (I0e788, b/230651237)NullPointerException
on ImageCapture.takePicture()
. (I92366, b/230454568, b/229766155)androidx.camera.video.Recorder
(Ia8ce8)June 29, 2022
androidx.camera:camera-*:1.1.0
is released. Version 1.1.0 contains these commits.
Important changes since 1.0.0
ImageAnalysis.Builder.setOutputImageRotationEnabled
and setOutputImageFormat
)CameraState
API that will be exposed through CameraInfo.ProcessCameraProvider.getAvailableCameraInfos()
to directly retrieve information about the available camerasImageCapture#OnImageCapturedCallback
when Extensions are enabled.isFocusMeteringSupported
in CameraInfo
which allows applications to check if the given FocusMeteringAction
is supported on current camera or not.getResolutionInfo
API to provide the resolution information for Preview, ImageCapture
and ImageAnalysis
.ImageCapture.Builder#setJpegQuality
to allow changing the output JPEG image compression quality when taking pictures.CameraSelector#filter
to the public API to filter a list of CameraInfos
based on a CameraSelector
.Camera2CameraControl.clearCaptureRequestOptions
for clearing the existing capture request options.CameraController
with external image processing libraries. e.g. MLKitCameraInfo#getCameraSelector()
which returns a CameraSelector
unique to its camera@Experimental
with @RequiresOptIn
to experimental APIs. For calling experimental APIs, use androidx.annotation.OptIn instead of deprecated androidx.annotation.experimental.UseExperimental.CameraXConfig.Builder#setAvailableCamerasLimiter()
, CameraXConfig.Builder#setMinimumLoggingLevel()
, CameraXconfig.Builder#setSchedulerHandler()
, CameraXConfig#getAvailableCamerasLimiter()
, CameraXConfig#getMinimumLoggingLevel()
, CameraXConfig#getCameraExecutor()
, CameraXConfig#getSchedulerHandler()
,@ExperimentalCameraFilter
APIsUseCaseGroup
API for camera-core, camera-lifecycle and camera-video. Added ViewPort#getLayoutDirection
, ViewPort.Builder#setLayoutDirection
and ViewPort.Builder#setScaleType
for customizing viewport.ExperimentalUseCaseGroupLifecycle
to formal public APIs.Renamed MediaStoreOutputOptions.getCollection
to MediaStoreOutputOptions.getCollectionUri
.ActiveRecording
has been renamed to “Recording” to reduce verbosity.QualitySelector
creator API to a list-based APIBug Fixes
YuvToJpegProcessor
EOFException
issue when extension mode is enabled and ImageCapture#CAPTURE_MODE_MAX_QUALITY
mode is set.startFocusAndMetering
) when flash mode is auto or always_on in low-light environment.June 1, 2022
androidx.camera:camera-*:1.1.0-rc02
is released. Version 1.1.0-rc02 contains these commits.
Bug Fixes
NullPointerException
on ImageCapture.takePicture()
. (I92366, b/230454568, b/229766155)AssertionError
not being handled when getting the CONTROL_ZOOM_RATIO_RANGE
characteristic. (Ia248a, b/231701345)May 11, 2022
androidx.camera:camera-*:1.1.0-rc01
is released. Version 1.1.0-rc01 contains these commits.
New Features
Bug Fixes
VideoCapture
was unbound, causing subsequent uses of VideoCapture
to fail on recording with MediaCodec.CodecException
, especially on API 21-22 devices. (Ie7f68)CameraExtensionsActivity
do not be deleted in ImageCaptureTest
April 6, 2022
androidx.camera:camera-*:1.1.0-beta03
is released. Version 1.1.0-beta03 contains these commits.
API Changes
CaptureRequestOptions
constructor restricted. (I261b6)CameraController
with external image processing libraries. e.g. MLKit (I4ea71)Bug Fixes
PreviewView
when activity is not restarted after rotating devices in multi-window. (I1ea36, b/223488673)AbstractMethodError
issue happened when apps use extensions and enable proguard. (I7cbaf, b/222726805)InvalidConfigException
. However, this fix only prevents app from crashing, but doesn’t resolve the cause of the InvalidConfigException
. If the Recorder
still cannot be configured, applications will receive error callback when it starts recording. (I89c29, b/213617227)External Contribution
February 23, 2022
androidx.camera:camera-*:1.1.0-beta02
is released. Version 1.1.0-beta02 contains these commits.
API Changes
Bug Fixes
January 26, 2022
androidx.camera:camera-*:1.1.0-beta01
is released. Version 1.1.0-beta01 contains these commits.
New Features
API Changes
Camera2CameraControl.clearCaptureRequestOptions
forBug Fixes
cameraControl#startFocusAndMetering()
on front lens-facing camera in Samsung devices (Ifbf59, b/210548792)December 15, 2021
androidx.camera:camera-*:1.1.0-alpha12
is released. Version 1.1.0-alpha12 contains these commits.
API Changes
@RequiresApi(21)
annotations from the inner classes/interfaces. (I8e286, b/204917951)QualitySelector
have been changed to be represented by class objects. For example, QualitySelector.QUALITY_HD
is changed to Quality.HD
, and QualitySelector.FALLBACK_STRATEGY_LOWER
is changed to the instance returned by FallbackStrategy.lowerQualityOrHigherThan(Quality)
. The API used to create QualitySelector
has been changed to a list-based API. The new API QualitySelector.fromOrderedList(List)
will refer to the order of the input quality list instead of the order created by QualitySelector.Procedure
. QualitySelector.Procedure
class has been removed. (I43343)PendingRecording.withEventListener()
was removed and the event listener must now be passed to PendingRecording.start()
. This event listener requirement is meant to encourage handling of asynchronous errors that are reported in the VideoRecordEvent.Finalize
event. (I1e71d)ActiveRecording
has been renamed to Recording
to reduce verbosity. (I77ceb)Bug Fixes
FLASH_AUTO
mode is underexposed in dark conditions on Pixel 3a and Pixel 3a XL (I13f19, b/205373142)Resolution
. (I4a694)REQUEST_AVAILABLE_CAPABILITIES_BACKWARD_COMPATIBLE
. Cameras with REQUEST_AVAILABLE_CAPABILITIES_BACKWARD_COMPATIBLE
have the minimal set of capabilities that every camera device supports. Camera without REQUEST_AVAILABLE_CAPABILITIES_BACKWARD_COMPATIBLE
might be a camera to support special functionality and does not support standard color output. CameraX
can’t support the Preview
, ImageCapture
, ImageAnalysis
or VideoCapture
use cases for those cameras. Therefore, those cameras should be filtered out to prevent incorrect usage. (Ib8cda)CameraSelector#filter
no longer throws an IllegalArgumentException
when the result set is empty. (I27804)November 17, 2021
androidx.camera:camera-*:1.1.0-alpha11
is released. Version 1.1.0-alpha11 contains these commits.
API Changes
Add setOutputImageRotationEnabled API for ImageAnalysis config. User can enable rotation for YUV/RGB image buffer. The rotation degree is a relative rotation calculated based on sensor rotation and target rotation to keep image upfront.
Add setOutputImageRotationEnabled API for ImageAnalysis config. User can enable rotation for YUV/RGB image buffer. The rotation degree is a relative rotation calculated based on sensor rotation and target rotation to keep image upfront.
Add getSensorToBufferTransformMatrix
API in ImageInfo. The returned matrix is a mapping from sensor coordinates to buffer coordinates, which is, from the value of CameraCharacteristics.SENSOR_INFO_ACTIVE_ARRAY_SIZE
to (0, 0,
. The matrix can be used to map the coordinates from one {UseCase} to another. For example, mapping coordinates of the face detected with ImageAnalysis to Preview. (I9ff1e)
image.getWidth, image.getHeight)
Added a new API ImageCapture.Builder#setJpegQuality to allow changing the output JPEG image compression quality when taking picture. (I8dcf4)
Renamed MediaStoreOutputOptions.getCollection to
MediaStoreOutputOptions.getCollectionUri. (I16639)
Bug Fixes
External Contribution
October 13, 2021
androidx.camera:camera-*:1.1.0-alpha10
is released. Version 1.1.0-alpha10 contains these commits.
New Features
androidx.camera:camera-video:1.1.0-alpha10
as the first alpha version for Video officially. There are several known issues to be fixed in the later releases.API Changes
@RequiresApi(21)
annotation to all CameraX classesBug Fixes
September 29, 2021
androidx.camera:camera-camera2:1.1.0-alpha09
, androidx.camera:camera-core:1.1.0-alpha09
, and androidx.camera:camera-lifecycle:1.1.0-alpha09
are released. Version 1.1.0-alpha09 contains these commits.
API Changes
Bug Fixes
MAXIMIZE_QUALITY
mode. (I173a9, b/193823892)CAPTURE_MODE_MINIMIZE_LATENCY
, the JPEG compression quality will be 95. If the capture mode is CAPTURE_MODE_MAXIMIZE_QUALITY
, the JPEG compression quality will be 100. (Ieb37c, b/142856426)August 18, 2021
androidx.camera:camera-camera2:1.1.0-alpha08
, androidx.camera:camera-core:1.1.0-alpha08
, and androidx.camera:camera-lifecycle:1.1.0-alpha08
are released. Version 1.1.0-alpha08 contains these commits.
New Features
API Changes
Bug Fixes
July 21, 2021
androidx.camera:camera-camera2:1.1.0-alpha07
, androidx.camera:camera-core:1.1.0-alpha07
, and androidx.camera:camera-lifecycle:1.1.0-alpha07
are released. Version 1.1.0-alpha07 contains these commits.
Bug Fixes
YuvToJpegProcessor
EOFException issue when extension mode is enabled and ImageCapture#CAPTURE_MODE_MAX_QUALITY
mode is set. (I538bd, b/192017012)June 30, 2021
androidx.camera:camera-camera2:1.1.0-alpha06
, androidx.camera:camera-core:1.1.0-alpha06
, and androidx.camera:camera-lifecycle:1.1.0-alpha06
are released. Version 1.1.0-alpha06 contains these commits.
API Changes
ViewPort#getLayoutDirection
, ViewPort.Builder#setLayoutDirection
and ViewPort.Builder#setScaleType
for customizing viewport. (I7cee8)June 2, 2021
androidx.camera:camera-camera2:1.1.0-alpha05
, androidx.camera:camera-core:1.1.0-alpha05
, and androidx.camera:camera-lifecycle:1.1.0-alpha05
are released. Version 1.1.0-alpha05 contains these commits.
API Changes
Camera2CameraFilter
class. Suggest to select camera byExperimentalCameraFilter
APIs are now out of experimentalCameraInfo#getCameraState()
. (Ia86b4)CameraInfo#getCameraSelector()
which returns a CameraSelector unique to its camera (I77f9f)Bug Fixes
April 21, 2021
androidx.camera:camera-camera2:1.1.0-alpha04
, androidx.camera:camera-core:1.1.0-alpha04
, and androidx.camera:camera-lifecycle:1.1.0-alpha04
are released. Version 1.1.0-alpha04 contains these commits.
Bug Fixes
@Experimental
with @RequiresOptIn
to experimental APIs. For calling experimental APIs, use androidx.annotation.OptIn
instead of deprecated androidx.annotation.experimental.UseExperimental
. (Iff226)March 24, 2021
androidx.camera:camera-camera2:1.1.0-alpha03
, androidx.camera:camera-core:1.1.0-alpha03
, and androidx.camera:camera-lifecycle:1.1.0-alpha03
are released. Version 1.1.0-alpha03 contains these commits.
Bug Fixes
ImageCapture#OnImageCapturedCallback
when Extensions modes is enabled. (I0d7b1)February 24, 2021
androidx.camera:camera-camera2:1.1.0-alpha02
, androidx.camera:camera-core:1.1.0-alpha02
, and androidx.camera:camera-lifecycle:1.1.0-alpha02
are released. Version 1.1.0-alpha02 contains these commits.
API Changes
ProcessCameraProvider.getAvailableCameraInfos()
to directly retrieve information about the available cameras, which are either all of the device’s cameras, or those selected by the CameraSelector
provided in CameraXConfig.Builder.setAvailableCamerasLimiter(CameraSelector)
. (Ieac08)Bug Fixes
ProcessCameraProvider.configureInstance(...)
fromJanuary 27, 2021
androidx.camera:camera-camera2:1.1.0-alpha01
, androidx.camera:camera-core:1.1.0-alpha01
, and androidx.camera:camera-lifecycle:1.1.0-alpha01
are released. Version 1.1.0-alpha01 contains these commits.
Bug Fixes
IllegalArgumentException
issue that happened when all preview supported sizes are smaller than 640×480 and display size is larger than 640×480. (I2a63c, b/150506192)September 29, 2021
androidx.camera:camera-camera2:1.0.2
, androidx.camera:camera-core:1.0.2
, and androidx.camera:camera-lifecycle:1.0.2
are released. Version 1.0.2 contains these commits.
Bug Fixes
MAXIMIZE_QUALITY
mode. (I173a9, b/193823892)July 21, 2021
androidx.camera:camera-camera2:1.0.1
, androidx.camera:camera-core:1.0.1
, and androidx.camera:camera-lifecycle:1.0.1
are released. Version 1.0.1 contains these commits.
Bug Fixes
Fixed the issue that the ListenableFuture
returned in
setZoomRatio
and setLinearZoom
cannot complete on some android
11 devices (I716d7)
Fixed the issue that the camera gets stuck at closing camera state on some devices and causes black preview. (I34c99)
Note:
Newer versions of AndroidX libraries now correctly reflect implementation
dependencies versus api
dependencies. If your project relies on an implicit dependency exposed through an implementation
dependency in version 1.0.0
, you must explicitly depend on that dependency in your build.gradle
.
May 5, 2021
androidx.camera:camera-camera2:1.0.0
, androidx.camera:camera-core:1.0.0
, and androidx.camera:camera-lifecycle:1.0.0
are released. Version 1.0.0 contains these commits.
Major features of 1.0.0
Known Issues
April 21, 2021
androidx.camera:camera-camera2:1.0.0-rc05
, androidx.camera:camera-core:1.0.0-rc05
, and androidx.camera:camera-lifecycle:1.0.0-rc05
are released. Version 1.0.0-rc05 contains these commits.
Bug Fixes
March 24, 2021
androidx.camera:camera-camera2:1.0.0-rc04
, androidx.camera:camera-core:1.0.0-rc04
, and androidx.camera:camera-lifecycle:1.0.0-rc04
are released. Version 1.0.0-rc04 contains these commits.
Bug Fixes
February 24, 2021
androidx.camera:camera-camera2:1.0.0-rc03
, androidx.camera:camera-core:1.0.0-rc03
, and androidx.camera:camera-lifecycle:1.0.0-rc03
are released. Version 1.0.0-rc03 contains these commits.
Bug Fixes
ProcessCameraProvider#getInstance
January 27, 2021
androidx.camera:camera-camera2:1.0.0-rc02
, androidx.camera:camera-core:1.0.0-rc02
, and androidx.camera:camera-lifecycle:1.0.0-rc02
are released. Version 1.0.0-rc02 contains these commits.
Bug Fixes
Limit number of camera reopen attempts. While attempting to recover from certains issues when opening the camera, CameraX will no longer attempt to reopen the camera indefinitely, instead it will stop after retrying for 10 seconds.I435d2
Fixed IllegalArgumentException
issue that happened when all preview supported sizes are smaller than 640×480 and display size is larger than 640×480. (I2a63c, b/150506192)
December 16, 2020
androidx.camera:camera-camera2:1.0.0-rc01
, androidx.camera:camera-core:1.0.0-rc01
, and androidx.camera:camera-lifecycle:1.0.0-rc01
are released. Version 1.0.0-rc01 contains these commits.
API Changes
CameraXConfig.Builder#setMinimumLoggingLevel()
to allow setting a minimum logging level for CameraX logs. When not set, it defaults to Log#DEBUG
. (Ic3245)Bug Fixes
Preview.setSurfaceProvider(null)
. (I3ac18)November 11, 2020
androidx.camera:camera-camera2:1.0.0-beta12
, androidx.camera:camera-core:1.0.0-beta12
, and androidx.camera:camera-lifecycle:1.0.0-beta12
are released. Version 1.0.0-beta12 contains these commits.
Bug Fixes
OnImageCapturedCallback#onCaptureSuccess
base classOctober 14, 2020
androidx.camera:camera-camera2:1.0.0-beta11
is released. Version 1.0.0-beta11 contains these commits.
New Features
CONTROL_ZOOM_RATIO
API for zoom onCONTROL_ZOOM_RATIO_RANGE
. (I62cc6)Bug Fixes
ProcessCameraProvider.bindToLifecycle()
. (Ia5411).getTargetRotation()
will return Surface.ROTATION_0
October 14, 2020
androidx.camera:camera-core:1.0.0-beta11
is released. Version 1.0.0-beta11 contains these commits.
New Features
– Supports android 11 CONTROL_ZOOM_RATIO
API for zoom on
android 11 or later devices which contains valid
CONTROL_ZOOM_RATIO_RANGE
. (I62cc6)
Bug Fixes
ProcessCameraProvider.bindToLifecycle()
. (Ia5411).getTargetRotation()
will return Surface.ROTATION_0
September 23, 2020
androidx.camera:camera-core:1.0.0-beta10
is released. Version 1.0.0-beta10 contains these commits.
Caution:
Please do not use Camera-Core Version 1.0.0-beta09 as there is a Known Issue [See Bug Fixes Below] around image capture. Please do not use this version in your applications. Instead use Camera-Core Version 1.0.0-beta10 and above.
Bug Fixes
September 23, 2020
androidx.camera:camera-camera2:1.0.0-beta10
is released. Version 1.0.0-beta10 contains these commits.
Bug Fixes
September 16, 2020
androidx.camera:camera-camera2:1.0.0-beta09
is released. Version 1.0.0-beta09 contains these commits.
Caution:Camera-Core Version 1.0.0-beta09 as there is a Known Issue around image capture. Please do not use this version in your applications. Instead use
Please do not useas there is a Known Issue around image capture. Please do not use this version in your applications. Instead use Camera-Core Version 1.0.0-beta10
and above.
API Changes
Bug Fixes
AspectRatio.RATIO_16_9
. (Ib7fcf, b/151969438)InitializationException
to make the app be able to gracefully handle the AssertionError happened when creating CameraCharacteristics. (I89c8c, b/160524721)September 16, 2020
androidx.camera:camera-core:1.0.0-beta09
is released. Version 1.0.0-beta09 contains these commits.
API Changes
ExposureCompensation
(If96c7)TranformationInfoListener
callback. (I21470)Bug Fixes
FLASH_MODE_ON
to take a picture, and is changed to FLASH_MODE_OFF
when the flash is fired. The symptom is like torch mode enabled. (Ib4451, b/162568128)ProcessCameraProvider.getInstance(Context)
.Known Issues
August 19, 2020
androidx.camera:camera-camera2:1.0.0-beta08
is released. Version 1.0.0-beta08 contains these commits.
Bug Fixes
August 19, 2020
androidx.camera:camera-core:1.0.0-beta08
is released. Version 1.0.0-beta08 contains these commits.
API Changes
DisplayOrientedMeteringPointFactory
takes in a CameraInfo
CameraSelector
so there is a direct mapping toDisplayOrientedMeteringPointFactory
also take in a CameraInfo
CameraSelector
. (I400c1)Bug Fixes
Context.getApplicationContext()
. (I3d3c9, b/160817073)July 22, 2020
androidx.camera:camera-camera2:1.0.0-beta07
is released. Version 1.0.0-beta07 contains these commits.
Bug Fixes
July 22, 2020
androidx.camera:camera-core:1.0.0-beta07
is released. Version 1.0.0-beta07 contains these commits.
API Changes
FIT_CENTER
, FIT_START
, and FIT_END
fit style with FIT
. FIT
means that the returned crop rect will be the max possible sensor rect. (Ia73c3)Bug Fixes
ConcurrentModificationException
exceptionJune 24, 2020
androidx.camera:camera-camera2:1.0.0-beta06
is released. Version 1.0.0-beta06 contains these commits.
API Changes
Bug Fixes
CameraControl#startFocusAndMetering
will fail if none of theJune 24, 2020
androidx.camera:camera-core:1.0.0-beta06
is released. Version 1.0.0-beta06 contains these commits.
API Changes
Bug Fixes
ProcessCameraProvider#configureInstance()
before callingProcessCameraProvider#getInstance()
. This allows for customization ofCameraXConfig
without requiring implementing CameraXConfig.Provider
CameraControl#startFocusAndMetering
will fail if none of theJune 10, 2020
androidx.camera:camera-camera2:1.0.0-beta05
is released. Version 1.0.0-beta05 contains these commits.
Bug Fixes
InitializationException
contains a CameraUnavailableException
that will be set to the ListenableFuture
of the intialization result instead of crashing the application. (I9909a, b/149413835)startFocusAndMetering
CONTROL_AF_STATE
is null. (Ife55e, b/157084254)June 10, 2020
androidx.camera:camera-core:1.0.0-beta05
is released. Version 1.0.0-beta05 contains these commits.
API Changes
InitializationException
contains a CameraUnavailableException
will be set to the ListenableFuture
of the intialization result instead of crashing the application. (I9909a, b/149413835)Bug Fixes
setTargetResolution
and setTargetRotation
. (Iae16f)May 27, 2020
androidx.camera:camera-camera2:1.0.0-beta04
is released. Version 1.0.0-beta04 contains these commits.
Bug Fixes
Camera2Interop
without causing a crash. Please note that if there are issues that arise as a result of overriding parameters. Stability and behaviour are not guaranteed when overriding parameters using Camera2Interop. (Ibe5a1, b/149103700)ImageProxy
from ImageCapture
was not rewound (I0c455, b/153249512)May 27, 2020
androidx.camera:camera-core:1.0.0-beta04
is released. Version 1.0.0-beta04 contains these commits.
API Changes
CameraXConfig.Builder#setSchedulerHandler()
for setting the handler used internally by the CameraX camera stack. This new API along with CameraXConfig.Builder#setCameraExecutor()
should allow full control over the threads being used by the CameraX camera stack. (I7bf32, b/121160431)Bug Fixes
ImageAnalysis
where the ImageProxy
is accessed after the ImageReaderProxy
has been closed. This also makes it so that all ImageProxy
received by the Analyzer
must be closed before the ImageReaderProxy
will be closed. (I4b299, b/145956416, b/154155377, b/156357269)CameraInfo
parameter from PreviewView#createSurfaceProvider()
, PreviewView
now internally retrieves it from the SurfaceRequest
. (If18f0, b/154652477)ImageAnalysis
where multiple calls to setAnalyzer/clearAnalyzer resulted in the analyzer not receiving images to analyze. (I6169f, b/151605317, b/153514544)ImageProxy
from ImageCapture
was not rewound (I0c455, b/153249512)CameraManager
is not always selected to use. (I4c624, b/153418028)Preview.SurfaceProvider
not releasing the previously requested surface. “java.lang.IllegalStateException: Camera surface session should only fail with request cancellation”
(I8e4e7, b/155936225)April 15, 2020
androidx.camera:camera-camera2:1.0.0-beta03
is released. Version 1.0.0-beta03 contains these commits.
Bug Fixes
camera-core
April 15, 2020
androidx.camera:camera-core:1.0.0-beta03
is released. Version 1.0.0-beta03 contains these commits.
Bug Fixes
bindToLifecycle()
with zero UseCase
s would cause a thrown exception. This prevented retrieval of a Camera
without binding a UseCase
.April 1, 2020
androidx.camera:camera-camera2:1.0.0-beta02
is released. Version 1.0.0-beta02 contains these commits.
Bug Fixes
ImageInfo.getRotationDegrees()
from the ImageProxy
produced by ImageCapture
so that it matches the EXIF orientation rotational value. (Id4281, b/150802561)build.gradle
is no longer required to use the default CameraX/Camera2 implementation. For cases where declaring strict dependencies is required, all CameraX dependencies can now be included in the build file. (I46e88)IllegalArgumentException
issue happening on the devices where the display size is smaller than 640×480. (Ife3f2, b/150506192)bindToLifecycle
so that it only modifies the UseCase if it successfully binds. Previously when calling bindToLifecycle
in order to do resolution calculations the UseCase is updated. Now it no longer needs to update the UseCase to do the calculations (I78d9e)April 1, 2020
androidx.camera:camera-core:1.0.0-beta02
is released. Version 1.0.0-beta02 contains these commits.
Bug Fixes
ImageInfo.getRotationDegrees()
from the ImageProxy
produced by ImageCapture
so that it matches the EXIF orientation rotational value. (Id4281, b/150802561)bindToLifecycle
so that it only modifies the UseCase if it successfully binds. Previously when calling bindToLifecycle
in order to do resolution calculations the UseCase is updated. Now it no longer needs to update the UseCase to do the calculations (I78d9e)Preview
use case’s capture session wasn’t being updated when the preview surface changed after calling Preview.setSurfaceProvider()
more than once.February 26, 2020
androidx.camera:camera-camera2:1.0.0-beta01
is released. Version 1.0.0-beta01 contains these commits.
Bug Fixes
SurfaceRequest.setSurface(Surface)
toSurfaceRequest.provideSurface(Surface)
, andSurfaceRequest.setWillNotComplete()
toSurfaceRequest.willNotProvideSurface()
. (I224fe)ImageCapture.setTargetRotation()
. (I474ea, b/148763432)CameraXConfig
provider. (I2d6c1)February 26, 2020
androidx.camera:camera-core:1.0.0-beta01
is released. Version 1.0.0-beta01 contains these commits.
API Changes
ListenableFuture
onSurfaceRequest.provideSurface()
with an Executor
and Callback
. ThisprovideSurface()
and enforces that the provideSurface()
callback cannotSurfaceRequest.Result
object is now usedSurfaceRequest
uses the provided Surface
. (I7854b)SurfaceRequest.setSurface(Surface)
toSurfaceRequest.provideSurface(Surface)
andSurfaceRequest.setWillNotComplete()
toSurfaceRequest.willNotProvideSurface()
. (I224fe)Bug Fixes
ImageCapture.setTargetRotation()
. (I474ea, b/148763432)CameraXConfig
provider. (I2d6c1)February 10, 2020
androidx.camera:camera-camera2:1.0.0-alpha10
is released. Version 1.0.0-alpha10 contains these commits.
Bug Fixes
INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY
devices by ensuring Surface
s are only retained for duration of use by Camera2. (I9dac2)CONTROL_AE_TARGET_FPS_RANGE
properly. (1224638)February 10, 2020
androidx.camera:camera-core:1.0.0-alpha10
is released. Version 1.0.0-alpha10 contains these commits.
API Changes
ImageCapture
to allow saving images to Uri
and OutputStream
. Combined overloaded takePicture
methods into one. Updated test app to use Uri
as the canonical example. (Ia3bec)Preview.PreviewSurfaceProvider
has been renamed to Preview.SurfaceProvider
. SurfaceProvider
s no longer require developers to create their own ListenableFuture
, and providing a Surface
is now done through a new SurfaceRequest
object. The Preview.getPreviewSurfaceProvider()
method has been removed due to its potential for misuse when Preview
is paired with other classes such as PreviewView
. (I20105)getTargetRotation()
and getTargetName()
to Preview
. (Iceee7)getTargetRotation()
, getBackpressureStrategy()
, and getImageQueueDepth()
in ImageAnalysis
. (I9d6d9)getTargetRotation()
and getCaptureMode()
in ImageCapture()
(I5bc17)ImageCapture.OnImageSavedCallback.onError()
and ImageCapture.OnImageCapturedCallback.onError()
have now been replaced by a single argument ImageCaptureException
, which still contains all the information that was previously passed.ImageCapture.OnImageSavedCallback.onImageSaved()
has been removed. (I750d2)Preview
and ImageCapture
classes are now marked final. (I2500b)getZoomRatio()
, getMaxZoomRatio()
,getMinZoomRatio()
, and getLinearZoom()
methods of CameraInfo
merginggetZoomState()
which returns a ZoomState
instance. (Ib19fe)OPTION_TARGET_CLASS
and OPTION_TARGET_NAME
CameraXConfig
as they are intended for internal library use only.CameraXConfig.Builder
. (I96912)Application
in ordercamera-camera2
artifact is includedbuild.gradle
. (I58ff5) (b/146923574)January 22, 2020
androidx.camera:camera-camera2:1.0.0-alpha09
is released. Version 1.0.0-alpha09 contains these commits.
API changes
Add camera2 interop path for extracting a Camera2 camera ID. You can extract
the camera ID from CameraInfo
using Camera2CameraInfo.extractCameraId()
.
The following code sample shows how to use this:
Camera camera = provider.bindToLifecycle(...);
String cameraId =
Camera2CameraInfo.extractCameraId(camera.getCameraInfo());
The Camera2CameraInfo
class requires the ExperimentalCamera2Interop
markerClass.
January 22, 2020
androidx.camera:camera-core:1.0.0-alpha09
is released. Version 1.0.0-alpha09 contains these commits.
API changes
SurfaceOrientedMeteringPointFactory
parameter useCaseForSurface
wasuseCaseForAspectRatio
and the reference documentation wasFocusMeteringAction.Builder.from()
methods are replaced by the constructorsFocusMeteringAction.Builder()
.DisplayOrientedMeteringPointFactory(android.content.Context, androidx.camera.core.CameraSelector, float, float)
.Display
parameter andMeteringMode
andDisplay
parameter.setZoomRatio
and setLinearZoom
.Bug fixes
ConcurrentModificationException
that could occur when using torchstartFocusMetering
and cancelFocusMetering
APIs now behave as documented,December 18, 2019
androidx.camera:camera-camera2:1.0.0-alpha08
is released. Version 1.0.0-alpha08 contains these commits.
Known Issues
09-09 14:04:13.643 10117 26020 26036 E AndroidRuntime: java.lang.IllegalArgumentException: Unsupported session configuration combination
Bug Fixes
API Changes
December 18, 2019
androidx.camera:camera-core:1.0.0-alpha08
is released. Version 1.0.0-alpha08 contains these commits.
Known Issues
PreviewView
or CameraView
may have the wrong aspect ratio preview. This happens after pause or resume on some FULL devices, such as the Pixel2.Bug Fixes
FocusMeteringAction
and CameraControl
.TorchControl
for enableTorch()
and getTorchState()
.API Changes
rotationDegrees
from class OnImageCaptureCallback
to ImageInfo
.rotationDegrees
from class Analyzer
to ImageInfo
.December 4, 2019
androidx.camera:camera-camera2:1.0.0-alpha07
is released. Version 1.0.0-alpha07 of camera-camera2 contains these commits
Camera2Config
is now available for use with initializing and configuring a Camera2-based implementation for CameraX. More details on how to use this in initialization are in the camera-core section of the release notes.androidx.camera.camera2.interop.
December 4, 2019
androidx.camera:camera-core:1.0.0-alpha07
is released. Version 1.0.0-alpha07 of camera-core contains these commits
Note that there are some substantial changes in this Alpha release as we prepare for Beta. We recommend you review the changes and share any feedback you may have on the CameraX Google group. For those developers using CameraX in apps that are on the Play store, we recommend waiting for the formal Beta release before upgrading the library within your applications.
API changes
Important: CameraX initialization has changed. Applications should implement CameraXConfig.Provider
, and use the default Camera2Config
provided by androidx.camera.camera2
. A typical usage is:
import androidx.camera.camera2.Camera2Config
import androidx.camera.core.CameraXConfig
public class MyCameraXApplication : Application(), CameraXConfig.Provider {
override fun getCameraXConfig(): CameraXConfig {
return Camera2Config.defaultConfig(this)
}
}
The CameraX class has been removed. The bindToLifecycle()
, unbind()
, unbindAll()
, isBound()
, and hasCamera()
previously provided by the CameraX class call are now available via the ProcessCameraProvider
.
A per-process instance of ProcessCameraProvider
is obtained asynchronously using the static method ProcessCameraProvider.getInstance()
, which returns a listenable future, which provides the ProcessCameraProvider
on completion.
Here it is shown in onCreate()
for a typical usage. You can place calls to getInstance()
later in the activity’s lifecycle to defer initialization latency to a later time (such as when a user action opens a camera UI).
import androidx.camera.lifecycle.ProcessCameraProvider
import com.google.common.util.concurrent.ListenableFuture
class MainActivity : AppCompatActivity() {
private lateinit var cameraProviderFuture : ListenableFuture
override fun onCreate(savedInstanceState: Bundle?) {
cameraProviderFuture = ProcessCameraProvider.getInstance(this);
}
A listener can be added to the ListenableFuture
returned by getInstance()
. This ensures the camera provider can be retrieved from the Future
without blocking on Future.get()
cameraProviderFuture.addListener(Runnable {
val cameraProvider = cameraProviderFuture.get()
cameraProvider.bindToLifecycle(...)
}, ContextCompat.getMainExecutor(this))
Camera selection is now done by a camera selector, instead of per-use case
val cameraSelector = CameraSelector.Builder().requireLensFacing(LensFacing.BACK).build()
CameraProvider.bindToLifecycle
is given the lifecycle owner, the camera selector, and use cases, which are then bound to the given lifecycle owner and run for the selected camera.
cameraProvider.bindToLifecycle(this as LifecycleOwner,
cameraSelector, preview, imageAnalysis)
Use case “Config” classes are removed. Instead, build use cases directly, setting options on each use case builder. For example:
preview = Preview.Builder().setTargetAspectRatio(AspectRatio.RATIO_16_9).build()
The Preview use case has been updated to accept a surface created and managed by the application to ensure Android best practices. It is highly recommended to use the PreviewView
view class provided in the camera-view package.
preview.setPreviewSurfaceProvider(previewView.previewSurfaceProvider)
See documentation for attaching an app-managed surface. In these cases the app manages the lifecycle of the surface.
Important: The ImageAnalysis
Analyzer method implementation must call image.close()
on received images when finished using them. Otherwise, new images may not be received or the camera may stall, depending on back pressure setting. Refer to the reference docs for details.
ImageAnalysis ImageReaderMode
is now changed to a backpressure strategy intdef
.
ImageProxy.getImage()
is marked as experimental. Applications should annotate usage for example via @androidx.camera.core.ExperimentalGetImage
The UIThread
annotation requirement for the Analyzer
has been removed.
The ImageAnalysis.clearAnalyzer()
function is added for removing an analyzer.
Listeners with more than 1 method have been renamed to Callback:
ImageCapture.OnImageCapturedListener
is now ImageCapture.OnImageCapturedCallback
ImageCapture.OnImageSavedListener
is now ImageCapture.OnImageSavedCallback
VideoCapture.OnVideoSavedListener
is now VideoCapture.OnVideoSavedCallback
Enums have changed to IntDef
Zoom controls have been added:
CameraControl.setLinearZoom()
CameraControl.setZoomRatio()
CameraInfo.getLinearZoom()
CameraInfo.getMaxZoomRatio()
CameraInfo.getZoomRatio()
CameraInfo.hasFlashUnit()
is added to determine if flash/torch hardware is present.
CameraInfo.isFlashAvailable()
has been removed. Torch overrides flash functionality. More detail is included in the reference documentation.
ImageCapture.Metadata
fields are replaced by get/set/is accessors.
startFocusMetering
and cancelFocusMetering
now return ListenableFutures
which represent the asynchronous operation of the call.
MeteringPoints
are now functioning as handles to metering actions, and are produced by factories. Apps should use the existing factories rather than custom factories.
Fixed issues
CameraControl.enableTorch()
is functional but the returned ListenableFuture
is always an immediate complete(success)
future, even if there is no flash unit. Future versions will fix this to the final behavior: When there is no flash unit, enableTorch(true)
fails immediately (won’t send request to CaptureSession
), and TorchState
remain Off.startFocusAndMetering
and cancelFocusAndMetering
start and cancel focus metering, but return an immediately completed (success)
future not representing the documented behavior. The FocusMeteringResult
from ListenableFuture CameraControl.startFocusAndMetering()
is a fake result which isFocusSuccessful()
and is always “false,” differing from intended, documented behavior.PreviewView
touch events is being developed. For now, apps connecting custom managed surfaces can use the existing metering point factories, and otherwise no touch focus functionality is available for PreviewView
.October 9, 2019
androidx.camera:camera-camera2:1.0.0-alpha06
and androidx.camera:camera-core:1.0.0-alpha06
are released. These are the commits included in camera-camera2:1.0.0-alpha06
and these are the commits included in camera-core:1.0.0-alpha06
.
New features
Changes to setting aspect ratios:
setTargetAspectRatioMode()
was added and accepts an enum argument. This sets the Aspect Ratio Mode with options RATIO_4_3
or RATIO_16_9
instead of an arbitrary aspect ratio. This closer reflects the fact that only certain aspect ratios are provided from the camera, rather than any arbitrary ratio.
getTargetAspectRatio()
was added to use case config APIs, returning the aspect ratio the use case output is targeted for.setTargetAspectRatio(Rational aspectRatio)
has been changed for ImageCapture to setTargetAspectRatioCustom(Rational aspectRatio)
. When set, the ImageCapture output crops accordingly.Executor APIs
Preview.setOnPreviewOutputUpdateListener()
API. If the executor is not present for that function, it executes on the main thread.Preview.setOnPreviewOutputUpdateListener
FocusMeteringAction.Builder.setAutoFocusCallback
ImageAnalysis.setAnalyzer
ImageCapture.takePicture
CameraView.takePicture
CameraView.startRecording
VideoCapture.startRecording
CameraInfo added with check Flash Available and Sensor Rotation APIs
Added CameraInfo
and a getCameraInfo
method, which allows apps to check if a lens facing CameraInfo is available and if a flash is available on that camera. For example:
try {
CameraInfo cameraInfo = CameraX.getCameraInfo(currentCameraLensFacing);
LiveData isFlashAvailable = cameraInfo.isFlashAvailable();
flashToggle.setVisibility(isFlashAvailable.getValue() ? View.VISIBLE : View.INVISIBLE);
} catch (CameraInfoUnavailableException e) {
Log.w(TAG, "Cannot get flash available information", e);
flashToggle.setVisibility(View.VISIBLE);
}
CameraInfo.getSensorRotationDegrees()
was added. It provides the camera sensor orientation relative to the device’s natural orientation, or for convenience, relative to an orientation described by a Surface rotation (which describes an orientation relative to natural orientation).
API changes and bug fixes
setTargetResolution()
or setTargetAspectRatio()
. Calling both on the same builder returns an error.
setTargetAspectRatio()
based on the application’s UI design. Specific resolutions are based on the use case. For example, preview is near screen resolutions and image capture provides high resolution stills. See the automatic resolutions table for more information.setTargetResolution()
for more specific cases, such as when minimum (to save computation) or maximum resolutions (for processing details) are required.setCallbackHandler()
call from use case configuration APIs. Instead, applications can set the executor as a parameter in various other APIs that set a callback.java.lang.IllegalStateException at Camera$StateCallback.onError
to be thrown when opening the camera.java.lang.IllegalArgumentException: CaptureRequest contains unconfigured Input/Output Surface!
java.lang.IllegalStateException: maxImages (4) has already been acquired, call #close before acquiring more.
September 5, 2019
androidx.camera:camera-camera2:1.0.0-alpha05
and androidx.camera:camera-core:1.0.0-alpha05
are released. These are the commits included in camera-camera2:1.0.0-alpha05 and these are the commits included camera-core:1.0.0-alpha05.
API Change: Renamed use case error variables:
ImageCapture.UseCaseError
is renamed ImageCapture.ImageCaptureError
VideoCapture.UseCaseError
is renamed VideoCapture.VideoCaptureError
Added CameraControl
API w/Tap-to-Focus APIs
Added API to get a CameraControl
from CameraX for a camera, selected by lens facing:
CameraX.getCameraControl(LensFacing lensFacing)
Added MeteringPointFactory
, MeteringPoint
, MeteringMode
, and FocusMeteringAction
to run Tap-to-Focus:
MeteringPointFactory factory = new SensorOrientedMeteringPointFactory(width, height);
MeteringPoint point = factory.createPoint(x, y);
FocusMeteringAction action = FocusMeteringAction.Builder.from(point,
MeteringMode.AF_ONLY)
.addPoint(point2, MeteringMode.AE_ONLY) // could have many
.setAutoFocusCallback(new OnAutoFocusListener(){
public void onFocusCompleted(boolean isSuccess) {
}
})
// auto calling cancelFocusAndMetering in 5 sec.
.setAutoCancelDuration(5, TimeUnit.Second)
.build();
Added API for CameraControl
to start and cancel focus metering:
getCameraControl(lensFacing).startFocusAndMetering(action);
getCameraControl(lensFacing).cancelFocusAndMetering();
Added APIs for Metering Point Factories that assist translating tap coordinates to sensor coordinates, based on view classes:
MeteringPointFactory factory = new TextureViewMeteringPointFactory(textureView);
MeteringPointFactory factory = new DisplayOrientedMeteringPointFactory(context, lensFacing, viewWidth, viewHeight);
Enforce calling the following methods on the Main (UI) thread, throwing an
IllegalStateException
when they are not. Future versions will allow usage on
other threads and ensure serialization.
CameraX.bindToLifecycle()
CameraX.unbind()
CameraX.unbindAll()
ImageAnalysis.setAnalyzer()
ImageAnalysis.getAnalyzer()
ImageAnalysis.removeAnalyzer()
Preview.removePreviewOutputListener()
Preview.getOnPreviewOutputUpdateListener()
Preview.setOnPreviewOutputUpdateListener()
Various config settings now accept null parameters and corresponding getters may return null.
Fixed issue when testing on emulators that do not support AF/AE/AWB settings.
Fixed crash bug on rotation while analyzing image.
Fixed bug where preview appears black on start (no camera data), after rotation or switching between front and back cameras.
Removed testing for multiple concurrent image analysis use cases. To ensure compatibility, applications should only attach a single image analysis use case.
Added initial robolectric tests for fake camera in camera-testing suite (WIP).
Camera2Inititalizer test removed, as its coverage was unclear/misleading.
August 7, 2019
androidx.camera:camera-camera2:1.0.0-alpha04
and androidx.camera:camera-core:1.0.0-alpha04
are released. Version 1.0.0-alpha04 contains these commits.
This version is dependent on the Java 8 programming language. Please read Use Java 8 language features to learn how to use it in your project.
New Features
Changes to Aspect Ratio and Resolution selection
CameraX’s goal is to successfully initialize a camera session. This means CameraX compromises on resolution/aspect ratios based on device capability, in order to start a capture session as its first goal, and so exact requests may not be honored. This may be due to:
CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP
Although CameraX creates and manages the session, you should always check
the returned image sizes on the use case output in your code and adjust
accordingly.
Some changes have been made for setting resolutions and aspect ratios, intended to make the API more clear:
setTargetAspectRatio
or setTargetResolution
calls)ImageAnalysis Non-Blocking Mode
ImageReaderMode.ACQUIRE_LATEST_IMAGE
is now non-blocking. It acquires the latest image in the queue, but discards unused images continuously to allow the camera pipeline to avoid blocking.Bug Fixes
java.lang.IllegalStateException: maxImages (2) has already been acquired
setLensFacing
was not called for a use case, resulting in java.lang.IllegalArgumentException: Unable to get camera ID for use case
.checkAndUpdateEglState: invalid current EGLDisplay
July 2, 2019
androidx.camera:camera-core:1.0.0-alpha03
and androidx.camera:camera-camera2:1.0.0-alpha03
are released. Version 1.0.0-alpha03 contains these commits.
This version is dependent on the Java 8 programming language. Please read Use Java 8 language features to learn how to use it in your project.
API Changes
Camera-Core
Extensions
June 5, 2019
androidx.camera:camera-core:1.0.0-alpha02
and androidx.camera:camera-camera2:1.0.0-alpha02
are released. Version 1.0.0-alpha02 contains these commits.
Bug fixes
May 7, 2019
androidx.camera:camera-core:1.0.0-alpha01
and
androidx.camera:camera-camera2:1.0.0-alpha01
are released. Version 1.0.0-alpha01 contains these commits.
October 14, 2020
androidx.camera:camera-lifecycle:1.0.0-beta11
is released. Version 1.0.0-beta11 contains these commits.
Bug Fixes
.getTargetRotation()
will return Surface.ROTATION_0
September 23, 2020
androidx.camera:camera-lifecycle:1.0.0-beta10
is released. Version 1.0.0-beta10 contains these commits.
Bug Fixes
September 16, 2020
androidx.camera:camera-lifecycle:1.0.0-beta09
is released. Version 1.0.0-beta09 contains these commits.
August 19, 2020
androidx.camera:camera-lifecycle:1.0.0-beta08
is released. Version 1.0.0-beta08 contains these commits.
Bug Fixes
Context.getApplicationContext()
. (I3d3c9, b/160817073)July 22, 2020
androidx.camera:camera-lifecycle:1.0.0-beta07
is released. Version 1.0.0-beta07 contains these commits.
June 24, 2020
androidx.camera:camera-lifecycle:1.0.0-beta06
is released. Version 1.0.0-beta06 contains these commits.
API Changes
June 10, 2020
androidx.camera:camera-lifecycle:1.0.0-beta05
is released. Version 1.0.0-beta05 contains these commits.
Bug Fixes
InitializationException
contains a CameraUnavailableException
will be set to the ListenableFuture
of the intialization result instead of crashing the application. (I9909a, b/149413835)May 27, 2020
androidx.camera:camera-lifecycle:1.0.0-beta04
is released. Version 1.0.0-beta04 contains these commits.
April 15, 2020
androidx.camera:camera-lifecycle:1.0.0-beta03
is released. Version 1.0.0-beta03 contains these commits.
Bug Fixes
bindToLifecycle()
with zero UseCase
s would cause a thrown exception. This prevented retrieval of a Camera
without binding a UseCase
.camera-core
February 26, 2020
androidx.camera:camera-lifecycle:1.0.0-beta01
is released. Version 1.0.0-beta01 contains these commits.
Bug Fixes
ProcessCameraProvider
during initialization, a default configuration isApplication
is optional. (I5e395)April 1, 2020
androidx.camera:camera-lifecycle:1.0.0-beta02
is released. Version 1.0.0-beta02 contains these commits.
Bug Fixes
camera-camera2:1.0.0-beta02
and camera-core:1.0.0-beta02
artifacts.February 10, 2020
androidx.camera:camera-lifecycle:1.0.0-alpha10
is released. Version 1.0.0-alpha10 contains these commits.
API Changes
@MainThread
annotation to BindToLifecycle, unbind and unbindAll methods. (I990d2)January 22, 2020
androidx.camera:camera-lifecycle:1.0.0-alpha03
is released. Version 1.0.0-alpha03 contains these commits.
Updates
December 18, 2019
androidx.camera:camera-lifecycle:1.0.0-alpha02
is released. Version 1.0.0-alpha02 contains these commits.
Dependency changes
androidx.camera:camera-core:1.0.0-alpha08
.December 4, 2019
androidx.camera:camera-lifecycle:1.0.0-alpha01
is released. Version 1.0.0-alpha01 of camera-lifecycle contains these commits
API notes
LifeCycleCameraProvider
interface, and an implementation called ProcessCameraProvider
which provides many of the functions of the previous CameraX class in core and is obtained via a getInstance()
method.ProcessCameraProvider
.December 15, 2021
androidx.camera:camera-extensions:1.0.0-alpha32
and androidx.camera:camera-view:1.0.0-alpha32
are released. Version 1.0.0-alpha32 contains these commits.
API Changes
@RequiresApi(21)
annotations from the inner classes/interfaces. (I8e286, b/204917951)Bug Fixes
VideoCapture
. CameraX Extensions only support ImageCapture
and Preview
. The VideoCapture
can’t be supported yet. If the app binds VideoCapture
and enables any extension mode, an IllegalArgumentException
will be thrown. (I0d87b)CameraSelector#filter
no longer throws an IllegalArgumentException
when the result set is empty. (I27804)ExtensionsManager#getInstance
API as getInstanceAsync
because it returns ListenableFuture
. The Async suffix of the function name can clearly present that it is an async function. (I279d2)ExtensionsManager#getEstimatedCaptureLatencyRange
API since users can’t know which sizes are supported for the ImageCapture
use case and can’t distinguish whether the returned latency information is for the maximum capture output size or the input resolution parameter. (I74bb2)CameraProvider
parameter of ExtensionsManager
functions to the getInstance()
API. So that the users don’t need to input the CameraProvider
parameter each time when calling the ExtensionsManager
functions. (Ic7e48)November 17, 2021
androidx.camera:camera-extensions:1.0.0-alpha31
and androidx.camera:camera-view:1.0.0-alpha31
are released. Version 1.0.0-alpha31 contains these commits.
API Changes
Bug Fixes
October 13, 2021
androidx.camera:camera-extensions:1.0.0-alpha30
and androidx.camera:camera-view:1.0.0-alpha30
are released. Version 1.0.0-alpha30 contains these commits.
API Changes
Bug Fixes
September 29, 2021
androidx.camera:camera-extensions:1.0.0-alpha29
and androidx.camera:camera-view:1.0.0-alpha29
are released. Version 1.0.0-alpha29 contains these commits.
API Changes
RotationProvider#removeAllListeners()
. Please use RotationProvider#removeListener(...)
instead. (Id9d4a)Bug Fixes
August 18, 2021
androidx.camera:camera-extensions:1.0.0-alpha28
and androidx.camera:camera-view:1.0.0-alpha28
are released. Version 1.0.0-alpha28 contains these commits.
API Changes
Bug Fixes
Extender
classes, ExtensionsErrorListener and related ExtensionsManager APIs. (I3b8c3)July 21, 2021
androidx.camera:camera-extensions:1.0.0-alpha27
and androidx.camera:camera-view:1.0.0-alpha27
are released. Version 1.0.0-alpha27 contains these commits.
API Changes
CoordinateTransform#getTransform
to CoordinateTransform#transform
and update JavaDoc (I864ae)Bug Fixes
PreviewView PERFORMANCE
mode stretch issue when using it together with Compose UI. (Ie1137, b/183864890)June 30, 2021
androidx.camera:camera-extensions:1.0.0-alpha26
and androidx.camera:camera-view:1.0.0-alpha26
are released. Version 1.0.0-alpha26 contains these commits.
API Changes
CameraController#getTapToFocusState()
that exposes the latest tap-to-focus result. (Iaccb0)Extender
classes and related APIs. (I329e6)June 2, 2021
androidx.camera:camera-extensions:1.0.0-alpha25
and androidx.camera:camera-view:1.0.0-alpha25
are released. Version 1.0.0-alpha25 contains these commits.
API Changes
CameraView
. CameraView
has been replaced by CameraController
. Please see the migration guide for how to migrate.: (Id5005)Bug Fixes
ExperimentalUseCaseGroupLifecycle
withExperimentalUseCaseGroup
. (I3b2ef, b/159033688)April 21, 2021
androidx.camera:camera-extensions:1.0.0-alpha24
and androidx.camera:camera-view:1.0.0-alpha24
are released. Version 1.0.0-alpha24 contains these commits.
Bug Fixes
@Experimental
with @RequiresOptIn
to experimental APIs. For calling experimental APIs, use androidx.annotation.OptIn
instead of deprecated androidx.annotation.experimental.UseExperimental
. (Iff226)March 24, 2021
androidx.camera:camera-extensions:1.0.0-alpha23
and androidx.camera:camera-view:1.0.0-alpha23
are released. Version 1.0.0-alpha23 contains these commits.
API Changes
LifecycleCameraController
instead. See the migration guide (Idac2c)Bug Fixes
February 24, 2021
androidx.camera:camera-extensions:1.0.0-alpha22
and androidx.camera:camera-view:1.0.0-alpha22
are released. Version 1.0.0-alpha22 contains these commits.
API Changes
Bug Fixes
January 27, 2021
androidx.camera:camera-extensions:1.0.0-alpha21
and androidx.camera:camera-view:1.0.0-alpha21
are released. Version 1.0.0-alpha21 contains these commits.
Releasing to support other camera library artifacts.
December 16, 2020
androidx.camera:camera-extensions:1.0.0-alpha20
and androidx.camera:camera-view:1.0.0-alpha20
are released. Version 1.0.0-alpha20 contains these commits.
Releasing to support other camera library artifacts.
November 11, 2020
androidx.camera:camera-extensions:1.0.0-alpha19
and androidx.camera:camera-view:1.0.0-alpha19
are released. Version 1.0.0-alpha19 contains these commits.
Bug Fixes
@ExperimentalVideo
annotation was introduced to camera-view.@UseExperimental
annotationExperimentalVideo
as the markerClass
. (I6d729)October 14, 2020
androidx.camera:camera-extensions:1.0.0-alpha18
is released. Version 1.0.0-alpha18 contains these commits.
Bug Fixes
.getTargetRotation()
will return Surface.ROTATION_0
October 14, 2020
androidx.camera:camera-view:1.0.0-alpha18
is released. Version 1.0.0-alpha18 contains these commits.
Releasing to support other camera library artifacts.
September 23, 2020
androidx.camera:camera-extensions:1.0.0-alpha17
is released. Version 1.0.0-alpha17 contains these commits.
Bug Fixes
September 23, 2020
androidx.camera:camera-view:1.0.0-alpha17
is released. Version 1.0.0-alpha17 contains these commits.
Bug Fixes
September 16, 2020
androidx.camera:camera-extensions:1.0.0-alpha16
is released. Version 1.0.0-alpha16 contains these commits.
Bug Fixes
ExtensionsManager
to get an Extensions
objectSeptember 16, 2020
androidx.camera:camera-view:1.0.0-alpha16
is released. Version 1.0.0-alpha16 contains these commits.
API Changes
PreviewView#setDeviceRotationForRemoteDisplayMode()
and PreviewView#getDeviceRotationForRemoteDisplayMode()
. The two methods are for customizing preview rotation, when desired rotation is not display rotation, e.g. remote display. To handle the non-display preview rotation now, set the desired rotation with Preview#setTargetRotation()
and the newly added PreviewView#getViewPort(targetRotation)
. (Ib62cc)createSurfaceProvider()
to getSurfaceProvider()
. The method will always return the same instance of Preview.SurfaceProvider. (Iff83c)Bug Fixes
TranformationInfoListener
callback. (I21470)Known Issues
OnClickListener#onClick()
is not invoked when the end user clicks PreviewView. The touch event is mistakenly consumed by PreviewView#onTouchEvent(). The issue will be fixed in the next release.PreviewView#getMeteringPointFactory()
may be wrong if ViewPort is used with PreviewView.August 19, 2020
androidx.camera:camera-extensions:1.0.0-alpha15
is released. Version 1.0.0-alpha15 contains these commits.
Bug Fixes
ExtensionsManager.init()
method now takes in aInitialization should no longer crash when using a Context
that does not return an Application object from Context.getApplicationContext()
. (I3d3c9, b/160817073)
August 19, 2020
androidx.camera:camera-view:1.0.0-alpha15
is released. Version 1.0.0-alpha15 contains these commits.
Bug Fixes
DisplayOrientedMeteringPointFactory
takes in a CameraInfo
CameraSelector
so there is a direct mapping toDisplayOrientedMeteringPointFactory
also take in a CameraInfo
CameraSelector
. (I400c1)TextureViewMeteringPointFactory
. PreviewView
provides a public API (createMeteringPointFactory()
) to create a metering point factory regardless of whether it’s using a TextureView
or SurfaceView
. (Ide693)SURFACE_VIEW
/TEXTURE_VIEW
implementation modes to PERFORMANCE
/COMPATIBLE
. PERFORMANCE
is the old SURFACE_VIEW
mode, and COMPATIBLE
is the old TEXTURE_VIEW
mode. (I0edc2)July 22, 2020
androidx.camera:camera-extensions:1.0.0-alpha14
is released. Version 1.0.0-alpha14 contains these commits.
July 22, 2020
androidx.camera:camera-view:1.0.0-alpha14
is released. Version 1.0.0-alpha14 contains these commits.
June 24, 2020
androidx.camera:camera-extensions:1.0.0-alpha13
is released. Version 1.0.0-alpha13 contains these commits.
Bug Fixes
June 24, 2020
androidx.camera:camera-view:1.0.0-alpha13
is released. Version 1.0.0-alpha13 contains these commits.
Bug Fixes
June 10, 2020
androidx.camera:camera-extensions:1.0.0-alpha12
is released. Version 1.0.0-alpha12 contains these commits.
Bug Fixes
InitializationException
contains a CameraUnavailableException
will be set to the ListenableFuture
of the intialization result instead of crashing the application. (I9909a, b/149413835)June 10, 2020
androidx.camera:camera-view:1.0.0-alpha12
is released. Version 1.0.0-alpha12 contains these commits.
Bug Fixes
PreviewView#getBitmap()
API which returns a Bitmap representation of the content displayed on the preview surface. (I9b500, b/157659818)May 27, 2020
androidx.camera:camera-extensions:1.0.0-alpha11
is released. Version 1.0.0-alpha11 contains these commits.
June 10, 2020
androidx.camera:camera-view:1.0.0-alpha12
is released. Version 1.0.0-alpha12 contains these commits.
New Features
API Changes
Bug Fixes
PreviewView#getBitmap()
API which returns a Bitmap representation of the content displayed on the preview surface. (I9b500, b/157659818)May 27, 2020
androidx.camera:camera-view:1.0.0-alpha11
is released. Version 1.0.0-alpha11 contains these commits.
API Changes
PreviewView#getPreviewStreamState
API whichPreviewView#setDeviceRotationForRemoteDisplayMode()
API to provide device rotation for transform calculations if the application is running in remote display mode. (I59b95, b/153514525)Bug Fixes
FULL/LIMITED/LEVEL_3
cameras running android 7.0 and below. Forced use ImplementationMode#TEXTURE_VIEW
mode when the android version is 7.0 or below. (I83e30, b/155085307)CameraInfo
parameter from PreviewView#createSurfaceProvider()
, PreviewView
now internally retrieves it from the SurfaceRequest
. (If18f0, b/154652477)PreviewView
black screen issues when swiped out Preview
fragment and then swiped back in ViewPager2. Also fixed the issue when removeView(previewview)
and then addView(previewView)
. (Iab555, b/149877652, b/147354615)CameraView#takePicture()
API to allow saving images to Uri
and OutputStream
. Update the test app to use Uri
as the canonical example. (Ia2459, b/153607583)ScaleType
attribute. (I08565, b/153015659)CameraView.ScaleType
has been removed. Instead, use PreviewView.ScaleType
to set/get a scale type with CameraView. (Ia8974, b/153014831)PreviewView
a background color by default if it doesn’t already have one. This prevents content behind it from being visible before the preview stream starts. (I09fad)April 15, 2020
androidx.camera:camera-extensions:1.0.0-alpha10
is released. Version 1.0.0-alpha10 contains these commits.
Bug Fixes
April 15, 2020
androidx.camera:camera-view:1.0.0-alpha010
is released. Version 1.0.0-alpha010 contains these commits.
Bug Fixes
PreviewView
‘s surfaceView implementation wasn’t working well on certain devices, and would cause the app to crash after resuming preview. (I5ed6b)April 1, 2020
androidx.camera:camera-extensions:1.0.0-alpha09
is released. Version 1.0.0-alpha09 contains these commits.
Bug Fixes
camera-camera2:1.0.0-beta02
, camera-core:1.0.0-beta02
, and camera-lifecycle:1.0.0-beta02
artifactsApril 1, 2020
androidx.camera:camera-view:1.0.0-alpha09
is released. Version 1.0.0-alpha09 contains these commits.
Known Issues
ImplementationMode.SURFACE_VIEW
with PreviewView
may not work well on certain devices, this is because the SurfaceView
used for preview invalidates its surface when the lifecycle of the window it’s in is stopped, when it restarts, the camera is reopened and may attempt to resume preview before the SurfaceView
‘s surface is valid again. For now, you should use ImplementationMode.TEXTURE_VIEW
.API Changes
PreviewView.setImplementationMode()
to PreviewView.setPreferredImplementationMode()
.PreviewView.getImplementationMode()
to PreviewView.getPreferredImplementationMode()
.PreviewView.getSurfaceProvider()
by PreviewView.createSurfaceProvider(CameraInfo)
, which takes a nullable CameraInfo
instance used to optimize preview by using ImplementationMode.SURFACE_VIEW
whenever possible. If a null instance is passed, or if you set the preferred implementation mode to ImplementationMode.TEXTURE_VIEW
, ImplementationMode.TEXTURE_VIEW
is used internally.The following code sample shows how a preview use case used to previously be used with PreviewView.
preview.setSurfaceProvider(previewView.previewSurfaceProvider)
cameraProvider.bindToLifecycle(lifecycleOwner, cameraSelector, preview)
Right now, you can write the following:
val camera = cameraProvider.bindToLifecycle(lifecycleOwner, cameraSelector, preview)
previewView.preferredImplementationMode = ImplementationMode.TEXTURE_VIEW
preview.setSurfaceProvider(previewView.createSurfaceProvider(camera.cameraInfo))
The @UiThread
annotation has been added to PreviewView.getSurfaceProvider()
, meaning it must be called from the main thread. (I192f3)
Added PreviewView.setScaleType()
which allows to set the scale type of the preview. It accepts one of the values in PreviewView.ScaleType
, and defaults to PreviewView.ScaleType.FILL_CENTER
.
Added PreviewView.getScaleType()
.
Removed support for setting the implementation mode for PreviewView
in a XML layout using the implementationMode
attribute.
Add createMeteringPointFactory()
API to PreviewView to support converting (x, y) in PreviewView
to MeteringPoint
. (Ib36d7)
Bug Fixes
PreviewView
‘s size changes. (I71101)February 26, 2020
androidx.camera:camera-extensions:1.0.0-alpha08
is released. Version 1.0.0-alpha08 contains these commits.
February 26, 2020
androidx.camera:camera-view:1.0.0-alpha08
is released. Version 1.0.0-alpha08 contains these commits.
Bug Fixes
ListenableFuture
onSurfaceRequest.provideSurface()
with an Executor
and Callback
. ThisprovideSurface()
and enforces that the provideSurface()
callback cannotSurfaceRequest.Result
object is now usedSurfaceRequest
uses the provided Surface
. (I7854b)SurfaceRequest.setSurface(Surface)
toSurfaceRequest.provideSurface(Surface)
andSurfaceRequest.setWillNotComplete()
toSurfaceRequest.willNotProvideSurface()
. (I224fe)CameraXConfig
provider. (I2d6c1)February 10, 2020
androidx.camera:camera-extensions:1.0.0-alpha07
is released. Version 1.0.0-alpha07 contains these commits.
Bug Fixes
ImageCapture.OnImageSavedCallback.onError()
and ImageCapture.OnImageCapturedCallback.onError()
have now been replaced by a single argument ImageCaptureException
, which still contains all the information that was previously passed.ImageCapture.OnImageSavedCallback.onImageSaved()
has been removed. (I750d2)February 10, 2020
androidx.camera:camera-view:1.0.0-alpha07
is released. Version 1.0.0-alpha07 contains these commits.
API Changes
PreviewView
‘s TextureView
implementation now sets the TextureView
‘s size to the camera sensor output size before scaling it to fill its parent PreviewView
. If you want the camera preview to fill an entire part of the UI (the whole screen for instance), you should not set the PreviewView
‘s size to a fixed value, or have it wrap its content (by using the attribute “wrap_content
” for example), this may result in the camera preview only filling part of the PreviewView
(if the camera sensor output size is smaller). Instead, you should set the PreviewView
as big as its parent (by using the attribute “match_parent
” for example). (1204869)Bug Fixes
ImageCapture
to allow saving images to Uri
and OutputStream
. Combined overloaded takePicture
methods into one. Updated test app to use Uri
as the canonical example. (Ia3bec)Preview.PreviewSurfaceProvider
has been renamed to Preview.SurfaceProvider
. SurfaceProvider
s no longer require developers to create their own ListenableFuture
, and providing a Surface
is now done through a new SurfaceRequest
object. The Preview.getPreviewSurfaceProvider()
method has been removed due to its potential for misuse when Preview
is paired with other classes such as PreviewView
. (I20105)ImageCapture.OnImageSavedCallback.onError()
and ImageCapture.OnImageCapturedCallback.onError()
have now been replaced by a single argument ImageCaptureException
, which still contains all the information that was previously passed.ImageCapture.OnImageSavedCallback.onImageSaved()
has been removed. (I750d2)getZoomRatio()
, getMaxZoomRatio()
, getMinZoomRatio()
, and getLinearZoom()
methods of CameraInfo
merging into getZoomState()
which returns a ZoomState
instance. (Ib19fe)January 22, 2020
androidx.camera:camera-extensions:1.0.0-alpha06
is released. Version 1.0.0-alpha06 contains these commits.
Updates
January 22, 2020
androidx.camera:camera-view:1.0.0-alpha06
is released. Version 1.0.0-alpha06 contains these commits.
Updates
December 18, 2019
androidx.camera:camera-extensions:1.0.0-alpha05
is released. Version 1.0.0-alpha05 contains these commits.
Bug Fixes
December 18, 2019
androidx.camera:camera-view:1.0.0-alpha05
is released. Version 1.0.0-alpha05 contains these commits.
Known Issues
New Features
PreviewView.TextureViewImplementation
that syncs the SurfaceTexture’s lifecycle with the camera’s usage of the TextureView’s surface.December 4, 2019
androidx.camera:camera-extensions:1.0.0-alpha04
is released. Version 1.0.0-alpha04 of camera-extensions contains these commits
API changes
Checking for the availability and enabling of an extension now takes in a CameraSelector
as an input parameter. This needs to be the same CameraSelector
that is used for binding the use case.
val cameraSelector = CameraSelector.DEFAULT_BACK_CAMERA
val builder = ImageCapture.Builder()
val bokehImageCaptureExtender = BokehImageCaptureExtender.create(builder)
if (bokehImageCaptureExtender.isExtensionAvailable(cameraSelector)) {
bokehImageCaptureExtender.enableExtension(cameraSelector)
}
val imageCapture = builder.build()
mCameraProvider?.bindToLifecycle(this, cameraSelector, imageCapture)
You must initialize extensions before using the extension library.
val availability = ExtensionsManager.init()
Futures.addCallback(
availability,
object : FutureCallback {
override fun onSuccess(availability: ExtensionsManager.ExtensionsAvailability?) {
// Ready to make extensions calls
}
override fun onFailure(throwable: Throwable) {
// Extensions could not be initialized
}
},
Executors.newSingleThreadExecutor()
)
December 4, 2019
androidx.camera:camera-view:1.0.0-alpha04
is released. Version 1.0.0-alpha04 of camera-view contains these commits
API changes
PreviewView
class is provided for easily displaying the output from the Preview use case in an application.PreviewView
can be included in the layout:
PreviewView
provides a PreviewSurfaceProvider
to easily connect a Preview use case
preview.setPreviewSurfaceProvider(previewView.previewSurfaceProvider)
“ZoomLevel
” is now “ZoomRatio
” in API-naming
Some method parameters have changed nullability
October 9, 2019
androidx.camera:camera-extensions:1.0.0-alpha03
and androidx.camera:camera-view:1.0.0-alpha03
are released. These are the commits included in camera-extensions:1.0.0-alpha03
and these are the commits included in camera-view:1.0.0-alpha03
.
New Features
September 5, 2019
androidx.camera:camera-extensions:1.0.0-alpha02
and
androidx.camera:camera-view:1.0.0-alpha02
are released. These are the
commits included in camera-extensions:1.0.0-alpha02
and these are the commits included
camera-view:1.0.0-alpha02.
PreviewImageProcessorImpl
has correctly implementedExtensionTest
test failure on Nexus 5 (API level 21) and ensure previewAugust 7, 2019
androidx.camera:camera-extensions:1.0.0-alpha01
and
androidx.camera:camera-view:1.0.0-alpha01
are released.
These are the
commits included in camera-extensions:1.0.0-alpha01
and these are the commits included
camera-view:1.0.0-alpha01
This library was last updated on: July 26, 2023
This library equal last update on : july twenty-six, 2023 CameraX be test along many device in our lab. To learn ampere list of the devices presently indium the lab, attend CameraX lab-tested device .
To total a addiction on CameraX, you mustiness add the google ace repository to your project. read google ‘s ace repository for more information .
add the colony for the artifact you want inch the build.gradle
file for your app oregon faculty :
dependencies { // CameraX core library using the camera2 implementation def camerax_version = "1.3.0-beta02" // The following line is optional, as the core library is included indirectly by camera-camera2 implementation "androidx.camera:camera-core:${camerax_version}" implementation "androidx.camera:camera-camera2:${camerax_version}" // If you want to additionally use the CameraX Lifecycle library implementation "androidx.camera:camera-lifecycle:${camerax_version}" // If you want to additionally use the CameraX VideoCapture library implementation "androidx.camera:camera-video:${camerax_version}" // If you want to additionally use the CameraX View class implementation "androidx.camera:camera-view:${camerax_version}" // If you want to additionally add CameraX ML Kit Vision Integration implementation "androidx.camera:camera-mlkit-vision:${camerax_version}" // If you want to additionally use the CameraX Extensions library implementation "androidx.camera:camera-extensions:${camerax_version}" }
dependencies { // CameraX core library using the camera2 implementation val camerax_version = "1.3.0-beta02" // The following line is optional, as the core library is included indirectly by camera-camera2 implementation("androidx.camera:camera-core:${camerax_version}") implementation("androidx.camera:camera-camera2:${camerax_version}") // If you want to additionally use the CameraX Lifecycle library implementation("androidx.camera:camera-lifecycle:${camerax_version}") // If you want to additionally use the CameraX VideoCapture library implementation("androidx.camera:camera-video:${camerax_version}") // If you want to additionally use the CameraX View class implementation("androidx.camera:camera-view:${camerax_version}") // If you want to additionally add CameraX ML Kit Vision Integration implementation("androidx.camera:camera-mlkit-vision:${camerax_version}") // If you want to additionally use the CameraX Extensions library implementation("androidx.camera:camera-extensions:${camerax_version}") }
Your feedback aid make Jetpack well. let uranium know if you identify new topic oregon accept theme for better this library. please learn vitamin a expect astatine the existing offspring in this library ahead you make a newfangled one. You toilet lend your vote to associate in nursing existent return aside click the star push button .
create vitamin a new issue
interpret the issue tracker documentation for more information .
july twenty-six, 2023
androidx.camera:camera-*:1.3.0-beta02
be release. version 1.3.0-beta02 contain these entrust .
Bug Fixes
CaptureFailedRetryQuirk
. (I7b589) june twenty-one, 2023
androidx.camera:camera-*:1.3.0-beta01
be free. interpretation 1.3.0-beta01 contain these entrust .
API Changes
ResolutionSelector.Builder#setHighResolutionEnabledFlag(int)
function name to setAllowedResolutionMode
and renamed the ResolutionSelector#HIGH_RESOLUTION_FLAG_OFF
/ON
constants to PREFER_CAPTURE_RATE_OVER_HIGHER_RESOLUTION
/PREFER_HIGHER_RESOLUTION_OVER_CAPTURE_RATE
. (If84e8)ImageAnalysis.setTargetRotationDegrees(int)
, ImageCapture.setTargetRotationDegrees(int)
and VideoCapture.setTargetRotationDegrees(int)
. (Id8e77)DynamicRange
class respresent the dynamic range of images. This can be used to select High Dynamic Range formats as the output of VideoCapture
through VideoCapture.Builder#setDynamicRange()
. (Ib0377)isImageAnalysisSupported
API to the ExtensionsManager
which apps can determine if an ImageAnalysis
use case can be bound along with Preview and ImageCapture
when Extensions are enabled. (I1bc63)VideoCapabilities
class obtained from the Recorder
can be used to query supported dynamic ranges and qualities for video recording on the device. QualitySelector
‘s getSupportedQualities()
and isQualitySupported()
methods are being deprecated. Please use VideoCapabilities
‘s getSupportedQualities()
and isQualitySupported()
methods instead. (I04014)CameraController#setVideoCaptureTargetQuality()
is renamed to setVideoCaptureQualitySelector
and takes argument QualitySelector
, which provides more flexibility for video quality setup. CameraController#getVideoCaptureTargetQuality()
is changed to getVideoCaptureQualitySelector
accordingly. (I520ed)Bug Fixes
ImageFormat.JPEG
format support for ImageProxy.toBitmap()
. If the JPEG byte array cannot be decoded, an UnsupportedOperationException
will be thrown. (I81958, b/282057603) whitethorn twenty-four, 2023
androidx.camera:camera-*:1.3.0-alpha07
be release. translation 1.3.0-alpha07 contain these entrust .
New Features
VideoCapture.Builder# setTargetFrameRate(Range)
API allows video recordings to be captured at other frame rates besides the device default. The available frame rates for recordings can be queried through the new CameraInfo#getSupportedFrameRates()
API.API Changes
ResolutionSelector#HIGH_RESOLUTION_FLAG_OFF
/ON
constants to ALLOWED_RESOLUTIONS_NORMAL
/SLOW
and renamed the builder setHighResolutionEnabledFlag
function name to setAllowedResolutionMode
. (Iae817)CameraInfo#getSupportedFrameRateRanges()
now returns a Set
rather than a List
to better represent that the ranges are unordered. (I02f43)CameraEffect
to handle unrecoverable errors (Ice471)ResolutionInfo
for better testability (If6d1c)UseCase.snapToSurfaceRotation(int)
to replace usage of setTargetRotationDegrees
and deprecate API ImageAnalysis.setTargetRotationDegrees(int)
, ImageCapture.setTargetRotationDegrees(int)
and VideoCapture.setTargetRotationDegrees(int)
. (Ia9010)Preview#getTargetFrameRate
and Preview.Builder#setTargetFrameRate
to be able to set and retrieve target frame rate for Preview use case (If4f22)VideoRecordEvent.Finalize
will now complete with error code ERROR_RECORDING_GARBAGE_COLLECTED
when the Recording
object is stopped due to garbage collection. (Iba974)Bug Fixes
NullPointerException
when the cached output sizes in StreamConfigurationMapCompat
are null. (Idf124, b/282025204)Preview.setSurfaceProvider(null)
doesn’t pause the preview in Extensions (Ia903e)ConcurrentModificationException
is thrown during camera opening when VideoCapture
is bound. (Ic8ac4) april nineteen, 2023
androidx.camera:camera-*:1.3.0-alpha06
be secrete. version 1.3.0-alpha06 incorporate these commit .
New Features
ResolutionSelector
API which covers the following features:
VideoCapture
mirroring APIs. Videos recorded by VideoCapture
are not mirrored by default. However, the camera preview is mirrored on the front camera by default. VideoCapture
mirroring APIs make it possible to align to the camera preview when using the front camera. There are three MirrorMode
, OFF
, ON
and ON_FRONT_ONLY
. To align to the camera preview, it is recommended to use ON_FRONT_ONLY
which means that mirroring is not enabled for the rear camera but is enabled for the front camera.API Changes
ResolutionSelector
API. Applications can specify aspect ratio and resolution strategies with fallback rules or a custom resolution filter to get the desired results. Applications can specify a flag to enable high resolution capture. This will allow CameraX to select higher resolutions when taking photos or videos. However, please note that using a high resolution may result in slower capture times. (Ibed95)CameraInfo#getSupportedFrameRateRanges()
. (Iaa67f)VideoCapture#getTargetFrameRate()
(I83304)setTargetAspectRatio
and setTargetResolution
API. Please use the new ResolutionSelector
API instead. (I542c3)List> getAvailableConcurrentCameraInfos()
ConcurrentCamera bindToLifecycle(@NonNull ConcurrentCameraConfig concurrentCameraConfig)
boolean isConcurrentCameraModeOn()
ConcurrentCameraConfig
, SingleCameraConfig
and ConcurrentCamera
(Iab1c1)ImageProcessor.Response#getOutputImage
NonNull (Ib9c60)VideoCapture
mirroring APIs, including VideoCapture.Builder.setMirrorMode(int)
and VideoCapture.getMirrorMode()
. The APIs are useful for applications require the video recording to be consistent with common camera preview behavior, i.e. the rear camera preview is not mirrored but the front camera preview is mirrored. (I713b6, b/194634656)setTargetFrameRate()
API in the VideoCapture.Builder
and getTargetFramerate()
API in VideoCapture
(I109d4)SurfaceOutput
extending Closable and hide SurfaceOutput.Event
‘s public constructor. (I60ea8)Recording.mute
to dynamically mute or unmute an in-processing recording. RecordingStats
will contain AudioStats.AUDIO_STATE_MUTED
when the in-processing recording is muted explicitly. (Ie17fc)#setEffects()
parameter non-null. Add a #clearEffects()
API for clearing effects. The app should call #clearEffects()
to remove effects. (I4b4d9)ViewfinderSurfaceRequest.Builder
to take a builder for copy constructor (I621a7)Bug Fixes
VideoCapture
could not work with the front camera on some devices. For example, on Samsung Galaxy S23 and Xiaomi 2107113SG. (Ibec7e, b/270656244)requestLegacyExternalStorage
to true in application tag. (I11b2c)RejectedExecutionException
crash in DefaultSurfaceProcessor
. The crash could happen when VideoCapture
is bound and the activity is paused. (Idb46a, b/273713906) march twenty-two, 2023
androidx.camera:camera-*:1.3.0-alpha05
be free. version 1.3.0-alpha05 control these perpetrate .
API Changes
VideoCapture
rotation APIs, including VideoCapture.Builder.setTargetRotation(int)
, VideoCapture.setTargetRotation(int)
, VideoCapture.setTargetRotationDegrees(int)
and VideoCapture.getTargetRotation()
. The APIs are useful for applications that lock the device orientation. ImageCapture.setTargetRotationDegrees(int)
and ImageAnalysis.setTargetRotationDegrees(int)
are also added. (Id3ffe, b/205242781)VIDEO_CAPTURE
and PREVIEW|VIDEO_CAPTURE
as effects target. Effects that targets VIDEO_CAPTURE
will be applied to the VideoCapture
UseCase; Effects that targets PREVIEW|VIDEO_CAPTURE
will be applied to a shared stream before copying to Preview and VideoCapture
stream. (Iee6f3)Bug Fixes
1.2.2
: Fixed the issue where CameraX Extensions don’t work properly when proguard is enabled on some devices such as Pixel (I90aa2)PreviewView
bug that if the app handles screen orientation itself. the preview might become distorted upon rotation. This only happens on certain devices. It can be reproduced on Pixel a4, Pixel 5, and Pixel 6a. (I14340, b/223488673) february twenty-two, 2023
androidx.camera:camera-*:1.3.0-alpha04
be exhaust. version 1.3.0-alpha04 hold these give .
New Features
angstrom raw feature to support previously unsupported come on combination aside share one pour to multiple UseCases .
IllegalArgumentException
.API Changes
ImageProxy
to Bitmap
. The supported ImageProxy
format is ImageFormat.YUV_420_888
and PixelFormat.RGBA_8888
. If the format is invalid, IllegalArgumentException
will be thrown. (Ic7110)CoroutineCameraViewfinder
to support configuring viewfinder using suspending functions in Kotlin. (I657bc)ViewfinderSurfaceRequest
. It provides the flexibility when user cannot provide CameraCharacteristics
. (Ie6549)Bug Fixes
january twenty-five, 2023
androidx.camera:camera-*:1.3.0-alpha03
constitute free. version 1.3.0-alpha03 incorporate these give .
API Changes
CameraInfo.getIntrinsicZoomRatio
to provide angle of view information relative to the default camera. (Ib300c)CameraInfo.getLensFacing
to provide lens facing information. Added CameraSelector#LENS_FACING_EXTERNAL
as an experimental feature for selecting external cameras. (Icaf3e)#setEffect()
to CameraController
that allows adding effects to camera output. (I1d21f)invalidate()
method to SurfaceRequest
. The Surface provider can notify that the previously provided surface is no longer valid. (Idc649)ImageProcessor
API. This interface is for inject post-processing effects into the ImageCapture
pipeline. (I575c6)Recorder.Builder.setAspectRatio()
which can be combined with QualitySelector
to support more video resolutions. (I8a082)Recorder.Builder#setTargetVideoEncodingBitRate
to set Target Video Encoding BitRate
and Recorder#getTargetVideoEncodingBitRate
to get Target Video Encoding BitRate. (I5984d)Bug Fixes
ImageCapture
failed when there is no flash unit and flash mode is on. (I9e8b4, b/263391112)CameraController#enableTorch
, the pending action is cached and submitted once the initialization compeltes. (I11e92, b/264157663) december seven, 2022
androidx.camera:camera-*:1.3.0-alpha02
be publish. version 1.3.0-alpha02 contain these invest .
API Changes
OutputOptions.getDurationLimit
to OutputOptions.getDurationLimitMillis
and OutputOptions.setDurationLimit
to OutputOptions.setDurationLimitMillis
. (I91f0c)AudioConfig
class to handle the audio related setting while recording video. The @RequiresPermission
annotation is moved from startRecording
functions to AudioConfig
to avoid unnecessary permission requests for the cases that audio is not needed. (I28755)OnVideoSavedCallback
, OutputFileOptions
and OutputFileResults
classes that are no longer used after applying the new video capture API. (I38cd8)getVideoCaptureTargetSize
and setVideoCaptureTargetSize
methods are replaced with the getVideoCaptureTargetQuality
and the setVideoCaptureTargetQuality
methods accordingly, as setTargetResolution
is no longer supported. (I2a1d5)Bug Fixes
core.VideoCapture
API. (I531e0)onError
callback is not called when taking pictures without the storage permission.(I936db, b/244807669)ViewPort
is enabled on legacy devices. (I16b8a, b/251357665) november nine, 2022
androidx.camera:camera-*:1.3.0-alpha01
equal exhaust. translation 1.3.0-alpha01 contain these perpetrate .
New Features
Camera-viewfinder
has been published officially. Camera-viewfinder
provides a base viewfinder widget that can display the camera feed for Camera2. Please check the sample code for an example.API Changes
OutputOptions.setDurationLimit
to allow setting of video duration limit. The recording will be automatically finalized when exceeding the specified duration limit. (I902a0)AudioStats.AUDIO_STATE_SOURCE_ERROR
. Sent when audio source setup fails or some error occurs. (I37410)Bug Fixes
PreviewView
SurfaceView
implementation black screen issue on ViewPager2
. As part of the fix, PreviewView
will reuse its SurfaceView
if the requested resolution is not changed. (Ib3f27)ViewPort
or CameraController
API is used. (Ifbba8, b/201085351) may twenty-four, 2023
androidx.camera:camera-*:1.2.3
cost free. version 1.2.3 control these perpetrate .
Bug Fixes
VideoCapture
could not work with the front camera on some devices. For example, on Samsung Galaxy S23 and Xiaomi 2107113SG. (Ibec7e, b/270656244) border twenty-two, 2023
androidx.camera:camera-*:1.2.2
be unblock. interpretation 1.2.2 check these give .
Bug Fixes
january twenty-five, 2023
androidx.camera:camera-*:1.2.1
exist free. translation 1.2.1 incorporate these perpetrate .
Bug Fixes
december seven, 2022
androidx.camera:camera-*:1.2.0
be exhaust. version 1.2.0 check these invest .
Important changes since 1.1.0
MLKitAnalyzer
as new APIs.CAPTURE_MODE_ZERO_SHUTTER_LAG
, the latency between the shutter button is clicked and the picture is taken is expected to be minimized, compared with other capture modes. On devices that don’t support ZERO_SHUTTER_LAG
, it’ll fallback to CAPTURE_MODE_MINIMIZE_LATENCY
.android.camera.core.VideoCapture
.setStreamUseCase()
as a public Camera2Interop
API.setOutputImageRotationEnabled
.ImageAnalysis.Analyzer#getTargetResolutionOverride()
to ImageAnalysis.Analyzer#getDefaultTargetResolution()
.VideoCapture
and Preview use cases with 16:9 aspect ratioPreview/VideoCapture
stretched issue on API level 27 devices. october twenty-four, 2022
androidx.camera:camera-*:1.2.0-rc01
be let go of. version 1.2.0-rc01 hold these entrust .
API Changes
setStreamUseCase
API for OutputConfiguration
. User can specify the Stream Use Case for the stream session, overrding CameraX’s internal logics to choose Stream Use Case in order to optimize according to their need. (Ib1a95)Bug Fixes
Preview/VideoCapture
stretched issue on API level 27 devices. Resolution 1920×1080 causes the Preview/VideoCapture
images to be stretched. Added workaround to not select the 1920×1080 resolution for Preview or VideoCapture
to avoid the image stretched problem. (I0e04e)VideoCapture
and Preview use cases with 16:9 aspect ratio on some Huawei devices. (If8c88, b/223643510)SurfaceProvider
is not set. As part of the fix, Preview with no SurfaceProvider
set will now not be configured into the camera capture session. (I99681) september twenty-one, 2022
androidx.camera:camera-*:1.2.0-beta02
embody exhaust. version 1.2.0-beta02 hold these entrust .
API Changes
setOutputImageRotationEnabled
(I26e3e, b/240993561)Bug Fixes
BOKEH
extension is enabled on some Samsung devices and user switches the cameras. (If6168) august twenty-four, 2022
androidx.camera:camera-*:1.2.0-beta01
constitute release. translation 1.2.0-beta01 hold these commit .
New Features
camera-mlkit-vision
. Easily integrate CameraX with many MLKit features, including barcode scanning, face detection, text detection, etc. Please find the sample code here.ImageAnalysis.Analyzer
and MLKitAnalyzer
as official APIs.ImageAnalysis.Analyzer#getTargetResolutionOverride()
to ImageAnalysis.Analyzer#getDefaultTargetResolution()
.Bug Fixes
ExifInterface
correctly parse the attributes. Capturing the images in YUV format and then compressing them to JPEG output images to workaround this issue. (I45abb) july twenty-seven, 2022
androidx.camera:camera-*:1.2.0-alpha04
equal free. version 1.2.0-alpha04 control these entrust .
API Changes
ImageAnalysis.Analyzer#getTargetResolutionOverride()
to ImageAnalysis.Analyzer#getDefaultTargetResolution()
. The behavior is also changed so that the value returned by this method can be overridden by the value of ImageAnalysis#setTargetResolution()
. (If1d36)android.location.Location
object can be set via new API androidx.camera.video.OutputOptions.Builder.setLocation(Location)
. (I313a0, b/204197544)Bug Fixes
Recorder
when attempting to record while audio source is unavailable. (I9f652) june twenty-nine, 2022
androidx.camera:camera-*:1.2.0-alpha03
embody exhaust. translation 1.2.0-alpha03 contain these commit .
API Changes
ImageAnalysis.Analyzer
and MLKitAnalyzer
. (I0ff22)Bug Fixes
isFocusSuccessful
false if the FocusMeteringAction
is not cancelled and the AF part is not converged in the duration. (Ibc2e3) june one, 2022
androidx.camera:camera-*:1.2.0-alpha02
be publish. adaptation 1.2.0-alpha02 contain these perpetrate .
New Features
API Changes
CAPTURE_MODE_ZERO_SHUTTER_LAG
in ImageCapture
and add isZslSupported
in CameraInfo
to query the device capability. CAPTURE_MODE_ZERO_SHUTTER_LAG
mode is aiming to provide the minimum latency for instant capture. It is implemented based on a ring buffer, which caches intermediate capture results for later reprocessing when the user presses buttons to take pictures. If {@link VideoCapture} is bound or flash mode is not OFF or OEM Extension is ON, this mode will be disabled automatically. (I9ae74)ImageAnalysis.getBackgroundExecutor()
method (Icc945)Bug Fixes
ImageCapture
takePicture method turns torch off on the reported devices. (Ib5eb5, b/228272227)AssertionError
not being handled when getting the CONTROL_ZOOM_RATIO_RANGE
characteristic.(/Ia248a, b/231701345) may eighteen, 2022
androidx.camera:camera-*:1.2.0-alpha01
be release. adaptation 1.2.0-alpha01 check these invest .
New Features
Bug Fixes
QualitySelector
fails to record a UHD video when a fallback strategy is enabled. The issue happens when VideoCapture
is bound with ImageCapture
and Preview on a FULL or higher hardware level camera device. A fallback strategy of QualitySelector
causes VideoCapture
incorrectly to get a FHD resolution. UHD resolution is actually supported for this use case combination and should be adopted. (I0e788, b/230651237)NullPointerException
on ImageCapture.takePicture()
. (I92366, b/230454568, b/229766155)androidx.camera.video.Recorder
(Ia8ce8) june twenty-nine, 2022
androidx.camera:camera-*:1.1.0
constitute free. version 1.1.0 contain these commit .
Important changes since 1.0.0
ImageAnalysis.Builder.setOutputImageRotationEnabled
and setOutputImageFormat
)CameraState
API that will be exposed through CameraInfo.ProcessCameraProvider.getAvailableCameraInfos()
to directly retrieve information about the available camerasImageCapture#OnImageCapturedCallback
when Extensions are enabled.isFocusMeteringSupported
in CameraInfo
which allows applications to check if the given FocusMeteringAction
is supported on current camera or not.getResolutionInfo
API to provide the resolution information for Preview, ImageCapture
and ImageAnalysis
.ImageCapture.Builder#setJpegQuality
to allow changing the output JPEG image compression quality when taking pictures.CameraSelector#filter
to the public API to filter a list of CameraInfos
based on a CameraSelector
.Camera2CameraControl.clearCaptureRequestOptions
for clearing the existing capture request options.CameraController
with external image processing libraries. e.g. MLKitCameraInfo#getCameraSelector()
which returns a CameraSelector
unique to its camera@Experimental
with @RequiresOptIn
to experimental APIs. For calling experimental APIs, use androidx.annotation.OptIn instead of deprecated androidx.annotation.experimental.UseExperimental.CameraXConfig.Builder#setAvailableCamerasLimiter()
, CameraXConfig.Builder#setMinimumLoggingLevel()
, CameraXconfig.Builder#setSchedulerHandler()
, CameraXConfig#getAvailableCamerasLimiter()
, CameraXConfig#getMinimumLoggingLevel()
, CameraXConfig#getCameraExecutor()
, CameraXConfig#getSchedulerHandler()
,@ExperimentalCameraFilter
APIsUseCaseGroup
API for camera-core, camera-lifecycle and camera-video. Added ViewPort#getLayoutDirection
, ViewPort.Builder#setLayoutDirection
and ViewPort.Builder#setScaleType
for customizing viewport.ExperimentalUseCaseGroupLifecycle
to formal public APIs.Renamed MediaStoreOutputOptions.getCollection
to MediaStoreOutputOptions.getCollectionUri
.ActiveRecording
has been renamed to “Recording” to reduce verbosity.QualitySelector
creator API to a list-based APIBug Fixes
YuvToJpegProcessor
EOFException
issue when extension mode is enabled and ImageCapture#CAPTURE_MODE_MAX_QUALITY
mode is set.startFocusAndMetering
) when flash mode is auto or always_on in low-light environment. june one, 2022
androidx.camera:camera-*:1.1.0-rc02
be exhaust. translation 1.1.0-rc02 contain these invest .
Bug Fixes
NullPointerException
on ImageCapture.takePicture()
. (I92366, b/230454568, b/229766155)AssertionError
not being handled when getting the CONTROL_ZOOM_RATIO_RANGE
characteristic. (Ia248a, b/231701345) whitethorn eleven, 2022
androidx.camera:camera-*:1.1.0-rc01
be secrete. version 1.1.0-rc01 contain these entrust .
New Features
Bug Fixes
VideoCapture
was unbound, causing subsequent uses of VideoCapture
to fail on recording with MediaCodec.CodecException
, especially on API 21-22 devices. (Ie7f68)CameraExtensionsActivity
do not be deleted in ImageCaptureTest
april six, 2022
androidx.camera:camera-*:1.1.0-beta03
embody unblock. translation 1.1.0-beta03 contain these entrust .
API Changes
CaptureRequestOptions
constructor restricted. (I261b6)CameraController
with external image processing libraries. e.g. MLKit (I4ea71)Bug Fixes
PreviewView
when activity is not restarted after rotating devices in multi-window. (I1ea36, b/223488673)AbstractMethodError
issue happened when apps use extensions and enable proguard. (I7cbaf, b/222726805)InvalidConfigException
. However, this fix only prevents app from crashing, but doesn’t resolve the cause of the InvalidConfigException
. If the Recorder
still cannot be configured, applications will receive error callback when it starts recording. (I89c29, b/213617227)External Contribution
february twenty-three, 2022
androidx.camera:camera-*:1.1.0-beta02
exist let go of. adaptation 1.1.0-beta02 contain these commit .
API Changes
Bug Fixes
january twenty-six, 2022
androidx.camera:camera-*:1.1.0-beta01
equal let go of. version 1.1.0-beta01 check these perpetrate .
New Features
API Changes
Camera2CameraControl.clearCaptureRequestOptions
forBug Fixes
cameraControl#startFocusAndMetering()
on front lens-facing camera in Samsung devices (Ifbf59, b/210548792) december fifteen, 2021
androidx.camera:camera-*:1.1.0-alpha12
exist turn. version 1.1.0-alpha12 control these invest .
API Changes
@RequiresApi(21)
annotations from the inner classes/interfaces. (I8e286, b/204917951)QualitySelector
have been changed to be represented by class objects. For example, QualitySelector.QUALITY_HD
is changed to Quality.HD
, and QualitySelector.FALLBACK_STRATEGY_LOWER
is changed to the instance returned by FallbackStrategy.lowerQualityOrHigherThan(Quality)
. The API used to create QualitySelector
has been changed to a list-based API. The new API QualitySelector.fromOrderedList(List)
will refer to the order of the input quality list instead of the order created by QualitySelector.Procedure
. QualitySelector.Procedure
class has been removed. (I43343)PendingRecording.withEventListener()
was removed and the event listener must now be passed to PendingRecording.start()
. This event listener requirement is meant to encourage handling of asynchronous errors that are reported in the VideoRecordEvent.Finalize
event. (I1e71d)ActiveRecording
has been renamed to Recording
to reduce verbosity. (I77ceb)Bug Fixes
FLASH_AUTO
mode is underexposed in dark conditions on Pixel 3a and Pixel 3a XL (I13f19, b/205373142)Resolution
. (I4a694)REQUEST_AVAILABLE_CAPABILITIES_BACKWARD_COMPATIBLE
. Cameras with REQUEST_AVAILABLE_CAPABILITIES_BACKWARD_COMPATIBLE
have the minimal set of capabilities that every camera device supports. Camera without REQUEST_AVAILABLE_CAPABILITIES_BACKWARD_COMPATIBLE
might be a camera to support special functionality and does not support standard color output. CameraX
can’t support the Preview
, ImageCapture
, ImageAnalysis
or VideoCapture
use cases for those cameras. Therefore, those cameras should be filtered out to prevent incorrect usage. (Ib8cda)CameraSelector#filter
no longer throws an IllegalArgumentException
when the result set is empty. (I27804) november seventeen, 2021
androidx.camera:camera-*:1.1.0-alpha11
constitute exhaust. version 1.1.0-alpha11 contain these invest .
API Changes
getSensorToBufferTransformMatrix
API indium ImageInfo. The render matrix embody a map from detector coordinate to buffer coordinate, which be, from the prize of CameraCharacteristics.SENSOR_INFO_ACTIVE_ARRAY_SIZE
to (0, 0,
image.getWidth, image.getHeight)
. The matrix can embody use to map the organize from one { UseCase } to another. For model, map align of the font detected with ImageAnalysis to preview. ( I9ff1e )Bug Fixes
External Contribution
october thirteen, 2021
androidx.camera:camera-*:1.1.0-alpha10
be publish. translation 1.1.0-alpha10 contain these perpetrate .
New Features
androidx.camera:camera-video:1.1.0-alpha10
as the first alpha version for Video officially. There are several known issues to be fixed in the later releases.API Changes
@RequiresApi(21)
annotation to all CameraX classesBug Fixes
september twenty-nine, 2021
androidx.camera:camera-camera2:1.1.0-alpha09
, androidx.camera:camera-core:1.1.0-alpha09
, and androidx.camera:camera-lifecycle:1.1.0-alpha09
be secrete. version 1.1.0-alpha09 contain these commit .
API Changes
Bug Fixes
MAXIMIZE_QUALITY
mode. (I173a9, b/193823892)CAPTURE_MODE_MINIMIZE_LATENCY
, the JPEG compression quality will be 95. If the capture mode is CAPTURE_MODE_MAXIMIZE_QUALITY
, the JPEG compression quality will be 100. (Ieb37c, b/142856426) august eighteen, 2021
androidx.camera:camera-camera2:1.1.0-alpha08
, androidx.camera:camera-core:1.1.0-alpha08
, and androidx.camera:camera-lifecycle:1.1.0-alpha08
equal exhaust. version 1.1.0-alpha08 check these entrust .
New Features
API Changes
Bug Fixes
july twenty-one, 2021
androidx.camera:camera-camera2:1.1.0-alpha07
, androidx.camera:camera-core:1.1.0-alpha07
, and androidx.camera:camera-lifecycle:1.1.0-alpha07
be unblock. version 1.1.0-alpha07 hold these commit .
Bug Fixes
YuvToJpegProcessor
EOFException issue when extension mode is enabled and ImageCapture#CAPTURE_MODE_MAX_QUALITY
mode is set. (I538bd, b/192017012) june thirty, 2021
androidx.camera:camera-camera2:1.1.0-alpha06
, androidx.camera:camera-core:1.1.0-alpha06
, and androidx.camera:camera-lifecycle:1.1.0-alpha06
embody release. interpretation 1.1.0-alpha06 contain these entrust .
API Changes
ViewPort#getLayoutDirection
, ViewPort.Builder#setLayoutDirection
and ViewPort.Builder#setScaleType
for customizing viewport. (I7cee8) june two, 2021
androidx.camera:camera-camera2:1.1.0-alpha05
, androidx.camera:camera-core:1.1.0-alpha05
, and androidx.camera:camera-lifecycle:1.1.0-alpha05
cost publish. translation 1.1.0-alpha05 hold these commit .
API Changes
Camera2CameraFilter
class. Suggest to select camera byExperimentalCameraFilter
APIs are now out of experimentalCameraInfo#getCameraState()
. (Ia86b4)CameraInfo#getCameraSelector()
which returns a CameraSelector unique to its camera (I77f9f)Bug Fixes
april twenty-one, 2021
androidx.camera:camera-camera2:1.1.0-alpha04
, androidx.camera:camera-core:1.1.0-alpha04
, and androidx.camera:camera-lifecycle:1.1.0-alpha04
be release. version 1.1.0-alpha04 incorporate these give .
Bug Fixes
@Experimental
with @RequiresOptIn
to experimental APIs. For calling experimental APIs, use androidx.annotation.OptIn
instead of deprecated androidx.annotation.experimental.UseExperimental
. (Iff226) march twenty-four, 2021
androidx.camera:camera-camera2:1.1.0-alpha03
, androidx.camera:camera-core:1.1.0-alpha03
, and androidx.camera:camera-lifecycle:1.1.0-alpha03
be secrete. adaptation 1.1.0-alpha03 incorporate these commit .
Bug Fixes
ImageCapture#OnImageCapturedCallback
when Extensions modes is enabled. (I0d7b1) february twenty-four, 2021
androidx.camera:camera-camera2:1.1.0-alpha02
, androidx.camera:camera-core:1.1.0-alpha02
, and androidx.camera:camera-lifecycle:1.1.0-alpha02
be release. translation 1.1.0-alpha02 contain these entrust .
API Changes
ProcessCameraProvider.getAvailableCameraInfos()
to directly retrieve information about the available cameras, which are either all of the device’s cameras, or those selected by the CameraSelector
provided in CameraXConfig.Builder.setAvailableCamerasLimiter(CameraSelector)
. (Ieac08)Bug Fixes
ProcessCameraProvider.configureInstance(...)
from january twenty-seven, 2021
androidx.camera:camera-camera2:1.1.0-alpha01
, androidx.camera:camera-core:1.1.0-alpha01
, and androidx.camera:camera-lifecycle:1.1.0-alpha01
be release. version 1.1.0-alpha01 contain these commit .
Bug Fixes
IllegalArgumentException
issue that happened when all preview supported sizes are smaller than 640×480 and display size is larger than 640×480. (I2a63c, b/150506192) september twenty-nine, 2021
androidx.camera:camera-camera2:1.0.2
, androidx.camera:camera-core:1.0.2
, and androidx.camera:camera-lifecycle:1.0.2
be secrete. adaptation 1.0.2 incorporate these give .
Bug Fixes
MAXIMIZE_QUALITY
mode. (I173a9, b/193823892) july twenty-one, 2021
androidx.camera:camera-camera2:1.0.1
, androidx.camera:camera-core:1.0.1
, and androidx.camera:camera-lifecycle:1.0.1
be let go of. version 1.0.1 contain these invest .
Bug Fixes
ListenableFuture
hark back inch setZoomRatio
and setLinearZoom
can not complete on some android eleven device ( I716d7 )Note: raw interpretation of AndroidX library now correctly reflect implementation
colony versus api
dependence. If your project trust along associate in nursing implicit addiction expose through associate in nursing implementation
dependence in version 1.0.0
, you must explicitly count on that addiction indium your build.gradle
.
may five, 2021
androidx.camera:camera-camera2:1.0.0
, androidx.camera:camera-core:1.0.0
, and androidx.camera:camera-lifecycle:1.0.0
constitute release. version 1.0.0 contain these entrust .
Major features of 1.0.0
Known Issues
april twenty-one, 2021
androidx.camera:camera-camera2:1.0.0-rc05
, androidx.camera:camera-core:1.0.0-rc05
, and androidx.camera:camera-lifecycle:1.0.0-rc05
embody release. translation 1.0.0-rc05 hold these perpetrate .
Bug Fixes
parade twenty-four, 2021
androidx.camera:camera-camera2:1.0.0-rc04
, androidx.camera:camera-core:1.0.0-rc04
, and androidx.camera:camera-lifecycle:1.0.0-rc04
be release. version 1.0.0-rc04 hold these commit .
Bug Fixes
february twenty-four, 2021
androidx.camera:camera-camera2:1.0.0-rc03
, androidx.camera:camera-core:1.0.0-rc03
, and androidx.camera:camera-lifecycle:1.0.0-rc03
cost free. translation 1.0.0-rc03 check these invest .
Bug Fixes
ProcessCameraProvider#getInstance
january twenty-seven, 2021
androidx.camera:camera-camera2:1.0.0-rc02
, androidx.camera:camera-core:1.0.0-rc02
, and androidx.camera:camera-lifecycle:1.0.0-rc02
be release. version 1.0.0-rc02 contain these entrust .
Bug Fixes
IllegalArgumentException
offspring that happen when all preview digest size embody modest than 640×480 and display size be large than 640×480. ( I2a63c, b/150506192 ) december sixteen, 2020
androidx.camera:camera-camera2:1.0.0-rc01
, androidx.camera:camera-core:1.0.0-rc01
, and androidx.camera:camera-lifecycle:1.0.0-rc01
be release. version 1.0.0-rc01 check these perpetrate .
API Changes
CameraXConfig.Builder#setMinimumLoggingLevel()
to allow setting a minimum logging level for CameraX logs. When not set, it defaults to Log#DEBUG
. (Ic3245)Bug Fixes
Preview.setSurfaceProvider(null)
. (I3ac18) november eleven, 2020
androidx.camera:camera-camera2:1.0.0-beta12
, androidx.camera:camera-core:1.0.0-beta12
, and androidx.camera:camera-lifecycle:1.0.0-beta12
constitute turn. translation 1.0.0-beta12 contain these invest .
Bug Fixes
OnImageCapturedCallback#onCaptureSuccess
base class october fourteen, 2020
androidx.camera:camera-camera2:1.0.0-beta11
be let go of. version 1.0.0-beta11 contain these commit .
New Features
CONTROL_ZOOM_RATIO
API for zoom onCONTROL_ZOOM_RATIO_RANGE
. (I62cc6)Bug Fixes
ProcessCameraProvider.bindToLifecycle()
. (Ia5411).getTargetRotation()
will return Surface.ROTATION_0
october fourteen, 2020
androidx.camera:camera-core:1.0.0-beta11
be release. translation 1.0.0-beta11 contain these commit .
New Features – back android eleven CONTROL_ZOOM_RATIO
API for zoom on android eleven oregon late device which contain valid CONTROL_ZOOM_RATIO_RANGE
. ( I62cc6 )
Bug Fixes
ProcessCameraProvider.bindToLifecycle()
. (Ia5411).getTargetRotation()
will return Surface.ROTATION_0
september twenty-three, 2020
androidx.camera:camera-core:1.0.0-beta10
be publish. translation 1.0.0-beta10 contain these perpetrate .
Caution: please do not use Camera-Core Version 1.0.0-beta09 equally there be a know issue [ visualize hemipterous insect repair below ] around persona capture. please suffice not use this adaptation indium your application. rather practice Camera-Core Version 1.0.0-beta10 and above .
Bug Fixes
september twenty-three, 2020
androidx.camera:camera-camera2:1.0.0-beta10
be release. version 1.0.0-beta10 contain these invest .
Bug Fixes
september sixteen, 2020
androidx.camera:camera-camera2:1.0.0-beta09
be turn. version 1.0.0-beta09 hold these entrust .
Caution:Camera-Core Version 1.0.0-beta09 as there is a Known Issue around image capture. Please do not use this version in your applications. Instead use please dress not useas there embody deoxyadenosine monophosphate know consequence about effigy capture. please do not use this version in your application. alternatively use Camera-Core Version 1.0.0-beta10
and above .
API Changes
Bug Fixes
AspectRatio.RATIO_16_9
. (Ib7fcf, b/151969438)InitializationException
to make the app be able to gracefully handle the AssertionError happened when creating CameraCharacteristics. (I89c8c, b/160524721) september sixteen, 2020
androidx.camera:camera-core:1.0.0-beta09
be unblock. adaptation 1.0.0-beta09 incorporate these commit .
API Changes
ExposureCompensation
(If96c7)TranformationInfoListener
callback. (I21470)Bug Fixes
FLASH_MODE_ON
to take a picture, and is changed to FLASH_MODE_OFF
when the flash is fired. The symptom is like torch mode enabled. (Ib4451, b/162568128)ProcessCameraProvider.getInstance(Context)
.Known Issues
august nineteen, 2020
androidx.camera:camera-camera2:1.0.0-beta08
equal unblock. interpretation 1.0.0-beta08 contain these entrust .
Bug Fixes
august nineteen, 2020
androidx.camera:camera-core:1.0.0-beta08
cost secrete. adaptation 1.0.0-beta08 incorporate these entrust .
API Changes
DisplayOrientedMeteringPointFactory
takes in a CameraInfo
CameraSelector
so there is a direct mapping toDisplayOrientedMeteringPointFactory
also take in a CameraInfo
CameraSelector
. (I400c1)Bug Fixes
Context.getApplicationContext()
. (I3d3c9, b/160817073) july twenty-two, 2020
androidx.camera:camera-camera2:1.0.0-beta07
be unblock. interpretation 1.0.0-beta07 check these commit .
Bug Fixes
july twenty-two, 2020
androidx.camera:camera-core:1.0.0-beta07
be secrete. version 1.0.0-beta07 check these perpetrate .
API Changes
FIT_CENTER
, FIT_START
, and FIT_END
fit style with FIT
. FIT
means that the returned crop rect will be the max possible sensor rect. (Ia73c3)Bug Fixes
ConcurrentModificationException
exception june twenty-four, 2020
androidx.camera:camera-camera2:1.0.0-beta06
be free. adaptation 1.0.0-beta06 check these give .
API Changes
Bug Fixes
CameraControl#startFocusAndMetering
will fail if none of the june twenty-four, 2020
androidx.camera:camera-core:1.0.0-beta06
be publish. version 1.0.0-beta06 check these give .
API Changes
Bug Fixes
ProcessCameraProvider#configureInstance()
before callingProcessCameraProvider#getInstance()
. This allows for customization ofCameraXConfig
without requiring implementing CameraXConfig.Provider
CameraControl#startFocusAndMetering
will fail if none of the june ten, 2020
androidx.camera:camera-camera2:1.0.0-beta05
embody let go of. adaptation 1.0.0-beta05 contain these entrust .
Bug Fixes
InitializationException
contains a CameraUnavailableException
that will be set to the ListenableFuture
of the intialization result instead of crashing the application. (I9909a, b/149413835)startFocusAndMetering
CONTROL_AF_STATE
is null. (Ife55e, b/157084254) june ten, 2020
androidx.camera:camera-core:1.0.0-beta05
be let go of. version 1.0.0-beta05 contain these perpetrate .
API Changes
InitializationException
contains a CameraUnavailableException
will be set to the ListenableFuture
of the intialization result instead of crashing the application. (I9909a, b/149413835)Bug Fixes
setTargetResolution
and setTargetRotation
. (Iae16f) whitethorn twenty-seven, 2020
androidx.camera:camera-camera2:1.0.0-beta04
be publish. interpretation 1.0.0-beta04 incorporate these invest .
Bug Fixes
Camera2Interop
without causing a crash. Please note that if there are issues that arise as a result of overriding parameters. Stability and behaviour are not guaranteed when overriding parameters using Camera2Interop. (Ibe5a1, b/149103700)ImageProxy
from ImageCapture
was not rewound (I0c455, b/153249512) whitethorn twenty-seven, 2020
androidx.camera:camera-core:1.0.0-beta04
be let go of. version 1.0.0-beta04 hold these entrust .
API Changes
CameraXConfig.Builder#setSchedulerHandler()
for setting the handler used internally by the CameraX camera stack. This new API along with CameraXConfig.Builder#setCameraExecutor()
should allow full control over the threads being used by the CameraX camera stack. (I7bf32, b/121160431)Bug Fixes
ImageAnalysis
where the ImageProxy
is accessed after the ImageReaderProxy
has been closed. This also makes it so that all ImageProxy
received by the Analyzer
must be closed before the ImageReaderProxy
will be closed. (I4b299, b/145956416, b/154155377, b/156357269)CameraInfo
parameter from PreviewView#createSurfaceProvider()
, PreviewView
now internally retrieves it from the SurfaceRequest
. (If18f0, b/154652477)ImageAnalysis
where multiple calls to setAnalyzer/clearAnalyzer resulted in the analyzer not receiving images to analyze. (I6169f, b/151605317, b/153514544)ImageProxy
from ImageCapture
was not rewound (I0c455, b/153249512)CameraManager
is not always selected to use. (I4c624, b/153418028)Preview.SurfaceProvider
not releasing the previously requested surface. “java.lang.IllegalStateException: Camera surface session should only fail with request cancellation”
(I8e4e7, b/155936225) april fifteen, 2020
androidx.camera:camera-camera2:1.0.0-beta03
be publish. version 1.0.0-beta03 incorporate these commit .
Bug Fixes
camera-core
april fifteen, 2020
androidx.camera:camera-core:1.0.0-beta03
be let go of. adaptation 1.0.0-beta03 check these perpetrate .
Bug Fixes
bindToLifecycle()
with zero UseCase
s would cause a thrown exception. This prevented retrieval of a Camera
without binding a UseCase
. april one, 2020
androidx.camera:camera-camera2:1.0.0-beta02
be unblock. interpretation 1.0.0-beta02 contain these commit .
Bug Fixes
ImageInfo.getRotationDegrees()
from the ImageProxy
produced by ImageCapture
so that it matches the EXIF orientation rotational value. (Id4281, b/150802561)build.gradle
is no longer required to use the default CameraX/Camera2 implementation. For cases where declaring strict dependencies is required, all CameraX dependencies can now be included in the build file. (I46e88)IllegalArgumentException
issue happening on the devices where the display size is smaller than 640×480. (Ife3f2, b/150506192)bindToLifecycle
so that it only modifies the UseCase if it successfully binds. Previously when calling bindToLifecycle
in order to do resolution calculations the UseCase is updated. Now it no longer needs to update the UseCase to do the calculations (I78d9e) april one, 2020
androidx.camera:camera-core:1.0.0-beta02
equal unblock. adaptation 1.0.0-beta02 check these commit .
Bug Fixes
ImageInfo.getRotationDegrees()
from the ImageProxy
produced by ImageCapture
so that it matches the EXIF orientation rotational value. (Id4281, b/150802561)bindToLifecycle
so that it only modifies the UseCase if it successfully binds. Previously when calling bindToLifecycle
in order to do resolution calculations the UseCase is updated. Now it no longer needs to update the UseCase to do the calculations (I78d9e)Preview
use case’s capture session wasn’t being updated when the preview surface changed after calling Preview.setSurfaceProvider()
more than once. february twenty-six, 2020
androidx.camera:camera-camera2:1.0.0-beta01
be unblock. version 1.0.0-beta01 hold these perpetrate .
Bug Fixes
SurfaceRequest.setSurface(Surface)
toSurfaceRequest.provideSurface(Surface)
, andSurfaceRequest.setWillNotComplete()
toSurfaceRequest.willNotProvideSurface()
. (I224fe)ImageCapture.setTargetRotation()
. (I474ea, b/148763432)CameraXConfig
provider. (I2d6c1) february twenty-six, 2020
androidx.camera:camera-core:1.0.0-beta01
be free. version 1.0.0-beta01 check these perpetrate .
API Changes
ListenableFuture
onSurfaceRequest.provideSurface()
with an Executor
and Callback
. ThisprovideSurface()
and enforces that the provideSurface()
callback cannotSurfaceRequest.Result
object is now usedSurfaceRequest
uses the provided Surface
. (I7854b)SurfaceRequest.setSurface(Surface)
toSurfaceRequest.provideSurface(Surface)
andSurfaceRequest.setWillNotComplete()
toSurfaceRequest.willNotProvideSurface()
. (I224fe)Bug Fixes
ImageCapture.setTargetRotation()
. (I474ea, b/148763432)CameraXConfig
provider. (I2d6c1) february ten, 2020
androidx.camera:camera-camera2:1.0.0-alpha10
cost exhaust. translation 1.0.0-alpha10 hold these invest .
Bug Fixes
INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY
devices by ensuring Surface
s are only retained for duration of use by Camera2. (I9dac2)CONTROL_AE_TARGET_FPS_RANGE
properly. (1224638) february ten, 2020
androidx.camera:camera-core:1.0.0-alpha10
exist secrete. version 1.0.0-alpha10 contain these perpetrate .
API Changes
ImageCapture
to allow saving images to Uri
and OutputStream
. Combined overloaded takePicture
methods into one. Updated test app to use Uri
as the canonical example. (Ia3bec)Preview.PreviewSurfaceProvider
has been renamed to Preview.SurfaceProvider
. SurfaceProvider
s no longer require developers to create their own ListenableFuture
, and providing a Surface
is now done through a new SurfaceRequest
object. The Preview.getPreviewSurfaceProvider()
method has been removed due to its potential for misuse when Preview
is paired with other classes such as PreviewView
. (I20105)getTargetRotation()
and getTargetName()
to Preview
. (Iceee7)getTargetRotation()
, getBackpressureStrategy()
, and getImageQueueDepth()
in ImageAnalysis
. (I9d6d9)getTargetRotation()
and getCaptureMode()
in ImageCapture()
(I5bc17)ImageCapture.OnImageSavedCallback.onError()
and ImageCapture.OnImageCapturedCallback.onError()
have now been replaced by a single argument ImageCaptureException
, which still contains all the information that was previously passed.ImageCapture.OnImageSavedCallback.onImageSaved()
has been removed. (I750d2)Preview
and ImageCapture
classes are now marked final. (I2500b)getZoomRatio()
, getMaxZoomRatio()
,getMinZoomRatio()
, and getLinearZoom()
methods of CameraInfo
merginggetZoomState()
which returns a ZoomState
instance. (Ib19fe)OPTION_TARGET_CLASS
and OPTION_TARGET_NAME
CameraXConfig
as they are intended for internal library use only.CameraXConfig.Builder
. (I96912)Application
in ordercamera-camera2
artifact is includedbuild.gradle
. (I58ff5) (b/146923574) january twenty-two, 2020
androidx.camera:camera-camera2:1.0.0-alpha09
be unblock. adaptation 1.0.0-alpha09 check these give .
API changes
CameraInfo
use Camera2CameraInfo.extractCameraId()
. The following code sample express how to use this :
Camera camera = provider.bindToLifecycle(...);
String cameraId =
Camera2CameraInfo.extractCameraId(camera.getCameraInfo());
The Camera2CameraInfo
class necessitate the ExperimentalCamera2Interop
markerClass .
january twenty-two, 2020
androidx.camera:camera-core:1.0.0-alpha09
equal free. translation 1.0.0-alpha09 contain these commit .
API changes
SurfaceOrientedMeteringPointFactory
parameter useCaseForSurface
wasuseCaseForAspectRatio
and the reference documentation wasFocusMeteringAction.Builder.from()
methods are replaced by the constructorsFocusMeteringAction.Builder()
.DisplayOrientedMeteringPointFactory(android.content.Context, androidx.camera.core.CameraSelector, float, float)
.Display
parameter andMeteringMode
andDisplay
parameter.setZoomRatio
and setLinearZoom
.Bug fixes
ConcurrentModificationException
that could occur when using torchstartFocusMetering
and cancelFocusMetering
APIs now behave as documented, december eighteen, 2019
androidx.camera:camera-camera2:1.0.0-alpha08
be secrete. adaptation 1.0.0-alpha08 hold these invest.
Read more : Quy trình in kỹ thuật số trên vải cotton
Known Issues
09-09 14:04:13.643 10117 26020 26036 E AndroidRuntime: java.lang.IllegalArgumentException: Unsupported session configuration combination
Bug Fixes
API Changes
december eighteen, 2019
androidx.camera:camera-core:1.0.0-alpha08
be turn. version 1.0.0-alpha08 check these commit .
Known Issues
PreviewView
or CameraView
may have the wrong aspect ratio preview. This happens after pause or resume on some FULL devices, such as the Pixel2.Bug Fixes
FocusMeteringAction
and CameraControl
.TorchControl
for enableTorch()
and getTorchState()
.API Changes
rotationDegrees
from class OnImageCaptureCallback
to ImageInfo
.rotationDegrees
from class Analyzer
to ImageInfo
. december four, 2019
androidx.camera:camera-camera2:1.0.0-alpha07
cost release. version 1.0.0-alpha07 of camera-camera2 incorporate these invest
Camera2Config
is now available for use with initializing and configuring a Camera2-based implementation for CameraX. More details on how to use this in initialization are in the camera-core section of the release notes.androidx.camera.camera2.interop.
december four, 2019
androidx.camera:camera-core:1.0.0-alpha07
cost let go of. version 1.0.0-alpha07 of camera-core check these invest
Note that there are some substantial changes in this Alpha release as we prepare for Beta. We recommend you review the deepen and share any feedback you whitethorn have on the CameraX google group. For those developer use CameraX indiana apps that equal on the play shop, we commend wait for the formal beta passing earlier upgrade the library inside your application .
API changes
CameraXConfig.Provider
, and consumption the default Camera2Config
provide aside androidx.camera.camera2
. ampere typical use be :
import androidx.camera.camera2.Camera2Config
import androidx.camera.core.CameraXConfig
public class MyCameraXApplication : Application(), CameraXConfig.Provider {
override fun getCameraXConfig(): CameraXConfig {
return Camera2Config.defaultConfig(this)
}
}
bindToLifecycle()
, unbind()
, unbindAll()
, isBound()
, and hasCamera()
previously supply aside the CameraX class call be now available via the ProcessCameraProvider
.ProcessCameraProvider
be receive asynchronously use the static method acting ProcessCameraProvider.getInstance()
, which recurrence ampere listenable future, which provide the ProcessCameraProvider
on completion. here information technology be prove indiana onCreate()
for angstrom typical custom. You displace place call to getInstance()
late inch the activeness ’ south lifecycle to submit low-level formatting latency to vitamin a late time ( such equally when a user action open angstrom camera UI ) .
import androidx.camera.lifecycle.ProcessCameraProvider
import com.google.common.util.concurrent.ListenableFuture
class MainActivity : AppCompatActivity() {
private lateinit var cameraProviderFuture : ListenableFuture
override fun onCreate(savedInstanceState: Bundle?) {
cameraProviderFuture = ProcessCameraProvider.getInstance(this);
}
ListenableFuture
reelect by getInstance()
. This guarantee the television camera provider displace be retrieve from the Future
without blocking along Future.get()
cameraProviderFuture.addListener(Runnable {
val cameraProvider = cameraProviderFuture.get()
cameraProvider.bindToLifecycle(...)
}, ContextCompat.getMainExecutor(this))
val cameraSelector = CameraSelector.Builder().requireLensFacing(LensFacing.BACK).build()
CameraProvider.bindToLifecycle
be give the lifecycle owner, the camera picker, and practice event, which be then bound to the give lifecycle owner and run for the selected television camera .
cameraProvider.bindToLifecycle(this as LifecycleOwner,
cameraSelector, preview, imageAnalysis)
preview = Preview.Builder().setTargetAspectRatio(AspectRatio.RATIO_16_9).build()
PreviewView
opinion class provide in the camera-view box .
preview.setPreviewSurfaceProvider(previewView.previewSurfaceProvider)
ImageAnalysis
Analyzer method implementation must call image.close()
on received images when finished using them. Otherwise, new images may not be received or the camera may stall, depending on back pressure setting. Refer to the reference docs for details.ImageAnalysis ImageReaderMode
cost now change to angstrom backpressure strategy intdef
.ImageProxy.getImage()
exist score equally experimental. application should annotate custom for model via @androidx.camera.core.ExperimentalGetImage
UIThread
annotation prerequisite for the Analyzer
suffer cost distant .ImageAnalysis.clearAnalyzer()
function be lend for get rid of associate in nursing analyzer .ImageCapture.OnImageCapturedListener
is now ImageCapture.OnImageCapturedCallback
ImageCapture.OnImageSavedListener
is now ImageCapture.OnImageSavedCallback
VideoCapture.OnVideoSavedListener
is now VideoCapture.OnVideoSavedCallback
CameraControl.setLinearZoom()
CameraControl.setZoomRatio()
CameraInfo.getLinearZoom()
CameraInfo.getMaxZoomRatio()
CameraInfo.getZoomRatio()
CameraInfo.hasFlashUnit()
be add to decide if flash/torch hardware be present .CameraInfo.isFlashAvailable()
take be removed. flashlight override flash functionality. more detail constitute included indiana the reference documentation .ImageCapture.Metadata
battlefield cost replace by get/set/is accessors .startFocusMetering
and cancelFocusMetering
now return ListenableFutures
which represent the asynchronous operation of the call .MeteringPoints
be immediately serve vitamin a handle to meter action, and exist grow aside factory. Apps should use the exist factory preferably than customs factory .Fixed issues
CameraControl.enableTorch()
is functional but the returned ListenableFuture
is always an immediate complete(success)
future, even if there is no flash unit. Future versions will fix this to the final behavior: When there is no flash unit, enableTorch(true)
fails immediately (won’t send request to CaptureSession
), and TorchState
remain Off.startFocusAndMetering
and cancelFocusAndMetering
start and cancel focus metering, but return an immediately completed (success)
future not representing the documented behavior. The FocusMeteringResult
from ListenableFuture CameraControl.startFocusAndMetering()
is a fake result which isFocusSuccessful()
and is always “false,” differing from intended, documented behavior.PreviewView
touch events is being developed. For now, apps connecting custom managed surfaces can use the existing metering point factories, and otherwise no touch focus functionality is available for PreviewView
. october nine, 2019
androidx.camera:camera-camera2:1.0.0-alpha06
and androidx.camera:camera-core:1.0.0-alpha06
be exhaust. These exist the perpetrate include indium camera-camera2:1.0.0-alpha06
and these are the commit include in camera-core:1.0.0-alpha06
.
New features
deepen to specify expression ratio :
setTargetAspectRatioMode()
was added and accepts an enum argument. This sets the Aspect Ratio Mode with options RATIO_4_3
or RATIO_16_9
instead of an arbitrary aspect ratio. This closer reflects the fact that only certain aspect ratios are provided from the camera, rather than any arbitrary ratio.
getTargetAspectRatio()
was added to use case config APIs, returning the aspect ratio the use case output is targeted for.setTargetAspectRatio(Rational aspectRatio)
has been changed for ImageCapture to setTargetAspectRatioCustom(Rational aspectRatio)
. When set, the ImageCapture output crops accordingly.executor apis
Preview.setOnPreviewOutputUpdateListener()
API. If the executor is not present for that function, it executes on the main thread.Preview.setOnPreviewOutputUpdateListener
FocusMeteringAction.Builder.setAutoFocusCallback
ImageAnalysis.setAnalyzer
ImageCapture.takePicture
CameraView.takePicture
CameraView.startRecording
VideoCapture.startRecording
CameraInfo add with check dart available and detector rotation apis
CameraInfo
and a getCameraInfo
method, which give up apps to check if deoxyadenosine monophosphate lens facing CameraInfo be available and if angstrom brassy be available on that camera. For case :
try {
CameraInfo cameraInfo = CameraX.getCameraInfo(currentCameraLensFacing);
LiveData isFlashAvailable = cameraInfo.isFlashAvailable();
flashToggle.setVisibility(isFlashAvailable.getValue() ? View.VISIBLE : View.INVISIBLE);
} catch (CameraInfoUnavailableException e) {
Log.w(TAG, "Cannot get flash available information", e);
flashToggle.setVisibility(View.VISIBLE);
}
CameraInfo.getSensorRotationDegrees()
equal add. information technology put up the television camera detector orientation relative to the device ’ sulfur natural orientation, operating room for public toilet, relative to associate in nursing orientation course described by deoxyadenosine monophosphate surface rotation ( which describe associate in nursing orientation relative to natural orientation course ) .API changes and bug fixes
setTargetResolution()
or setTargetAspectRatio()
. Calling both on the same builder returns an error.
setTargetAspectRatio()
based on the application’s UI design. Specific resolutions are based on the use case. For example, preview is near screen resolutions and image capture provides high resolution stills. See the automatic resolutions table for more information.setTargetResolution()
for more specific cases, such as when minimum (to save computation) or maximum resolutions (for processing details) are required.setCallbackHandler()
call from use case configuration APIs. Instead, applications can set the executor as a parameter in various other APIs that set a callback.java.lang.IllegalStateException at Camera$StateCallback.onError
to be thrown when opening the camera.java.lang.IllegalArgumentException: CaptureRequest contains unconfigured Input/Output Surface!
java.lang.IllegalStateException: maxImages (4) has already been acquired, call #close before acquiring more.
september five, 2019
androidx.camera:camera-camera2:1.0.0-alpha05
and androidx.camera:camera-core:1.0.0-alpha05
be free. These be the invest included in camera-camera2:1.0.0-alpha05 and these constitute the give include camera-core:1.0.0-alpha05 .
ImageCapture.UseCaseError
is renamed ImageCapture.ImageCaptureError
VideoCapture.UseCaseError
is renamed VideoCapture.VideoCaptureError
CameraControl
API w/Tap-to-Focus apis
CameraControl
from CameraX for a camera, selected aside lens confront :CameraX.getCameraControl(LensFacing lensFacing)
MeteringPointFactory
, MeteringPoint
, MeteringMode
, and FocusMeteringAction
to melt Tap-to-Focus :
MeteringPointFactory factory = new SensorOrientedMeteringPointFactory(width, height);
MeteringPoint point = factory.createPoint(x, y);
FocusMeteringAction action = FocusMeteringAction.Builder.from(point,
MeteringMode.AF_ONLY)
.addPoint(point2, MeteringMode.AE_ONLY) // could have many
.setAutoFocusCallback(new OnAutoFocusListener(){
public void onFocusCompleted(boolean isSuccess) {
}
})
// auto calling cancelFocusAndMetering in 5 sec.
.setAutoCancelDuration(5, TimeUnit.Second)
.build();
CameraControl
to begin and cancel focus meter :getCameraControl(lensFacing).startFocusAndMetering(action);
getCameraControl(lensFacing).cancelFocusAndMetering();
MeteringPointFactory factory = new TextureViewMeteringPointFactory(textureView);
MeteringPointFactory factory = new DisplayOrientedMeteringPointFactory(context, lensFacing, viewWidth, viewHeight);
IllegalStateException
when they be not. future adaptation will give up use along early togs and guarantee serialization .
CameraX.bindToLifecycle()
CameraX.unbind()
CameraX.unbindAll()
ImageAnalysis.setAnalyzer()
ImageAnalysis.getAnalyzer()
ImageAnalysis.removeAnalyzer()
Preview.removePreviewOutputListener()
Preview.getOnPreviewOutputUpdateListener()
Preview.setOnPreviewOutputUpdateListener()
august seven, 2019
androidx.camera:camera-camera2:1.0.0-alpha04
and androidx.camera:camera-core:1.0.0-alpha04
constitute publish. translation 1.0.0-alpha04 incorporate these commit .
Note: This adaptation be subject along the java eight programming language. please read use coffee eight linguistic process feature to memorize how to consumption information technology in your project .
New Features
transfer to view ratio and solution survival
CameraX ‘s goal be to successfully format a television camera session. This means CameraX compromise along resolution/aspect proportion establish along device capability, indium order to start adenine appropriate seance vitamin a information technology first goal, and sol demand request whitethorn not cost honor. This whitethorn embody due to :
CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP
Although CameraX make and wangle the session, you should constantly check the return image size on the manipulation case output in your code and adjust accordingly .
approximately exchange rich person be name for determine resolution and expression proportion, intend to make the API more clear :
setTargetAspectRatio
or setTargetResolution
calls)ImageAnalysis Non-Blocking mode
ImageReaderMode.ACQUIRE_LATEST_IMAGE
is now non-blocking. It acquires the latest image in the queue, but discards unused images continuously to allow the camera pipeline to avoid blocking.Bug Fixes
java.lang.IllegalStateException: maxImages (2) has already been acquired
setLensFacing
was not called for a use case, resulting in java.lang.IllegalArgumentException: Unable to get camera ID for use case
.checkAndUpdateEglState: invalid current EGLDisplay
july two, 2019
androidx.camera:camera-core:1.0.0-alpha03
and androidx.camera:camera-camera2:1.0.0-alpha03
are free. version 1.0.0-alpha03 hold these commit .
Note: This version be subject along the coffee eight programming lyric. please read manipulation java eight linguistic process have to determine how to use information technology in your project .
API Changes
Camera-Core
Extensions
june five, 2019
androidx.camera:camera-core:1.0.0-alpha02
and androidx.camera:camera-camera2:1.0.0-alpha02
cost free. version 1.0.0-alpha02 contain these perpetrate .
Bug fixes
may seven, 2019
androidx.camera:camera-core:1.0.0-alpha01
and androidx.camera:camera-camera2:1.0.0-alpha01
cost release. adaptation 1.0.0-alpha01 incorporate these give .
october fourteen, 2020
androidx.camera:camera-lifecycle:1.0.0-beta11
be secrete. translation 1.0.0-beta11 contain these perpetrate .
Bug Fixes
.getTargetRotation()
will return Surface.ROTATION_0
september twenty-three, 2020
androidx.camera:camera-lifecycle:1.0.0-beta10
be publish. version 1.0.0-beta10 incorporate these commit .
Bug Fixes
september sixteen, 2020
androidx.camera:camera-lifecycle:1.0.0-beta09
be let go of. version 1.0.0-beta09 check these perpetrate .
august nineteen, 2020
androidx.camera:camera-lifecycle:1.0.0-beta08
be free. version 1.0.0-beta08 contain these commit .
Bug Fixes
Context.getApplicationContext()
. (I3d3c9, b/160817073) july twenty-two, 2020
androidx.camera:camera-lifecycle:1.0.0-beta07
be free. adaptation 1.0.0-beta07 contain these commit .
june twenty-four, 2020
androidx.camera:camera-lifecycle:1.0.0-beta06
be free. version 1.0.0-beta06 incorporate these give .
API Changes
june ten, 2020
androidx.camera:camera-lifecycle:1.0.0-beta05
be publish. adaptation 1.0.0-beta05 contain these perpetrate .
Bug Fixes
InitializationException
contains a CameraUnavailableException
will be set to the ListenableFuture
of the intialization result instead of crashing the application. (I9909a, b/149413835) may twenty-seven, 2020
androidx.camera:camera-lifecycle:1.0.0-beta04
equal turn. adaptation 1.0.0-beta04 control these entrust .
april fifteen, 2020
androidx.camera:camera-lifecycle:1.0.0-beta03
embody free. adaptation 1.0.0-beta03 contain these commit .
Bug Fixes
bindToLifecycle()
with zero UseCase
s would cause a thrown exception. This prevented retrieval of a Camera
without binding a UseCase
.camera-core
february twenty-six, 2020
androidx.camera:camera-lifecycle:1.0.0-beta01
embody secrete. translation 1.0.0-beta01 contain these commit .
Bug Fixes
ProcessCameraProvider
during initialization, a default configuration isApplication
is optional. (I5e395) april one, 2020
androidx.camera:camera-lifecycle:1.0.0-beta02
embody exhaust. version 1.0.0-beta02 control these entrust .
Bug Fixes
camera-camera2:1.0.0-beta02
and camera-core:1.0.0-beta02
artifacts. february ten, 2020
androidx.camera:camera-lifecycle:1.0.0-alpha10
embody turn. version 1.0.0-alpha10 control these commit .
API Changes
@MainThread
annotation to BindToLifecycle, unbind and unbindAll methods. (I990d2) january twenty-two, 2020
androidx.camera:camera-lifecycle:1.0.0-alpha03
be exhaust. adaptation 1.0.0-alpha03 check these commit .
Updates
december eighteen, 2019
androidx.camera:camera-lifecycle:1.0.0-alpha02
equal unblock. translation 1.0.0-alpha02 contain these commit .
Dependency changes
androidx.camera:camera-core:1.0.0-alpha08
. december four, 2019
androidx.camera:camera-lifecycle:1.0.0-alpha01
equal let go of. adaptation 1.0.0-alpha01 of camera-lifecycle incorporate these entrust
API notes
LifeCycleCameraProvider
interface, and an implementation called ProcessCameraProvider
which provides many of the functions of the previous CameraX class in core and is obtained via a getInstance()
method.ProcessCameraProvider
. december fifteen, 2021
androidx.camera:camera-extensions:1.0.0-alpha32
and androidx.camera:camera-view:1.0.0-alpha32
constitute free. version 1.0.0-alpha32 check these perpetrate .
API Changes
@RequiresApi(21)
annotations from the inner classes/interfaces. (I8e286, b/204917951)Bug Fixes
VideoCapture
. CameraX Extensions only support ImageCapture
and Preview
. The VideoCapture
can’t be supported yet. If the app binds VideoCapture
and enables any extension mode, an IllegalArgumentException
will be thrown. (I0d87b)CameraSelector#filter
no longer throws an IllegalArgumentException
when the result set is empty. (I27804)ExtensionsManager#getInstance
API as getInstanceAsync
because it returns ListenableFuture
. The Async suffix of the function name can clearly present that it is an async function. (I279d2)ExtensionsManager#getEstimatedCaptureLatencyRange
API since users can’t know which sizes are supported for the ImageCapture
use case and can’t distinguish whether the returned latency information is for the maximum capture output size or the input resolution parameter. (I74bb2)CameraProvider
parameter of ExtensionsManager
functions to the getInstance()
API. So that the users don’t need to input the CameraProvider
parameter each time when calling the ExtensionsManager
functions. (Ic7e48) november seventeen, 2021
androidx.camera:camera-extensions:1.0.0-alpha31
and androidx.camera:camera-view:1.0.0-alpha31
be secrete. version 1.0.0-alpha31 check these commit .
API Changes
Bug Fixes
october thirteen, 2021
androidx.camera:camera-extensions:1.0.0-alpha30
and androidx.camera:camera-view:1.0.0-alpha30
be free. version 1.0.0-alpha30 contain these commit .
API Changes
Bug Fixes
september twenty-nine, 2021
androidx.camera:camera-extensions:1.0.0-alpha29
and androidx.camera:camera-view:1.0.0-alpha29
equal free. adaptation 1.0.0-alpha29 control these perpetrate .
API Changes
RotationProvider#removeAllListeners()
. Please use RotationProvider#removeListener(...)
instead. (Id9d4a)Bug Fixes
august eighteen, 2021
androidx.camera:camera-extensions:1.0.0-alpha28
and androidx.camera:camera-view:1.0.0-alpha28
be release. version 1.0.0-alpha28 control these invest .
API Changes
Bug Fixes
Extender
classes, ExtensionsErrorListener and related ExtensionsManager APIs. (I3b8c3) july twenty-one, 2021
androidx.camera:camera-extensions:1.0.0-alpha27
and androidx.camera:camera-view:1.0.0-alpha27
cost turn. translation 1.0.0-alpha27 contain these give .
API Changes
CoordinateTransform#getTransform
to CoordinateTransform#transform
and update JavaDoc (I864ae)Bug Fixes
PreviewView PERFORMANCE
mode stretch issue when using it together with Compose UI. (Ie1137, b/183864890) june thirty, 2021
androidx.camera:camera-extensions:1.0.0-alpha26
and androidx.camera:camera-view:1.0.0-alpha26
constitute free. interpretation 1.0.0-alpha26 check these commit .
API Changes
CameraController#getTapToFocusState()
that exposes the latest tap-to-focus result. (Iaccb0)Extender
classes and related APIs. (I329e6) june two, 2021
androidx.camera:camera-extensions:1.0.0-alpha25
and androidx.camera:camera-view:1.0.0-alpha25
be turn. version 1.0.0-alpha25 incorporate these commit .
API Changes
CameraView
. CameraView
has been replaced by CameraController
. Please see the migration guide for how to migrate.: (Id5005)Bug Fixes
ExperimentalUseCaseGroupLifecycle
withExperimentalUseCaseGroup
. (I3b2ef, b/159033688) april twenty-one, 2021
androidx.camera:camera-extensions:1.0.0-alpha24
and androidx.camera:camera-view:1.0.0-alpha24
be release. adaptation 1.0.0-alpha24 hold these commit .
Bug Fixes
@Experimental
with @RequiresOptIn
to experimental APIs. For calling experimental APIs, use androidx.annotation.OptIn
instead of deprecated androidx.annotation.experimental.UseExperimental
. (Iff226) march twenty-four, 2021
androidx.camera:camera-extensions:1.0.0-alpha23
and androidx.camera:camera-view:1.0.0-alpha23
are unblock. adaptation 1.0.0-alpha23 contain these entrust .
API Changes
LifecycleCameraController
instead. See the migration guide (Idac2c)Bug Fixes
february twenty-four, 2021
androidx.camera:camera-extensions:1.0.0-alpha22
and androidx.camera:camera-view:1.0.0-alpha22
be free. translation 1.0.0-alpha22 contain these perpetrate .
API Changes
Bug Fixes
january twenty-seven, 2021
androidx.camera:camera-extensions:1.0.0-alpha21
and androidx.camera:camera-view:1.0.0-alpha21
cost free. version 1.0.0-alpha21 contain these give .
release to back early television camera library artifact .
december sixteen, 2020
androidx.camera:camera-extensions:1.0.0-alpha20
and androidx.camera:camera-view:1.0.0-alpha20
constitute release. translation 1.0.0-alpha20 contain these entrust .
publish to support early camera library artifact .
november eleven, 2020
androidx.camera:camera-extensions:1.0.0-alpha19
and androidx.camera:camera-view:1.0.0-alpha19
be unblock. version 1.0.0-alpha19 contain these perpetrate .
Bug Fixes
@ExperimentalVideo
annotation was introduced to camera-view.@UseExperimental
annotationExperimentalVideo
as the markerClass
. (I6d729) october fourteen, 2020
androidx.camera:camera-extensions:1.0.0-alpha18
be publish. adaptation 1.0.0-alpha18 contain these give .
Bug Fixes
.getTargetRotation()
will return Surface.ROTATION_0
october fourteen, 2020
androidx.camera:camera-view:1.0.0-alpha18
be turn. version 1.0.0-alpha18 contain these entrust .
exhaust to support early camera library artifact .
september twenty-three, 2020
androidx.camera:camera-extensions:1.0.0-alpha17
be let go of. interpretation 1.0.0-alpha17 control these give .
Bug Fixes
september twenty-three, 2020
androidx.camera:camera-view:1.0.0-alpha17
be exhaust. adaptation 1.0.0-alpha17 check these invest .
Bug Fixes
september sixteen, 2020
androidx.camera:camera-extensions:1.0.0-alpha16
embody release. adaptation 1.0.0-alpha16 hold these give .
Bug Fixes
ExtensionsManager
to get an Extensions
object september sixteen, 2020
androidx.camera:camera-view:1.0.0-alpha16
be release. version 1.0.0-alpha16 contain these give .
API Changes
PreviewView#setDeviceRotationForRemoteDisplayMode()
and PreviewView#getDeviceRotationForRemoteDisplayMode()
. The two methods are for customizing preview rotation, when desired rotation is not display rotation, e.g. remote display. To handle the non-display preview rotation now, set the desired rotation with Preview#setTargetRotation()
and the newly added PreviewView#getViewPort(targetRotation)
. (Ib62cc)createSurfaceProvider()
to getSurfaceProvider()
. The method will always return the same instance of Preview.SurfaceProvider. (Iff83c)Bug Fixes
TranformationInfoListener
callback. (I21470)Known Issues
OnClickListener#onClick()
is not invoked when the end user clicks PreviewView. The touch event is mistakenly consumed by PreviewView#onTouchEvent(). The issue will be fixed in the next release.PreviewView#getMeteringPointFactory()
may be wrong if ViewPort is used with PreviewView. august nineteen, 2020
androidx.camera:camera-extensions:1.0.0-alpha15
be free. version 1.0.0-alpha15 incorporate these perpetrate .
Bug Fixes
ExtensionsManager.init()
method now takes in aContext.getApplicationContext()
. ( I3d3c9, b/160817073 )august nineteen, 2020
androidx.camera:camera-view:1.0.0-alpha15
be exhaust. version 1.0.0-alpha15 control these commit .
Bug Fixes
DisplayOrientedMeteringPointFactory
takes in a CameraInfo
CameraSelector
so there is a direct mapping toDisplayOrientedMeteringPointFactory
also take in a CameraInfo
CameraSelector
. (I400c1)TextureViewMeteringPointFactory
. PreviewView
provides a public API (createMeteringPointFactory()
) to create a metering point factory regardless of whether it’s using a TextureView
or SurfaceView
. (Ide693)SURFACE_VIEW
/TEXTURE_VIEW
implementation modes to PERFORMANCE
/COMPATIBLE
. PERFORMANCE
is the old SURFACE_VIEW
mode, and COMPATIBLE
is the old TEXTURE_VIEW
mode. (I0edc2) july twenty-two, 2020
androidx.camera:camera-extensions:1.0.0-alpha14
be release. version 1.0.0-alpha14 hold these invest .
july twenty-two, 2020
androidx.camera:camera-view:1.0.0-alpha14
be release. adaptation 1.0.0-alpha14 control these invest .
june twenty-four, 2020
androidx.camera:camera-extensions:1.0.0-alpha13
equal turn. version 1.0.0-alpha13 check these invest .
Bug Fixes
june twenty-four, 2020
androidx.camera:camera-view:1.0.0-alpha13
be release. translation 1.0.0-alpha13 check these perpetrate .
Bug Fixes
june ten, 2020
androidx.camera:camera-extensions:1.0.0-alpha12
exist free. translation 1.0.0-alpha12 control these commit .
Bug Fixes
InitializationException
contains a CameraUnavailableException
will be set to the ListenableFuture
of the intialization result instead of crashing the application. (I9909a, b/149413835) june ten, 2020
androidx.camera:camera-view:1.0.0-alpha12
be secrete. version 1.0.0-alpha12 contain these commit .
Bug Fixes
PreviewView#getBitmap()
API which returns a Bitmap representation of the content displayed on the preview surface. (I9b500, b/157659818) may twenty-seven, 2020
androidx.camera:camera-extensions:1.0.0-alpha11
exist release. version 1.0.0-alpha11 control these commit .
june ten, 2020
androidx.camera:camera-view:1.0.0-alpha12
equal free. version 1.0.0-alpha12 check these commit .
New Features
API Changes
Bug Fixes
PreviewView#getBitmap()
API which returns a Bitmap representation of the content displayed on the preview surface. (I9b500, b/157659818) may twenty-seven, 2020
androidx.camera:camera-view:1.0.0-alpha11
be free. interpretation 1.0.0-alpha11 incorporate these entrust .
API Changes
PreviewView#getPreviewStreamState
API whichPreviewView#setDeviceRotationForRemoteDisplayMode()
API to provide device rotation for transform calculations if the application is running in remote display mode. (I59b95, b/153514525)Bug Fixes
FULL/LIMITED/LEVEL_3
cameras running android 7.0 and below. Forced use ImplementationMode#TEXTURE_VIEW
mode when the android version is 7.0 or below. (I83e30, b/155085307)CameraInfo
parameter from PreviewView#createSurfaceProvider()
, PreviewView
now internally retrieves it from the SurfaceRequest
. (If18f0, b/154652477)PreviewView
black screen issues when swiped out Preview
fragment and then swiped back in ViewPager2. Also fixed the issue when removeView(previewview)
and then addView(previewView)
. (Iab555, b/149877652, b/147354615)CameraView#takePicture()
API to allow saving images to Uri
and OutputStream
. Update the test app to use Uri
as the canonical example. (Ia2459, b/153607583)ScaleType
attribute. (I08565, b/153015659)CameraView.ScaleType
has been removed. Instead, use PreviewView.ScaleType
to set/get a scale type with CameraView. (Ia8974, b/153014831)PreviewView
a background color by default if it doesn’t already have one. This prevents content behind it from being visible before the preview stream starts. (I09fad) april fifteen, 2020
androidx.camera:camera-extensions:1.0.0-alpha10
be turn. version 1.0.0-alpha10 check these give .
Bug Fixes
april fifteen, 2020
androidx.camera:camera-view:1.0.0-alpha010
equal publish. version 1.0.0-alpha010 incorporate these invest .
Bug Fixes
PreviewView
‘s surfaceView implementation wasn’t working well on certain devices, and would cause the app to crash after resuming preview. (I5ed6b) april one, 2020
androidx.camera:camera-extensions:1.0.0-alpha09
equal free. version 1.0.0-alpha09 incorporate these commit .
Bug Fixes
camera-camera2:1.0.0-beta02
, camera-core:1.0.0-beta02
, and camera-lifecycle:1.0.0-beta02
artifacts april one, 2020 androidx.camera:camera-view:1.0.0-alpha09
cost let go of. version 1.0.0-alpha09 contain these perpetrate .
Known Issues
ImplementationMode.SURFACE_VIEW
with PreviewView
may not work well on certain devices, this is because the SurfaceView
used for preview invalidates its surface when the lifecycle of the window it’s in is stopped, when it restarts, the camera is reopened and may attempt to resume preview before the SurfaceView
‘s surface is valid again. For now, you should use ImplementationMode.TEXTURE_VIEW
.API Changes
PreviewView.setImplementationMode()
to PreviewView.setPreferredImplementationMode()
.PreviewView.getImplementationMode()
to PreviewView.getPreferredImplementationMode()
.PreviewView.getSurfaceProvider()
by PreviewView.createSurfaceProvider(CameraInfo)
, which takes a nullable CameraInfo
instance used to optimize preview by using ImplementationMode.SURFACE_VIEW
whenever possible. If a null instance is passed, or if you set the preferred implementation mode to ImplementationMode.TEXTURE_VIEW
, ImplementationMode.TEXTURE_VIEW
is used internally.preview.setSurfaceProvider(previewView.previewSurfaceProvider)
cameraProvider.bindToLifecycle(lifecycleOwner, cameraSelector, preview)
right now, you can write the follow :
val camera = cameraProvider.bindToLifecycle(lifecycleOwner, cameraSelector, preview)
previewView.preferredImplementationMode = ImplementationMode.TEXTURE_VIEW
preview.setSurfaceProvider(previewView.createSurfaceProvider(camera.cameraInfo))
@UiThread
note hour angle equal add to PreviewView.getSurfaceProvider()
, mean information technology must be call from the independent ribbon. ( I192f3 )PreviewView.setScaleType()
which permit to dress the scale type of the preview. information technology take one of the value in PreviewView.ScaleType
, and default to PreviewView.ScaleType.FILL_CENTER
.PreviewView.getScaleType()
.PreviewView
indiana vitamin a XML layout use the implementationMode
attribute .createMeteringPointFactory()
API to PreviewView to support convert ( ten, y ) in PreviewView
to MeteringPoint
. ( Ib36d7 )Bug Fixes
PreviewView
‘s size changes. (I71101) february twenty-six, 2020
androidx.camera:camera-extensions:1.0.0-alpha08
be exhaust. version 1.0.0-alpha08 control these commit .
february twenty-six, 2020
androidx.camera:camera-view:1.0.0-alpha08
be turn. interpretation 1.0.0-alpha08 contain these commit .
Bug Fixes
ListenableFuture
onSurfaceRequest.provideSurface()
with an Executor
and Callback
. ThisprovideSurface()
and enforces that the provideSurface()
callback cannotSurfaceRequest.Result
object is now usedSurfaceRequest
uses the provided Surface
. (I7854b)SurfaceRequest.setSurface(Surface)
toSurfaceRequest.provideSurface(Surface)
andSurfaceRequest.setWillNotComplete()
toSurfaceRequest.willNotProvideSurface()
. (I224fe)CameraXConfig
provider. (I2d6c1) february ten, 2020
androidx.camera:camera-extensions:1.0.0-alpha07
be release. translation 1.0.0-alpha07 check these invest .
Bug Fixes
ImageCapture.OnImageSavedCallback.onError()
and ImageCapture.OnImageCapturedCallback.onError()
have now been replaced by a single argument ImageCaptureException
, which still contains all the information that was previously passed.ImageCapture.OnImageSavedCallback.onImageSaved()
has been removed. (I750d2) february ten, 2020
androidx.camera:camera-view:1.0.0-alpha07
be unblock. adaptation 1.0.0-alpha07 hold these entrust .
API Changes
PreviewView
‘s TextureView
implementation now sets the TextureView
‘s size to the camera sensor output size before scaling it to fill its parent PreviewView
. If you want the camera preview to fill an entire part of the UI (the whole screen for instance), you should not set the PreviewView
‘s size to a fixed value, or have it wrap its content (by using the attribute “wrap_content
” for example), this may result in the camera preview only filling part of the PreviewView
(if the camera sensor output size is smaller). Instead, you should set the PreviewView
as big as its parent (by using the attribute “match_parent
” for example). (1204869)Bug Fixes
ImageCapture
to allow saving images to Uri
and OutputStream
. Combined overloaded takePicture
methods into one. Updated test app to use Uri
as the canonical example. (Ia3bec)Preview.PreviewSurfaceProvider
has been renamed to Preview.SurfaceProvider
. SurfaceProvider
s no longer require developers to create their own ListenableFuture
, and providing a Surface
is now done through a new SurfaceRequest
object. The Preview.getPreviewSurfaceProvider()
method has been removed due to its potential for misuse when Preview
is paired with other classes such as PreviewView
. (I20105)ImageCapture.OnImageSavedCallback.onError()
and ImageCapture.OnImageCapturedCallback.onError()
have now been replaced by a single argument ImageCaptureException
, which still contains all the information that was previously passed.ImageCapture.OnImageSavedCallback.onImageSaved()
has been removed. (I750d2)getZoomRatio()
, getMaxZoomRatio()
, getMinZoomRatio()
, and getLinearZoom()
methods of CameraInfo
merging into getZoomState()
which returns a ZoomState
instance. (Ib19fe) january twenty-two, 2020
androidx.camera:camera-extensions:1.0.0-alpha06
embody secrete. version 1.0.0-alpha06 check these commit .
Updates
january twenty-two, 2020
androidx.camera:camera-view:1.0.0-alpha06
equal secrete. version 1.0.0-alpha06 check these commit .
Updates
december eighteen, 2019
androidx.camera:camera-extensions:1.0.0-alpha05
be let go of. translation 1.0.0-alpha05 contain these commit .
Bug Fixes
december eighteen, 2019
androidx.camera:camera-view:1.0.0-alpha05
be release. interpretation 1.0.0-alpha05 contain these give .
Known Issues
New Features
PreviewView.TextureViewImplementation
that syncs the SurfaceTexture’s lifecycle with the camera’s usage of the TextureView’s surface. december four, 2019
androidx.camera:camera-extensions:1.0.0-alpha04
exist unblock. translation 1.0.0-alpha04 of camera-extensions hold these perpetrate
API changes
CameraSelector
arsenic associate in nursing input parameter. This necessitate to be the same CameraSelector
that be use for bind the use case .
val cameraSelector = CameraSelector.DEFAULT_BACK_CAMERA
val builder = ImageCapture.Builder()
val bokehImageCaptureExtender = BokehImageCaptureExtender.create(builder)
if (bokehImageCaptureExtender.isExtensionAvailable(cameraSelector)) {
bokehImageCaptureExtender.enableExtension(cameraSelector)
}
val imageCapture = builder.build()
mCameraProvider?.bindToLifecycle(this, cameraSelector, imageCapture)
val availability = ExtensionsManager.init()
Futures.addCallback(
availability,
object : FutureCallback {
override fun onSuccess(availability: ExtensionsManager.ExtensionsAvailability?) {
// Ready to make extensions calls
}
override fun onFailure(throwable: Throwable) {
// Extensions could not be initialized
}
},
Executors.newSingleThreadExecutor()
)
december four, 2019
androidx.camera:camera-view:1.0.0-alpha04
be free. translation 1.0.0-alpha04 of camera-view contain these commit
API changes
PreviewView
class is provided for easily displaying the output from the Preview use case in an application.PreviewView
toilet embody admit inch the layout :
PreviewView
provide vitamin a PreviewSurfaceProvider
to easily connect adenine preview manipulation subject
preview.setPreviewSurfaceProvider(previewView.previewSurfaceProvider)
ZoomLevel
” constitute now “ ZoomRatio
” in API-naming october nine, 2019
androidx.camera:camera-extensions:1.0.0-alpha03
and androidx.camera:camera-view:1.0.0-alpha03
equal turn. These exist the perpetrate included in camera-extensions:1.0.0-alpha03
and these be the commit include indiana camera-view:1.0.0-alpha03
.
New Features
september five, 2019
androidx.camera:camera-extensions:1.0.0-alpha02
and androidx.camera:camera-view:1.0.0-alpha02
be turn. These be the commit include inch camera-extensions:1.0.0-alpha02 and these equal the give included camera-view:1.0.0-alpha02 .
PreviewImageProcessorImpl
has correctly implementedExtensionTest
test failure on Nexus 5 (API level 21) and ensure preview androidx.camera:camera-extensions:1.0.0-alpha01
and androidx.camera:camera-view:1.0.0-alpha01
be release. These be the commit admit in camera-extensions:1.0.0-alpha01 and these be the entrust admit camera-view:1.0.0-alpha01