Compartir a través de


MultiResolutionImageReader Constructors

Definition

Overloads

MultiResolutionImageReader(IntPtr, JniHandleOwnership)
MultiResolutionImageReader(ICollection<MultiResolutionStreamInfo>, Int32, Int32)

Create a new multi-resolution reader based on a group of camera stream properties returned by a camera device.

MultiResolutionImageReader(IntPtr, JniHandleOwnership)

protected MultiResolutionImageReader (IntPtr javaReference, Android.Runtime.JniHandleOwnership transfer);
new Android.Hardware.Camera2.MultiResolutionImageReader : nativeint * Android.Runtime.JniHandleOwnership -> Android.Hardware.Camera2.MultiResolutionImageReader

Parameters

javaReference
IntPtr

nativeint

Applies to

MultiResolutionImageReader(ICollection<MultiResolutionStreamInfo>, Int32, Int32)

Create a new multi-resolution reader based on a group of camera stream properties returned by a camera device.

[Android.Runtime.Register(".ctor", "(Ljava/util/Collection;II)V", "", ApiSince=31)]
public MultiResolutionImageReader (System.Collections.Generic.ICollection<Android.Hardware.Camera2.Params.MultiResolutionStreamInfo> streams, int format, int maxImages);
[<Android.Runtime.Register(".ctor", "(Ljava/util/Collection;II)V", "", ApiSince=31)>]
new Android.Hardware.Camera2.MultiResolutionImageReader : System.Collections.Generic.ICollection<Android.Hardware.Camera2.Params.MultiResolutionStreamInfo> * int * int -> Android.Hardware.Camera2.MultiResolutionImageReader

Parameters

streams
ICollection<MultiResolutionStreamInfo>

The group of multi-resolution stream info, which is used to create a multi-resolution reader containing a number of ImageReader objects. Each ImageReader object represents a multi-resolution stream in the group.

format
Int32

The format of the Image that this multi-resolution reader will produce. This must be one of the android.graphics.ImageFormat or android.graphics.PixelFormat constants. Note that not all formats are supported, like ImageFormat.NV21. The supported multi-resolution reader format can be queried by android.hardware.camera2.params.MultiResolutionStreamConfigurationMap#getOutputFormats.

maxImages
Int32

The maximum number of images the user will want to access simultaneously. This should be as small as possible to limit memory use. Once maxImages images are obtained by the user from any given internal ImageReader, one of them has to be released before a new Image will become available for access through the ImageReader's ImageReader#acquireLatestImage() or ImageReader#acquireNextImage(). Must be greater than 0.

Attributes

Remarks

Create a new multi-resolution reader based on a group of camera stream properties returned by a camera device.

The valid size and formats depend on the camera characteristics. MultiResolutionImageReader for an image format is supported by the camera device if the format is in the supported multi-resolution output stream formats returned by android.hardware.camera2.params.MultiResolutionStreamConfigurationMap#getOutputFormats. If the image format is supported, the MultiResolutionImageReader object can be created with the streams objects returned by android.hardware.camera2.params.MultiResolutionStreamConfigurationMap#getOutputInfo.

The maxImages parameter determines the maximum number of Image objects that can be acquired from each of the ImageReader within the MultiResolutionImageReader. However, requesting more buffers will use up more memory, so it is important to use only the minimum number necessary. The application is strongly recommended to acquire no more than maxImages images from all of the internal ImageReader objects combined. By keeping track of the number of acquired images for the MultiResolutionImageReader, the application doesn't need to do the bookkeeping for each internal ImageReader returned from ImageReader.OnImageAvailableListener#onImageAvailable onImageAvailable callback.

Unlike the normal ImageReader, the MultiResolutionImageReader has a more complex configuration sequence. Instead of passing the same surface to OutputConfiguration and CaptureRequest, the android.hardware.camera2.params.OutputConfiguration#createInstancesForMultiResolutionOutput call needs to be used to create the OutputConfigurations for session creation, and then #getSurface is used to get CaptureRequest.Builder#addTarget the target for CaptureRequest.

Java documentation for android.hardware.camera2.MultiResolutionImageReader.MultiResolutionImageReader(java.util.Collection<android.hardware.camera2.params.MultiResolutionStreamInfo>, int, 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