Class VideoSize
- java.lang.Object
-
- com.google.android.exoplayer2.video.VideoSize
-
- All Implemented Interfaces:
Bundleable
public final class VideoSize extends Object implements Bundleable
Represents the video size.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.google.android.exoplayer2.Bundleable
Bundleable.Creator<T extends Bundleable>
-
-
Field Summary
Fields Modifier and Type Field Description static Bundleable.Creator<VideoSize>
CREATOR
int
height
The video height in pixels, 0 when unknown.float
pixelWidthHeightRatio
The width to height ratio of each pixel, 1 if unknown.int
unappliedRotationDegrees
Clockwise rotation in degrees that the application should apply for the video for it to be rendered in the correct orientation.static VideoSize
UNKNOWN
int
width
The video width in pixels, 0 when unknown.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
int
hashCode()
Bundle
toBundle()
Returns aBundle
representing the information stored in this object.
-
-
-
Field Detail
-
UNKNOWN
public static final VideoSize UNKNOWN
-
width
@IntRange(from=0L) public final int width
The video width in pixels, 0 when unknown.
-
height
@IntRange(from=0L) public final int height
The video height in pixels, 0 when unknown.
-
unappliedRotationDegrees
@IntRange(from=0L, to=359L) public final 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
TextureView
can apply the rotation by callingTextureView.setTransform(android.graphics.Matrix)
.
-
pixelWidthHeightRatio
@FloatRange(from=0.0, fromInclusive=false) public final 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.
-
CREATOR
public static final Bundleable.Creator<VideoSize> CREATOR
-
-
Constructor Detail
-
VideoSize
public VideoSize(@IntRange(from=0L) int width, @IntRange(from=0L) int height)
Creates a VideoSize without unapplied rotation or anamorphic content.- Parameters:
width
- The video width in pixels.height
- The video height in pixels.
-
VideoSize
public VideoSize(@IntRange(from=0L) int width, @IntRange(from=0L) int height, @IntRange(from=0L,to=359L) int unappliedRotationDegrees, @FloatRange(from=0.0,fromInclusive=false) float pixelWidthHeightRatio)
Creates a VideoSize.- Parameters:
width
- The video width in pixels.height
- The video height in pixels.unappliedRotationDegrees
- Clockwise rotation in degrees that the application should apply for the video for it to be rendered in the correct orientation. SeeunappliedRotationDegrees
.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.
-
-
Method Detail
-
toBundle
public Bundle toBundle()
Description copied from interface:Bundleable
Returns aBundle
representing the information stored in this object.- Specified by:
toBundle
in interfaceBundleable
-
-