Add Dvbc Frontend Bandwidth Settings
Test: atest android.media.tv.tuner.cts Bug: 169868608 Change-Id: I690018c8590eaddb3c261c948a3da849b0823d3a
This commit is contained in:
@@ -5797,6 +5797,7 @@ package android.media.tv.tuner.frontend {
|
||||
public class DvbcFrontendSettings extends android.media.tv.tuner.frontend.FrontendSettings {
|
||||
method @NonNull public static android.media.tv.tuner.frontend.DvbcFrontendSettings.Builder builder();
|
||||
method public int getAnnex();
|
||||
method public int getBandwidth();
|
||||
method public long getInnerFec();
|
||||
method public int getModulation();
|
||||
method public int getOuterFec();
|
||||
@@ -5808,6 +5809,11 @@ package android.media.tv.tuner.frontend {
|
||||
field public static final int ANNEX_B = 2; // 0x2
|
||||
field public static final int ANNEX_C = 4; // 0x4
|
||||
field public static final int ANNEX_UNDEFINED = 0; // 0x0
|
||||
field public static final int BANDWIDTH_5MHZ = 1; // 0x1
|
||||
field public static final int BANDWIDTH_6MHZ = 2; // 0x2
|
||||
field public static final int BANDWIDTH_7MHZ = 4; // 0x4
|
||||
field public static final int BANDWIDTH_8MHZ = 8; // 0x8
|
||||
field public static final int BANDWIDTH_UNDEFINED = 0; // 0x0
|
||||
field public static final int MODULATION_AUTO = 1; // 0x1
|
||||
field public static final int MODULATION_MOD_128QAM = 16; // 0x10
|
||||
field public static final int MODULATION_MOD_16QAM = 2; // 0x2
|
||||
@@ -5837,6 +5843,7 @@ package android.media.tv.tuner.frontend {
|
||||
public static class DvbcFrontendSettings.Builder {
|
||||
method @NonNull public android.media.tv.tuner.frontend.DvbcFrontendSettings build();
|
||||
method @NonNull public android.media.tv.tuner.frontend.DvbcFrontendSettings.Builder setAnnex(int);
|
||||
method @NonNull public android.media.tv.tuner.frontend.DvbcFrontendSettings.Builder setBandwidth(int);
|
||||
method @IntRange(from=1) @NonNull public android.media.tv.tuner.frontend.DvbcFrontendSettings.Builder setFrequency(int);
|
||||
method @NonNull public android.media.tv.tuner.frontend.DvbcFrontendSettings.Builder setInnerFec(long);
|
||||
method @NonNull public android.media.tv.tuner.frontend.DvbcFrontendSettings.Builder setModulation(int);
|
||||
|
||||
@@ -5737,6 +5737,7 @@ package android.media.tv.tuner.frontend {
|
||||
public class DvbcFrontendSettings extends android.media.tv.tuner.frontend.FrontendSettings {
|
||||
method @NonNull public static android.media.tv.tuner.frontend.DvbcFrontendSettings.Builder builder();
|
||||
method public int getAnnex();
|
||||
method public int getBandwidth();
|
||||
method public long getInnerFec();
|
||||
method public int getModulation();
|
||||
method public int getOuterFec();
|
||||
@@ -5748,6 +5749,11 @@ package android.media.tv.tuner.frontend {
|
||||
field public static final int ANNEX_B = 2; // 0x2
|
||||
field public static final int ANNEX_C = 4; // 0x4
|
||||
field public static final int ANNEX_UNDEFINED = 0; // 0x0
|
||||
field public static final int BANDWIDTH_5MHZ = 1; // 0x1
|
||||
field public static final int BANDWIDTH_6MHZ = 2; // 0x2
|
||||
field public static final int BANDWIDTH_7MHZ = 4; // 0x4
|
||||
field public static final int BANDWIDTH_8MHZ = 8; // 0x8
|
||||
field public static final int BANDWIDTH_UNDEFINED = 0; // 0x0
|
||||
field public static final int MODULATION_AUTO = 1; // 0x1
|
||||
field public static final int MODULATION_MOD_128QAM = 16; // 0x10
|
||||
field public static final int MODULATION_MOD_16QAM = 2; // 0x2
|
||||
@@ -5777,6 +5783,7 @@ package android.media.tv.tuner.frontend {
|
||||
public static class DvbcFrontendSettings.Builder {
|
||||
method @NonNull public android.media.tv.tuner.frontend.DvbcFrontendSettings build();
|
||||
method @NonNull public android.media.tv.tuner.frontend.DvbcFrontendSettings.Builder setAnnex(int);
|
||||
method @NonNull public android.media.tv.tuner.frontend.DvbcFrontendSettings.Builder setBandwidth(int);
|
||||
method @IntRange(from=1) @NonNull public android.media.tv.tuner.frontend.DvbcFrontendSettings.Builder setFrequency(int);
|
||||
method @NonNull public android.media.tv.tuner.frontend.DvbcFrontendSettings.Builder setInnerFec(long);
|
||||
method @NonNull public android.media.tv.tuner.frontend.DvbcFrontendSettings.Builder setModulation(int);
|
||||
|
||||
@@ -223,6 +223,40 @@ public class DvbcFrontendSettings extends FrontendSettings {
|
||||
public static final int TIME_INTERLEAVE_MODE_128_4 = android.hardware.tv.tuner.V1_1.Constants
|
||||
.FrontendCableTimeInterleaveMode.INTERLEAVING_128_4;
|
||||
|
||||
/** @hide */
|
||||
@IntDef(flag = true,
|
||||
prefix = "BANDWIDTH_",
|
||||
value = {BANDWIDTH_UNDEFINED, BANDWIDTH_5MHZ, BANDWIDTH_6MHZ, BANDWIDTH_7MHZ,
|
||||
BANDWIDTH_8MHZ})
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
public @interface Bandwidth {}
|
||||
|
||||
/**
|
||||
* Bandwidth undefined.
|
||||
*/
|
||||
public static final int BANDWIDTH_UNDEFINED =
|
||||
android.hardware.tv.tuner.V1_1.Constants.FrontendDvbcBandwidth.UNDEFINED;
|
||||
/**
|
||||
* 5 MHz bandwidth.
|
||||
*/
|
||||
public static final int BANDWIDTH_5MHZ =
|
||||
android.hardware.tv.tuner.V1_1.Constants.FrontendDvbcBandwidth.BANDWIDTH_5MHZ;
|
||||
/**
|
||||
* 6 MHz bandwidth.
|
||||
*/
|
||||
public static final int BANDWIDTH_6MHZ =
|
||||
android.hardware.tv.tuner.V1_1.Constants.FrontendDvbcBandwidth.BANDWIDTH_6MHZ;
|
||||
/**
|
||||
* 7 MHz bandwidth.
|
||||
*/
|
||||
public static final int BANDWIDTH_7MHZ =
|
||||
android.hardware.tv.tuner.V1_1.Constants.FrontendDvbcBandwidth.BANDWIDTH_7MHZ;
|
||||
/**
|
||||
* 8 MHz bandwidth.
|
||||
*/
|
||||
public static final int BANDWIDTH_8MHZ =
|
||||
android.hardware.tv.tuner.V1_1.Constants.FrontendDvbcBandwidth.BANDWIDTH_8MHZ;
|
||||
|
||||
|
||||
private final int mModulation;
|
||||
private final long mInnerFec;
|
||||
@@ -232,9 +266,11 @@ public class DvbcFrontendSettings extends FrontendSettings {
|
||||
private final int mSpectralInversion;
|
||||
// Dvbc time interleave mode is only supported in Tuner 1.1 or higher.
|
||||
private final int mInterleaveMode;
|
||||
// Dvbc bandwidth is only supported in Tuner 1.1 or higher.
|
||||
private final int mBandwidth;
|
||||
|
||||
private DvbcFrontendSettings(int frequency, int modulation, long innerFec, int symbolRate,
|
||||
int outerFec, int annex, int spectralInversion, int interleaveMode) {
|
||||
int outerFec, int annex, int spectralInversion, int interleaveMode, int bandwidth) {
|
||||
super(frequency);
|
||||
mModulation = modulation;
|
||||
mInnerFec = innerFec;
|
||||
@@ -243,6 +279,7 @@ public class DvbcFrontendSettings extends FrontendSettings {
|
||||
mAnnex = annex;
|
||||
mSpectralInversion = spectralInversion;
|
||||
mInterleaveMode = interleaveMode;
|
||||
mBandwidth = bandwidth;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -293,6 +330,13 @@ public class DvbcFrontendSettings extends FrontendSettings {
|
||||
public int getTimeInterleaveMode() {
|
||||
return mInterleaveMode;
|
||||
}
|
||||
/**
|
||||
* Gets Bandwidth.
|
||||
*/
|
||||
@Bandwidth
|
||||
public int getBandwidth() {
|
||||
return mBandwidth;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a builder for {@link DvbcFrontendSettings}.
|
||||
@@ -314,6 +358,7 @@ public class DvbcFrontendSettings extends FrontendSettings {
|
||||
private int mAnnex = ANNEX_UNDEFINED;
|
||||
private int mSpectralInversion = FrontendSettings.FRONTEND_SPECTRAL_INVERSION_UNDEFINED;
|
||||
private int mInterleaveMode = TIME_INTERLEAVE_MODE_UNDEFINED;
|
||||
private int mBandwidth = BANDWIDTH_UNDEFINED;
|
||||
|
||||
private Builder() {
|
||||
}
|
||||
@@ -407,6 +452,23 @@ public class DvbcFrontendSettings extends FrontendSettings {
|
||||
}
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Set the Bandwidth.
|
||||
*
|
||||
* <p>This API is only supported by Tuner HAL 1.1 or higher. Unsupported version would cause
|
||||
* no-op. Use {@link TunerVersionChecker.getTunerVersion()} to check the version.
|
||||
*
|
||||
* @param bandwidth the value to set as the bandwidth. Default value is
|
||||
* {@link #BANDWIDTH_UNDEFINED}.
|
||||
*/
|
||||
@NonNull
|
||||
public Builder setBandwidth(@Bandwidth int bandwidth) {
|
||||
if (TunerVersionChecker.checkHigherOrEqualVersionTo(
|
||||
TunerVersionChecker.TUNER_VERSION_1_1, "setBandwidth")) {
|
||||
mBandwidth = bandwidth;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds a {@link DvbcFrontendSettings} object.
|
||||
@@ -414,7 +476,7 @@ public class DvbcFrontendSettings extends FrontendSettings {
|
||||
@NonNull
|
||||
public DvbcFrontendSettings build() {
|
||||
return new DvbcFrontendSettings(mFrequency, mModulation, mInnerFec, mSymbolRate,
|
||||
mOuterFec, mAnnex, mSpectralInversion, mInterleaveMode);
|
||||
mOuterFec, mAnnex, mSpectralInversion, mInterleaveMode, mBandwidth);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -140,6 +140,7 @@ using ::android::hardware::tv::tuner::V1_1::FrontendAnalogAftFlag;
|
||||
using ::android::hardware::tv::tuner::V1_1::FrontendAnalogSettingsExt1_1;
|
||||
using ::android::hardware::tv::tuner::V1_1::FrontendBandwidth;
|
||||
using ::android::hardware::tv::tuner::V1_1::FrontendCableTimeInterleaveMode;
|
||||
using ::android::hardware::tv::tuner::V1_1::FrontendDvbcBandwidth;
|
||||
using ::android::hardware::tv::tuner::V1_1::FrontendDvbsScanType;
|
||||
using ::android::hardware::tv::tuner::V1_1::FrontendDvbcSettingsExt1_1;
|
||||
using ::android::hardware::tv::tuner::V1_1::FrontendDvbsSettingsExt1_1;
|
||||
@@ -2725,9 +2726,13 @@ static void getDvbcFrontendSettingsExt1_1(JNIEnv *env, const jobject& settings,
|
||||
FrontendCableTimeInterleaveMode interleaveMode =
|
||||
static_cast<FrontendCableTimeInterleaveMode>(
|
||||
env->GetIntField(settings, env->GetFieldID(clazz, "mInterleaveMode", "I")));
|
||||
FrontendDvbcBandwidth bandwidth =
|
||||
static_cast<FrontendDvbcBandwidth>(
|
||||
env->GetIntField(settings, env->GetFieldID(clazz, "mBandwidth", "I")));
|
||||
|
||||
FrontendDvbcSettingsExt1_1 dvbcExt1_1 {
|
||||
.interleaveMode = interleaveMode,
|
||||
.bandwidth = bandwidth,
|
||||
};
|
||||
settingsExt1_1.settingExt.dvbc(dvbcExt1_1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user