Added in API level 29

MandatoryStreamInformation


class MandatoryStreamInformation
kotlin.Any
   ↳ android.hardware.camera2.params.MandatoryStreamCombination.MandatoryStreamInformation

Immutable class to store available mandatory stream information.

Summary

Public methods
Boolean
equals(other: Any?)

Check if this MandatoryStreamInformation is equal to another MandatoryStreamInformation.

Int

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

MutableList<Size!>

Return the list of available sizes for this mandatory stream.

Int

Retrieve the mandatory stream format.

Long

Retrieve the mandatory stream use case.

Int

Returns a hash code value for the object.

Boolean

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

Boolean

Confirms whether or not this is an input stream.

Boolean

Confirms whether or not this is a maximum size stream.

Boolean

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

Public methods

equals

Added in API level 29
fun equals(other: Any?): Boolean

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 the reference object with which to compare.
Return
Boolean true if the objects were equal, false otherwise

get10BitFormat

Added in API level 33
fun get10BitFormat(): Int

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.

Return
Int integer format. Value is android.graphics.ImageFormat#UNKNOWN, android.graphics.PixelFormat#RGBA_8888, android.graphics.PixelFormat#RGBX_8888, android.graphics.PixelFormat#RGB_888, android.graphics.ImageFormat#RGB_565, android.graphics.ImageFormat#YV12, android.graphics.ImageFormat#Y8, android.graphics.ImageFormat.Y16, android.graphics.ImageFormat#YCBCR_P010, android.graphics.ImageFormat#YCBCR_P210, android.graphics.ImageFormat#NV16, android.graphics.ImageFormat#NV21, android.graphics.ImageFormat#YUY2, android.graphics.ImageFormat#JPEG, android.graphics.ImageFormat#DEPTH_JPEG, android.graphics.ImageFormat#YUV_420_888, android.graphics.ImageFormat#YUV_422_888, android.graphics.ImageFormat#YUV_444_888, android.graphics.ImageFormat#FLEX_RGB_888, android.graphics.ImageFormat#FLEX_RGBA_8888, android.graphics.ImageFormat#RAW_SENSOR, android.graphics.ImageFormat#RAW_PRIVATE, android.graphics.ImageFormat#RAW10, android.graphics.ImageFormat#RAW12, android.graphics.ImageFormat#DEPTH16, android.graphics.ImageFormat#DEPTH_POINT_CLOUD, android.graphics.ImageFormat.RAW_DEPTH, android.graphics.ImageFormat.RAW_DEPTH10, android.graphics.ImageFormat#PRIVATE, android.graphics.ImageFormat#HEIC, android.graphics.ImageFormat.HEIC_ULTRAHDR, or android.graphics.ImageFormat#JPEG_R
Exceptions
java.lang.UnsupportedOperationException in case the stream is not capable of 10-bit output

getAvailableSizes

Added in API level 29
fun getAvailableSizes(): MutableList<Size!>

Return the list of available sizes for this mandatory stream.

Per documented android.hardware.camera2.CameraDevice#createCaptureSession 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 android.hardware.camera2.CameraDevice#createCaptureSession or CameraDevice.CameraDeviceSetup.isSessionConfigurationSupported.

Return
MutableList<Size!> non-modifiable ascending list of available sizes. This value cannot be null.

hashCode

Added in API level 29
fun hashCode(): Int

Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by java.util.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.
Return
Int a hash code value for this object.

is10BitCapable

Added in API level 33
fun is10BitCapable(): Boolean

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 android.hardware.camera2.params.OutputConfiguration#setDynamicRangeProfile 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 android.view.SurfaceView, android.view.TextureView, android.media.MediaRecorder, android.media.MediaCodec etc.) or ImageFormat.YCBCR_P010.

Return
Boolean true if stream is able to output 10-bit pixels

isInput

Added in API level 29
fun isInput(): Boolean

Confirms whether or not this is an input stream.

Return
Boolean true in case the stream is input, false otherwise.

isMaximumSize

Added in API level 31
fun isMaximumSize(): Boolean

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 android.hardware.camera2.CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP. This maximum size has the same meaning as the 'MAXIMUM' target size documented in the camera capture session android.hardware.camera2.CameraDevice#createCaptureSession.

The application can use a android.hardware.camera2.MultiResolutionImageReader for a maximum size output stream if the camera device supports multi-resolution outputs for the stream's format. See android.hardware.camera2.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 android.hardware.camera2.CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP_MAXIMUM_RESOLUTION instead.

Return
Boolean true if the stream is a maximum size stream.

isUltraHighResolution

Added in API level 31
fun isUltraHighResolution(): Boolean

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 android.hardware.camera2.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 android.hardware.camera2.CaptureRequest.

Return
Boolean true in case the stream is ultra high resolution, false otherwise.