CameraDevice.CreateExtensionSession(ExtensionSessionConfiguration) Method

Definition

Initialize a specific device-specific extension augmented camera capture session.

[Android.Runtime.Register("createExtensionSession", "(Landroid/hardware/camera2/params/ExtensionSessionConfiguration;)V", "GetCreateExtensionSession_Landroid_hardware_camera2_params_ExtensionSessionConfiguration_Handler", ApiSince=31)]
public virtual void CreateExtensionSession (Android.Hardware.Camera2.Params.ExtensionSessionConfiguration extensionConfiguration);
[<Android.Runtime.Register("createExtensionSession", "(Landroid/hardware/camera2/params/ExtensionSessionConfiguration;)V", "GetCreateExtensionSession_Landroid_hardware_camera2_params_ExtensionSessionConfiguration_Handler", ApiSince=31)>]
abstract member CreateExtensionSession : Android.Hardware.Camera2.Params.ExtensionSessionConfiguration -> unit
override this.CreateExtensionSession : Android.Hardware.Camera2.Params.ExtensionSessionConfiguration -> unit

Parameters

extensionConfiguration
ExtensionSessionConfiguration

extension configuration

Attributes

Remarks

Initialize a specific device-specific extension augmented camera capture session.

Extension sessions can be used to enable device-specific operation modes like CameraExtensionCharacteristics#EXTENSION_NIGHT or CameraExtensionCharacteristics#EXTENSION_HDR. These modes are less flexible than the full camera API, but enable access to more sophisticated processing algorithms that can capture multi-frame bursts to generate single output images. To query for available extensions on this device call CameraExtensionCharacteristics#getSupportedExtensions().

This method will also trigger the setup of the internal processing pipeline for extension augmented preview and multi-frame still capture.

If a prior CameraCaptureSession already exists when this method is called, the previous session will no longer be able to accept new capture requests and will be closed. Any in-progress capture requests made on the prior session will be completed before it's closed.

The CameraExtensionSession will be active until the client either calls CameraExtensionSession.close() or creates a new camera capture session. In both cases all internal resources will be released, continuous repeating requests stopped and any pending multi-frame capture requests flushed.

Note that the CameraExtensionSession currently supports at most wo multi frame capture surface formats: ImageFormat.JPEG will be supported by all extensions and ImageFormat.YUV_420_888 may or may not be supported. Clients must query the multi-frame capture format support using CameraExtensionCharacteristics#getExtensionSupportedSizes(int, int). For repeating requests CameraExtensionSession supports only android.graphics.SurfaceTexture as output. Clients can query the supported resolution for the repeating request output using CameraExtensionCharacteristics#getExtensionSupportedSizes(int, Class) getExtensionSupportedSizes(..., Class).

At the very minimum the initialization expects either one valid output surface for repeating or one valid output for high-quality single requests registered in the outputs argument of the extension configuration argument. At the maximum the initialization will accept two valid output surfaces, one for repeating and the other for single requests. Additional unsupported surfaces passed to ExtensionSessionConfiguration will cause an IllegalArgumentException to be thrown.

Java documentation for android.hardware.camera2.CameraDevice.createExtensionSession(android.hardware.camera2.params.ExtensionSessionConfiguration).

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