public static final class TvTrackInfo.Builder extends Object
TvTrackInfo
objects.Constructor and Description |
---|
Builder(int type,
String id)
Create a
TvTrackInfo.Builder . |
Modifier and Type | Method and Description |
---|---|
TvTrackInfo |
build()
Creates a
TvTrackInfo instance with the specified fields. |
TvTrackInfo.Builder |
setAudioChannelCount(int audioChannelCount)
Sets the audio channel count.
|
TvTrackInfo.Builder |
setAudioSampleRate(int audioSampleRate)
Sets the audio sample rate, in the unit of Hz.
|
TvTrackInfo.Builder |
setDescription(CharSequence description)
Sets a user readable description for the current track.
|
TvTrackInfo.Builder |
setExtra(Bundle extra)
Sets the extra information about the current track.
|
TvTrackInfo.Builder |
setLanguage(String language)
Sets the language information of the current track.
|
TvTrackInfo.Builder |
setVideoActiveFormatDescription(byte videoActiveFormatDescription)
Sets the Active Format Description (AFD) code of the video.
|
TvTrackInfo.Builder |
setVideoFrameRate(float videoFrameRate)
Sets the frame rate of the video, in the unit fps (frames per rate).
|
TvTrackInfo.Builder |
setVideoHeight(int videoHeight)
Sets the height of the video, in the unit of pixels.
|
TvTrackInfo.Builder |
setVideoPixelAspectRatio(float videoPixelAspectRatio)
Sets the pixel aspect ratio (the ratio of a pixel's width to its height) of the video.
|
TvTrackInfo.Builder |
setVideoWidth(int videoWidth)
Sets the width of the video, in the unit of pixels.
|
public Builder(int type, String id)
TvTrackInfo.Builder
. Any field that should be included in the TvTrackInfo
must be added.type
- The type of the track.id
- The ID of the track that uniquely identifies the current track among all the
other tracks in the same TV program.IllegalArgumentException
- if the type is not any of TvTrackInfo.TYPE_AUDIO
,
TvTrackInfo.TYPE_VIDEO
and TvTrackInfo.TYPE_SUBTITLE
public final TvTrackInfo.Builder setLanguage(String language)
language
- The language string encoded by either ISO 639-1 or ISO 639-2/T.public final TvTrackInfo.Builder setDescription(CharSequence description)
description
- The user readable description.public final TvTrackInfo.Builder setAudioChannelCount(int audioChannelCount)
TvTrackInfo.TYPE_AUDIO
tracks.audioChannelCount
- The audio channel count.IllegalStateException
- if not called on an audio trackpublic final TvTrackInfo.Builder setAudioSampleRate(int audioSampleRate)
TvTrackInfo.TYPE_AUDIO
tracks.audioSampleRate
- The audio sample rate.IllegalStateException
- if not called on an audio trackpublic final TvTrackInfo.Builder setVideoWidth(int videoWidth)
TvTrackInfo.TYPE_VIDEO
tracks.videoWidth
- The width of the video.IllegalStateException
- if not called on a video trackpublic final TvTrackInfo.Builder setVideoHeight(int videoHeight)
TvTrackInfo.TYPE_VIDEO
tracks.videoHeight
- The height of the video.IllegalStateException
- if not called on a video trackpublic final TvTrackInfo.Builder setVideoFrameRate(float videoFrameRate)
TvTrackInfo.TYPE_VIDEO
tracks.videoFrameRate
- The frame rate of the video.IllegalStateException
- if not called on a video trackpublic final TvTrackInfo.Builder setVideoPixelAspectRatio(float videoPixelAspectRatio)
TvTrackInfo.TYPE_VIDEO
tracks.
This is needed for applications to be able to scale the video properly for some video formats such as 720x576 4:3 and 720x576 16:9 where pixels are not square. By default, applications assume the value of 1.0 (square pixels), so it is not necessary to set the pixel aspect ratio for most video formats.
videoPixelAspectRatio
- The pixel aspect ratio of the video.IllegalStateException
- if not called on a video trackpublic final TvTrackInfo.Builder setVideoActiveFormatDescription(byte videoActiveFormatDescription)
TvTrackInfo.TYPE_VIDEO
tracks.
This is needed for applications to be able to scale the video properly based on the information about where in the coded picture the active video is. The complete list of values are defined in ETSI TS 101 154 V1.7.1 Annex B, ATSC A/53 Part 4 and SMPTE 2016-1-2007.
videoActiveFormatDescription
- The AFD code of the video.IllegalStateException
- if not called on a video trackpublic final TvTrackInfo.Builder setExtra(Bundle extra)
extra
- The extra information.public TvTrackInfo build()
TvTrackInfo
instance with the specified fields.TvTrackInfo
instance