OutputConfiguration Constructors
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.
Overloads
OutputConfiguration(Surface) |
Create a new |
OutputConfiguration(ImageFormatType, Size) |
Create a new |
OutputConfiguration(Size, Class) |
Create a new |
OutputConfiguration(Int32, Surface) |
Create a new |
OutputConfiguration(ImageFormatType, Size, Int64) |
Create a new |
OutputConfiguration(Int32, ImageFormatType, Size) |
Create a new |
OutputConfiguration(Int32, ImageFormatType, Size, Int64) |
Create a new |
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.
<p>This constructor creates a default configuration, with a surface group ID of
<code data-dev-comment-type="c">#SURFACE_GROUP_ID_NONE</code>.</p>
- Attributes
Remarks
Create a new OutputConfiguration
instance with a 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(ImageFormatType, Size)
Create a new OutputConfiguration
instance for an ImageReader
for a given
format and size.
[Android.Runtime.Register(".ctor", "(ILandroid/util/Size;)V", "", ApiSince=35)]
public OutputConfiguration (Android.Graphics.ImageFormatType format, Android.Util.Size surfaceSize);
[<Android.Runtime.Register(".ctor", "(ILandroid/util/Size;)V", "", ApiSince=35)>]
new Android.Hardware.Camera2.Params.OutputConfiguration : Android.Graphics.ImageFormatType * Android.Util.Size -> Android.Hardware.Camera2.Params.OutputConfiguration
Parameters
- format
- ImageFormatType
The format of the ImageReader output. This must be one of the
android.graphics.ImageFormat
or android.graphics.PixelFormat
constants. Note that not all formats are supported by the camera device.
- surfaceSize
- Size
Size for the ImageReader surface.
- Attributes
Remarks
Create a new OutputConfiguration
instance for an ImageReader
for a given format and size.
This constructor creates an OutputConfiguration for an ImageReader without providing the actual output Surface. The actual output Surface must be set via #addSurface
before creating the capture session.
An OutputConfiguration object created by this constructor can be used for CameraDeviceSetup.isSessionConfigurationSupported
and CameraDeviceSetup.getSessionCharacteristics
without having called #addSurface
.
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-null
Class
object reference that indicates the source of
this surface. Only android.view.SurfaceHolder SurfaceHolder.class
,
android.graphics.SurfaceTexture SurfaceTexture.class
, android.media.MediaRecorder MediaRecorder.class
, and
android.media.MediaCodec MediaCodec.class
are supported.
Before android.os.Build.VERSION_CODES#VANILLA_ICE_CREAM Android V
, 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.
Starting from android.os.Build.VERSION_CODES#VANILLA_ICE_CREAM Android V
, the deferred Surface can be obtained: (1) from android.view.SurfaceView
by calling android.view.SurfaceHolder#getSurface
, (2) from android.graphics.SurfaceTexture
via android.view.Surface#Surface(android.graphics.SurfaceTexture)
, (3) from android.media.MediaRecorder
via android.media.MediaRecorder.getSurface
or android.media.MediaCodec#createPersistentInputSurface
, or (4) from android.media.MediaCodce
via android.media.MediaCodec#createInputSurface
or android.media.MediaCodec#createPersistentInputSource
.
<ul> <li>Surfaces for android.view.SurfaceView
and android.graphics.SurfaceTexture
can be deferred until after CameraDevice#createCaptureSession
. In that case, the output Surface must be set via #addSurface
, and the Surface configuration must be finalized via CameraCaptureSession#finalizeOutputConfiguration
before submitting a request with the Surface target.</li> <li>For all other target types, the output Surface must be set by #addSurface
, and CameraCaptureSession#finalizeOutputConfiguration
is not needed because the OutputConfiguration used to create the session will contain the actual Surface.</li> </ul>
Before android.os.Build.VERSION_CODES#VANILLA_ICE_CREAM Android V
, only android.view.SurfaceView
and android.graphics.SurfaceTexture
are supported. Both kind of outputs can be deferred until after CameraDevice#createCaptureSessionByOutputConfiguration
.
An OutputConfiguration object created by this constructor can be used for CameraDeviceSetup.isSessionConfigurationSupported
and CameraDeviceSetup.getSessionCharacteristics
without having called #addSurface
.
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.
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(ImageFormatType, Size, Int64)
Create a new OutputConfiguration
instance for an ImageReader
for a given
format, size, and usage flags.
[Android.Runtime.Register(".ctor", "(ILandroid/util/Size;J)V", "", ApiSince=35)]
public OutputConfiguration (Android.Graphics.ImageFormatType format, Android.Util.Size surfaceSize, long usage);
[<Android.Runtime.Register(".ctor", "(ILandroid/util/Size;J)V", "", ApiSince=35)>]
new Android.Hardware.Camera2.Params.OutputConfiguration : Android.Graphics.ImageFormatType * Android.Util.Size * int64 -> Android.Hardware.Camera2.Params.OutputConfiguration
Parameters
- format
- ImageFormatType
The format of the ImageReader output. This must be one of the
android.graphics.ImageFormat
or android.graphics.PixelFormat
constants. Note that not all formats are supported by the camera device.
- surfaceSize
- Size
Size for the ImageReader surface.
- usage
- Int64
The usage flags of the ImageReader output surface.
- Attributes
Remarks
Create a new OutputConfiguration
instance for an ImageReader
for a given format, size, and usage flags.
This constructor creates an OutputConfiguration for an ImageReader without providing the actual output Surface. The actual output Surface must be set via #addSurface
before creating the capture session.
An OutputConfiguration object created by this constructor can be used for CameraDeviceSetup.isSessionConfigurationSupported
and CameraDeviceSetup.getSessionCharacteristics
without having called #addSurface
.
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, ImageFormatType, Size)
Create a new OutputConfiguration
instance for an ImageReader
for a given
surfaceGroupId, format, and size.
[Android.Runtime.Register(".ctor", "(IILandroid/util/Size;)V", "", ApiSince=35)]
public OutputConfiguration (int surfaceGroupId, Android.Graphics.ImageFormatType format, Android.Util.Size surfaceSize);
[<Android.Runtime.Register(".ctor", "(IILandroid/util/Size;)V", "", ApiSince=35)>]
new Android.Hardware.Camera2.Params.OutputConfiguration : int * Android.Graphics.ImageFormatType * Android.Util.Size -> Android.Hardware.Camera2.Params.OutputConfiguration
Parameters
- surfaceGroupId
- Int32
A group ID for this output, used for sharing memory between multiple outputs.
- format
- ImageFormatType
The format of the ImageReader output. This must be one of the
android.graphics.ImageFormat
or android.graphics.PixelFormat
constants. Note that not all formats are supported by the camera device.
- surfaceSize
- Size
Size for the ImageReader surface.
- Attributes
Remarks
Create a new OutputConfiguration
instance for an ImageReader
for a given surfaceGroupId, format, and size.
This constructor creates an OutputConfiguration for an ImageReader without providing the actual output Surface. The actual output Surface must be set via #addSurface
before creating the capture session.
An OutputConfiguration object created by this constructor can be used for CameraDeviceSetup.isSessionConfigurationSupported
and CameraDeviceSetup.getSessionCharacteristics
without having called #addSurface
.
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, ImageFormatType, Size, Int64)
Create a new OutputConfiguration
instance for an ImageReader
for a given
surface group id, format, size, and usage flags.
[Android.Runtime.Register(".ctor", "(IILandroid/util/Size;J)V", "", ApiSince=35)]
public OutputConfiguration (int surfaceGroupId, Android.Graphics.ImageFormatType format, Android.Util.Size surfaceSize, long usage);
[<Android.Runtime.Register(".ctor", "(IILandroid/util/Size;J)V", "", ApiSince=35)>]
new Android.Hardware.Camera2.Params.OutputConfiguration : int * Android.Graphics.ImageFormatType * Android.Util.Size * int64 -> Android.Hardware.Camera2.Params.OutputConfiguration
Parameters
- surfaceGroupId
- Int32
A group ID for this output, used for sharing memory between multiple outputs.
- format
- ImageFormatType
The format of the ImageReader output. This must be one of the
android.graphics.ImageFormat
or android.graphics.PixelFormat
constants. Note that not all formats are supported by the camera device.
- surfaceSize
- Size
Size for the ImageReader surface.
- usage
- Int64
The usage flags of the ImageReader output surface.
- Attributes
Remarks
Create a new OutputConfiguration
instance for an ImageReader
for a given surface group id, format, size, and usage flags.
This constructor creates an OutputConfiguration for an ImageReader without providing the actual output Surface. The actual output Surface must be set via #addSurface
before creating the capture session.
An OutputConfiguration object created by this constructor can be used for CameraDeviceSetup.isSessionConfigurationSupported
and CameraDeviceSetup.getSessionCharacteristics
without having called #addSurface
.
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.