Add PsExtractor test for AC3
PiperOrigin-RevId: 305503256
This commit is contained in:
parent
376d02ac3f
commit
afc2858ad0
@ -51,7 +51,8 @@ public final class PsDurationReaderTest {
|
|||||||
FakeExtractorInput input =
|
FakeExtractorInput input =
|
||||||
new FakeExtractorInput.Builder()
|
new FakeExtractorInput.Builder()
|
||||||
.setData(
|
.setData(
|
||||||
TestUtil.getByteArray(ApplicationProvider.getApplicationContext(), "ts/sample.ps"))
|
TestUtil.getByteArray(
|
||||||
|
ApplicationProvider.getApplicationContext(), "ts/sample_h262_mpeg_audio.ps"))
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
int result = Extractor.RESULT_CONTINUE;
|
int result = Extractor.RESULT_CONTINUE;
|
||||||
@ -70,7 +71,8 @@ public final class PsDurationReaderTest {
|
|||||||
FakeExtractorInput input =
|
FakeExtractorInput input =
|
||||||
new FakeExtractorInput.Builder()
|
new FakeExtractorInput.Builder()
|
||||||
.setData(
|
.setData(
|
||||||
TestUtil.getByteArray(ApplicationProvider.getApplicationContext(), "ts/sample.ps"))
|
TestUtil.getByteArray(
|
||||||
|
ApplicationProvider.getApplicationContext(), "ts/sample_h262_mpeg_audio.ps"))
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
input.setPosition(1234);
|
input.setPosition(1234);
|
||||||
|
@ -25,7 +25,12 @@ import org.junit.runner.RunWith;
|
|||||||
public final class PsExtractorTest {
|
public final class PsExtractorTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void sample() throws Exception {
|
public void sampleWithH262AndMpegAudio() throws Exception {
|
||||||
ExtractorAsserts.assertBehavior(PsExtractor::new, "ts/sample.ps");
|
ExtractorAsserts.assertBehavior(PsExtractor::new, "ts/sample_h262_mpeg_audio.ps");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void sampleWithAc3() throws Exception {
|
||||||
|
ExtractorAsserts.assertBehavior(PsExtractor::new, "ts/sample_ac3.ps");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
BIN
testdata/src/test/assets/ts/sample_ac3.ps
vendored
Normal file
BIN
testdata/src/test/assets/ts/sample_ac3.ps
vendored
Normal file
Binary file not shown.
29
testdata/src/test/assets/ts/sample_ac3.ps.0.dump
vendored
Normal file
29
testdata/src/test/assets/ts/sample_ac3.ps.0.dump
vendored
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
seekMap:
|
||||||
|
isSeekable = true
|
||||||
|
duration = 0
|
||||||
|
getPosition(0) = [[timeUs=0, position=0]]
|
||||||
|
getPosition(1) = [[timeUs=1, position=0]]
|
||||||
|
getPosition(0) = [[timeUs=0, position=0]]
|
||||||
|
getPosition(0) = [[timeUs=0, position=0]]
|
||||||
|
numberOfTracks = 1
|
||||||
|
track 189:
|
||||||
|
total output bytes = 1252
|
||||||
|
sample count = 3
|
||||||
|
format 0:
|
||||||
|
id = 189
|
||||||
|
sampleMimeType = audio/ac3
|
||||||
|
channelCount = 1
|
||||||
|
sampleRate = 44100
|
||||||
|
sample 0:
|
||||||
|
time = 0
|
||||||
|
flags = 1
|
||||||
|
data = length 416, hash 6B14E268
|
||||||
|
sample 1:
|
||||||
|
time = 34829
|
||||||
|
flags = 1
|
||||||
|
data = length 418, hash BC27DF0B
|
||||||
|
sample 2:
|
||||||
|
time = 69658
|
||||||
|
flags = 1
|
||||||
|
data = length 418, hash BC27DF0B
|
||||||
|
tracksEnded = false
|
29
testdata/src/test/assets/ts/sample_ac3.ps.1.dump
vendored
Normal file
29
testdata/src/test/assets/ts/sample_ac3.ps.1.dump
vendored
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
seekMap:
|
||||||
|
isSeekable = true
|
||||||
|
duration = 0
|
||||||
|
getPosition(0) = [[timeUs=0, position=0]]
|
||||||
|
getPosition(1) = [[timeUs=1, position=0]]
|
||||||
|
getPosition(0) = [[timeUs=0, position=0]]
|
||||||
|
getPosition(0) = [[timeUs=0, position=0]]
|
||||||
|
numberOfTracks = 1
|
||||||
|
track 189:
|
||||||
|
total output bytes = 1252
|
||||||
|
sample count = 3
|
||||||
|
format 0:
|
||||||
|
id = 189
|
||||||
|
sampleMimeType = audio/ac3
|
||||||
|
channelCount = 1
|
||||||
|
sampleRate = 44100
|
||||||
|
sample 0:
|
||||||
|
time = 0
|
||||||
|
flags = 1
|
||||||
|
data = length 416, hash 6B14E268
|
||||||
|
sample 1:
|
||||||
|
time = 34829
|
||||||
|
flags = 1
|
||||||
|
data = length 418, hash BC27DF0B
|
||||||
|
sample 2:
|
||||||
|
time = 69658
|
||||||
|
flags = 1
|
||||||
|
data = length 418, hash BC27DF0B
|
||||||
|
tracksEnded = false
|
29
testdata/src/test/assets/ts/sample_ac3.ps.2.dump
vendored
Normal file
29
testdata/src/test/assets/ts/sample_ac3.ps.2.dump
vendored
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
seekMap:
|
||||||
|
isSeekable = true
|
||||||
|
duration = 0
|
||||||
|
getPosition(0) = [[timeUs=0, position=0]]
|
||||||
|
getPosition(1) = [[timeUs=1, position=0]]
|
||||||
|
getPosition(0) = [[timeUs=0, position=0]]
|
||||||
|
getPosition(0) = [[timeUs=0, position=0]]
|
||||||
|
numberOfTracks = 1
|
||||||
|
track 189:
|
||||||
|
total output bytes = 1252
|
||||||
|
sample count = 3
|
||||||
|
format 0:
|
||||||
|
id = 189
|
||||||
|
sampleMimeType = audio/ac3
|
||||||
|
channelCount = 1
|
||||||
|
sampleRate = 44100
|
||||||
|
sample 0:
|
||||||
|
time = 0
|
||||||
|
flags = 1
|
||||||
|
data = length 416, hash 6B14E268
|
||||||
|
sample 1:
|
||||||
|
time = 34829
|
||||||
|
flags = 1
|
||||||
|
data = length 418, hash BC27DF0B
|
||||||
|
sample 2:
|
||||||
|
time = 69658
|
||||||
|
flags = 1
|
||||||
|
data = length 418, hash BC27DF0B
|
||||||
|
tracksEnded = false
|
29
testdata/src/test/assets/ts/sample_ac3.ps.3.dump
vendored
Normal file
29
testdata/src/test/assets/ts/sample_ac3.ps.3.dump
vendored
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
seekMap:
|
||||||
|
isSeekable = true
|
||||||
|
duration = 0
|
||||||
|
getPosition(0) = [[timeUs=0, position=0]]
|
||||||
|
getPosition(1) = [[timeUs=1, position=0]]
|
||||||
|
getPosition(0) = [[timeUs=0, position=0]]
|
||||||
|
getPosition(0) = [[timeUs=0, position=0]]
|
||||||
|
numberOfTracks = 1
|
||||||
|
track 189:
|
||||||
|
total output bytes = 1252
|
||||||
|
sample count = 3
|
||||||
|
format 0:
|
||||||
|
id = 189
|
||||||
|
sampleMimeType = audio/ac3
|
||||||
|
channelCount = 1
|
||||||
|
sampleRate = 44100
|
||||||
|
sample 0:
|
||||||
|
time = 0
|
||||||
|
flags = 1
|
||||||
|
data = length 416, hash 6B14E268
|
||||||
|
sample 1:
|
||||||
|
time = 34829
|
||||||
|
flags = 1
|
||||||
|
data = length 418, hash BC27DF0B
|
||||||
|
sample 2:
|
||||||
|
time = 69658
|
||||||
|
flags = 1
|
||||||
|
data = length 418, hash BC27DF0B
|
||||||
|
tracksEnded = false
|
26
testdata/src/test/assets/ts/sample_ac3.ps.unknown_length.dump
vendored
Normal file
26
testdata/src/test/assets/ts/sample_ac3.ps.unknown_length.dump
vendored
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
seekMap:
|
||||||
|
isSeekable = false
|
||||||
|
duration = UNSET TIME
|
||||||
|
getPosition(0) = [[timeUs=0, position=0]]
|
||||||
|
numberOfTracks = 1
|
||||||
|
track 189:
|
||||||
|
total output bytes = 1252
|
||||||
|
sample count = 3
|
||||||
|
format 0:
|
||||||
|
id = 189
|
||||||
|
sampleMimeType = audio/ac3
|
||||||
|
channelCount = 1
|
||||||
|
sampleRate = 44100
|
||||||
|
sample 0:
|
||||||
|
time = 0
|
||||||
|
flags = 1
|
||||||
|
data = length 416, hash 6B14E268
|
||||||
|
sample 1:
|
||||||
|
time = 34829
|
||||||
|
flags = 1
|
||||||
|
data = length 418, hash BC27DF0B
|
||||||
|
sample 2:
|
||||||
|
time = 69658
|
||||||
|
flags = 1
|
||||||
|
data = length 418, hash BC27DF0B
|
||||||
|
tracksEnded = false
|
Loading…
x
Reference in New Issue
Block a user