Commit 92029ed0 by olly Committed by Oliver Woodman

Un-deprecate Format.pcmEncoding and switch tests back to it.

This change precedes one that will remove Format.encoding.

PiperOrigin-RevId: 322619495
parent 21fe2f1e
Showing with 72 additions and 73 deletions
...@@ -767,8 +767,8 @@ public final class Format implements Parcelable { ...@@ -767,8 +767,8 @@ public final class Format implements Parcelable {
* The audio sampling rate in Hz, or {@link #NO_VALUE} if unknown or not applicable. * The audio sampling rate in Hz, or {@link #NO_VALUE} if unknown or not applicable.
*/ */
public final int sampleRate; public final int sampleRate;
/** @deprecated Use {@link #encoding}. */ /** The {@link C.PcmEncoding} for PCM audio. Set to {@link #NO_VALUE} for other media types. */
@Deprecated @C.PcmEncoding public final int pcmEncoding; @C.PcmEncoding public final int pcmEncoding;
/** The {@link C.Encoding} for audio. Set to {@link #NO_VALUE} for other media types. */ /** The {@link C.Encoding} for audio. Set to {@link #NO_VALUE} for other media types. */
@C.Encoding public final int encoding; @C.Encoding public final int encoding;
/** /**
...@@ -1214,7 +1214,6 @@ public final class Format implements Parcelable { ...@@ -1214,7 +1214,6 @@ public final class Format implements Parcelable {
} }
// Some fields are deprecated but they're still assigned below. // Some fields are deprecated but they're still assigned below.
@SuppressWarnings("deprecation")
/* package */ Format( /* package */ Format(
@Nullable String id, @Nullable String id,
@Nullable String label, @Nullable String label,
...@@ -1301,7 +1300,7 @@ public final class Format implements Parcelable { ...@@ -1301,7 +1300,7 @@ public final class Format implements Parcelable {
} }
// Some fields are deprecated but they're still assigned below. // Some fields are deprecated but they're still assigned below.
@SuppressWarnings({"ResourceType", "deprecation"}) @SuppressWarnings({"ResourceType"})
/* package */ Format(Parcel in) { /* package */ Format(Parcel in) {
id = in.readString(); id = in.readString();
label = in.readString(); label = in.readString();
......
...@@ -16,7 +16,7 @@ track 0: ...@@ -16,7 +16,7 @@ track 0:
maxInputSize = 16384 maxInputSize = 16384
channelCount = 2 channelCount = 2
sampleRate = 48000 sampleRate = 48000
encoding = 2 pcmEncoding = 2
sample 0: sample 0:
time = 0 time = 0
flags = 1 flags = 1
......
...@@ -16,7 +16,7 @@ track 0: ...@@ -16,7 +16,7 @@ track 0:
maxInputSize = 16384 maxInputSize = 16384
channelCount = 2 channelCount = 2
sampleRate = 48000 sampleRate = 48000
encoding = 2 pcmEncoding = 2
sample 0: sample 0:
time = 853333 time = 853333
flags = 1 flags = 1
......
...@@ -16,7 +16,7 @@ track 0: ...@@ -16,7 +16,7 @@ track 0:
maxInputSize = 16384 maxInputSize = 16384
channelCount = 2 channelCount = 2
sampleRate = 48000 sampleRate = 48000
encoding = 2 pcmEncoding = 2
sample 0: sample 0:
time = 1792000 time = 1792000
flags = 1 flags = 1
......
...@@ -16,7 +16,7 @@ track 0: ...@@ -16,7 +16,7 @@ track 0:
maxInputSize = 16384 maxInputSize = 16384
channelCount = 2 channelCount = 2
sampleRate = 48000 sampleRate = 48000
encoding = 2 pcmEncoding = 2
sample 0: sample 0:
time = 2645333 time = 2645333
flags = 1 flags = 1
......
...@@ -16,7 +16,7 @@ track 0: ...@@ -16,7 +16,7 @@ track 0:
maxInputSize = 16384 maxInputSize = 16384
channelCount = 2 channelCount = 2
sampleRate = 48000 sampleRate = 48000
encoding = 2 pcmEncoding = 2
sample 0: sample 0:
time = 0 time = 0
flags = 1 flags = 1
......
...@@ -14,7 +14,7 @@ track 0: ...@@ -14,7 +14,7 @@ track 0:
maxInputSize = 16384 maxInputSize = 16384
channelCount = 2 channelCount = 2
sampleRate = 48000 sampleRate = 48000
encoding = 2 pcmEncoding = 2
sample 0: sample 0:
time = 0 time = 0
flags = 1 flags = 1
......
...@@ -14,7 +14,7 @@ track 0: ...@@ -14,7 +14,7 @@ track 0:
maxInputSize = 16384 maxInputSize = 16384
channelCount = 2 channelCount = 2
sampleRate = 48000 sampleRate = 48000
encoding = 2 pcmEncoding = 2
sample 0: sample 0:
time = 0 time = 0
flags = 1 flags = 1
......
...@@ -13,7 +13,7 @@ track 0: ...@@ -13,7 +13,7 @@ track 0:
maxInputSize = 16384 maxInputSize = 16384
channelCount = 2 channelCount = 2
sampleRate = 48000 sampleRate = 48000
encoding = 2 pcmEncoding = 2
sample 0: sample 0:
time = 0 time = 0
flags = 1 flags = 1
......
...@@ -13,7 +13,7 @@ track 0: ...@@ -13,7 +13,7 @@ track 0:
maxInputSize = 16384 maxInputSize = 16384
channelCount = 2 channelCount = 2
sampleRate = 48000 sampleRate = 48000
encoding = 2 pcmEncoding = 2
sample 0: sample 0:
time = 0 time = 0
flags = 1 flags = 1
......
...@@ -16,7 +16,7 @@ track 0: ...@@ -16,7 +16,7 @@ track 0:
maxInputSize = 16384 maxInputSize = 16384
channelCount = 2 channelCount = 2
sampleRate = 48000 sampleRate = 48000
encoding = 2 pcmEncoding = 2
sample 0: sample 0:
time = 0 time = 0
flags = 1 flags = 1
......
...@@ -16,7 +16,7 @@ track 0: ...@@ -16,7 +16,7 @@ track 0:
maxInputSize = 16384 maxInputSize = 16384
channelCount = 2 channelCount = 2
sampleRate = 48000 sampleRate = 48000
encoding = 2 pcmEncoding = 2
sample 0: sample 0:
time = 853333 time = 853333
flags = 1 flags = 1
......
...@@ -16,7 +16,7 @@ track 0: ...@@ -16,7 +16,7 @@ track 0:
maxInputSize = 16384 maxInputSize = 16384
channelCount = 2 channelCount = 2
sampleRate = 48000 sampleRate = 48000
encoding = 2 pcmEncoding = 2
sample 0: sample 0:
time = 1792000 time = 1792000
flags = 1 flags = 1
......
...@@ -16,7 +16,7 @@ track 0: ...@@ -16,7 +16,7 @@ track 0:
maxInputSize = 16384 maxInputSize = 16384
channelCount = 2 channelCount = 2
sampleRate = 48000 sampleRate = 48000
encoding = 2 pcmEncoding = 2
sample 0: sample 0:
time = 2730666 time = 2730666
flags = 1 flags = 1
......
...@@ -13,7 +13,7 @@ track 0: ...@@ -13,7 +13,7 @@ track 0:
maxInputSize = 16384 maxInputSize = 16384
channelCount = 2 channelCount = 2
sampleRate = 48000 sampleRate = 48000
encoding = 2 pcmEncoding = 2
sample 0: sample 0:
time = 0 time = 0
flags = 1 flags = 1
......
...@@ -16,7 +16,7 @@ track 0: ...@@ -16,7 +16,7 @@ track 0:
maxInputSize = 16384 maxInputSize = 16384
channelCount = 2 channelCount = 2
sampleRate = 48000 sampleRate = 48000
encoding = 2 pcmEncoding = 2
sample 0: sample 0:
time = 0 time = 0
flags = 1 flags = 1
......
...@@ -16,7 +16,7 @@ track 0: ...@@ -16,7 +16,7 @@ track 0:
maxInputSize = 16384 maxInputSize = 16384
channelCount = 2 channelCount = 2
sampleRate = 48000 sampleRate = 48000
encoding = 2 pcmEncoding = 2
sample 0: sample 0:
time = 853333 time = 853333
flags = 1 flags = 1
......
...@@ -16,7 +16,7 @@ track 0: ...@@ -16,7 +16,7 @@ track 0:
maxInputSize = 16384 maxInputSize = 16384
channelCount = 2 channelCount = 2
sampleRate = 48000 sampleRate = 48000
encoding = 2 pcmEncoding = 2
sample 0: sample 0:
time = 1792000 time = 1792000
flags = 1 flags = 1
......
...@@ -16,7 +16,7 @@ track 0: ...@@ -16,7 +16,7 @@ track 0:
maxInputSize = 16384 maxInputSize = 16384
channelCount = 2 channelCount = 2
sampleRate = 48000 sampleRate = 48000
encoding = 2 pcmEncoding = 2
sample 0: sample 0:
time = 2645333 time = 2645333
flags = 1 flags = 1
......
...@@ -16,7 +16,7 @@ track 0: ...@@ -16,7 +16,7 @@ track 0:
maxInputSize = 16384 maxInputSize = 16384
channelCount = 2 channelCount = 2
sampleRate = 48000 sampleRate = 48000
encoding = 2 pcmEncoding = 2
sample 0: sample 0:
time = 0 time = 0
flags = 1 flags = 1
......
...@@ -16,7 +16,7 @@ track 0: ...@@ -16,7 +16,7 @@ track 0:
maxInputSize = 18432 maxInputSize = 18432
channelCount = 2 channelCount = 2
sampleRate = 44000 sampleRate = 44000
encoding = 2 pcmEncoding = 2
sample 0: sample 0:
time = 0 time = 0
flags = 1 flags = 1
......
...@@ -16,7 +16,7 @@ track 0: ...@@ -16,7 +16,7 @@ track 0:
maxInputSize = 18432 maxInputSize = 18432
channelCount = 2 channelCount = 2
sampleRate = 44000 sampleRate = 44000
encoding = 2 pcmEncoding = 2
sample 0: sample 0:
time = 837818 time = 837818
flags = 1 flags = 1
......
...@@ -16,7 +16,7 @@ track 0: ...@@ -16,7 +16,7 @@ track 0:
maxInputSize = 18432 maxInputSize = 18432
channelCount = 2 channelCount = 2
sampleRate = 44000 sampleRate = 44000
encoding = 2 pcmEncoding = 2
sample 0: sample 0:
time = 1780363 time = 1780363
flags = 1 flags = 1
......
...@@ -16,7 +16,7 @@ track 0: ...@@ -16,7 +16,7 @@ track 0:
maxInputSize = 18432 maxInputSize = 18432
channelCount = 2 channelCount = 2
sampleRate = 44000 sampleRate = 44000
encoding = 2 pcmEncoding = 2
sample 0: sample 0:
time = 2618181 time = 2618181
flags = 1 flags = 1
......
...@@ -16,7 +16,7 @@ track 0: ...@@ -16,7 +16,7 @@ track 0:
maxInputSize = 18432 maxInputSize = 18432
channelCount = 2 channelCount = 2
sampleRate = 44000 sampleRate = 44000
encoding = 2 pcmEncoding = 2
sample 0: sample 0:
time = 0 time = 0
flags = 1 flags = 1
......
...@@ -16,7 +16,7 @@ track 0: ...@@ -16,7 +16,7 @@ track 0:
maxInputSize = 16384 maxInputSize = 16384
channelCount = 2 channelCount = 2
sampleRate = 48000 sampleRate = 48000
encoding = 2 pcmEncoding = 2
sample 0: sample 0:
time = 0 time = 0
flags = 1 flags = 1
......
...@@ -16,7 +16,7 @@ track 0: ...@@ -16,7 +16,7 @@ track 0:
maxInputSize = 16384 maxInputSize = 16384
channelCount = 2 channelCount = 2
sampleRate = 48000 sampleRate = 48000
encoding = 2 pcmEncoding = 2
sample 0: sample 0:
time = 853333 time = 853333
flags = 1 flags = 1
......
...@@ -16,7 +16,7 @@ track 0: ...@@ -16,7 +16,7 @@ track 0:
maxInputSize = 16384 maxInputSize = 16384
channelCount = 2 channelCount = 2
sampleRate = 48000 sampleRate = 48000
encoding = 2 pcmEncoding = 2
sample 0: sample 0:
time = 1792000 time = 1792000
flags = 1 flags = 1
......
...@@ -16,7 +16,7 @@ track 0: ...@@ -16,7 +16,7 @@ track 0:
maxInputSize = 16384 maxInputSize = 16384
channelCount = 2 channelCount = 2
sampleRate = 48000 sampleRate = 48000
encoding = 2 pcmEncoding = 2
sample 0: sample 0:
time = 2645333 time = 2645333
flags = 1 flags = 1
......
...@@ -16,7 +16,7 @@ track 0: ...@@ -16,7 +16,7 @@ track 0:
maxInputSize = 16384 maxInputSize = 16384
channelCount = 2 channelCount = 2
sampleRate = 48000 sampleRate = 48000
encoding = 2 pcmEncoding = 2
sample 0: sample 0:
time = 0 time = 0
flags = 1 flags = 1
......
...@@ -16,7 +16,7 @@ track 0: ...@@ -16,7 +16,7 @@ track 0:
maxInputSize = 16384 maxInputSize = 16384
channelCount = 2 channelCount = 2
sampleRate = 48000 sampleRate = 48000
encoding = 2 pcmEncoding = 2
metadata = entries=[TXXX: description=ID: value=105519843, TIT2: description=null: value=那么爱你为什么, TPE1: description=null: value=阿强, TALB: description=null: value=华丽的外衣, TXXX: description=ID: value=105519843, APIC: mimeType=image/jpeg, description=] metadata = entries=[TXXX: description=ID: value=105519843, TIT2: description=null: value=那么爱你为什么, TPE1: description=null: value=阿强, TALB: description=null: value=华丽的外衣, TXXX: description=ID: value=105519843, APIC: mimeType=image/jpeg, description=]
sample 0: sample 0:
time = 0 time = 0
......
...@@ -16,7 +16,7 @@ track 0: ...@@ -16,7 +16,7 @@ track 0:
maxInputSize = 16384 maxInputSize = 16384
channelCount = 2 channelCount = 2
sampleRate = 48000 sampleRate = 48000
encoding = 2 pcmEncoding = 2
metadata = entries=[TXXX: description=ID: value=105519843, TIT2: description=null: value=那么爱你为什么, TPE1: description=null: value=阿强, TALB: description=null: value=华丽的外衣, TXXX: description=ID: value=105519843, APIC: mimeType=image/jpeg, description=] metadata = entries=[TXXX: description=ID: value=105519843, TIT2: description=null: value=那么爱你为什么, TPE1: description=null: value=阿强, TALB: description=null: value=华丽的外衣, TXXX: description=ID: value=105519843, APIC: mimeType=image/jpeg, description=]
sample 0: sample 0:
time = 853333 time = 853333
......
...@@ -16,7 +16,7 @@ track 0: ...@@ -16,7 +16,7 @@ track 0:
maxInputSize = 16384 maxInputSize = 16384
channelCount = 2 channelCount = 2
sampleRate = 48000 sampleRate = 48000
encoding = 2 pcmEncoding = 2
metadata = entries=[TXXX: description=ID: value=105519843, TIT2: description=null: value=那么爱你为什么, TPE1: description=null: value=阿强, TALB: description=null: value=华丽的外衣, TXXX: description=ID: value=105519843, APIC: mimeType=image/jpeg, description=] metadata = entries=[TXXX: description=ID: value=105519843, TIT2: description=null: value=那么爱你为什么, TPE1: description=null: value=阿强, TALB: description=null: value=华丽的外衣, TXXX: description=ID: value=105519843, APIC: mimeType=image/jpeg, description=]
sample 0: sample 0:
time = 1792000 time = 1792000
......
...@@ -16,7 +16,7 @@ track 0: ...@@ -16,7 +16,7 @@ track 0:
maxInputSize = 16384 maxInputSize = 16384
channelCount = 2 channelCount = 2
sampleRate = 48000 sampleRate = 48000
encoding = 2 pcmEncoding = 2
metadata = entries=[TXXX: description=ID: value=105519843, TIT2: description=null: value=那么爱你为什么, TPE1: description=null: value=阿强, TALB: description=null: value=华丽的外衣, TXXX: description=ID: value=105519843, APIC: mimeType=image/jpeg, description=] metadata = entries=[TXXX: description=ID: value=105519843, TIT2: description=null: value=那么爱你为什么, TPE1: description=null: value=阿强, TALB: description=null: value=华丽的外衣, TXXX: description=ID: value=105519843, APIC: mimeType=image/jpeg, description=]
sample 0: sample 0:
time = 2645333 time = 2645333
......
...@@ -16,7 +16,7 @@ track 0: ...@@ -16,7 +16,7 @@ track 0:
maxInputSize = 16384 maxInputSize = 16384
channelCount = 2 channelCount = 2
sampleRate = 48000 sampleRate = 48000
encoding = 2 pcmEncoding = 2
metadata = entries=[TXXX: description=ID: value=105519843, TIT2: description=null: value=那么爱你为什么, TPE1: description=null: value=阿强, TALB: description=null: value=华丽的外衣, TXXX: description=ID: value=105519843, APIC: mimeType=image/jpeg, description=] metadata = entries=[TXXX: description=ID: value=105519843, TIT2: description=null: value=那么爱你为什么, TPE1: description=null: value=阿强, TALB: description=null: value=华丽的外衣, TXXX: description=ID: value=105519843, APIC: mimeType=image/jpeg, description=]
sample 0: sample 0:
time = 0 time = 0
......
...@@ -16,7 +16,7 @@ track 0: ...@@ -16,7 +16,7 @@ track 0:
maxInputSize = 16384 maxInputSize = 16384
channelCount = 2 channelCount = 2
sampleRate = 48000 sampleRate = 48000
encoding = 2 pcmEncoding = 2
metadata = entries=[Picture: mimeType=image/png, description=] metadata = entries=[Picture: mimeType=image/png, description=]
sample 0: sample 0:
time = 0 time = 0
......
...@@ -16,7 +16,7 @@ track 0: ...@@ -16,7 +16,7 @@ track 0:
maxInputSize = 16384 maxInputSize = 16384
channelCount = 2 channelCount = 2
sampleRate = 48000 sampleRate = 48000
encoding = 2 pcmEncoding = 2
metadata = entries=[Picture: mimeType=image/png, description=] metadata = entries=[Picture: mimeType=image/png, description=]
sample 0: sample 0:
time = 853333 time = 853333
......
...@@ -16,7 +16,7 @@ track 0: ...@@ -16,7 +16,7 @@ track 0:
maxInputSize = 16384 maxInputSize = 16384
channelCount = 2 channelCount = 2
sampleRate = 48000 sampleRate = 48000
encoding = 2 pcmEncoding = 2
metadata = entries=[Picture: mimeType=image/png, description=] metadata = entries=[Picture: mimeType=image/png, description=]
sample 0: sample 0:
time = 1792000 time = 1792000
......
...@@ -16,7 +16,7 @@ track 0: ...@@ -16,7 +16,7 @@ track 0:
maxInputSize = 16384 maxInputSize = 16384
channelCount = 2 channelCount = 2
sampleRate = 48000 sampleRate = 48000
encoding = 2 pcmEncoding = 2
metadata = entries=[Picture: mimeType=image/png, description=] metadata = entries=[Picture: mimeType=image/png, description=]
sample 0: sample 0:
time = 2645333 time = 2645333
......
...@@ -16,7 +16,7 @@ track 0: ...@@ -16,7 +16,7 @@ track 0:
maxInputSize = 16384 maxInputSize = 16384
channelCount = 2 channelCount = 2
sampleRate = 48000 sampleRate = 48000
encoding = 2 pcmEncoding = 2
metadata = entries=[Picture: mimeType=image/png, description=] metadata = entries=[Picture: mimeType=image/png, description=]
sample 0: sample 0:
time = 0 time = 0
......
...@@ -16,7 +16,7 @@ track 0: ...@@ -16,7 +16,7 @@ track 0:
maxInputSize = 16384 maxInputSize = 16384
channelCount = 2 channelCount = 2
sampleRate = 48000 sampleRate = 48000
encoding = 2 pcmEncoding = 2
metadata = entries=[VC: TITLE=test title, VC: ARTIST=test artist] metadata = entries=[VC: TITLE=test title, VC: ARTIST=test artist]
sample 0: sample 0:
time = 0 time = 0
......
...@@ -16,7 +16,7 @@ track 0: ...@@ -16,7 +16,7 @@ track 0:
maxInputSize = 16384 maxInputSize = 16384
channelCount = 2 channelCount = 2
sampleRate = 48000 sampleRate = 48000
encoding = 2 pcmEncoding = 2
metadata = entries=[VC: TITLE=test title, VC: ARTIST=test artist] metadata = entries=[VC: TITLE=test title, VC: ARTIST=test artist]
sample 0: sample 0:
time = 853333 time = 853333
......
...@@ -16,7 +16,7 @@ track 0: ...@@ -16,7 +16,7 @@ track 0:
maxInputSize = 16384 maxInputSize = 16384
channelCount = 2 channelCount = 2
sampleRate = 48000 sampleRate = 48000
encoding = 2 pcmEncoding = 2
metadata = entries=[VC: TITLE=test title, VC: ARTIST=test artist] metadata = entries=[VC: TITLE=test title, VC: ARTIST=test artist]
sample 0: sample 0:
time = 1792000 time = 1792000
......
...@@ -16,7 +16,7 @@ track 0: ...@@ -16,7 +16,7 @@ track 0:
maxInputSize = 16384 maxInputSize = 16384
channelCount = 2 channelCount = 2
sampleRate = 48000 sampleRate = 48000
encoding = 2 pcmEncoding = 2
metadata = entries=[VC: TITLE=test title, VC: ARTIST=test artist] metadata = entries=[VC: TITLE=test title, VC: ARTIST=test artist]
sample 0: sample 0:
time = 2645333 time = 2645333
......
...@@ -16,7 +16,7 @@ track 0: ...@@ -16,7 +16,7 @@ track 0:
maxInputSize = 16384 maxInputSize = 16384
channelCount = 2 channelCount = 2
sampleRate = 48000 sampleRate = 48000
encoding = 2 pcmEncoding = 2
metadata = entries=[VC: TITLE=test title, VC: ARTIST=test artist] metadata = entries=[VC: TITLE=test title, VC: ARTIST=test artist]
sample 0: sample 0:
time = 0 time = 0
......
config: config:
encoding = 2 (16 bit) pcmEncoding = 2
channel count = 2 channelCount = 2
sample rate = 48000 sampleRate = 48000
buffer: buffer:
time = 1000 time = 1000
data = 1217833679 data = 1217833679
......
config: config:
encoding = 536870912 (24 bit) pcmEncoding = 536870912
channel count = 2 channelCount = 2
sample rate = 48000 sampleRate = 48000
buffer: buffer:
time = 0 time = 0
data = 225023649 data = 225023649
......
...@@ -16,7 +16,7 @@ track 0: ...@@ -16,7 +16,7 @@ track 0:
maxInputSize = 8820 maxInputSize = 8820
channelCount = 1 channelCount = 1
sampleRate = 44100 sampleRate = 44100
encoding = 2 pcmEncoding = 2
sample 0: sample 0:
time = 0 time = 0
flags = 1 flags = 1
......
...@@ -16,7 +16,7 @@ track 0: ...@@ -16,7 +16,7 @@ track 0:
maxInputSize = 8820 maxInputSize = 8820
channelCount = 1 channelCount = 1
sampleRate = 44100 sampleRate = 44100
encoding = 2 pcmEncoding = 2
sample 0: sample 0:
time = 333333 time = 333333
flags = 1 flags = 1
......
...@@ -16,7 +16,7 @@ track 0: ...@@ -16,7 +16,7 @@ track 0:
maxInputSize = 8820 maxInputSize = 8820
channelCount = 1 channelCount = 1
sampleRate = 44100 sampleRate = 44100
encoding = 2 pcmEncoding = 2
sample 0: sample 0:
time = 666666 time = 666666
flags = 1 flags = 1
......
...@@ -16,7 +16,7 @@ track 0: ...@@ -16,7 +16,7 @@ track 0:
maxInputSize = 8820 maxInputSize = 8820
channelCount = 1 channelCount = 1
sampleRate = 44100 sampleRate = 44100
encoding = 2 pcmEncoding = 2
sample 0: sample 0:
time = 1000000 time = 1000000
flags = 1 flags = 1
......
...@@ -16,7 +16,7 @@ track 0: ...@@ -16,7 +16,7 @@ track 0:
maxInputSize = 8820 maxInputSize = 8820
channelCount = 1 channelCount = 1
sampleRate = 44100 sampleRate = 44100
encoding = 2 pcmEncoding = 2
sample 0: sample 0:
time = 0 time = 0
flags = 1 flags = 1
......
...@@ -16,7 +16,7 @@ track 0: ...@@ -16,7 +16,7 @@ track 0:
maxInputSize = 8820 maxInputSize = 8820
channelCount = 1 channelCount = 1
sampleRate = 44100 sampleRate = 44100
encoding = 2 pcmEncoding = 2
sample 0: sample 0:
time = 0 time = 0
flags = 1 flags = 1
......
...@@ -16,7 +16,7 @@ track 0: ...@@ -16,7 +16,7 @@ track 0:
maxInputSize = 8820 maxInputSize = 8820
channelCount = 1 channelCount = 1
sampleRate = 44100 sampleRate = 44100
encoding = 2 pcmEncoding = 2
sample 0: sample 0:
time = 339395 time = 339395
flags = 1 flags = 1
......
...@@ -16,7 +16,7 @@ track 0: ...@@ -16,7 +16,7 @@ track 0:
maxInputSize = 8820 maxInputSize = 8820
channelCount = 1 channelCount = 1
sampleRate = 44100 sampleRate = 44100
encoding = 2 pcmEncoding = 2
sample 0: sample 0:
time = 678790 time = 678790
flags = 1 flags = 1
......
...@@ -16,7 +16,7 @@ track 0: ...@@ -16,7 +16,7 @@ track 0:
maxInputSize = 8820 maxInputSize = 8820
channelCount = 1 channelCount = 1
sampleRate = 44100 sampleRate = 44100
encoding = 2 pcmEncoding = 2
sample 0: sample 0:
time = 1018185 time = 1018185
flags = 1 flags = 1
......
...@@ -16,7 +16,7 @@ track 0: ...@@ -16,7 +16,7 @@ track 0:
maxInputSize = 8820 maxInputSize = 8820
channelCount = 1 channelCount = 1
sampleRate = 44100 sampleRate = 44100
encoding = 2 pcmEncoding = 2
sample 0: sample 0:
time = 0 time = 0
flags = 1 flags = 1
......
...@@ -19,11 +19,11 @@ import static com.google.common.truth.Truth.assertWithMessage; ...@@ -19,11 +19,11 @@ import static com.google.common.truth.Truth.assertWithMessage;
import android.content.Context; import android.content.Context;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.Format; import com.google.android.exoplayer2.Format;
import com.google.android.exoplayer2.audio.AudioSink; import com.google.android.exoplayer2.audio.AudioSink;
import com.google.android.exoplayer2.audio.ForwardingAudioSink; import com.google.android.exoplayer2.audio.ForwardingAudioSink;
import com.google.android.exoplayer2.util.Assertions; import com.google.android.exoplayer2.util.Assertions;
import com.google.android.exoplayer2.util.Util;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.io.PrintWriter; import java.io.PrintWriter;
...@@ -131,24 +131,24 @@ public final class CapturingAudioSink extends ForwardingAudioSink implements Dum ...@@ -131,24 +131,24 @@ public final class CapturingAudioSink extends ForwardingAudioSink implements Dum
private static final class DumpableConfiguration implements Dumper.Dumpable { private static final class DumpableConfiguration implements Dumper.Dumpable {
private final int inputEncoding; @C.PcmEncoding private final int inputPcmEncoding;
private final int inputChannelCount; private final int inputChannelCount;
private final int inputSampleRate; private final int inputSampleRate;
public DumpableConfiguration(int inputEncoding, int inputChannelCount, int inputSampleRate) { public DumpableConfiguration(
this.inputEncoding = inputEncoding; @C.PcmEncoding int inputPcmEncoding, int inputChannelCount, int inputSampleRate) {
this.inputPcmEncoding = inputPcmEncoding;
this.inputChannelCount = inputChannelCount; this.inputChannelCount = inputChannelCount;
this.inputSampleRate = inputSampleRate; this.inputSampleRate = inputSampleRate;
} }
@Override @Override
public void dump(Dumper dumper) { public void dump(Dumper dumper) {
int bitDepth = (Util.getPcmFrameSize(inputEncoding, /* channelCount= */ 1) * 8);
dumper dumper
.startBlock("config") .startBlock("config")
.add("encoding", inputEncoding + " (" + bitDepth + " bit)") .add("pcmEncoding", inputPcmEncoding)
.add("channel count", inputChannelCount) .add("channelCount", inputChannelCount)
.add("sample rate", inputSampleRate) .add("sampleRate", inputSampleRate)
.endBlock(); .endBlock();
} }
} }
......
...@@ -312,7 +312,7 @@ public final class FakeTrackOutput implements TrackOutput, Dumper.Dumpable { ...@@ -312,7 +312,7 @@ public final class FakeTrackOutput implements TrackOutput, Dumper.Dumpable {
addIfNonDefault(dumper, "pixelWidthHeightRatio", format -> format.pixelWidthHeightRatio); addIfNonDefault(dumper, "pixelWidthHeightRatio", format -> format.pixelWidthHeightRatio);
addIfNonDefault(dumper, "channelCount", format -> format.channelCount); addIfNonDefault(dumper, "channelCount", format -> format.channelCount);
addIfNonDefault(dumper, "sampleRate", format -> format.sampleRate); addIfNonDefault(dumper, "sampleRate", format -> format.sampleRate);
addIfNonDefault(dumper, "encoding", format -> format.encoding); addIfNonDefault(dumper, "pcmEncoding", format -> format.pcmEncoding);
addIfNonDefault(dumper, "encoderDelay", format -> format.encoderDelay); addIfNonDefault(dumper, "encoderDelay", format -> format.encoderDelay);
addIfNonDefault(dumper, "encoderPadding", format -> format.encoderPadding); addIfNonDefault(dumper, "encoderPadding", format -> format.encoderPadding);
addIfNonDefault(dumper, "subsampleOffsetUs", format -> format.subsampleOffsetUs); addIfNonDefault(dumper, "subsampleOffsetUs", format -> format.subsampleOffsetUs);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment