1 /* 2 * Copyright 2019 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package android.media.tv.tuner.frontend; 18 19 import android.annotation.SystemApi; 20 import android.media.tv.tuner.TunerVersionChecker; 21 22 /** 23 * ISDBT Capabilities. 24 * 25 * @hide 26 */ 27 @SystemApi 28 public class IsdbtFrontendCapabilities extends FrontendCapabilities { 29 private final int mModeCap; 30 private final int mBandwidthCap; 31 private final int mModulationCap; 32 private final int mCodeRateCap; 33 private final int mGuardIntervalCap; 34 private final int mTimeInterleaveCap; 35 private final boolean mIsSegmentAutoSupported; 36 private final boolean mIsFullSegmentSupported; 37 IsdbtFrontendCapabilities(int modeCap, int bandwidthCap, int modulationCap, int codeRateCap, int guardIntervalCap, int timeInterleaveCap, boolean isSegmentAutoSupported, boolean isFullSegmentSupported)38 private IsdbtFrontendCapabilities(int modeCap, int bandwidthCap, int modulationCap, 39 int codeRateCap, int guardIntervalCap, int timeInterleaveCap, 40 boolean isSegmentAutoSupported, boolean isFullSegmentSupported) { 41 mModeCap = modeCap; 42 mBandwidthCap = bandwidthCap; 43 mModulationCap = modulationCap; 44 mCodeRateCap = codeRateCap; 45 mGuardIntervalCap = guardIntervalCap; 46 mTimeInterleaveCap = timeInterleaveCap; 47 mIsSegmentAutoSupported = isSegmentAutoSupported; 48 mIsFullSegmentSupported = isFullSegmentSupported; 49 } 50 51 /** 52 * Gets mode capability. 53 */ 54 @IsdbtFrontendSettings.Mode getModeCapability()55 public int getModeCapability() { 56 return mModeCap; 57 } 58 /** 59 * Gets bandwidth capability. 60 */ 61 @IsdbtFrontendSettings.Bandwidth getBandwidthCapability()62 public int getBandwidthCapability() { 63 return mBandwidthCap; 64 } 65 /** 66 * Gets modulation capability. 67 */ 68 @IsdbtFrontendSettings.Modulation getModulationCapability()69 public int getModulationCapability() { 70 return mModulationCap; 71 } 72 /** 73 * Gets code rate capability. 74 */ 75 @DvbtFrontendSettings.CodeRate getCodeRateCapability()76 public int getCodeRateCapability() { 77 return mCodeRateCap; 78 } 79 /** 80 * Gets guard interval capability. 81 */ 82 @DvbtFrontendSettings.GuardInterval getGuardIntervalCapability()83 public int getGuardIntervalCapability() { 84 return mGuardIntervalCap; 85 } 86 /** 87 * Gets time interleave mode capability. 88 * 89 * <p>This query is only supported by Tuner HAL 2.0 or higher. Unsupported version will 90 * return {@link IsdbtFrontendSettings#TIME_INTERLEAVE_MODE_UNDEFINED}. 91 * Use {@link TunerVersionChecker#getTunerVersion()} to check the version. 92 */ 93 @IsdbtFrontendSettings.TimeInterleaveMode getTimeInterleaveModeCapability()94 public int getTimeInterleaveModeCapability() { 95 return mTimeInterleaveCap; 96 } 97 /** 98 * If auto segment is supported or not. 99 * 100 * <p>This query is only supported by Tuner HAL 2.0 or higher. Unsupported version will 101 * return false. 102 * Use {@link TunerVersionChecker#getTunerVersion()} to check the version. 103 */ isSegmentAutoSupported()104 public boolean isSegmentAutoSupported() { 105 return mIsSegmentAutoSupported; 106 } 107 /** 108 * If full segment is supported or not. 109 * 110 * <p>This query is only supported by Tuner HAL 2.0 or higher. Unsupported version will 111 * return false. 112 * Use {@link TunerVersionChecker#getTunerVersion()} to check the version. 113 */ isFullSegmentSupported()114 public boolean isFullSegmentSupported() { 115 return mIsFullSegmentSupported; 116 } 117 } 118