Merge "TIF: Add Active Format Description to TvTrackInfo" into nyc-dev

This commit is contained in:
Jae Seo
2016-02-11 02:22:39 +00:00
committed by Android (Google) Code Review
4 changed files with 48 additions and 2 deletions

View File

@@ -23067,6 +23067,7 @@ package android.media.tv {
method public final java.lang.String getId();
method public final java.lang.String getLanguage();
method public final int getType();
method public final byte getVideoActiveFormatDescription();
method public final float getVideoFrameRate();
method public final int getVideoHeight();
method public final float getVideoPixelAspectRatio();
@@ -23086,6 +23087,7 @@ package android.media.tv {
method public final android.media.tv.TvTrackInfo.Builder setDescription(java.lang.CharSequence);
method public final android.media.tv.TvTrackInfo.Builder setExtra(android.os.Bundle);
method public final android.media.tv.TvTrackInfo.Builder setLanguage(java.lang.String);
method public final android.media.tv.TvTrackInfo.Builder setVideoActiveFormatDescription(byte);
method public final android.media.tv.TvTrackInfo.Builder setVideoFrameRate(float);
method public final android.media.tv.TvTrackInfo.Builder setVideoHeight(int);
method public final android.media.tv.TvTrackInfo.Builder setVideoPixelAspectRatio(float);

View File

@@ -24852,6 +24852,7 @@ package android.media.tv {
method public final java.lang.String getId();
method public final java.lang.String getLanguage();
method public final int getType();
method public final byte getVideoActiveFormatDescription();
method public final float getVideoFrameRate();
method public final int getVideoHeight();
method public final float getVideoPixelAspectRatio();
@@ -24871,6 +24872,7 @@ package android.media.tv {
method public final android.media.tv.TvTrackInfo.Builder setDescription(java.lang.CharSequence);
method public final android.media.tv.TvTrackInfo.Builder setExtra(android.os.Bundle);
method public final android.media.tv.TvTrackInfo.Builder setLanguage(java.lang.String);
method public final android.media.tv.TvTrackInfo.Builder setVideoActiveFormatDescription(byte);
method public final android.media.tv.TvTrackInfo.Builder setVideoFrameRate(float);
method public final android.media.tv.TvTrackInfo.Builder setVideoHeight(int);
method public final android.media.tv.TvTrackInfo.Builder setVideoPixelAspectRatio(float);

View File

@@ -23076,6 +23076,7 @@ package android.media.tv {
method public final java.lang.String getId();
method public final java.lang.String getLanguage();
method public final int getType();
method public final byte getVideoActiveFormatDescription();
method public final float getVideoFrameRate();
method public final int getVideoHeight();
method public final float getVideoPixelAspectRatio();
@@ -23095,6 +23096,7 @@ package android.media.tv {
method public final android.media.tv.TvTrackInfo.Builder setDescription(java.lang.CharSequence);
method public final android.media.tv.TvTrackInfo.Builder setExtra(android.os.Bundle);
method public final android.media.tv.TvTrackInfo.Builder setLanguage(java.lang.String);
method public final android.media.tv.TvTrackInfo.Builder setVideoActiveFormatDescription(byte);
method public final android.media.tv.TvTrackInfo.Builder setVideoFrameRate(float);
method public final android.media.tv.TvTrackInfo.Builder setVideoHeight(int);
method public final android.media.tv.TvTrackInfo.Builder setVideoPixelAspectRatio(float);

View File

@@ -52,11 +52,14 @@ public final class TvTrackInfo implements Parcelable {
private final int mVideoHeight;
private final float mVideoFrameRate;
private final float mVideoPixelAspectRatio;
private final byte mVideoActiveFormatDescription;
private final Bundle mExtra;
private TvTrackInfo(int type, String id, String language, CharSequence description,
int audioChannelCount, int audioSampleRate, int videoWidth, int videoHeight,
float videoFrameRate, float videoPixelAspectRatio, Bundle extra) {
float videoFrameRate, float videoPixelAspectRatio, byte videoActiveFormatDescription,
Bundle extra) {
mType = type;
mId = id;
mLanguage = language;
@@ -67,6 +70,7 @@ public final class TvTrackInfo implements Parcelable {
mVideoHeight = videoHeight;
mVideoFrameRate = videoFrameRate;
mVideoPixelAspectRatio = videoPixelAspectRatio;
mVideoActiveFormatDescription = videoActiveFormatDescription;
mExtra = extra;
}
@@ -81,6 +85,7 @@ public final class TvTrackInfo implements Parcelable {
mVideoHeight = in.readInt();
mVideoFrameRate = in.readFloat();
mVideoPixelAspectRatio = in.readFloat();
mVideoActiveFormatDescription = in.readByte();
mExtra = in.readBundle();
}
@@ -178,6 +183,20 @@ public final class TvTrackInfo implements Parcelable {
return mVideoPixelAspectRatio;
}
/**
* Returns the Active Format Description (AFD) code of the video.
* Valid only for {@link #TYPE_VIDEO} tracks.
*
* <p>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.
*/
public final byte getVideoActiveFormatDescription() {
if (mType != TYPE_VIDEO) {
throw new IllegalStateException("Not a video track");
}
return mVideoActiveFormatDescription;
}
/**
* Returns the extra information about the current track.
*/
@@ -208,6 +227,7 @@ public final class TvTrackInfo implements Parcelable {
dest.writeInt(mVideoHeight);
dest.writeFloat(mVideoFrameRate);
dest.writeFloat(mVideoPixelAspectRatio);
dest.writeByte(mVideoActiveFormatDescription);
dest.writeBundle(mExtra);
}
@@ -238,6 +258,7 @@ public final class TvTrackInfo implements Parcelable {
private int mVideoHeight;
private float mVideoFrameRate;
private float mVideoPixelAspectRatio = 1.0f;
private byte mVideoActiveFormatDescription;
private Bundle mExtra;
/**
@@ -367,6 +388,25 @@ public final class TvTrackInfo implements Parcelable {
return this;
}
/**
* Sets the Active Format Description (AFD) code of the video.
* Valid only for {@link #TYPE_VIDEO} tracks.
*
* <p>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.
*
* @param videoActiveFormatDescription The AFD code of the video.
*/
public final Builder setVideoActiveFormatDescription(byte videoActiveFormatDescription) {
if (mType != TYPE_VIDEO) {
throw new IllegalStateException("Not a video track");
}
mVideoActiveFormatDescription = videoActiveFormatDescription;
return this;
}
/**
* Sets the extra information about the current track.
*
@@ -385,7 +425,7 @@ public final class TvTrackInfo implements Parcelable {
public TvTrackInfo build() {
return new TvTrackInfo(mType, mId, mLanguage, mDescription, mAudioChannelCount,
mAudioSampleRate, mVideoWidth, mVideoHeight, mVideoFrameRate,
mVideoPixelAspectRatio, mExtra);
mVideoPixelAspectRatio, mVideoActiveFormatDescription, mExtra);
}
}
}