使用createcapturesession(SessionConfiguration)创建捕获会话
最近在学习camera2的时候发现原本的
createCaptureSession(@NonNull List outputs,
@NonNull CameraCaptureSession.StateCallback callback, @Nullable Handler handler)
@Deprecated
public abstract void createCaptureSession(@NonNull List<Surface> outputs,
@NonNull CameraCaptureSession.StateCallback callback, @Nullable Handler handler)
throws CameraAccessException;
已不推荐使用,android开发者文档那边也没有更新,因此写一篇博客记录一下新的方法
public void createCaptureSession(
SessionConfiguration config) throws CameraAccessException {
throw new UnsupportedOperationException("No default implementation");
}
让我们先看一下SessionConfiguration的源码
/**
* Create a new {@link SessionConfiguration}.
*
* @param sessionType The session type.
* @param outputs A list of output configurations for the capture session.
* @param executor The executor which should be used to invoke the callback. In general it is