CameraX Release Notes for September 2019

268 views
Skip to first unread message

Eric Ng

unread,
Aug 29, 2019, 6:49:37 PM8/29/19
to
Hello Everyone,

The CameraX team is excited to share with you some of the things we're currently working on. Please find the release notes for the upcoming Jetpack/AndroidX release notes for Camera [Camera2, Core, Extension, and View]. Libraries should be live on Google Maven within the next week. Thank you!

-Eric on behalf of the CameraX Team

CameraX: Camera2 and Core Version 1.0.0-alpha05


The commits included in this version can be found here [Camera2 / Core]

  • 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


CameraX Extensions and View Version 1.0.0-alpha02

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

Eric Ng

unread,
Aug 30, 2019, 11:41:01 AM8/30/19
to
Hello,

Apologies, we have one minor correction below:

Changes:
  • MeteringActions was renamed to FocusMeteringAction; as shown below:
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();

Thanks!
--
-Eric Ng
Reply all
Reply to author
Forward
0 new messages