Compartilhar via


OutputConfiguration Constructors

Definition

Overloads

OutputConfiguration(Surface)

Create a new OutputConfiguration instance with a Surface.

OutputConfiguration(Size, Class)

Create a new OutputConfiguration instance, with desired Surface size and Surface source class.

OutputConfiguration(Int32, Surface)

Create a new OutputConfiguration instance with a Surface, with a surface group ID.

OutputConfiguration(Surface)

Create a new OutputConfiguration instance with a Surface.

[Android.Runtime.Register(".ctor", "(Landroid/view/Surface;)V", "", ApiSince=24)]
public OutputConfiguration (Android.Views.Surface surface);
[<Android.Runtime.Register(".ctor", "(Landroid/view/Surface;)V", "", ApiSince=24)>]
new Android.Hardware.Camera2.Params.OutputConfiguration : Android.Views.Surface -> Android.Hardware.Camera2.Params.OutputConfiguration

Parameters

surface
Surface

A Surface for camera to output to.

        &lt;p&gt;This constructor creates a default configuration, with a surface group ID of
        <code data-dev-comment-type="c">#SURFACE_GROUP_ID_NONE</code>.&lt;/p&gt;
Attributes

Remarks

Create a new OutputConfiguration instance with a Surface.

Java documentation for android.hardware.camera2.params.OutputConfiguration.OutputConfiguration(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

OutputConfiguration(Size, Class)

Create a new OutputConfiguration instance, with desired Surface size and Surface source class.

[Android.Runtime.Register(".ctor", "(Landroid/util/Size;Ljava/lang/Class;)V", "", ApiSince=26)]
public OutputConfiguration (Android.Util.Size surfaceSize, Java.Lang.Class klass);
[<Android.Runtime.Register(".ctor", "(Landroid/util/Size;Ljava/lang/Class;)V", "", ApiSince=26)>]
new Android.Hardware.Camera2.Params.OutputConfiguration : Android.Util.Size * Java.Lang.Class -> Android.Hardware.Camera2.Params.OutputConfiguration

Parameters

surfaceSize
Size

Size for the deferred surface.

klass
Class

a non-nullClass object reference that indicates the source of this surface. Only android.view.SurfaceHolder SurfaceHolder.class and android.graphics.SurfaceTexture SurfaceTexture.class are supported.

Attributes

Remarks

Create a new OutputConfiguration instance, with desired Surface size and Surface source class.

This constructor takes an argument for desired Surface size and the Surface source class without providing the actual output Surface. This is used to setup an output configuration with a deferred Surface. The application can use this output configuration to create a session.

However, the actual output Surface must be set via #addSurface and the deferred Surface configuration must be finalized via CameraCaptureSession#finalizeOutputConfigurations before submitting a request with this Surface target. The deferred Surface can only be obtained either from android.view.SurfaceView by calling android.view.SurfaceHolder#getSurface, or from android.graphics.SurfaceTexture via android.view.Surface#Surface(android.graphics.SurfaceTexture)).

Java documentation for android.hardware.camera2.params.OutputConfiguration.OutputConfiguration(android.util.Size, java.lang.Class<T>).

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

OutputConfiguration(Int32, Surface)

Create a new OutputConfiguration instance with a Surface, with a surface group ID.

[Android.Runtime.Register(".ctor", "(ILandroid/view/Surface;)V", "", ApiSince=24)]
public OutputConfiguration (int surfaceGroupId, Android.Views.Surface surface);
[<Android.Runtime.Register(".ctor", "(ILandroid/view/Surface;)V", "", ApiSince=24)>]
new Android.Hardware.Camera2.Params.OutputConfiguration : int * Android.Views.Surface -> Android.Hardware.Camera2.Params.OutputConfiguration

Parameters

surfaceGroupId
Int32

A group ID for this output, used for sharing memory between multiple outputs.

surface
Surface

A Surface for camera to output to.

Attributes

Remarks

Create a new OutputConfiguration instance with a Surface, with a surface group ID.

A surface group ID is used to identify which surface group this output surface belongs to. A surface group is a group of output surfaces that are not intended to receive camera output buffer streams simultaneously. The CameraDevice may be able to share the buffers used by all the surfaces from the same surface group, therefore may reduce the overall memory footprint. The application should only set the same set ID for the streams that are not simultaneously streaming. A negative ID indicates that this surface doesn't belong to any surface group. The default value is #SURFACE_GROUP_ID_NONE.

For example, a video chat application that has an adaptive output resolution feature would need two (or more) output resolutions, to switch resolutions without any output glitches. However, at any given time, only one output is active to minimize outgoing network bandwidth and encoding overhead. To save memory, the application should set the video outputs to have the same non-negative group ID, so that the camera device can share the same memory region for the alternating outputs.

It is not an error to include output streams with the same group ID in the same capture request, but the resulting memory consumption may be higher than if the two streams were not in the same surface group to begin with, especially if the outputs have substantially different dimensions.

Java documentation for android.hardware.camera2.params.OutputConfiguration.OutputConfiguration(int, 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