public final class VideoSize implements Bundleable


Represents the video size.

Summary

Constants

static final Bundleable.Creator<VideoSize>

This field is deprecated.

Use fromBundle instead.

static final VideoSize

Public fields

final @IntRange(from = 0) int

The video height in pixels, 0 when unknown.

final @FloatRange(from = 0, fromInclusive = false) float

The width to height ratio of each pixel, 1 if unknown.

final @IntRange(from = 0, to = 359) int

Clockwise rotation in degrees that the application should apply for the video for it to be rendered in the correct orientation.

final @IntRange(from = 0) int

The video width in pixels, 0 when unknown.

Public constructors

@UnstableApi
VideoSize(@IntRange(from = 0) int width, @IntRange(from = 0) int height)

Creates a VideoSize without unapplied rotation or anamorphic content.

@UnstableApi
VideoSize(
    @IntRange(from = 0) int width,
    @IntRange(from = 0) int height,
    @IntRange(from = 0, to = 359) int unappliedRotationDegrees,
    @FloatRange(from = 0, fromInclusive = false) float pixelWidthHeightRatio
)

Creates a new instance.

Public methods

boolean
static VideoSize

Restores a VideoSize from a Bundle.

int
Bundle

Returns a Bundle representing the information stored in this object.

Constants

CREATOR

@UnstableApi
public static final Bundleable.Creator<VideoSizeCREATOR

UNKNOWN

public static final VideoSize UNKNOWN

Public fields

height

public final @IntRange(from = 0) int height

The video height in pixels, 0 when unknown.

pixelWidthHeightRatio

public final @FloatRange(from = 0, fromInclusive = false) float pixelWidthHeightRatio

The width to height ratio of each pixel, 1 if unknown.

For the normal case of square pixels this will be equal to 1.0. Different values are indicative of anamorphic content.

unappliedRotationDegrees

public final @IntRange(from = 0, to = 359) int unappliedRotationDegrees

Clockwise rotation in degrees that the application should apply for the video for it to be rendered in the correct orientation.

Is 0 if unknown or if no rotation is needed.

Player should apply video rotation internally, in which case unappliedRotationDegrees is 0. But when a player can't apply the rotation, for example before API level 21, the unapplied rotation is reported by this field for application to handle.

Applications that use android.view.TextureView can apply the rotation by calling setTransform.

width

public final @IntRange(from = 0) int width

The video width in pixels, 0 when unknown.

Public constructors

VideoSize

@UnstableApi
public VideoSize(@IntRange(from = 0) int width, @IntRange(from = 0) int height)

Creates a VideoSize without unapplied rotation or anamorphic content.

Parameters
@IntRange(from = 0) int width

The video width in pixels.

@IntRange(from = 0) int height

The video height in pixels.

VideoSize

@UnstableApi
public VideoSize(
    @IntRange(from = 0) int width,
    @IntRange(from = 0) int height,
    @IntRange(from = 0, to = 359) int unappliedRotationDegrees,
    @FloatRange(from = 0, fromInclusive = false) float pixelWidthHeightRatio
)

Creates a new instance.

Parameters
@IntRange(from = 0) int width

The video width in pixels.

@IntRange(from = 0) int height

The video height in pixels.

@IntRange(from = 0, to = 359) int unappliedRotationDegrees

Clockwise rotation in degrees that the application should apply for the video for it to be rendered in the correct orientation. See unappliedRotationDegrees.

@FloatRange(from = 0, fromInclusive = false) float pixelWidthHeightRatio

The width to height ratio of each pixel. For the normal case of square pixels this will be equal to 1.0. Different values are indicative of anamorphic content.

Public methods

equals

public boolean equals(@Nullable Object obj)

fromBundle

@UnstableApi
public static VideoSize fromBundle(Bundle bundle)

Restores a VideoSize from a Bundle.

hashCode

public int hashCode()

toBundle

@UnstableApi
public Bundle toBundle()

Returns a Bundle representing the information stored in this object.