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.IntDef;
20 import android.annotation.IntRange;
21 import android.annotation.NonNull;
22 import android.annotation.SystemApi;
23 import android.hardware.tv.tuner.V1_0.Constants;
24 
25 import java.lang.annotation.Retention;
26 import java.lang.annotation.RetentionPolicy;
27 
28 /**
29  * Frontend settings for DVBT.
30  *
31  * @hide
32  */
33 @SystemApi
34 public class DvbtFrontendSettings extends FrontendSettings {
35 
36     /** @hide */
37     @IntDef(flag = true,
38             prefix = "TRANSMISSION_MODE_",
39             value = {TRANSMISSION_MODE_UNDEFINED, TRANSMISSION_MODE_AUTO,
40                     TRANSMISSION_MODE_2K, TRANSMISSION_MODE_8K, TRANSMISSION_MODE_4K,
41                     TRANSMISSION_MODE_1K, TRANSMISSION_MODE_16K, TRANSMISSION_MODE_32K})
42     @Retention(RetentionPolicy.SOURCE)
43     public @interface TransmissionMode {}
44 
45     /**
46      * Transmission Mode undefined.
47      */
48     public static final int TRANSMISSION_MODE_UNDEFINED =
49             Constants.FrontendDvbtTransmissionMode.UNDEFINED;
50     /**
51      * Hardware is able to detect and set Transmission Mode automatically
52      */
53     public static final int TRANSMISSION_MODE_AUTO = Constants.FrontendDvbtTransmissionMode.AUTO;
54     /**
55      * 2K Transmission Mode.
56      */
57     public static final int TRANSMISSION_MODE_2K = Constants.FrontendDvbtTransmissionMode.MODE_2K;
58     /**
59      * 8K Transmission Mode.
60      */
61     public static final int TRANSMISSION_MODE_8K = Constants.FrontendDvbtTransmissionMode.MODE_8K;
62     /**
63      * 4K Transmission Mode.
64      */
65     public static final int TRANSMISSION_MODE_4K = Constants.FrontendDvbtTransmissionMode.MODE_4K;
66     /**
67      * 1K Transmission Mode.
68      */
69     public static final int TRANSMISSION_MODE_1K = Constants.FrontendDvbtTransmissionMode.MODE_1K;
70     /**
71      * 16K Transmission Mode.
72      */
73     public static final int TRANSMISSION_MODE_16K = Constants.FrontendDvbtTransmissionMode.MODE_16K;
74     /**
75      * 32K Transmission Mode.
76      */
77     public static final int TRANSMISSION_MODE_32K = Constants.FrontendDvbtTransmissionMode.MODE_32K;
78 
79 
80 
81     /** @hide */
82     @IntDef(flag = true,
83             prefix = "BANDWIDTH_",
84             value = {BANDWIDTH_UNDEFINED, BANDWIDTH_AUTO, BANDWIDTH_8MHZ, BANDWIDTH_7MHZ,
85                     BANDWIDTH_6MHZ, BANDWIDTH_5MHZ, BANDWIDTH_1_7MHZ, BANDWIDTH_10MHZ})
86     @Retention(RetentionPolicy.SOURCE)
87     public @interface Bandwidth {}
88 
89     /**
90      * Bandwidth undefined.
91      */
92     public static final int BANDWIDTH_UNDEFINED = Constants.FrontendDvbtBandwidth.UNDEFINED;
93     /**
94      * Hardware is able to detect and set Bandwidth automatically.
95      */
96     public static final int BANDWIDTH_AUTO = Constants.FrontendDvbtBandwidth.AUTO;
97     /**
98      * 8 MHz bandwidth.
99      */
100     public static final int BANDWIDTH_8MHZ = Constants.FrontendDvbtBandwidth.BANDWIDTH_8MHZ;
101     /**
102      * 7 MHz bandwidth.
103      */
104     public static final int BANDWIDTH_7MHZ = Constants.FrontendDvbtBandwidth.BANDWIDTH_7MHZ;
105     /**
106      * 6 MHz bandwidth.
107      */
108     public static final int BANDWIDTH_6MHZ = Constants.FrontendDvbtBandwidth.BANDWIDTH_6MHZ;
109     /**
110      * 5 MHz bandwidth.
111      */
112     public static final int BANDWIDTH_5MHZ = Constants.FrontendDvbtBandwidth.BANDWIDTH_5MHZ;
113     /**
114      * 1,7 MHz bandwidth.
115      */
116     public static final int BANDWIDTH_1_7MHZ = Constants.FrontendDvbtBandwidth.BANDWIDTH_1_7MHZ;
117     /**
118      * 10 MHz bandwidth.
119      */
120     public static final int BANDWIDTH_10MHZ = Constants.FrontendDvbtBandwidth.BANDWIDTH_10MHZ;
121 
122 
123     /** @hide */
124     @IntDef(flag = true,
125             prefix = "CONSTELLATION_",
126             value = {CONSTELLATION_UNDEFINED, CONSTELLATION_AUTO, CONSTELLATION_QPSK,
127                     CONSTELLATION_16QAM, CONSTELLATION_64QAM,
128                     CONSTELLATION_256QAM})
129     @Retention(RetentionPolicy.SOURCE)
130     public @interface Constellation {}
131 
132     /**
133      * Constellation not defined.
134      */
135     public static final int CONSTELLATION_UNDEFINED = Constants.FrontendDvbtConstellation.UNDEFINED;
136     /**
137      * Hardware is able to detect and set Constellation automatically.
138      */
139     public static final int CONSTELLATION_AUTO = Constants.FrontendDvbtConstellation.AUTO;
140     /**
141      * QPSK Constellation.
142      */
143     public static final int CONSTELLATION_QPSK =
144             Constants.FrontendDvbtConstellation.CONSTELLATION_QPSK;
145     /**
146      * 16QAM Constellation.
147      */
148     public static final int CONSTELLATION_16QAM =
149             Constants.FrontendDvbtConstellation.CONSTELLATION_16QAM;
150     /**
151      * 64QAM Constellation.
152      */
153     public static final int CONSTELLATION_64QAM =
154             Constants.FrontendDvbtConstellation.CONSTELLATION_64QAM;
155     /**
156      * 256QAM Constellation.
157      */
158     public static final int CONSTELLATION_256QAM =
159             Constants.FrontendDvbtConstellation.CONSTELLATION_256QAM;
160 
161 
162     /** @hide */
163     @IntDef(flag = true,
164             prefix = "HIERARCHY_",
165             value = {HIERARCHY_UNDEFINED, HIERARCHY_AUTO, HIERARCHY_NON_NATIVE, HIERARCHY_1_NATIVE,
166             HIERARCHY_2_NATIVE, HIERARCHY_4_NATIVE, HIERARCHY_NON_INDEPTH, HIERARCHY_1_INDEPTH,
167             HIERARCHY_2_INDEPTH, HIERARCHY_4_INDEPTH})
168     @Retention(RetentionPolicy.SOURCE)
169     public @interface Hierarchy {}
170 
171     /**
172      * Hierarchy undefined.
173      */
174     public static final int HIERARCHY_UNDEFINED = Constants.FrontendDvbtHierarchy.UNDEFINED;
175     /**
176      * Hardware is able to detect and set Hierarchy automatically.
177      */
178     public static final int HIERARCHY_AUTO = Constants.FrontendDvbtHierarchy.AUTO;
179     /**
180      * Non-native Hierarchy
181      */
182     public static final int HIERARCHY_NON_NATIVE =
183             Constants.FrontendDvbtHierarchy.HIERARCHY_NON_NATIVE;
184     /**
185      * 1-native Hierarchy
186      */
187     public static final int HIERARCHY_1_NATIVE = Constants.FrontendDvbtHierarchy.HIERARCHY_1_NATIVE;
188     /**
189      * 2-native Hierarchy
190      */
191     public static final int HIERARCHY_2_NATIVE = Constants.FrontendDvbtHierarchy.HIERARCHY_2_NATIVE;
192     /**
193      * 4-native Hierarchy
194      */
195     public static final int HIERARCHY_4_NATIVE = Constants.FrontendDvbtHierarchy.HIERARCHY_4_NATIVE;
196     /**
197      * Non-indepth Hierarchy
198      */
199     public static final int HIERARCHY_NON_INDEPTH =
200             Constants.FrontendDvbtHierarchy.HIERARCHY_NON_INDEPTH;
201     /**
202      * 1-indepth Hierarchy
203      */
204     public static final int HIERARCHY_1_INDEPTH =
205             Constants.FrontendDvbtHierarchy.HIERARCHY_1_INDEPTH;
206     /**
207      * 2-indepth Hierarchy
208      */
209     public static final int HIERARCHY_2_INDEPTH =
210             Constants.FrontendDvbtHierarchy.HIERARCHY_2_INDEPTH;
211     /**
212      * 4-indepth Hierarchy
213      */
214     public static final int HIERARCHY_4_INDEPTH =
215             Constants.FrontendDvbtHierarchy.HIERARCHY_4_INDEPTH;
216 
217 
218     /** @hide */
219     @IntDef(flag = true,
220             prefix = "CODERATE_",
221             value = {CODERATE_UNDEFINED, CODERATE_AUTO, CODERATE_1_2, CODERATE_2_3, CODERATE_3_4,
222             CODERATE_5_6, CODERATE_7_8, CODERATE_3_5, CODERATE_4_5, CODERATE_6_7, CODERATE_8_9})
223     @Retention(RetentionPolicy.SOURCE)
224     public @interface CodeRate {}
225 
226     /**
227      * Code rate undefined.
228      */
229     public static final int CODERATE_UNDEFINED =
230             Constants.FrontendDvbtCoderate.UNDEFINED;
231     /**
232      * Hardware is able to detect and set code rate automatically.
233      */
234     public static final int CODERATE_AUTO = Constants.FrontendDvbtCoderate.AUTO;
235     /**
236      * 1/2 code rate.
237      */
238     public static final int CODERATE_1_2 = Constants.FrontendDvbtCoderate.CODERATE_1_2;
239     /**
240      * 2/3 code rate.
241      */
242     public static final int CODERATE_2_3 = Constants.FrontendDvbtCoderate.CODERATE_2_3;
243     /**
244      * 3/4 code rate.
245      */
246     public static final int CODERATE_3_4 = Constants.FrontendDvbtCoderate.CODERATE_3_4;
247     /**
248      * 5/6 code rate.
249      */
250     public static final int CODERATE_5_6 = Constants.FrontendDvbtCoderate.CODERATE_5_6;
251     /**
252      * 7/8 code rate.
253      */
254     public static final int CODERATE_7_8 = Constants.FrontendDvbtCoderate.CODERATE_7_8;
255     /**
256      * 4/5 code rate.
257      */
258     public static final int CODERATE_3_5 = Constants.FrontendDvbtCoderate.CODERATE_3_5;
259     /**
260      * 4/5 code rate.
261      */
262     public static final int CODERATE_4_5 = Constants.FrontendDvbtCoderate.CODERATE_4_5;
263     /**
264      * 6/7 code rate.
265      */
266     public static final int CODERATE_6_7 = Constants.FrontendDvbtCoderate.CODERATE_6_7;
267     /**
268      * 8/9 code rate.
269      */
270     public static final int CODERATE_8_9 = Constants.FrontendDvbtCoderate.CODERATE_8_9;
271 
272     /** @hide */
273     @IntDef(flag = true,
274             prefix = "GUARD_INTERVAL_",
275             value = {GUARD_INTERVAL_UNDEFINED, GUARD_INTERVAL_AUTO,
276             GUARD_INTERVAL_1_32, GUARD_INTERVAL_1_16,
277             GUARD_INTERVAL_1_8, GUARD_INTERVAL_1_4,
278             GUARD_INTERVAL_1_128,
279             GUARD_INTERVAL_19_128,
280             GUARD_INTERVAL_19_256})
281     @Retention(RetentionPolicy.SOURCE)
282     public @interface GuardInterval {}
283 
284     /**
285      * Guard Interval undefined.
286      */
287     public static final int GUARD_INTERVAL_UNDEFINED =
288             Constants.FrontendDvbtGuardInterval.UNDEFINED;
289     /**
290      * Hardware is able to detect and set Guard Interval automatically.
291      */
292     public static final int GUARD_INTERVAL_AUTO = Constants.FrontendDvbtGuardInterval.AUTO;
293     /**
294      * 1/32 Guard Interval.
295      */
296     public static final int GUARD_INTERVAL_1_32 =
297             Constants.FrontendDvbtGuardInterval.INTERVAL_1_32;
298     /**
299      * 1/16 Guard Interval.
300      */
301     public static final int GUARD_INTERVAL_1_16 =
302             Constants.FrontendDvbtGuardInterval.INTERVAL_1_16;
303     /**
304      * 1/8 Guard Interval.
305      */
306     public static final int GUARD_INTERVAL_1_8 =
307             Constants.FrontendDvbtGuardInterval.INTERVAL_1_8;
308     /**
309      * 1/4 Guard Interval.
310      */
311     public static final int GUARD_INTERVAL_1_4 =
312             Constants.FrontendDvbtGuardInterval.INTERVAL_1_4;
313     /**
314      * 1/128 Guard Interval.
315      */
316     public static final int GUARD_INTERVAL_1_128 =
317             Constants.FrontendDvbtGuardInterval.INTERVAL_1_128;
318     /**
319      * 19/128 Guard Interval.
320      */
321     public static final int GUARD_INTERVAL_19_128 =
322             Constants.FrontendDvbtGuardInterval.INTERVAL_19_128;
323     /**
324      * 19/256 Guard Interval.
325      */
326     public static final int GUARD_INTERVAL_19_256 =
327             Constants.FrontendDvbtGuardInterval.INTERVAL_19_256;
328 
329     /** @hide */
330     @IntDef(flag = true,
331             prefix = "STANDARD",
332             value = {STANDARD_AUTO, STANDARD_T, STANDARD_T2}
333     )
334     @Retention(RetentionPolicy.SOURCE)
335     public @interface Standard {}
336 
337     /**
338      * Hardware is able to detect and set Standard automatically.
339      */
340     public static final int STANDARD_AUTO = Constants.FrontendDvbtStandard.AUTO;
341     /**
342      * T standard.
343      */
344     public static final int STANDARD_T = Constants.FrontendDvbtStandard.T;
345     /**
346      * T2 standard.
347      */
348     public static final int STANDARD_T2 = Constants.FrontendDvbtStandard.T2;
349 
350     /** @hide */
351     @IntDef(prefix = "PLP_MODE_",
352             value = {PLP_MODE_UNDEFINED, PLP_MODE_AUTO, PLP_MODE_MANUAL})
353     @Retention(RetentionPolicy.SOURCE)
354     public @interface PlpMode {}
355 
356     /**
357      * Physical Layer Pipe (PLP) Mode undefined.
358      */
359     public static final int PLP_MODE_UNDEFINED = Constants.FrontendDvbtPlpMode.UNDEFINED;
360     /**
361      * Hardware is able to detect and set Physical Layer Pipe (PLP) Mode automatically.
362      */
363     public static final int PLP_MODE_AUTO = Constants.FrontendDvbtPlpMode.AUTO;
364     /**
365      * Physical Layer Pipe (PLP) manual Mode.
366      */
367     public static final int PLP_MODE_MANUAL = Constants.FrontendDvbtPlpMode.MANUAL;
368 
369 
370     private final int mTransmissionMode;
371     private final int mBandwidth;
372     private final int mConstellation;
373     private final int mHierarchy;
374     private final int mHpCodeRate;
375     private final int mLpCodeRate;
376     private final int mGuardInterval;
377     private final boolean mIsHighPriority;
378     private final int mStandard;
379     private final boolean mIsMiso;
380     private final int mPlpMode;
381     private final int mPlpId;
382     private final int mPlpGroupId;
383 
DvbtFrontendSettings(int frequency, int transmissionMode, int bandwidth, int constellation, int hierarchy, int hpCodeRate, int lpCodeRate, int guardInterval, boolean isHighPriority, int standard, boolean isMiso, int plpMode, int plpId, int plpGroupId)384     private DvbtFrontendSettings(int frequency, int transmissionMode, int bandwidth,
385             int constellation, int hierarchy, int hpCodeRate, int lpCodeRate, int guardInterval,
386             boolean isHighPriority, int standard, boolean isMiso, int plpMode, int plpId,
387             int plpGroupId) {
388         super(frequency);
389         mTransmissionMode = transmissionMode;
390         mBandwidth = bandwidth;
391         mConstellation = constellation;
392         mHierarchy = hierarchy;
393         mHpCodeRate = hpCodeRate;
394         mLpCodeRate = lpCodeRate;
395         mGuardInterval = guardInterval;
396         mIsHighPriority = isHighPriority;
397         mStandard = standard;
398         mIsMiso = isMiso;
399         mPlpMode = plpMode;
400         mPlpId = plpId;
401         mPlpGroupId = plpGroupId;
402     }
403 
404     /**
405      * Gets Transmission Mode.
406      */
407     @TransmissionMode
getTransmissionMode()408     public int getTransmissionMode() {
409         return mTransmissionMode;
410     }
411     /**
412      * Gets Bandwidth.
413      */
414     @Bandwidth
getBandwidth()415     public int getBandwidth() {
416         return mBandwidth;
417     }
418     /**
419      * Gets Constellation.
420      */
421     @Constellation
getConstellation()422     public int getConstellation() {
423         return mConstellation;
424     }
425     /**
426      * Gets Hierarchy.
427      */
428     @Hierarchy
getHierarchy()429     public int getHierarchy() {
430         return mHierarchy;
431     }
432     /**
433      * Gets Code Rate for High Priority level.
434      */
435     @CodeRate
getHighPriorityCodeRate()436     public int getHighPriorityCodeRate() {
437         return mHpCodeRate;
438     }
439     /**
440      * Gets Code Rate for Low Priority level.
441      */
442     @CodeRate
getLowPriorityCodeRate()443     public int getLowPriorityCodeRate() {
444         return mLpCodeRate;
445     }
446     /**
447      * Gets Guard Interval.
448      */
449     @GuardInterval
getGuardInterval()450     public int getGuardInterval() {
451         return mGuardInterval;
452     }
453     /**
454      * Checks whether it's high priority.
455      */
isHighPriority()456     public boolean isHighPriority() {
457         return mIsHighPriority;
458     }
459     /**
460      * Gets Standard.
461      */
462     @Standard
getStandard()463     public int getStandard() {
464         return mStandard;
465     }
466     /**
467      * Gets whether it's MISO.
468      */
isMiso()469     public boolean isMiso() {
470         return mIsMiso;
471     }
472     /**
473      * Gets Physical Layer Pipe (PLP) Mode.
474      */
475     @PlpMode
getPlpMode()476     public int getPlpMode() {
477         return mPlpMode;
478     }
479     /**
480      * Gets Physical Layer Pipe (PLP) ID.
481      */
getPlpId()482     public int getPlpId() {
483         return mPlpId;
484     }
485     /**
486      * Gets Physical Layer Pipe (PLP) group ID.
487      */
getPlpGroupId()488     public int getPlpGroupId() {
489         return mPlpGroupId;
490     }
491 
492     /**
493      * Creates a builder for {@link DvbtFrontendSettings}.
494      */
495     @NonNull
builder()496     public static Builder builder() {
497         return new Builder();
498     }
499 
500     /**
501      * Builder for {@link DvbtFrontendSettings}.
502      */
503     public static class Builder {
504         private int mFrequency = 0;
505         private int mTransmissionMode = TRANSMISSION_MODE_UNDEFINED;
506         private int mBandwidth = BANDWIDTH_UNDEFINED;
507         private int mConstellation = CONSTELLATION_UNDEFINED;
508         private int mHierarchy = HIERARCHY_UNDEFINED;
509         private int mHpCodeRate = CODERATE_UNDEFINED;
510         private int mLpCodeRate = CODERATE_UNDEFINED;
511         private int mGuardInterval = GUARD_INTERVAL_UNDEFINED;
512         private boolean mIsHighPriority = false;
513         private int mStandard = STANDARD_AUTO;
514         private boolean mIsMiso = false;
515         private int mPlpMode = PLP_MODE_UNDEFINED;
516         private int mPlpId = 0;
517         private int mPlpGroupId = 0;
518 
Builder()519         private Builder() {
520         }
521 
522         /**
523          * Sets frequency in Hz.
524          *
525          * <p>Default value is 0.
526          */
527         @NonNull
528         @IntRange(from = 1)
setFrequency(int frequency)529         public Builder setFrequency(int frequency) {
530             mFrequency = frequency;
531             return this;
532         }
533 
534         /**
535          * Sets Transmission Mode.
536          *
537          * <p>Default value is {@link #TRANSMISSION_MODE_UNDEFINED}.
538          */
539         @NonNull
setTransmissionMode(@ransmissionMode int transmissionMode)540         public Builder setTransmissionMode(@TransmissionMode int transmissionMode) {
541             mTransmissionMode = transmissionMode;
542             return this;
543         }
544         /**
545          * Sets Bandwidth.
546          *
547          * <p>Default value is {@link #BANDWIDTH_UNDEFINED}.
548          */
549         @NonNull
setBandwidth(@andwidth int bandwidth)550         public Builder setBandwidth(@Bandwidth int bandwidth) {
551             mBandwidth = bandwidth;
552             return this;
553         }
554         /**
555          * Sets Constellation.
556          *
557          * <p>Default value is {@link #CONSTELLATION_UNDEFINED}.
558          */
559         @NonNull
setConstellation(@onstellation int constellation)560         public Builder setConstellation(@Constellation int constellation) {
561             mConstellation = constellation;
562             return this;
563         }
564         /**
565          * Sets Hierarchy.
566          *
567          * <p>Default value is {@link #HIERARCHY_UNDEFINED}.
568          */
569         @NonNull
setHierarchy(@ierarchy int hierarchy)570         public Builder setHierarchy(@Hierarchy int hierarchy) {
571             mHierarchy = hierarchy;
572             return this;
573         }
574         /**
575          * Sets Code Rate for High Priority level.
576          *
577          * <p>Default value is {@link #CODERATE_UNDEFINED}.
578          */
579         @NonNull
setHighPriorityCodeRate(@odeRate int hpCodeRate)580         public Builder setHighPriorityCodeRate(@CodeRate int hpCodeRate) {
581             mHpCodeRate = hpCodeRate;
582             return this;
583         }
584         /**
585          * Sets Code Rate for Low Priority level.
586          *
587          * <p>Default value is {@link #CODERATE_UNDEFINED}.
588          */
589         @NonNull
setLowPriorityCodeRate(@odeRate int lpCodeRate)590         public Builder setLowPriorityCodeRate(@CodeRate int lpCodeRate) {
591             mLpCodeRate = lpCodeRate;
592             return this;
593         }
594         /**
595          * Sets Guard Interval.
596          *
597          * <p>Default value is {@link #GUARD_INTERVAL_UNDEFINED}.
598          */
599         @NonNull
setGuardInterval(@uardInterval int guardInterval)600         public Builder setGuardInterval(@GuardInterval int guardInterval) {
601             mGuardInterval = guardInterval;
602             return this;
603         }
604         /**
605          * Sets whether it's high priority.
606          *
607          * <p>Default value is {@code false}.
608          */
609         @NonNull
setHighPriority(boolean isHighPriority)610         public Builder setHighPriority(boolean isHighPriority) {
611             mIsHighPriority = isHighPriority;
612             return this;
613         }
614         /**
615          * Sets Standard.
616          *
617          * <p>Default value is {@link #STANDARD_AUTO}.
618          */
619         @NonNull
setStandard(@tandard int standard)620         public Builder setStandard(@Standard int standard) {
621             mStandard = standard;
622             return this;
623         }
624         /**
625          * Sets whether it's MISO.
626          *
627          * <p>Default value is {@code false}.
628          */
629         @NonNull
setMiso(boolean isMiso)630         public Builder setMiso(boolean isMiso) {
631             mIsMiso = isMiso;
632             return this;
633         }
634         /**
635          * Sets Physical Layer Pipe (PLP) Mode.
636          *
637          * <p>Default value is {@link #PLP_MODE_UNDEFINED}.
638          */
639         @NonNull
setPlpMode(@lpMode int plpMode)640         public Builder setPlpMode(@PlpMode int plpMode) {
641             mPlpMode = plpMode;
642             return this;
643         }
644         /**
645          * Sets Physical Layer Pipe (PLP) ID.
646          *
647          * <p>Default value is 0.
648          */
649         @NonNull
setPlpId(int plpId)650         public Builder setPlpId(int plpId) {
651             mPlpId = plpId;
652             return this;
653         }
654         /**
655          * Sets Physical Layer Pipe (PLP) group ID.
656          *
657          * <p>Default value is 0.
658          */
659         @NonNull
setPlpGroupId(int plpGroupId)660         public Builder setPlpGroupId(int plpGroupId) {
661             mPlpGroupId = plpGroupId;
662             return this;
663         }
664 
665         /**
666          * Builds a {@link DvbtFrontendSettings} object.
667          */
668         @NonNull
build()669         public DvbtFrontendSettings build() {
670             return new DvbtFrontendSettings(mFrequency, mTransmissionMode, mBandwidth,
671                     mConstellation, mHierarchy, mHpCodeRate, mLpCodeRate, mGuardInterval,
672                     mIsHighPriority, mStandard, mIsMiso, mPlpMode, mPlpId, mPlpGroupId);
673         }
674     }
675 
676     @Override
getType()677     public int getType() {
678         return FrontendSettings.TYPE_DVBT;
679     }
680 }
681