Share via


OutputConfiguration.SetMirrorMode(Surface, MirrorMode) Method

Definition

Set the mirroring mode for a surface belonging to this OutputConfiguration

[Android.Runtime.Register("setMirrorMode", "(Landroid/view/Surface;I)V", "", ApiSince=36)]
public void SetMirrorMode(Android.Views.Surface surface, Android.Hardware.Camera2.Params.MirrorMode mirrorMode);
[<Android.Runtime.Register("setMirrorMode", "(Landroid/view/Surface;I)V", "", ApiSince=36)>]
member this.SetMirrorMode : Android.Views.Surface * Android.Hardware.Camera2.Params.MirrorMode -> unit

Parameters

surface
Surface
mirrorMode
MirrorMode
Attributes

Remarks

Set the mirroring mode for a surface belonging to this OutputConfiguration

This function is identical to #setMirrorMode(int) if surface is the only surface belonging to this OutputConfiguration.

If this OutputConfiguration contains a deferred surface, the application can either call #setMirrorMode(int), or call this function after calling #addSurface.

If this OutputConfiguration contains shared surfaces, the application can set different mirroring modes for different surfaces.

For efficiency, the mirror effect is applied as a transform flag, so it is only effective in some outputs. It works automatically for SurfaceView and TextureView outputs. For manual use of SurfaceTexture, it is reflected in the value of android.graphics.SurfaceTexture#getTransformMatrix. For other end points, such as ImageReader, MediaRecorder, or MediaCodec, the mirror mode has no effect. If mirroring is needed for such outputs, the application needs to mirror the image buffers itself before passing them onward.

Java documentation for android.hardware.camera2.params.OutputConfiguration.setMirrorMode(android.view.Surface, int).

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