android camera2 createCaptureSession deprecated

Viewed 3190

CameraDevice.createCaptureSession is mostly deprecated. Any example on how to use the left over version method with the SessionConfiguration argument (and there especially the executor argument), would be nice.

Currently I have:

cameraDevice.createCaptureSession(surfaceList, mCameraSessionListener, mCameraHandler);
1 Answers

If you do not want to use any executor capabilites you can use a HandlerExecutor:

SessionConfiguration sessionConfiguration = new SessionConfiguration(SessionConfiguration.SESSION_REGULAR, Collections.singletonList(outputConfiguration), new HandlerExecutor(mCameraHandler.getLooper()), mCameraSessionListener);
cameraDevice.createCaptureSession(sessionConfiguration);
Related