FileDocCategorySizeDatePackage
TvTrackInfo.javaAPI DocAndroid 5.1 API10460Thu Mar 12 22:22:30 GMT 2015android.media.tv

TvTrackInfo

public final class TvTrackInfo extends Object implements android.os.Parcelable
Encapsulates the format of tracks played in {@link TvInputService}.

Fields Summary
public static final int
TYPE_AUDIO
The type value for audio tracks.
public static final int
TYPE_VIDEO
The type value for video tracks.
public static final int
TYPE_SUBTITLE
The type value for subtitle tracks.
private final int
mType
private final String
mId
private final String
mLanguage
private final int
mAudioChannelCount
private final int
mAudioSampleRate
private final int
mVideoWidth
private final int
mVideoHeight
private final float
mVideoFrameRate
private final android.os.Bundle
mExtra
public static final Parcelable.Creator
CREATOR
Constructors Summary
private TvTrackInfo(int type, String id, String language, int audioChannelCount, int audioSampleRate, int videoWidth, int videoHeight, float videoFrameRate, android.os.Bundle extra)


            
                   
              
        mType = type;
        mId = id;
        mLanguage = language;
        mAudioChannelCount = audioChannelCount;
        mAudioSampleRate = audioSampleRate;
        mVideoWidth = videoWidth;
        mVideoHeight = videoHeight;
        mVideoFrameRate = videoFrameRate;
        mExtra = extra;
    
private TvTrackInfo(android.os.Parcel in)

        mType = in.readInt();
        mId = in.readString();
        mLanguage = in.readString();
        mAudioChannelCount = in.readInt();
        mAudioSampleRate = in.readInt();
        mVideoWidth = in.readInt();
        mVideoHeight = in.readInt();
        mVideoFrameRate = in.readFloat();
        mExtra = in.readBundle();
    
Methods Summary
public intdescribeContents()

        return 0;
    
public final intgetAudioChannelCount()
Returns the audio channel count. Valid only for {@link #TYPE_AUDIO} tracks.

        if (mType != TYPE_AUDIO) {
            throw new IllegalStateException("Not an audio track");
        }
        return mAudioChannelCount;
    
public final intgetAudioSampleRate()
Returns the audio sample rate, in the unit of Hz. Valid only for {@link #TYPE_AUDIO} tracks.

        if (mType != TYPE_AUDIO) {
            throw new IllegalStateException("Not an audio track");
        }
        return mAudioSampleRate;
    
public final android.os.BundlegetExtra()
Returns the extra information about the current track.

        return mExtra;
    
public final java.lang.StringgetId()
Returns the ID of the track.

        return mId;
    
public final java.lang.StringgetLanguage()
Returns the language information encoded by either ISO 639-1 or ISO 639-2/T. If the language is unknown or could not be determined, the corresponding value will be {@code null}.

        return mLanguage;
    
public final intgetType()
Returns the type of the track. The type should be one of the followings: {@link #TYPE_AUDIO}, {@link #TYPE_VIDEO} and {@link #TYPE_SUBTITLE}.

        return mType;
    
public final floatgetVideoFrameRate()
Returns the frame rate of the video, in the unit of fps (frames per second). Valid only for {@link #TYPE_VIDEO} tracks.

        if (mType != TYPE_VIDEO) {
            throw new IllegalStateException("Not a video track");
        }
        return mVideoFrameRate;
    
public final intgetVideoHeight()
Returns the height of the video, in the unit of pixels. Valid only for {@link #TYPE_VIDEO} tracks.

        if (mType != TYPE_VIDEO) {
            throw new IllegalStateException("Not a video track");
        }
        return mVideoHeight;
    
public final intgetVideoWidth()
Returns the width of the video, in the unit of pixels. Valid only for {@link #TYPE_VIDEO} tracks.

        if (mType != TYPE_VIDEO) {
            throw new IllegalStateException("Not a video track");
        }
        return mVideoWidth;
    
public voidwriteToParcel(android.os.Parcel dest, int flags)
Used to package this object into a {@link Parcel}.

param
dest The {@link Parcel} to be written.
param
flags The flags used for parceling.

        dest.writeInt(mType);
        dest.writeString(mId);
        dest.writeString(mLanguage);
        dest.writeInt(mAudioChannelCount);
        dest.writeInt(mAudioSampleRate);
        dest.writeInt(mVideoWidth);
        dest.writeInt(mVideoHeight);
        dest.writeFloat(mVideoFrameRate);
        dest.writeBundle(mExtra);