Merge "Add spoken subtitle information to TvTrackInfo" am: e515bb6fb6 am: 2fba623381
Change-Id: I0b198c59944430638650e0a2294a193114d3ded9
This commit is contained in:
@@ -28330,6 +28330,7 @@ package android.media.tv {
|
|||||||
method public boolean isAudioDescription();
|
method public boolean isAudioDescription();
|
||||||
method public boolean isEncrypted();
|
method public boolean isEncrypted();
|
||||||
method public boolean isHardOfHearing();
|
method public boolean isHardOfHearing();
|
||||||
|
method public boolean isSpokenSubtitle();
|
||||||
method public void writeToParcel(android.os.Parcel, int);
|
method public void writeToParcel(android.os.Parcel, int);
|
||||||
field @NonNull public static final android.os.Parcelable.Creator<android.media.tv.TvTrackInfo> CREATOR;
|
field @NonNull public static final android.os.Parcelable.Creator<android.media.tv.TvTrackInfo> CREATOR;
|
||||||
field public static final int TYPE_AUDIO = 0; // 0x0
|
field public static final int TYPE_AUDIO = 0; // 0x0
|
||||||
@@ -28348,6 +28349,7 @@ package android.media.tv {
|
|||||||
method public android.media.tv.TvTrackInfo.Builder setExtra(android.os.Bundle);
|
method public android.media.tv.TvTrackInfo.Builder setExtra(android.os.Bundle);
|
||||||
method @NonNull public android.media.tv.TvTrackInfo.Builder setHardOfHearing(boolean);
|
method @NonNull public android.media.tv.TvTrackInfo.Builder setHardOfHearing(boolean);
|
||||||
method public android.media.tv.TvTrackInfo.Builder setLanguage(String);
|
method public android.media.tv.TvTrackInfo.Builder setLanguage(String);
|
||||||
|
method @NonNull public android.media.tv.TvTrackInfo.Builder setSpokenSubtitle(boolean);
|
||||||
method public android.media.tv.TvTrackInfo.Builder setVideoActiveFormatDescription(byte);
|
method public android.media.tv.TvTrackInfo.Builder setVideoActiveFormatDescription(byte);
|
||||||
method public android.media.tv.TvTrackInfo.Builder setVideoFrameRate(float);
|
method public android.media.tv.TvTrackInfo.Builder setVideoFrameRate(float);
|
||||||
method public android.media.tv.TvTrackInfo.Builder setVideoHeight(int);
|
method public android.media.tv.TvTrackInfo.Builder setVideoHeight(int);
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ public final class TvTrackInfo implements Parcelable {
|
|||||||
private final int mAudioSampleRate;
|
private final int mAudioSampleRate;
|
||||||
private final boolean mAudioDescription;
|
private final boolean mAudioDescription;
|
||||||
private final boolean mHardOfHearing;
|
private final boolean mHardOfHearing;
|
||||||
|
private final boolean mSpokenSubtitle;
|
||||||
private final int mVideoWidth;
|
private final int mVideoWidth;
|
||||||
private final int mVideoHeight;
|
private final int mVideoHeight;
|
||||||
private final float mVideoFrameRate;
|
private final float mVideoFrameRate;
|
||||||
@@ -73,8 +74,9 @@ public final class TvTrackInfo implements Parcelable {
|
|||||||
|
|
||||||
private TvTrackInfo(int type, String id, String language, CharSequence description,
|
private TvTrackInfo(int type, String id, String language, CharSequence description,
|
||||||
boolean encrypted, int audioChannelCount, int audioSampleRate, boolean audioDescription,
|
boolean encrypted, int audioChannelCount, int audioSampleRate, boolean audioDescription,
|
||||||
boolean hardOfHearing, int videoWidth, int videoHeight, float videoFrameRate,
|
boolean hardOfHearing, boolean spokenSubtitle, int videoWidth, int videoHeight,
|
||||||
float videoPixelAspectRatio, byte videoActiveFormatDescription, Bundle extra) {
|
float videoFrameRate, float videoPixelAspectRatio, byte videoActiveFormatDescription,
|
||||||
|
Bundle extra) {
|
||||||
mType = type;
|
mType = type;
|
||||||
mId = id;
|
mId = id;
|
||||||
mLanguage = language;
|
mLanguage = language;
|
||||||
@@ -84,6 +86,7 @@ public final class TvTrackInfo implements Parcelable {
|
|||||||
mAudioSampleRate = audioSampleRate;
|
mAudioSampleRate = audioSampleRate;
|
||||||
mAudioDescription = audioDescription;
|
mAudioDescription = audioDescription;
|
||||||
mHardOfHearing = hardOfHearing;
|
mHardOfHearing = hardOfHearing;
|
||||||
|
mSpokenSubtitle = spokenSubtitle;
|
||||||
mVideoWidth = videoWidth;
|
mVideoWidth = videoWidth;
|
||||||
mVideoHeight = videoHeight;
|
mVideoHeight = videoHeight;
|
||||||
mVideoFrameRate = videoFrameRate;
|
mVideoFrameRate = videoFrameRate;
|
||||||
@@ -102,6 +105,7 @@ public final class TvTrackInfo implements Parcelable {
|
|||||||
mAudioSampleRate = in.readInt();
|
mAudioSampleRate = in.readInt();
|
||||||
mAudioDescription = in.readInt() != 0;
|
mAudioDescription = in.readInt() != 0;
|
||||||
mHardOfHearing = in.readInt() != 0;
|
mHardOfHearing = in.readInt() != 0;
|
||||||
|
mSpokenSubtitle = in.readInt() != 0;
|
||||||
mVideoWidth = in.readInt();
|
mVideoWidth = in.readInt();
|
||||||
mVideoHeight = in.readInt();
|
mVideoHeight = in.readInt();
|
||||||
mVideoFrameRate = in.readFloat();
|
mVideoFrameRate = in.readFloat();
|
||||||
@@ -211,6 +215,22 @@ public final class TvTrackInfo implements Parcelable {
|
|||||||
return mHardOfHearing;
|
return mHardOfHearing;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns {@code true} if the track is a spoken subtitle for people with visual impairment,
|
||||||
|
* {@code false} otherwise. Valid only for {@link #TYPE_AUDIO} tracks.
|
||||||
|
*
|
||||||
|
* <p>For example of broadcast, spoken subtitle information may be referred to broadcast
|
||||||
|
* standard (e.g. Supplementary Audio Language Descriptor of ETSI EN 300 468).
|
||||||
|
*
|
||||||
|
* @throws IllegalStateException if not called on an audio track
|
||||||
|
*/
|
||||||
|
public boolean isSpokenSubtitle() {
|
||||||
|
if (mType != TYPE_AUDIO) {
|
||||||
|
throw new IllegalStateException("Not an audio track");
|
||||||
|
}
|
||||||
|
return mSpokenSubtitle;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the width of the video, in the unit of pixels. Valid only for {@link #TYPE_VIDEO}
|
* Returns the width of the video, in the unit of pixels. Valid only for {@link #TYPE_VIDEO}
|
||||||
* tracks.
|
* tracks.
|
||||||
@@ -308,6 +328,7 @@ public final class TvTrackInfo implements Parcelable {
|
|||||||
dest.writeInt(mAudioSampleRate);
|
dest.writeInt(mAudioSampleRate);
|
||||||
dest.writeInt(mAudioDescription ? 1 : 0);
|
dest.writeInt(mAudioDescription ? 1 : 0);
|
||||||
dest.writeInt(mHardOfHearing ? 1 : 0);
|
dest.writeInt(mHardOfHearing ? 1 : 0);
|
||||||
|
dest.writeInt(mSpokenSubtitle ? 1 : 0);
|
||||||
dest.writeInt(mVideoWidth);
|
dest.writeInt(mVideoWidth);
|
||||||
dest.writeInt(mVideoHeight);
|
dest.writeInt(mVideoHeight);
|
||||||
dest.writeFloat(mVideoFrameRate);
|
dest.writeFloat(mVideoFrameRate);
|
||||||
@@ -331,6 +352,7 @@ public final class TvTrackInfo implements Parcelable {
|
|||||||
if (!TextUtils.equals(mId, obj.mId) || mType != obj.mType
|
if (!TextUtils.equals(mId, obj.mId) || mType != obj.mType
|
||||||
|| !TextUtils.equals(mLanguage, obj.mLanguage)
|
|| !TextUtils.equals(mLanguage, obj.mLanguage)
|
||||||
|| !TextUtils.equals(mDescription, obj.mDescription)
|
|| !TextUtils.equals(mDescription, obj.mDescription)
|
||||||
|
|| mEncrypted != obj.mEncrypted
|
||||||
|| !Objects.equals(mExtra, obj.mExtra)) {
|
|| !Objects.equals(mExtra, obj.mExtra)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -340,7 +362,8 @@ public final class TvTrackInfo implements Parcelable {
|
|||||||
return mAudioChannelCount == obj.mAudioChannelCount
|
return mAudioChannelCount == obj.mAudioChannelCount
|
||||||
&& mAudioSampleRate == obj.mAudioSampleRate
|
&& mAudioSampleRate == obj.mAudioSampleRate
|
||||||
&& mAudioDescription == obj.mAudioDescription
|
&& mAudioDescription == obj.mAudioDescription
|
||||||
&& mHardOfHearing == obj.mHardOfHearing;
|
&& mHardOfHearing == obj.mHardOfHearing
|
||||||
|
&& mSpokenSubtitle == obj.mSpokenSubtitle;
|
||||||
|
|
||||||
case TYPE_VIDEO:
|
case TYPE_VIDEO:
|
||||||
return mVideoWidth == obj.mVideoWidth
|
return mVideoWidth == obj.mVideoWidth
|
||||||
@@ -387,6 +410,7 @@ public final class TvTrackInfo implements Parcelable {
|
|||||||
private int mAudioSampleRate;
|
private int mAudioSampleRate;
|
||||||
private boolean mAudioDescription;
|
private boolean mAudioDescription;
|
||||||
private boolean mHardOfHearing;
|
private boolean mHardOfHearing;
|
||||||
|
private boolean mSpokenSubtitle;
|
||||||
private int mVideoWidth;
|
private int mVideoWidth;
|
||||||
private int mVideoHeight;
|
private int mVideoHeight;
|
||||||
private float mVideoFrameRate;
|
private float mVideoFrameRate;
|
||||||
@@ -520,6 +544,25 @@ public final class TvTrackInfo implements Parcelable {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the spoken subtitle attribute of the audio. Valid only for {@link #TYPE_AUDIO}
|
||||||
|
* tracks.
|
||||||
|
*
|
||||||
|
* <p>For example of broadcast, spoken subtitle information may be referred to broadcast
|
||||||
|
* standard (e.g. Supplementary Audio Language Descriptor of ETSI EN 300 468).
|
||||||
|
*
|
||||||
|
* @param spokenSubtitle The spoken subtitle attribute of the audio.
|
||||||
|
* @throws IllegalStateException if not called on an audio track
|
||||||
|
*/
|
||||||
|
@NonNull
|
||||||
|
public Builder setSpokenSubtitle(boolean spokenSubtitle) {
|
||||||
|
if (mType != TYPE_AUDIO) {
|
||||||
|
throw new IllegalStateException("Not an audio track");
|
||||||
|
}
|
||||||
|
mSpokenSubtitle = spokenSubtitle;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the width of the video, in the unit of pixels. Valid only for {@link #TYPE_VIDEO}
|
* Sets the width of the video, in the unit of pixels. Valid only for {@link #TYPE_VIDEO}
|
||||||
* tracks.
|
* tracks.
|
||||||
@@ -623,8 +666,8 @@ public final class TvTrackInfo implements Parcelable {
|
|||||||
public TvTrackInfo build() {
|
public TvTrackInfo build() {
|
||||||
return new TvTrackInfo(mType, mId, mLanguage, mDescription, mEncrypted,
|
return new TvTrackInfo(mType, mId, mLanguage, mDescription, mEncrypted,
|
||||||
mAudioChannelCount, mAudioSampleRate, mAudioDescription, mHardOfHearing,
|
mAudioChannelCount, mAudioSampleRate, mAudioDescription, mHardOfHearing,
|
||||||
mVideoWidth, mVideoHeight, mVideoFrameRate, mVideoPixelAspectRatio,
|
mSpokenSubtitle, mVideoWidth, mVideoHeight, mVideoFrameRate,
|
||||||
mVideoActiveFormatDescription, mExtra);
|
mVideoPixelAspectRatio, mVideoActiveFormatDescription, mExtra);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user