OutputConfiguration.AddSurface(Surface) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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 this function is called before session creation, CameraCaptureSession#finalizeOutputConfigurations doesn't need to be called.
If the OutputConfiguration was constructed by OutputConfiguration#OutputConfiguration(Size, Class), the added surface must be obtained: <ul> <li>from android.view.SurfaceView by calling android.view.SurfaceHolder#getSurface</li> <li>from android.graphics.SurfaceTexture by calling android.view.Surface#Surface(android.graphics.SurfaceTexture)</li> <li>from android.media.MediaRecorder by calling android.media.MediaRecorder#getSurface or android.media.MediaCodec#createPersistentInputSurface</li> <li>from android.media.MediaCodec by calling android.media.MediaCodec#createInputSurface or android.media.MediaCodec#createPersistentInputSurface()</li> </ul>
If the OutputConfiguration was constructed by #OutputConfiguration(int, Size) or its variants, the added surface must be obtained from android.media.ImageReader by calling android.media.ImageReader#getSurface.
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.
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.