Udostępnij za pośrednictwem


CameraCaptureSession.FinalizeOutputConfigurations Method

Definition

Finalize the output configurations that now have their deferred and/or extra Surfaces included.

[Android.Runtime.Register("finalizeOutputConfigurations", "(Ljava/util/List;)V", "GetFinalizeOutputConfigurations_Ljava_util_List_Handler", ApiSince=26)]
public abstract void FinalizeOutputConfigurations (System.Collections.Generic.IList<Android.Hardware.Camera2.Params.OutputConfiguration>? outputConfigs);
[<Android.Runtime.Register("finalizeOutputConfigurations", "(Ljava/util/List;)V", "GetFinalizeOutputConfigurations_Ljava_util_List_Handler", ApiSince=26)>]
abstract member FinalizeOutputConfigurations : System.Collections.Generic.IList<Android.Hardware.Camera2.Params.OutputConfiguration> -> unit

Parameters

outputConfigs
IList<OutputConfiguration>

a list of OutputConfiguration OutputConfigurations that have had OutputConfiguration#addSurface addSurface invoked with a valid output Surface after CameraDevice#createCaptureSessionByOutputConfigurations.

Attributes

Remarks

Finalize the output configurations that now have their deferred and/or extra Surfaces included.

For camera use cases where a preview and other output configurations need to be configured, it can take some time for the preview Surface to be ready. For example, if the preview Surface is obtained from android.view.SurfaceView, the SurfaceView will only be ready after the UI layout is done, potentially delaying camera startup.

To speed up camera startup time, the application can configure the CameraCaptureSession with the eventual preview size (via OutputConfiguration#OutputConfiguration(Size,Class) a deferred OutputConfiguration), and defer the preview output configuration until the Surface is ready. After the CameraCaptureSession is created successfully with this deferred output and other normal outputs, the application can start submitting requests as long as they do not include deferred output Surfaces. Once a deferred Surface is ready, the application can add the Surface to the deferred output configuration with the OutputConfiguration#addSurface method, and then update the deferred output configuration via this method, before it can submit capture requests with this output target.

This function can also be called in case where multiple surfaces share the same OutputConfiguration, and one of the surfaces becomes available after the CameraCaptureSession is created. In that case, the application must first create the OutputConfiguration with the available Surface, then enable further surface sharing via OutputConfiguration#enableSurfaceSharing, before creating the CameraCaptureSession. After the CameraCaptureSession is created, and once the extra Surface becomes available, the application must then call OutputConfiguration#addSurface before finalizing the configuration with this method.

If the provided OutputConfigurations are unchanged from session creation, this function call has no effect. This function must only be called once for a particular output configuration.

The output Surfaces included by this list of OutputConfiguration OutputConfigurations can be used as CaptureRequest targets as soon as this call returns.

This method is not supported by CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY LEGACY-level devices.

Java documentation for android.hardware.camera2.CameraCaptureSession.finalizeOutputConfigurations(java.util.List<android.hardware.camera2.params.OutputConfiguration>).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to