FileDocCategorySizeDatePackage
StreamConfigurationDuration.javaAPI DocAndroid 5.1 API4632Thu Mar 12 22:22:10 GMT 2015android.hardware.camera2.params

StreamConfigurationDuration

public final class StreamConfigurationDuration extends Object
Immutable class to store a time duration for any given format/size combination.
see
CameraCharacteristics#SCALER_AVAILABLE_STREAM_CONFIGURATIONS
see
CameraCharacteristics#SCALER_AVAILABLE_MIN_FRAME_DURATIONS
see
CameraCharacteristics#SCALER_AVAILABLE_STALL_DURATIONS
hide

Fields Summary
private final int
mFormat
private final int
mWidth
private final int
mHeight
private final long
mDurationNs
Constructors Summary
public StreamConfigurationDuration(int format, int width, int height, long durationNs)
Create a new {@link StreamConfigurationDuration}.

param
format image format
param
width image width, in pixels (positive)
param
height image height, in pixels (positive)
param
durationNs duration in nanoseconds (non-negative)
throws
IllegalArgumentException if width/height were not positive, or durationNs was negative or if the format was not user-defined in ImageFormat/PixelFormat (IMPL_DEFINED is OK)
hide

        mFormat =  checkArgumentFormatInternal(format);
        mWidth = checkArgumentPositive(width, "width must be positive");
        mHeight = checkArgumentPositive(height, "height must be positive");
        mDurationNs = checkArgumentNonnegative(durationNs, "durationNs must be non-negative");
    
Methods Summary
public booleanequals(java.lang.Object obj)
Check if this {@link StreamConfigurationDuration} is equal to another {@link StreamConfigurationDuration}.

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

return
{@code true} if the objects were equal, {@code false} otherwise

        if (obj == null) {
            return false;
        }
        if (this == obj) {
            return true;
        }
        if (obj instanceof StreamConfigurationDuration) {
            final StreamConfigurationDuration other = (StreamConfigurationDuration) obj;
            return mFormat == other.mFormat &&
                    mWidth == other.mWidth &&
                    mHeight == other.mHeight &&
                    mDurationNs == other.mDurationNs;
        }
        return false;
    
public longgetDuration()
Get the time duration (in nanoseconds).

return
long >= 0

        return mDurationNs;
    
public final intgetFormat()
Get the internal image {@code format} in this stream configuration duration

return
an integer format
see
ImageFormat
see
PixelFormat

        return mFormat;
    
public intgetHeight()
Return the height of the stream configuration duration

return
height > 0

        return mHeight;
    
public android.util.SizegetSize()
Convenience method to return the size of this stream configuration duration.

return
a Size with positive width and height

        return new Size(mWidth, mHeight);
    
public intgetWidth()
Return the width of the stream configuration duration.

return
width > 0

        return mWidth;
    
public inthashCode()
{@inheritDoc}

        return HashCodeHelpers.hashCode(mFormat, mWidth, mHeight,
                (int) mDurationNs, (int)(mDurationNs >>> Integer.SIZE));