StreamConfigurationpublic final class StreamConfiguration extends Object Immutable class to store the available stream
{@link CameraCharacteristics#SCALER_AVAILABLE_STREAM_CONFIGURATIONS configurations} to set up
{@link android.view.Surface Surfaces} for creating a {@link CameraCaptureSession capture session}
with {@link CameraDevice#createCaptureSession}.
This is the authoritative list for all input/output formats (and sizes respectively
for that format) that are supported by a camera device. |
Fields Summary |
---|
private final int | mFormat | private final int | mWidth | private final int | mHeight | private final boolean | mInput |
Constructors Summary |
---|
public StreamConfiguration(int format, int width, int height, boolean input)Create a new {@link StreamConfiguration}.
mFormat = checkArgumentFormatInternal(format);
mWidth = checkArgumentPositive(width, "width must be positive");
mHeight = checkArgumentPositive(height, "height must be positive");
mInput = input;
|
Methods Summary |
---|
public boolean | equals(java.lang.Object obj)Check if this {@link StreamConfiguration} is equal to another {@link StreamConfiguration}.
Two vectors are only equal if and only if each of the respective elements is equal.
if (obj == null) {
return false;
}
if (this == obj) {
return true;
}
if (obj instanceof StreamConfiguration) {
final StreamConfiguration other = (StreamConfiguration) obj;
return mFormat == other.mFormat &&
mWidth == other.mWidth &&
mHeight == other.mHeight &&
mInput == other.mInput;
}
return false;
| public final int | getFormat()Get the internal image {@code format} in this stream configuration.
return mFormat;
| public int | getHeight()Return the height of the stream configuration.
return mHeight;
| public android.util.Size | getSize()Convenience method to return the size of this stream configuration.
return new Size(mWidth, mHeight);
| public int | getWidth()Return the width of the stream configuration.
return mWidth;
| public int | hashCode(){@inheritDoc}
return HashCodeHelpers.hashCode(mFormat, mWidth, mHeight, mInput ? 1 : 0);
| public boolean | isInput()Determines if this configuration is usable for input streams.
Input and output stream configurations are not interchangeable;
input stream configurations must be used when configuring inputs.
return mInput;
| public boolean | isOutput()Determines if this configuration is usable for output streams.
Input and output stream configurations are not interchangeable;
out stream configurations must be used when configuring outputs.
return !mInput;
|
|