camera/camera-camera2/src/main/java/androidx/camera/camera2/internal/SynchronizedCaptureSessionOpener.java
/**
     * Opens the SynchronizedCaptureSession.
     *
     * <p>The behavior of this method similar to the
     * {@link CameraDevice#createCaptureSession(SessionConfiguration)}. It will use the
     * input cameraDevice to create the SynchronizedCaptureSession.
     *
     * <p>The {@link SessionConfigurationCompat} object that is needed in this method should be
     * created via the {@link #createSessionConfigurationCompat}.
     *
     * <p>The use count of the input DeferrableSurfaces will be increased. It will be
     * automatically decreased when the surface is not used by the camera. For instance, when the
     * opened SynchronizedCaptureSession is closed completely or when the configuration of the
     * session is failed.
     *
     * <p>Cancellation of the returned future is a no-op. The opening task can only be
     * cancelled by the {@link #stop()}. The {@link #stop()} only effective when the
     * CameraDevice#createCaptureSession() hasn't been invoked. If the {@link #stop()} is called
     * before the CameraDevice#createCaptureSession(), it will stop the
     * SynchronizedCaptureSession creation.
     * Otherwise, the SynchronizedCaptureSession will be created and the
     * {@link SynchronizedCaptureSession.StateCallback#onConfigured} or
     * {@link SynchronizedCaptureSession.StateCallback#onConfigureFailed} callback will be invoked.
     *
     * @param cameraDevice               the camera with which to generate the
     *                                   SynchronizedCaptureSession
     * @param sessionConfigurationCompat A {@link SessionConfigurationCompat} that is created via
     *                                   the {@link #createSessionConfigurationCompat}.
     * @param deferrableSurfaces         the list of the DeferrableSurface that be used to
     *                                   configure the session.
     * @return a ListenableFuture object which completes when the SynchronizedCaptureSession is
     * configured.
     * @see #createSessionConfigurationCompat(int, List, SynchronizedCaptureSession.StateCallback)
     * @see #stop()
     */


The  SessionConfigurationCompat object that is needed in this method should be
created via the  #createSessionConfigurationCompat.

The use count of the input DeferrableSurfaces will be increased. It will be
automatically decreased when the surface is not used by the camera. For instance, when the
opened SynchronizedCaptureSession is closed completely or when the configuration of the
session is failed.

Cancellation of the returned future is a no-op. The opening task can only be
cancelled by the  #stop(). The  #stop() only effective when the
CameraDevice#createCaptureSession() hasn't been invoked. If the  #stop() is called
before the CameraDevice#createCaptureSession(), it will stop the
SynchronizedCaptureSession creation.

@param cameraDevice               the camera with which to generate the
SynchronizedCaptureSession
@param sessionConfigurationCompat A  SessionConfigurationCompat that is created via
the  #createSessionConfigurationCompat.
@param deferrableSurfaces         the list of the DeferrableSurface that be used to
configure the session.
@return a ListenableFuture object which completes when the SynchronizedCaptureSession is
configured.
The SessionConfigurationCompat object that is needed in this method should be created via the #createSessionConfigurationCompat . The use count of the input DeferrableSurfaces will be increased . It will be automatically decreased when the surface is not used by the camera . For instance when the opened SynchronizedCaptureSession is closed completely or when the configuration of the session is failed . Cancellation of the returned future is a no - op . The opening task can only be cancelled by the #stop () . The #stop () only effective when the CameraDevice#createCaptureSession () hasn ' t been invoked . If the #stop () is called before the CameraDevice#createCaptureSession () it will stop the SynchronizedCaptureSession creation . @param cameraDevice the camera with which to generate the SynchronizedCaptureSession @param sessionConfigurationCompat A SessionConfigurationCompat that is created via the #createSessionConfigurationCompat . @param deferrableSurfaces the list of the DeferrableSurface that be used to configure the session . @return a ListenableFuture object which completes when the SynchronizedCaptureSession is configured .
@NonNull
    ListenableFuture<Void> openCaptureSession(@NonNull CameraDevice cameraDevice,
            @NonNull SessionConfigurationCompat sessionConfigurationCompat,
            @NonNull List<DeferrableSurface> deferrableSurfaces) {
        return mImpl.openCaptureSession(cameraDevice, sessionConfigurationCompat,
                deferrableSurfaces);
    }
@ NonNull ListenableFuture < Void > openCaptureSession ( @ NonNull CameraDevice cameraDevice , @ NonNull SessionConfigurationCompat sessionConfigurationCompat , @ NonNull List < DeferrableSurface > deferrableSurfaces ) { return mImpl . openCaptureSession ( cameraDevice , sessionConfigurationCompat , deferrableSurfaces ) ; }
Opens the SynchronizedCaptureSession.
Opens the SynchronizedCaptureSession .