共用方式為


OutputConfiguration.AddSurface(Surface) Method

Definition

Add a surface to this OutputConfiguration.

[Android.Runtime.Register("addSurface", "(Landroid/view/Surface;)V", "", ApiSince=26)]
public void AddSurface (Android.Views.Surface surface);
[<Android.Runtime.Register("addSurface", "(Landroid/view/Surface;)V", "", ApiSince=26)>]
member this.AddSurface : Android.Views.Surface -> unit

Parameters

surface
Surface

The surface to be added.

Attributes

Remarks

Add a surface to this OutputConfiguration.

This function can be called before or after CameraDevice#createCaptureSessionByOutputConfigurations. If it's called after, the application must finalize the capture session with CameraCaptureSession#finalizeOutputConfigurations. It is possible to call this method after the output configurations have been finalized only in cases of enabled surface sharing see #enableSurfaceSharing. The modified output configuration must be updated with CameraCaptureSession#updateOutputConfiguration.

If the OutputConfiguration was constructed with a deferred surface by OutputConfiguration#OutputConfiguration(Size, Class), the added surface must be obtained from android.view.SurfaceView by calling android.view.SurfaceHolder#getSurface, or from android.graphics.SurfaceTexture via android.view.Surface#Surface(android.graphics.SurfaceTexture)).

If the OutputConfiguration was constructed by other constructors, the added surface must be compatible with the existing surface. See #enableSurfaceSharing for details of compatible surfaces.

If the OutputConfiguration already contains a Surface, #enableSurfaceSharing must be called before calling this function to add a new Surface.

Java documentation for android.hardware.camera2.params.OutputConfiguration.addSurface(android.view.Surface).

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