Add FrontendStatus for IPTV
Bug: 263504906 Test: atest android.media.tv.tuner.cts Change-Id: I50f500ca9de6355196ea500ff2c96aac326e1ed3
This commit is contained in:
@@ -8596,6 +8596,11 @@ package android.media.tv.tuner.frontend {
|
||||
method public int getHierarchy();
|
||||
method public long getInnerFec();
|
||||
method @NonNull public int[] getInterleaving();
|
||||
method @IntRange(from=0) public int getIptvAverageJitterMillis();
|
||||
method @NonNull public String getIptvContentUrl();
|
||||
method @IntRange(from=0) public long getIptvPacketsLost();
|
||||
method @IntRange(from=0) public long getIptvPacketsReceived();
|
||||
method @IntRange(from=0) public int getIptvWorstJitterMillis();
|
||||
method public int getIsdbtMode();
|
||||
method public int getIsdbtPartialReceptionFlag();
|
||||
method @IntRange(from=0, to=255) @NonNull public int[] getIsdbtSegment();
|
||||
@@ -8639,6 +8644,11 @@ package android.media.tv.tuner.frontend {
|
||||
field public static final int FRONTEND_STATUS_TYPE_GUARD_INTERVAL = 26; // 0x1a
|
||||
field public static final int FRONTEND_STATUS_TYPE_HIERARCHY = 19; // 0x13
|
||||
field public static final int FRONTEND_STATUS_TYPE_INTERLEAVINGS = 30; // 0x1e
|
||||
field public static final int FRONTEND_STATUS_TYPE_IPTV_AVERAGE_JITTER_MS = 46; // 0x2e
|
||||
field public static final int FRONTEND_STATUS_TYPE_IPTV_CONTENT_URL = 42; // 0x2a
|
||||
field public static final int FRONTEND_STATUS_TYPE_IPTV_PACKETS_LOST = 43; // 0x2b
|
||||
field public static final int FRONTEND_STATUS_TYPE_IPTV_PACKETS_RECEIVED = 44; // 0x2c
|
||||
field public static final int FRONTEND_STATUS_TYPE_IPTV_WORST_JITTER_MS = 45; // 0x2d
|
||||
field public static final int FRONTEND_STATUS_TYPE_ISDBT_MODE = 37; // 0x25
|
||||
field public static final int FRONTEND_STATUS_TYPE_ISDBT_PARTIAL_RECEPTION_FLAG = 38; // 0x26
|
||||
field public static final int FRONTEND_STATUS_TYPE_ISDBT_SEGMENTS = 31; // 0x1f
|
||||
|
||||
@@ -23,6 +23,7 @@ import android.annotation.SuppressLint;
|
||||
import android.annotation.SystemApi;
|
||||
import android.media.tv.tuner.Lnb;
|
||||
import android.media.tv.tuner.TunerVersionChecker;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.util.Arrays;
|
||||
@@ -57,7 +58,10 @@ public class FrontendStatus {
|
||||
FRONTEND_STATUS_TYPE_IS_MISO_ENABLED, FRONTEND_STATUS_TYPE_IS_LINEAR,
|
||||
FRONTEND_STATUS_TYPE_IS_SHORT_FRAMES_ENABLED, FRONTEND_STATUS_TYPE_ISDBT_MODE,
|
||||
FRONTEND_STATUS_TYPE_ISDBT_PARTIAL_RECEPTION_FLAG, FRONTEND_STATUS_TYPE_STREAM_IDS,
|
||||
FRONTEND_STATUS_TYPE_DVBT_CELL_IDS, FRONTEND_STATUS_TYPE_ATSC3_ALL_PLP_INFO})
|
||||
FRONTEND_STATUS_TYPE_DVBT_CELL_IDS, FRONTEND_STATUS_TYPE_ATSC3_ALL_PLP_INFO,
|
||||
FRONTEND_STATUS_TYPE_IPTV_CONTENT_URL, FRONTEND_STATUS_TYPE_IPTV_PACKETS_LOST,
|
||||
FRONTEND_STATUS_TYPE_IPTV_PACKETS_RECEIVED, FRONTEND_STATUS_TYPE_IPTV_WORST_JITTER_MS,
|
||||
FRONTEND_STATUS_TYPE_IPTV_AVERAGE_JITTER_MS})
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
public @interface FrontendStatusType {}
|
||||
|
||||
@@ -270,6 +274,36 @@ public class FrontendStatus {
|
||||
public static final int FRONTEND_STATUS_TYPE_DVBT_CELL_IDS =
|
||||
android.hardware.tv.tuner.FrontendStatusType.DVBT_CELL_IDS;
|
||||
|
||||
/**
|
||||
* IPTV content URL.
|
||||
*/
|
||||
public static final int FRONTEND_STATUS_TYPE_IPTV_CONTENT_URL =
|
||||
android.hardware.tv.tuner.FrontendStatusType.IPTV_CONTENT_URL;
|
||||
|
||||
/**
|
||||
* IPTV packets lost.
|
||||
*/
|
||||
public static final int FRONTEND_STATUS_TYPE_IPTV_PACKETS_LOST =
|
||||
android.hardware.tv.tuner.FrontendStatusType.IPTV_PACKETS_LOST;
|
||||
|
||||
/**
|
||||
* IPTV packets received.
|
||||
*/
|
||||
public static final int FRONTEND_STATUS_TYPE_IPTV_PACKETS_RECEIVED =
|
||||
android.hardware.tv.tuner.FrontendStatusType.IPTV_PACKETS_RECEIVED;
|
||||
|
||||
/**
|
||||
* IPTV worst jitter.
|
||||
*/
|
||||
public static final int FRONTEND_STATUS_TYPE_IPTV_WORST_JITTER_MS =
|
||||
android.hardware.tv.tuner.FrontendStatusType.IPTV_WORST_JITTER_MS;
|
||||
|
||||
/**
|
||||
* IPTV average jitter.
|
||||
*/
|
||||
public static final int FRONTEND_STATUS_TYPE_IPTV_AVERAGE_JITTER_MS =
|
||||
android.hardware.tv.tuner.FrontendStatusType.IPTV_AVERAGE_JITTER_MS;
|
||||
|
||||
/**
|
||||
* All PLP information in a frequency band for ATSC-3.0 frontend, which includes both tuned and
|
||||
* not tuned PLPs for currently watching service.
|
||||
@@ -519,6 +553,11 @@ public class FrontendStatus {
|
||||
private int[] mStreamIds;
|
||||
private int[] mDvbtCellIds;
|
||||
private Atsc3PlpInfo[] mAllPlpInfo;
|
||||
private String mIptvContentUrl;
|
||||
private Long mIptvPacketsLost;
|
||||
private Long mIptvPacketsReceived;
|
||||
private Integer mIptvWorstJitterMs;
|
||||
private Integer mIptvAverageJitterMs;
|
||||
|
||||
// Constructed and fields set by JNI code.
|
||||
private FrontendStatus() {
|
||||
@@ -1144,4 +1183,94 @@ public class FrontendStatus {
|
||||
return mUec;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the IPTV content URL.
|
||||
*
|
||||
* @return A String URL in the format protocol://ip:port (udp://127.0.0.1:3000).
|
||||
*
|
||||
* <p>This query is only supported by Tuner HAL 3.0 or higher. Use
|
||||
* {@link TunerVersionChecker#getTunerVersion()} to check the version.
|
||||
*/
|
||||
@NonNull
|
||||
public String getIptvContentUrl() {
|
||||
TunerVersionChecker.checkHigherOrEqualVersionTo(
|
||||
TunerVersionChecker.TUNER_VERSION_3_0, "IptvContentUrl status");
|
||||
if (mIptvContentUrl == null) {
|
||||
throw new IllegalStateException("IptvContentUrl status is empty");
|
||||
}
|
||||
return mIptvContentUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the number of packets lost.
|
||||
*
|
||||
* @return A long value representing the number of packets lost in transmission.
|
||||
*
|
||||
* <p>This query is only supported by Tuner HAL 3.0 or higher. Use
|
||||
* {@link TunerVersionChecker#getTunerVersion()} to check the version.
|
||||
*/
|
||||
@IntRange(from = 0)
|
||||
public long getIptvPacketsLost() {
|
||||
TunerVersionChecker.checkHigherOrEqualVersionTo(
|
||||
TunerVersionChecker.TUNER_VERSION_3_0, "IptvPacketsLost status");
|
||||
if (mIptvPacketsLost == null) {
|
||||
throw new IllegalStateException("IptvPacketsLost status is empty");
|
||||
}
|
||||
return mIptvPacketsLost;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the number of packets received.
|
||||
*
|
||||
* @return A long value representing the number of packets received.
|
||||
*
|
||||
* <p>This query is only supported by Tuner HAL 3.0 or higher. Use
|
||||
* {@link TunerVersionChecker#getTunerVersion()} to check the version.
|
||||
*/
|
||||
@IntRange(from = 0)
|
||||
public long getIptvPacketsReceived() {
|
||||
TunerVersionChecker.checkHigherOrEqualVersionTo(
|
||||
TunerVersionChecker.TUNER_VERSION_3_0, "IptvPacketsReceived status");
|
||||
if (mIptvPacketsReceived == null) {
|
||||
throw new IllegalStateException("IptvPacketsReceived status is empty");
|
||||
}
|
||||
return mIptvPacketsReceived;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the worst jitter.
|
||||
*
|
||||
* @return An integer representing worst jitter recorded (in milliseconds).
|
||||
*
|
||||
* <p>This query is only supported by Tuner HAL 3.0 or higher. Use
|
||||
* {@link TunerVersionChecker#getTunerVersion()} to check the version.
|
||||
*/
|
||||
@IntRange(from = 0)
|
||||
public int getIptvWorstJitterMillis() {
|
||||
TunerVersionChecker.checkHigherOrEqualVersionTo(
|
||||
TunerVersionChecker.TUNER_VERSION_3_0, "IptvWorstJitterMs status");
|
||||
if (mIptvWorstJitterMs == null) {
|
||||
throw new IllegalStateException("IptvWorstJitterMs status is empty");
|
||||
}
|
||||
return mIptvWorstJitterMs;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the average jitter.
|
||||
*
|
||||
* @return An integer representing average jitter recorded (in milliseconds).
|
||||
*
|
||||
* <p>This query is only supported by Tuner HAL 3.0 or higher. Use
|
||||
* {@link TunerVersionChecker#getTunerVersion()} to check the version.
|
||||
*/
|
||||
@IntRange(from = 0)
|
||||
public int getIptvAverageJitterMillis() {
|
||||
TunerVersionChecker.checkHigherOrEqualVersionTo(
|
||||
TunerVersionChecker.TUNER_VERSION_3_0, "IptvAverageJitterMs status");
|
||||
if (mIptvAverageJitterMs == null) {
|
||||
throw new IllegalStateException("IptvAverageJitterMs status is empty");
|
||||
}
|
||||
return mIptvAverageJitterMs;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2772,6 +2772,52 @@ jobject JTuner::getFrontendStatus(jintArray types) {
|
||||
env->DeleteLocalRef(valObj);
|
||||
break;
|
||||
}
|
||||
case FrontendStatus::Tag::iptvContentUrl: {
|
||||
jfieldID field = env->GetFieldID(clazz, "mIptvContentUrl", "Ljava/lang/String;");
|
||||
std::string iptvContentUrl = s.get<FrontendStatus::Tag::iptvContentUrl>();
|
||||
jstring iptvContentUrlUtf8 = env->NewStringUTF(iptvContentUrl.c_str());
|
||||
env->SetObjectField(statusObj, field, iptvContentUrlUtf8);
|
||||
env->DeleteLocalRef(iptvContentUrlUtf8);
|
||||
break;
|
||||
}
|
||||
case FrontendStatus::Tag::iptvPacketsLost: {
|
||||
jfieldID field = env->GetFieldID(clazz, "mIptvPacketsLost", "Ljava/lang/Long;");
|
||||
jobject newLongObj =
|
||||
env->NewObject(longClazz, initLong,
|
||||
s.get<FrontendStatus::Tag::iptvPacketsLost>());
|
||||
env->SetObjectField(statusObj, field, newLongObj);
|
||||
env->DeleteLocalRef(newLongObj);
|
||||
break;
|
||||
}
|
||||
case FrontendStatus::Tag::iptvPacketsReceived: {
|
||||
jfieldID field = env->GetFieldID(clazz, "mIptvPacketsReceived", "Ljava/lang/Long;");
|
||||
jobject newLongObj =
|
||||
env->NewObject(longClazz, initLong,
|
||||
s.get<FrontendStatus::Tag::iptvPacketsReceived>());
|
||||
env->SetObjectField(statusObj, field, newLongObj);
|
||||
env->DeleteLocalRef(newLongObj);
|
||||
break;
|
||||
}
|
||||
case FrontendStatus::Tag::iptvWorstJitterMs: {
|
||||
jfieldID field = env->GetFieldID(clazz, "mIptvWorstJitterMs",
|
||||
"Ljava/lang/Integer;");
|
||||
jobject newIntegerObj =
|
||||
env->NewObject(intClazz, initInt,
|
||||
s.get<FrontendStatus::Tag::iptvWorstJitterMs>());
|
||||
env->SetObjectField(statusObj, field, newIntegerObj);
|
||||
env->DeleteLocalRef(newIntegerObj);
|
||||
break;
|
||||
}
|
||||
case FrontendStatus::Tag::iptvAverageJitterMs: {
|
||||
jfieldID field = env->GetFieldID(clazz, "mIptvAverageJitterMs",
|
||||
"Ljava/lang/Integer;");
|
||||
jobject newIntegerObj =
|
||||
env->NewObject(intClazz, initInt,
|
||||
s.get<FrontendStatus::Tag::iptvAverageJitterMs>());
|
||||
env->SetObjectField(statusObj, field, newIntegerObj);
|
||||
env->DeleteLocalRef(newIntegerObj);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return statusObj;
|
||||
|
||||
Reference in New Issue
Block a user