Add PsExtractor test for AC3

PiperOrigin-RevId: 305503256
This commit is contained in:
kimvde 2020-04-08 18:18:55 +01:00 committed by Oliver Woodman
parent 376d02ac3f
commit afc2858ad0
14 changed files with 153 additions and 4 deletions

View File

@ -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);

View File

@ -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");
} }
} }

Binary file not shown.

View 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

View 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

View 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

View 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

View 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