Most visited

Recently visited

Added in API level 21

TvTrackInfo

public final class TvTrackInfo
extends Object implements Parcelable

java.lang.Object
   ↳ android.media.tv.TvTrackInfo


封装在 TvInputService播放的曲目的格式。

Summary

Nested classes

class TvTrackInfo.Builder

用于创建TvTrackInfo对象的构建器类。

Constants

int TYPE_AUDIO

音轨的类型值。

int TYPE_SUBTITLE

字幕轨道的类型值。

int TYPE_VIDEO

视频轨道的类型值。

Inherited constants

From interface android.os.Parcelable

Fields

public static final Creator<TvTrackInfo> CREATOR

Public methods

int describeContents()

描述此Parcelable实例的封送表示中包含的特殊对象的种类。

boolean equals(Object o)

指示其他某个对象是否“等于”这一个。

final int getAudioChannelCount()

返回音频通道计数。

final int getAudioSampleRate()

以Hz为单位返回音频采样率。

final CharSequence getDescription()

返回当前曲目的用户可读描述。

final Bundle getExtra()

返回有关当前曲目的额外信息。

final String getId()

返回曲目的ID。

final String getLanguage()

返回由ISO 639-1或ISO 639-2 / T编码的语言信息。

final int getType()

返回曲目的类型。

final byte getVideoActiveFormatDescription()

返回视频的活动格式描述(AFD)代码。

final float getVideoFrameRate()

以fps(帧/秒)为单位返回视频的帧速率。

final int getVideoHeight()

以像素为单位返回视频的高度。

final float getVideoPixelAspectRatio()

返回视频的像素宽高比(像素宽度与其高度的比率)。

final int getVideoWidth()

以像素为单位返回视频的宽度。

int hashCode()

返回对象的哈希码值。

void writeToParcel(Parcel dest, int flags)

用于将此对象打包到 Parcel

Inherited methods

From class java.lang.Object
From interface android.os.Parcelable

Constants

TYPE_AUDIO

Added in API level 21
int TYPE_AUDIO

音轨的类型值。

常量值:0(0x00000000)

TYPE_SUBTITLE

Added in API level 21
int TYPE_SUBTITLE

字幕轨道的类型值。

常量值:2(0x00000002)

TYPE_VIDEO

Added in API level 21
int TYPE_VIDEO

视频轨道的类型值。

常数值:1(0x00000001)

Fields

CREATOR

Added in API level 21
Creator<TvTrackInfo> CREATOR

Public methods

describeContents

Added in API level 21
int describeContents ()

描述此Parcelable实例的封送表示中包含的特殊对象的种类。 例如,如果对象将在writeToParcel(Parcel, int)的输出中包含writeToParcel(Parcel, int) ,则此方法的返回值必须包含CONTENTS_FILE_DESCRIPTOR位。

Returns
int a bitmask indicating the set of special object types marshaled by this Parcelable object instance.

equals

Added in API level 21
boolean equals (Object o)

指示其他某个对象是否“等于”这一个。

equals方法在非空对象引用上实现等价关系:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

equals类的方法Object实现对象上最可能的等价关系; 也就是说,对于任何非空参考值xy ,当且仅当xy引用同一对象( x == y的值为true )时,此方法返回true

请注意,无论何时覆盖此方法,通常都需要覆盖 hashCode方法,以便维护 hashCode方法的一般合同,该方法声明等同对象必须具有相同的哈希代码。

Parameters
o Object: the reference object with which to compare.
Returns
boolean true if this object is the same as the obj argument; false otherwise.

getAudioChannelCount

Added in API level 21
int getAudioChannelCount ()

返回音频通道计数。 仅适用于TYPE_AUDIO曲目。

Returns
int
Throws
IllegalStateException if not called on an audio track

getAudioSampleRate

Added in API level 21
int getAudioSampleRate ()

以Hz为单位返回音频采样率。 仅适用于TYPE_AUDIO曲目。

Returns
int
Throws
IllegalStateException if not called on an audio track

getDescription

Added in API level 23
CharSequence getDescription ()

返回当前曲目的用户可读描述。

Returns
CharSequence

getExtra

Added in API level 21
Bundle getExtra ()

返回有关当前曲目的额外信息。

Returns
Bundle

getId

Added in API level 21
String getId ()

返回曲目的ID。

Returns
String

getLanguage

Added in API level 21
String getLanguage ()

返回由ISO 639-1或ISO 639-2 / T编码的语言信息。 如果语言未知或无法确定,则相应的值为null

Returns
String

getType

Added in API level 21
int getType ()

返回曲目的类型。 该类型应为以下之一: TYPE_AUDIOTYPE_VIDEOTYPE_SUBTITLE

Returns
int

getVideoActiveFormatDescription

Added in API level 24
byte getVideoActiveFormatDescription ()

返回视频的活动格式描述(AFD)代码。 仅适用于TYPE_VIDEO曲目。

ETSI TS 101 154 V1.7.1附件B,ATSC A / 53第4部分和SMPTE 2016-1-2007中定义了完整的值列表。

Returns
byte
Throws
IllegalStateException if not called on a video track

getVideoFrameRate

Added in API level 21
float getVideoFrameRate ()

以fps(帧/秒)为单位返回视频的帧速率。 仅适用于TYPE_VIDEO曲目。

Returns
float
Throws
IllegalStateException if not called on a video track

getVideoHeight

Added in API level 21
int getVideoHeight ()

以像素为单位返回视频的高度。 仅适用于TYPE_VIDEO曲目。

Returns
int
Throws
IllegalStateException if not called on a video track

getVideoPixelAspectRatio

Added in API level 23
float getVideoPixelAspectRatio ()

返回视频的像素宽高比(像素宽度与其高度的比率)。 仅适用于TYPE_VIDEO曲目。

Returns
float
Throws
IllegalStateException if not called on a video track

getVideoWidth

Added in API level 21
int getVideoWidth ()

以像素为单位返回视频的宽度。 仅适用于TYPE_VIDEO曲目。

Returns
int
Throws
IllegalStateException if not called on a video track

hashCode

Added in API level 21
int hashCode ()

返回对象的哈希码值。 这种方法支持哈希表的好处,例如HashMap提供的哈希表。

hashCode的总合同是:

  • 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 in equals 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(Object) method, then calling the hashCode 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(java.lang.Object) method, then calling the hashCode 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.

尽可能合理实用,类Object定义的hashCode方法确实为不同的对象返回不同的整数。 (这通常通过将对象的内部地址转换为整数来实现,但Java TM编程语言不需要此实现技术。)

Returns
int a hash code value for this object.

writeToParcel

Added in API level 21
void writeToParcel (Parcel dest, 
                int flags)

用于将此对象打包成 Parcel

Parameters
dest Parcel: The Parcel to be written.
flags int: The flags used for parceling.

Hooray!