Share via


OutputConfiguration.SetPhysicalCameraId(String) Method

Definition

Set the id of the physical camera for this OutputConfiguration

[Android.Runtime.Register("setPhysicalCameraId", "(Ljava/lang/String;)V", "", ApiSince=28)]
public void SetPhysicalCameraId (string? physicalCameraId);
[<Android.Runtime.Register("setPhysicalCameraId", "(Ljava/lang/String;)V", "", ApiSince=28)>]
member this.SetPhysicalCameraId : string -> unit

Parameters

physicalCameraId
String
Attributes

Remarks

Set the id of the physical camera for this OutputConfiguration

In the case one logical camera is made up of multiple physical cameras, it could be desirable for the camera application to request streams from individual physical cameras. This call achieves it by mapping the OutputConfiguration to the physical camera id.

The valid physical camera ids can be queried by CameraCharacteristics#getPhysicalCameraIds.

Passing in a null physicalCameraId means that the OutputConfiguration is for a logical stream.

This function must be called before CameraDevice#createCaptureSessionByOutputConfigurations or CameraDevice#createReprocessableCaptureSessionByConfigurations. Calling this function after CameraDevice#createCaptureSessionByOutputConfigurations or CameraDevice#createReprocessableCaptureSessionByConfigurations has no effect.

As of android.os.Build.VERSION_CODES#S Android 12, an image buffer from a physical camera stream can be used for reprocessing to logical camera streams and streams from the same physical camera if the camera device supports multi-resolution input and output streams. See CameraCharacteristics#SCALER_MULTI_RESOLUTION_STREAM_CONFIGURATION_MAP for details. The behaviors of reprocessing from a non-physical camera stream to a physical camera stream, and from a physical camera stream to a physical camera stream of different physical camera, are device-specific and not guaranteed to be supported.

On prior API levels, the surface belonging to a physical camera OutputConfiguration must not be used as input or output of a reprocessing request.

Java documentation for android.hardware.camera2.params.OutputConfiguration.setPhysicalCameraId(java.lang.String).

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