Merge "Add audio description information to TvTrackInfo"
This commit is contained in:
@@ -28327,6 +28327,7 @@ package android.media.tv {
|
|||||||
method public int getVideoHeight();
|
method public int getVideoHeight();
|
||||||
method public float getVideoPixelAspectRatio();
|
method public float getVideoPixelAspectRatio();
|
||||||
method public int getVideoWidth();
|
method public int getVideoWidth();
|
||||||
|
method public boolean isAudioDescription();
|
||||||
method public boolean isEncrypted();
|
method public boolean isEncrypted();
|
||||||
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;
|
||||||
@@ -28339,6 +28340,7 @@ package android.media.tv {
|
|||||||
ctor public TvTrackInfo.Builder(int, @NonNull String);
|
ctor public TvTrackInfo.Builder(int, @NonNull String);
|
||||||
method public android.media.tv.TvTrackInfo build();
|
method public android.media.tv.TvTrackInfo build();
|
||||||
method public android.media.tv.TvTrackInfo.Builder setAudioChannelCount(int);
|
method public android.media.tv.TvTrackInfo.Builder setAudioChannelCount(int);
|
||||||
|
method @NonNull public android.media.tv.TvTrackInfo.Builder setAudioDescription(boolean);
|
||||||
method public android.media.tv.TvTrackInfo.Builder setAudioSampleRate(int);
|
method public android.media.tv.TvTrackInfo.Builder setAudioSampleRate(int);
|
||||||
method public android.media.tv.TvTrackInfo.Builder setDescription(CharSequence);
|
method public android.media.tv.TvTrackInfo.Builder setDescription(CharSequence);
|
||||||
method @NonNull public android.media.tv.TvTrackInfo.Builder setEncrypted(boolean);
|
method @NonNull public android.media.tv.TvTrackInfo.Builder setEncrypted(boolean);
|
||||||
|
|||||||
@@ -61,6 +61,7 @@ public final class TvTrackInfo implements Parcelable {
|
|||||||
private final boolean mEncrypted;
|
private final boolean mEncrypted;
|
||||||
private final int mAudioChannelCount;
|
private final int mAudioChannelCount;
|
||||||
private final int mAudioSampleRate;
|
private final int mAudioSampleRate;
|
||||||
|
private final boolean mAudioDescription;
|
||||||
private final int mVideoWidth;
|
private final int mVideoWidth;
|
||||||
private final int mVideoHeight;
|
private final int mVideoHeight;
|
||||||
private final float mVideoFrameRate;
|
private final float mVideoFrameRate;
|
||||||
@@ -70,8 +71,8 @@ public final class TvTrackInfo implements Parcelable {
|
|||||||
private final Bundle mExtra;
|
private final Bundle mExtra;
|
||||||
|
|
||||||
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, int videoWidth,
|
boolean encrypted, int audioChannelCount, int audioSampleRate, boolean audioDescription,
|
||||||
int videoHeight, float videoFrameRate, float videoPixelAspectRatio,
|
int videoWidth, int videoHeight, float videoFrameRate, float videoPixelAspectRatio,
|
||||||
byte videoActiveFormatDescription, Bundle extra) {
|
byte videoActiveFormatDescription, Bundle extra) {
|
||||||
mType = type;
|
mType = type;
|
||||||
mId = id;
|
mId = id;
|
||||||
@@ -80,6 +81,7 @@ public final class TvTrackInfo implements Parcelable {
|
|||||||
mEncrypted = encrypted;
|
mEncrypted = encrypted;
|
||||||
mAudioChannelCount = audioChannelCount;
|
mAudioChannelCount = audioChannelCount;
|
||||||
mAudioSampleRate = audioSampleRate;
|
mAudioSampleRate = audioSampleRate;
|
||||||
|
mAudioDescription = audioDescription;
|
||||||
mVideoWidth = videoWidth;
|
mVideoWidth = videoWidth;
|
||||||
mVideoHeight = videoHeight;
|
mVideoHeight = videoHeight;
|
||||||
mVideoFrameRate = videoFrameRate;
|
mVideoFrameRate = videoFrameRate;
|
||||||
@@ -96,6 +98,7 @@ public final class TvTrackInfo implements Parcelable {
|
|||||||
mEncrypted = in.readInt() != 0;
|
mEncrypted = in.readInt() != 0;
|
||||||
mAudioChannelCount = in.readInt();
|
mAudioChannelCount = in.readInt();
|
||||||
mAudioSampleRate = in.readInt();
|
mAudioSampleRate = in.readInt();
|
||||||
|
mAudioDescription = in.readInt() != 0;
|
||||||
mVideoWidth = in.readInt();
|
mVideoWidth = in.readInt();
|
||||||
mVideoHeight = in.readInt();
|
mVideoHeight = in.readInt();
|
||||||
mVideoFrameRate = in.readFloat();
|
mVideoFrameRate = in.readFloat();
|
||||||
@@ -171,6 +174,23 @@ public final class TvTrackInfo implements Parcelable {
|
|||||||
return mAudioSampleRate;
|
return mAudioSampleRate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns {@code true} if the track is an audio description intended for people with visual
|
||||||
|
* impairment, {@code false} otherwise. Valid only for {@link #TYPE_AUDIO} tracks.
|
||||||
|
*
|
||||||
|
* <p>For example of broadcast, audio description information may be referred to broadcast
|
||||||
|
* standard (e.g. ISO 639 Language Descriptor of ISO/IEC 13818-1, Supplementary Audio Language
|
||||||
|
* Descriptor, AC-3 Descriptor, Enhanced AC-3 Descriptor, AAC Descriptor of ETSI EN 300 468).
|
||||||
|
*
|
||||||
|
* @throws IllegalStateException if not called on an audio track
|
||||||
|
*/
|
||||||
|
public boolean isAudioDescription() {
|
||||||
|
if (mType != TYPE_AUDIO) {
|
||||||
|
throw new IllegalStateException("Not an audio track");
|
||||||
|
}
|
||||||
|
return mAudioDescription;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 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.
|
||||||
@@ -266,6 +286,7 @@ public final class TvTrackInfo implements Parcelable {
|
|||||||
dest.writeInt(mEncrypted ? 1 : 0);
|
dest.writeInt(mEncrypted ? 1 : 0);
|
||||||
dest.writeInt(mAudioChannelCount);
|
dest.writeInt(mAudioChannelCount);
|
||||||
dest.writeInt(mAudioSampleRate);
|
dest.writeInt(mAudioSampleRate);
|
||||||
|
dest.writeInt(mAudioDescription ? 1 : 0);
|
||||||
dest.writeInt(mVideoWidth);
|
dest.writeInt(mVideoWidth);
|
||||||
dest.writeInt(mVideoHeight);
|
dest.writeInt(mVideoHeight);
|
||||||
dest.writeFloat(mVideoFrameRate);
|
dest.writeFloat(mVideoFrameRate);
|
||||||
@@ -296,7 +317,8 @@ public final class TvTrackInfo implements Parcelable {
|
|||||||
switch (mType) {
|
switch (mType) {
|
||||||
case TYPE_AUDIO:
|
case TYPE_AUDIO:
|
||||||
return mAudioChannelCount == obj.mAudioChannelCount
|
return mAudioChannelCount == obj.mAudioChannelCount
|
||||||
&& mAudioSampleRate == obj.mAudioSampleRate;
|
&& mAudioSampleRate == obj.mAudioSampleRate
|
||||||
|
&& mAudioDescription == obj.mAudioDescription;
|
||||||
|
|
||||||
case TYPE_VIDEO:
|
case TYPE_VIDEO:
|
||||||
return mVideoWidth == obj.mVideoWidth
|
return mVideoWidth == obj.mVideoWidth
|
||||||
@@ -338,6 +360,7 @@ public final class TvTrackInfo implements Parcelable {
|
|||||||
private boolean mEncrypted;
|
private boolean mEncrypted;
|
||||||
private int mAudioChannelCount;
|
private int mAudioChannelCount;
|
||||||
private int mAudioSampleRate;
|
private int mAudioSampleRate;
|
||||||
|
private boolean mAudioDescription;
|
||||||
private int mVideoWidth;
|
private int mVideoWidth;
|
||||||
private int mVideoHeight;
|
private int mVideoHeight;
|
||||||
private float mVideoFrameRate;
|
private float mVideoFrameRate;
|
||||||
@@ -429,6 +452,27 @@ public final class TvTrackInfo implements Parcelable {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the audio description attribute of the audio. Valid only for {@link #TYPE_AUDIO}
|
||||||
|
* tracks.
|
||||||
|
*
|
||||||
|
* <p>For example of broadcast, audio description information may be referred to broadcast
|
||||||
|
* standard (e.g. ISO 639 Language Descriptor of ISO/IEC 13818-1, Supplementary Audio
|
||||||
|
* Language Descriptor, AC-3 Descriptor, Enhanced AC-3 Descriptor, AAC Descriptor of ETSI EN
|
||||||
|
* 300 468).
|
||||||
|
*
|
||||||
|
* @param audioDescription The audio description attribute of the audio.
|
||||||
|
* @throws IllegalStateException if not called on an audio track
|
||||||
|
*/
|
||||||
|
@NonNull
|
||||||
|
public Builder setAudioDescription(boolean audioDescription) {
|
||||||
|
if (mType != TYPE_AUDIO) {
|
||||||
|
throw new IllegalStateException("Not an audio track");
|
||||||
|
}
|
||||||
|
mAudioDescription = audioDescription;
|
||||||
|
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.
|
||||||
@@ -531,8 +575,9 @@ 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, mVideoWidth, mVideoHeight,
|
mAudioChannelCount, mAudioSampleRate, mAudioDescription, mVideoWidth,
|
||||||
mVideoFrameRate, mVideoPixelAspectRatio, mVideoActiveFormatDescription, mExtra);
|
mVideoHeight, mVideoFrameRate, mVideoPixelAspectRatio,
|
||||||
|
mVideoActiveFormatDescription, mExtra);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user