Added in API level 29

MandatoryStreamCombination.MandatoryStreamInformation


public static final class MandatoryStreamCombination.MandatoryStreamInformation
extends Object

java.lang.Object
   ↳ android.hardware.camera2.params.MandatoryStreamCombination.MandatoryStreamInformation


Immutable class to store available mandatory stream information.

Summary

Public methods

boolean equals(Object obj)

Check if this MandatoryStreamInformation is equal to another MandatoryStreamInformation.

int get10BitFormat()

Retrieve the mandatory stream 10-bit format for 10-bit capable streams.

List<Size> getAvailableSizes()

Return the list of available sizes for this mandatory stream.

int getFormat()

Retrieve the mandatory stream format.

long getStreamUseCase()

Retrieve the mandatory stream use case.

int hashCode()

Returns a hash code value for the object.

boolean is10BitCapable()

Indicates whether this stream is able to support 10-bit output.

boolean isInput()

Confirms whether or not this is an input stream.

boolean isMaximumSize()

Confirms whether or not this is a maximum size stream.

boolean isUltraHighResolution()

Confirms whether or not this is an ultra high resolution stream.

Inherited methods

Public methods

equals

Added in API level 29
public boolean equals (Object obj)

Check if this MandatoryStreamInformation is equal to another MandatoryStreamInformation.

Two vectors are only equal if and only if each of the respective elements is equal.

Parameters
obj Object: the reference object with which to compare.

Returns
boolean true if the objects were equal, false otherwise

get10BitFormat

Added in API level 33
public int get10BitFormat ()

Retrieve the mandatory stream 10-bit format for 10-bit capable streams.

In case is10BitCapable() returns true, then this method will return the corresponding 10-bit output Surface pixel format. Depending on the stream type it will be either ImageFormat.PRIVATE or ImageFormat.YCBCR_P010.

Returns
int integer format. Value is ImageFormat.UNKNOWN, PixelFormat.RGBA_8888, PixelFormat.RGBX_8888, PixelFormat.RGB_888, ImageFormat.RGB_565, ImageFormat.YV12, ImageFormat.Y8, android.graphics.ImageFormat.Y16, ImageFormat.YCBCR_P010, ImageFormat.YCBCR_P210, ImageFormat.NV16, ImageFormat.NV21, ImageFormat.YUY2, ImageFormat.JPEG, ImageFormat.DEPTH_JPEG, ImageFormat.YUV_420_888, ImageFormat.YUV_422_888, ImageFormat.YUV_444_888, ImageFormat.FLEX_RGB_888, ImageFormat.FLEX_RGBA_8888, ImageFormat.RAW_SENSOR, ImageFormat.RAW_PRIVATE, ImageFormat.RAW10, ImageFormat.RAW12, ImageFormat.DEPTH16, ImageFormat.DEPTH_POINT_CLOUD, android.graphics.ImageFormat.RAW_DEPTH, android.graphics.ImageFormat.RAW_DEPTH10, ImageFormat.PRIVATE, ImageFormat.HEIC, android.graphics.ImageFormat.HEIC_ULTRAHDR, or ImageFormat.JPEG_R

Throws
UnsupportedOperationException in case the stream is not capable of 10-bit output

See also:

getAvailableSizes

Added in API level 29
public List<Size> getAvailableSizes ()

Return the list of available sizes for this mandatory stream.

Per documented guideline the largest resolution in the result will be tested and guaranteed to work. If clients want to use smaller sizes, then the resulting session configuration can be tested either by calling CameraDevice.createCaptureSession or CameraDevice.CameraDeviceSetup.isSessionConfigurationSupported.

Returns
List<Size> non-modifiable ascending list of available sizes. This value cannot be null.

getFormat

Added in API level 29
public int getFormat ()

Retrieve the mandatory stream format.

Returns
int integer format. Value is ImageFormat.UNKNOWN, PixelFormat.RGBA_8888, PixelFormat.RGBX_8888, PixelFormat.RGB_888, ImageFormat.RGB_565, ImageFormat.YV12, ImageFormat.Y8, android.graphics.ImageFormat.Y16, ImageFormat.YCBCR_P010, ImageFormat.YCBCR_P210, ImageFormat.NV16, ImageFormat.NV21, ImageFormat.YUY2, ImageFormat.JPEG, ImageFormat.DEPTH_JPEG, ImageFormat.YUV_420_888, ImageFormat.YUV_422_888, ImageFormat.YUV_444_888, ImageFormat.FLEX_RGB_888, ImageFormat.FLEX_RGBA_8888, ImageFormat.RAW_SENSOR, ImageFormat.RAW_PRIVATE, ImageFormat.RAW10, ImageFormat.RAW12, ImageFormat.DEPTH16, ImageFormat.DEPTH_POINT_CLOUD, android.graphics.ImageFormat.RAW_DEPTH, android.graphics.ImageFormat.RAW_DEPTH10, ImageFormat.PRIVATE, ImageFormat.HEIC, android.graphics.ImageFormat.HEIC_ULTRAHDR, or ImageFormat.JPEG_R

getStreamUseCase

Added in API level 33
public long getStreamUseCase ()

Retrieve the mandatory stream use case.

If this MandatoryStreamInformation is part of a mandatory stream combination for stream use cases, the return value will be a non-DEFAULT value. For MandatoryStreamInformation belonging to other mandatory stream combinations, the return value will be DEFAULT.

Returns
long the long integer stream use case. Value is CameraMetadata.SCALER_AVAILABLE_STREAM_USE_CASES_DEFAULT, CameraMetadata.SCALER_AVAILABLE_STREAM_USE_CASES_PREVIEW, CameraMetadata.SCALER_AVAILABLE_STREAM_USE_CASES_STILL_CAPTURE, CameraMetadata.SCALER_AVAILABLE_STREAM_USE_CASES_VIDEO_RECORD, CameraMetadata.SCALER_AVAILABLE_STREAM_USE_CASES_PREVIEW_VIDEO_STILL, CameraMetadata.SCALER_AVAILABLE_STREAM_USE_CASES_VIDEO_CALL, or CameraMetadata.SCALER_AVAILABLE_STREAM_USE_CASES_CROPPED_RAW

hashCode

Added in API level 29
public int hashCode ()

Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.

Returns
int a hash code value for this object.

is10BitCapable

Added in API level 33
public boolean is10BitCapable ()

Indicates whether this stream is able to support 10-bit output.

10-bit capable streams can be configured to output 10-bit sample data via calls to OutputConfiguration.setDynamicRangeProfile(long) and selecting the appropriate output Surface pixel format which can be queried via get10BitFormat() and will be either ImageFormat.PRIVATE (the default for Surfaces initialized by SurfaceView, TextureView, MediaRecorder, MediaCodec etc.) or ImageFormat.YCBCR_P010.

Returns
boolean true if stream is able to output 10-bit pixels

isInput

Added in API level 29
public boolean isInput ()

Confirms whether or not this is an input stream.

Returns
boolean true in case the stream is input, false otherwise.

isMaximumSize

Added in API level 31
public boolean isMaximumSize ()

Confirms whether or not this is a maximum size stream.

A stream with maximum size is one with the camera device's maximum resolution for the stream's format as appears in CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP. This maximum size has the same meaning as the 'MAXIMUM' target size documented in the camera capture session guideline.

The application can use a MultiResolutionImageReader for a maximum size output stream if the camera device supports multi-resolution outputs for the stream's format. See CameraCharacteristics.SCALER_MULTI_RESOLUTION_STREAM_CONFIGURATION_MAP for details.

This is different from the ultra high resolution flag, which applies only to ultra high resolution sensor camera devices and refers to a stream in CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP_MAXIMUM_RESOLUTION instead.

Returns
boolean true if the stream is a maximum size stream.

isUltraHighResolution

Added in API level 31
public boolean isUltraHighResolution ()

Confirms whether or not this is an ultra high resolution stream.

An 'ultra high resolution' stream is one which has a configuration which appears in CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP_MAXIMUM_RESOLUTION, Streams which are ultra high resolution must not be included with streams which are not ultra high resolution in the same CaptureRequest.

Returns
boolean true in case the stream is ultra high resolution, false otherwise.