Merge "Tuner API: set default values of FilterConfig" into rvc-dev am: 48c1ef6e77 am: c54c343795 am: 8c0b2e3691
Change-Id: I5c43748333ca818d6a9e09899f4d2e2a40f1f9c2
This commit is contained in:
@@ -125,8 +125,8 @@ public final class AlpFilterConfiguration extends FilterConfiguration {
|
||||
* Builder for {@link AlpFilterConfiguration}.
|
||||
*/
|
||||
public static final class Builder {
|
||||
private int mPacketType;
|
||||
private int mLengthType;
|
||||
private int mPacketType = PACKET_TYPE_IPV4;
|
||||
private int mLengthType = LENGTH_TYPE_UNDEFINED;
|
||||
private Settings mSettings;
|
||||
|
||||
private Builder() {
|
||||
@@ -136,6 +136,7 @@ public final class AlpFilterConfiguration extends FilterConfiguration {
|
||||
* Sets packet type.
|
||||
*
|
||||
* <p>The meaning of each packet type value is shown in ATSC A/330:2019 table 5.2.
|
||||
* <p>Default value is {@link #PACKET_TYPE_IPV4}.
|
||||
*/
|
||||
@NonNull
|
||||
public Builder setPacketType(int packetType) {
|
||||
@@ -144,6 +145,8 @@ public final class AlpFilterConfiguration extends FilterConfiguration {
|
||||
}
|
||||
/**
|
||||
* Sets length type.
|
||||
*
|
||||
* <p>Default value is {@link #LENGTH_TYPE_UNDEFINED}.
|
||||
*/
|
||||
@NonNull
|
||||
public Builder setLengthType(@LengthType int lengthType) {
|
||||
|
||||
@@ -106,11 +106,11 @@ public final class IpFilterConfiguration extends FilterConfiguration {
|
||||
* Builder for {@link IpFilterConfiguration}.
|
||||
*/
|
||||
public static final class Builder {
|
||||
private byte[] mSrcIpAddress;
|
||||
private byte[] mDstIpAddress;
|
||||
private int mSrcPort;
|
||||
private int mDstPort;
|
||||
private boolean mPassthrough;
|
||||
private byte[] mSrcIpAddress = {0, 0, 0, 0};
|
||||
private byte[] mDstIpAddress = {0, 0, 0, 0};;
|
||||
private int mSrcPort = 0;
|
||||
private int mDstPort = 0;
|
||||
private boolean mPassthrough = false;
|
||||
private Settings mSettings;
|
||||
|
||||
private Builder() {
|
||||
@@ -118,6 +118,8 @@ public final class IpFilterConfiguration extends FilterConfiguration {
|
||||
|
||||
/**
|
||||
* Sets source IP address.
|
||||
*
|
||||
* <p>Default value is 0.0.0.0, an invalid IP address.
|
||||
*/
|
||||
@NonNull
|
||||
public Builder setSrcIpAddress(@NonNull byte[] srcIpAddress) {
|
||||
@@ -126,6 +128,8 @@ public final class IpFilterConfiguration extends FilterConfiguration {
|
||||
}
|
||||
/**
|
||||
* Sets destination IP address.
|
||||
*
|
||||
* <p>Default value is 0.0.0.0, an invalid IP address.
|
||||
*/
|
||||
@NonNull
|
||||
public Builder setDstIpAddress(@NonNull byte[] dstIpAddress) {
|
||||
@@ -134,6 +138,8 @@ public final class IpFilterConfiguration extends FilterConfiguration {
|
||||
}
|
||||
/**
|
||||
* Sets source port.
|
||||
*
|
||||
* <p>Default value is 0.
|
||||
*/
|
||||
@NonNull
|
||||
public Builder setSrcPort(int srcPort) {
|
||||
@@ -142,6 +148,8 @@ public final class IpFilterConfiguration extends FilterConfiguration {
|
||||
}
|
||||
/**
|
||||
* Sets destination port.
|
||||
*
|
||||
* <p>Default value is 0.
|
||||
*/
|
||||
@NonNull
|
||||
public Builder setDstPort(int dstPort) {
|
||||
@@ -150,6 +158,8 @@ public final class IpFilterConfiguration extends FilterConfiguration {
|
||||
}
|
||||
/**
|
||||
* Sets passthrough.
|
||||
*
|
||||
* <p>Default value is {@code false}.
|
||||
*/
|
||||
@NonNull
|
||||
public Builder setPassthrough(boolean passthrough) {
|
||||
|
||||
@@ -21,6 +21,7 @@ import android.annotation.Nullable;
|
||||
import android.annotation.RequiresPermission;
|
||||
import android.annotation.SystemApi;
|
||||
import android.content.Context;
|
||||
import android.media.tv.tuner.Tuner;
|
||||
import android.media.tv.tuner.TunerUtils;
|
||||
|
||||
/**
|
||||
@@ -67,7 +68,7 @@ public final class MmtpFilterConfiguration extends FilterConfiguration {
|
||||
* Builder for {@link IpFilterConfiguration}.
|
||||
*/
|
||||
public static final class Builder {
|
||||
private int mMmtpPid;
|
||||
private int mMmtpPid = Tuner.INVALID_TS_PID;
|
||||
private Settings mSettings;
|
||||
|
||||
private Builder() {
|
||||
@@ -75,6 +76,8 @@ public final class MmtpFilterConfiguration extends FilterConfiguration {
|
||||
|
||||
/**
|
||||
* Sets MMTP Packet ID.
|
||||
*
|
||||
* <p>Default value is {@link Tuner#INVALID_TS_PID}.
|
||||
*/
|
||||
@NonNull
|
||||
public Builder setMmtpPacketId(int mmtpPid) {
|
||||
|
||||
@@ -110,9 +110,9 @@ public final class TlvFilterConfiguration extends FilterConfiguration {
|
||||
* Builder for {@link TlvFilterConfiguration}.
|
||||
*/
|
||||
public static final class Builder {
|
||||
private int mPacketType;
|
||||
private boolean mIsCompressedIpPacket;
|
||||
private boolean mPassthrough;
|
||||
private int mPacketType = PACKET_TYPE_NULL;
|
||||
private boolean mIsCompressedIpPacket = false;
|
||||
private boolean mPassthrough = false;
|
||||
private Settings mSettings;
|
||||
|
||||
private Builder() {
|
||||
@@ -122,6 +122,7 @@ public final class TlvFilterConfiguration extends FilterConfiguration {
|
||||
* Sets packet type.
|
||||
*
|
||||
* <p>The description of each packet type value is shown in ITU-R BT.1869 table 2.
|
||||
* <p>Default value is {@link #PACKET_TYPE_NULL}.
|
||||
*/
|
||||
@NonNull
|
||||
public Builder setPacketType(int packetType) {
|
||||
@@ -130,6 +131,8 @@ public final class TlvFilterConfiguration extends FilterConfiguration {
|
||||
}
|
||||
/**
|
||||
* Sets whether the data is compressed IP packet.
|
||||
*
|
||||
* <p>Default value is {@code false}.
|
||||
*/
|
||||
@NonNull
|
||||
public Builder setCompressedIpPacket(boolean isCompressedIpPacket) {
|
||||
@@ -138,6 +141,8 @@ public final class TlvFilterConfiguration extends FilterConfiguration {
|
||||
}
|
||||
/**
|
||||
* Sets whether it's passthrough.
|
||||
*
|
||||
* <p>Default value is {@code false}.
|
||||
*/
|
||||
@NonNull
|
||||
public Builder setPassthrough(boolean passthrough) {
|
||||
|
||||
@@ -65,7 +65,7 @@ public final class TsFilterConfiguration extends FilterConfiguration {
|
||||
* Builder for {@link TsFilterConfiguration}.
|
||||
*/
|
||||
public static final class Builder {
|
||||
private int mTpid;
|
||||
private int mTpid = 0;
|
||||
private Settings mSettings;
|
||||
|
||||
private Builder() {
|
||||
@@ -74,6 +74,8 @@ public final class TsFilterConfiguration extends FilterConfiguration {
|
||||
/**
|
||||
* Sets Tag Protocol ID.
|
||||
*
|
||||
* <p>Default value is 0.
|
||||
*
|
||||
* @param tpid the Tag Protocol ID.
|
||||
*/
|
||||
@NonNull
|
||||
|
||||
Reference in New Issue
Block a user