API Change: Renamed use case error variables:
ImageCapture.UseCaseError is renamed ImageCapture.ImageCaptureError
VideoCapture.UseCaseError is renamed VideoCapture.VideoCaptureError
CameraControl API w/ Tap-to-Focus
Added API to get a CameraControl from CameraX for a camera, selected by lens facing:
CameraX.getCameraControl(LensFacing)
Added MeteringPointFactory, MeteringPoint, MeteringMode and MeteringAction to run tap-to-focus:
MeteringPointFactory factory = new SensorOrientedMeteringPointFactory(width, height);
MeteringPoint point = factory.createPoint(x, y);
MeteringAction action = MeteringAction.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 & 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 the following methods are called on the Main (UI) thread, by throwing an IllegalStateException if otherwise. 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 which do not support AF/AE/AWB settings.
Fix crash bug on rotation while analyzing image.
Fixed bug where preview appears black on start (no camera data), after rotation or switching between front & 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
The commits included in this version can be found here [Extensions / View]
Added tests to verify PreviewImageProcessorImpl has correctly implemented timestamps
Fix ExtensionTest test failure on Nexus 5 API21 and ensure preview is available
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();