androidcamera2createCaptureSession 已弃用

Ser*_*sor 4 android android-camera2

CameraDevice.createCaptureSession 大部分已被弃用。有关如何将剩余版本方法与 SessionConfiguration 参数(尤其是执行程序参数)一起使用的任何示例都会很好。

目前我有:

cameraDevice.createCaptureSession(surfaceList, mCameraSessionListener, mCameraHandler);
Run Code Online (Sandbox Code Playgroud)

Ser*_*sor 5

如果您不想使用任何执行程序功能,您可以使用 HandlerExecutor:

SessionConfiguration sessionConfiguration = new SessionConfiguration(SessionConfiguration.SESSION_REGULAR, Collections.singletonList(outputConfiguration), new HandlerExecutor(mCameraHandler.getLooper()), mCameraSessionListener);
cameraDevice.createCaptureSession(sessionConfiguration);
Run Code Online (Sandbox Code Playgroud)