MandatoryStreamInformation
class MandatoryStreamInformation
kotlin.Any | |
↳ | android.hardware.camera2.params.MandatoryStreamCombination.MandatoryStreamInformation |
Immutable class to store available mandatory stream information.
Summary
Public methods | |
---|---|
Boolean |
Check if this |
Int |
Retrieve the mandatory stream 10-bit |
MutableList<Size!> |
Return the list of available sizes for this mandatory stream. |
Int |
Retrieve the mandatory stream |
Long |
Retrieve the mandatory stream use case. |
Int |
hashCode() Returns a hash code value for the object. |
Boolean |
Indicates whether this stream is able to support 10-bit output. |
Boolean |
isInput() 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
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
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
.
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
in case the stream is not capable of 10-bit output |
See Also
getAvailableSizes
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 . |
getFormat
fun getFormat(): Int
Retrieve the mandatory stream format
.
getStreamUseCase
fun getStreamUseCase(): Long
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.
hashCode
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 inequals
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 thehashCode
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 thehashCode
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
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
fun isInput(): Boolean
Confirms whether or not this is an input stream.
Return | |
---|---|
Boolean |
true in case the stream is input, false otherwise. |
isMaximumSize
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
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. |