Commit d33c5ac0 by kimvde Committed by Oliver Woodman

Improve tests and samples naming in TsExtractor

PiperOrigin-RevId: 305526093
parent 2e51182f
Showing with 44 additions and 163 deletions
...@@ -44,8 +44,13 @@ import org.junit.runner.RunWith; ...@@ -44,8 +44,13 @@ import org.junit.runner.RunWith;
public final class TsExtractorTest { public final class TsExtractorTest {
@Test @Test
public void sample() throws Exception { public void sampleWithH262AndMpegAudio() throws Exception {
ExtractorAsserts.assertBehavior(TsExtractor::new, "ts/sample.ts"); ExtractorAsserts.assertBehavior(TsExtractor::new, "ts/sample_h262_mpeg_audio.ts");
}
@Test
public void sampleWithH264AndMpegAudio() throws Exception {
ExtractorAsserts.assertBehavior(TsExtractor::new, "ts/sample_h264_mpeg_audio.ts");
} }
@Test @Test
...@@ -79,11 +84,6 @@ public final class TsExtractorTest { ...@@ -79,11 +84,6 @@ public final class TsExtractorTest {
} }
@Test @Test
public void sampleWithH264() throws Exception {
ExtractorAsserts.assertBehavior(TsExtractor::new, "ts/sample_h264.ts");
}
@Test
public void sampleWithLatm() throws Exception { public void sampleWithLatm() throws Exception {
ExtractorAsserts.assertBehavior(TsExtractor::new, "ts/sample_latm.ts"); ExtractorAsserts.assertBehavior(TsExtractor::new, "ts/sample_latm.ts");
} }
...@@ -102,7 +102,8 @@ public final class TsExtractorTest { ...@@ -102,7 +102,8 @@ public final class TsExtractorTest {
FakeExtractorInput input = FakeExtractorInput input =
new FakeExtractorInput.Builder() new FakeExtractorInput.Builder()
.setData( .setData(
TestUtil.getByteArray(ApplicationProvider.getApplicationContext(), "ts/sample.ts")) TestUtil.getByteArray(
ApplicationProvider.getApplicationContext(), "ts/sample_h262_mpeg_audio.ts"))
.setSimulateIOErrors(false) .setSimulateIOErrors(false)
.setSimulateUnknownLength(false) .setSimulateUnknownLength(false)
.setSimulatePartialReads(false) .setSimulatePartialReads(false)
......
...@@ -5,30 +5,12 @@ seekMap: ...@@ -5,30 +5,12 @@ seekMap:
getPosition(1) = [[timeUs=1, position=0]] getPosition(1) = [[timeUs=1, position=0]]
getPosition(0) = [[timeUs=0, position=0]] getPosition(0) = [[timeUs=0, position=0]]
getPosition(0) = [[timeUs=0, position=0]] getPosition(0) = [[timeUs=0, position=0]]
numberOfTracks = 3 numberOfTracks = 1
track 256: track 256:
total output bytes = 45026
sample count = 2
format 0:
id = 1/256
sampleMimeType = video/mpeg2
width = 640
height = 426
initializationData:
data = length 22, hash CE183139
sample 0:
time = 33367
flags = 1
data = length 20711, hash 34341E8
sample 1:
time = 66733
flags = 0
data = length 18112, hash EC44B35B
track 257:
total output bytes = 1396 total output bytes = 1396
sample count = 5 sample count = 5
format 0: format 0:
id = 1/257 id = 1/256
sampleMimeType = audio/mp4a-latm sampleMimeType = audio/mp4a-latm
codecs = mp4a.40.5 codecs = mp4a.40.5
channelCount = 1 channelCount = 1
...@@ -37,29 +19,23 @@ track 257: ...@@ -37,29 +19,23 @@ track 257:
initializationData: initializationData:
data = length 4, hash 1FE978 data = length 4, hash 1FE978
sample 0: sample 0:
time = -92233 time = 0
flags = 1 flags = 1
data = length 279, hash 79BF9F9B data = length 279, hash 79BF9F9B
sample 1: sample 1:
time = -69014 time = 23219
flags = 1 flags = 1
data = length 279, hash C96F4684 data = length 279, hash C96F4684
sample 2: sample 2:
time = -45795 time = 46438
flags = 1 flags = 1
data = length 279, hash 65670B86 data = length 279, hash 65670B86
sample 3: sample 3:
time = -22576 time = 69657
flags = 1 flags = 1
data = length 280, hash 1AF29BCE data = length 280, hash 1AF29BCE
sample 4: sample 4:
time = 643 time = 92876
flags = 1 flags = 1
data = length 279, hash C96F4684 data = length 279, hash C96F4684
track 8448:
total output bytes = 0
sample count = 0
format 0:
id = 1/8448
sampleMimeType = application/cea-608
tracksEnded = true tracksEnded = true
...@@ -5,30 +5,12 @@ seekMap: ...@@ -5,30 +5,12 @@ seekMap:
getPosition(1) = [[timeUs=1, position=0]] getPosition(1) = [[timeUs=1, position=0]]
getPosition(0) = [[timeUs=0, position=0]] getPosition(0) = [[timeUs=0, position=0]]
getPosition(0) = [[timeUs=0, position=0]] getPosition(0) = [[timeUs=0, position=0]]
numberOfTracks = 3 numberOfTracks = 1
track 256: track 256:
total output bytes = 45026
sample count = 2
format 0:
id = 1/256
sampleMimeType = video/mpeg2
width = 640
height = 426
initializationData:
data = length 22, hash CE183139
sample 0:
time = 33367
flags = 1
data = length 20711, hash 34341E8
sample 1:
time = 66733
flags = 0
data = length 18112, hash EC44B35B
track 257:
total output bytes = 1396 total output bytes = 1396
sample count = 5 sample count = 5
format 0: format 0:
id = 1/257 id = 1/256
sampleMimeType = audio/mp4a-latm sampleMimeType = audio/mp4a-latm
codecs = mp4a.40.5 codecs = mp4a.40.5
channelCount = 1 channelCount = 1
...@@ -37,29 +19,23 @@ track 257: ...@@ -37,29 +19,23 @@ track 257:
initializationData: initializationData:
data = length 4, hash 1FE978 data = length 4, hash 1FE978
sample 0: sample 0:
time = -92233 time = 0
flags = 1 flags = 1
data = length 279, hash 79BF9F9B data = length 279, hash 79BF9F9B
sample 1: sample 1:
time = -69014 time = 23219
flags = 1 flags = 1
data = length 279, hash C96F4684 data = length 279, hash C96F4684
sample 2: sample 2:
time = -45795 time = 46438
flags = 1 flags = 1
data = length 279, hash 65670B86 data = length 279, hash 65670B86
sample 3: sample 3:
time = -22576 time = 69657
flags = 1 flags = 1
data = length 280, hash 1AF29BCE data = length 280, hash 1AF29BCE
sample 4: sample 4:
time = 643 time = 92876
flags = 1 flags = 1
data = length 279, hash C96F4684 data = length 279, hash C96F4684
track 8448:
total output bytes = 0
sample count = 0
format 0:
id = 1/8448
sampleMimeType = application/cea-608
tracksEnded = true tracksEnded = true
...@@ -5,30 +5,12 @@ seekMap: ...@@ -5,30 +5,12 @@ seekMap:
getPosition(1) = [[timeUs=1, position=0]] getPosition(1) = [[timeUs=1, position=0]]
getPosition(0) = [[timeUs=0, position=0]] getPosition(0) = [[timeUs=0, position=0]]
getPosition(0) = [[timeUs=0, position=0]] getPosition(0) = [[timeUs=0, position=0]]
numberOfTracks = 3 numberOfTracks = 1
track 256: track 256:
total output bytes = 45026
sample count = 2
format 0:
id = 1/256
sampleMimeType = video/mpeg2
width = 640
height = 426
initializationData:
data = length 22, hash CE183139
sample 0:
time = 33367
flags = 1
data = length 20711, hash 34341E8
sample 1:
time = 66733
flags = 0
data = length 18112, hash EC44B35B
track 257:
total output bytes = 1396 total output bytes = 1396
sample count = 5 sample count = 5
format 0: format 0:
id = 1/257 id = 1/256
sampleMimeType = audio/mp4a-latm sampleMimeType = audio/mp4a-latm
codecs = mp4a.40.5 codecs = mp4a.40.5
channelCount = 1 channelCount = 1
...@@ -37,29 +19,23 @@ track 257: ...@@ -37,29 +19,23 @@ track 257:
initializationData: initializationData:
data = length 4, hash 1FE978 data = length 4, hash 1FE978
sample 0: sample 0:
time = -92233 time = 0
flags = 1 flags = 1
data = length 279, hash 79BF9F9B data = length 279, hash 79BF9F9B
sample 1: sample 1:
time = -69014 time = 23219
flags = 1 flags = 1
data = length 279, hash C96F4684 data = length 279, hash C96F4684
sample 2: sample 2:
time = -45795 time = 46438
flags = 1 flags = 1
data = length 279, hash 65670B86 data = length 279, hash 65670B86
sample 3: sample 3:
time = -22576 time = 69657
flags = 1 flags = 1
data = length 280, hash 1AF29BCE data = length 280, hash 1AF29BCE
sample 4: sample 4:
time = 643 time = 92876
flags = 1 flags = 1
data = length 279, hash C96F4684 data = length 279, hash C96F4684
track 8448:
total output bytes = 0
sample count = 0
format 0:
id = 1/8448
sampleMimeType = application/cea-608
tracksEnded = true tracksEnded = true
...@@ -5,30 +5,12 @@ seekMap: ...@@ -5,30 +5,12 @@ seekMap:
getPosition(1) = [[timeUs=1, position=0]] getPosition(1) = [[timeUs=1, position=0]]
getPosition(0) = [[timeUs=0, position=0]] getPosition(0) = [[timeUs=0, position=0]]
getPosition(0) = [[timeUs=0, position=0]] getPosition(0) = [[timeUs=0, position=0]]
numberOfTracks = 3 numberOfTracks = 1
track 256: track 256:
total output bytes = 45026
sample count = 2
format 0:
id = 1/256
sampleMimeType = video/mpeg2
width = 640
height = 426
initializationData:
data = length 22, hash CE183139
sample 0:
time = 33367
flags = 1
data = length 20711, hash 34341E8
sample 1:
time = 66733
flags = 0
data = length 18112, hash EC44B35B
track 257:
total output bytes = 1396 total output bytes = 1396
sample count = 5 sample count = 5
format 0: format 0:
id = 1/257 id = 1/256
sampleMimeType = audio/mp4a-latm sampleMimeType = audio/mp4a-latm
codecs = mp4a.40.5 codecs = mp4a.40.5
channelCount = 1 channelCount = 1
...@@ -37,29 +19,23 @@ track 257: ...@@ -37,29 +19,23 @@ track 257:
initializationData: initializationData:
data = length 4, hash 1FE978 data = length 4, hash 1FE978
sample 0: sample 0:
time = -92233 time = 0
flags = 1 flags = 1
data = length 279, hash 79BF9F9B data = length 279, hash 79BF9F9B
sample 1: sample 1:
time = -69014 time = 23219
flags = 1 flags = 1
data = length 279, hash C96F4684 data = length 279, hash C96F4684
sample 2: sample 2:
time = -45795 time = 46438
flags = 1 flags = 1
data = length 279, hash 65670B86 data = length 279, hash 65670B86
sample 3: sample 3:
time = -22576 time = 69657
flags = 1 flags = 1
data = length 280, hash 1AF29BCE data = length 280, hash 1AF29BCE
sample 4: sample 4:
time = 643 time = 92876
flags = 1 flags = 1
data = length 279, hash C96F4684 data = length 279, hash C96F4684
track 8448:
total output bytes = 0
sample count = 0
format 0:
id = 1/8448
sampleMimeType = application/cea-608
tracksEnded = true tracksEnded = true
...@@ -2,30 +2,12 @@ seekMap: ...@@ -2,30 +2,12 @@ seekMap:
isSeekable = false isSeekable = false
duration = UNSET TIME duration = UNSET TIME
getPosition(0) = [[timeUs=0, position=0]] getPosition(0) = [[timeUs=0, position=0]]
numberOfTracks = 3 numberOfTracks = 1
track 256: track 256:
total output bytes = 45026
sample count = 2
format 0:
id = 1/256
sampleMimeType = video/mpeg2
width = 640
height = 426
initializationData:
data = length 22, hash CE183139
sample 0:
time = 33367
flags = 1
data = length 20711, hash 34341E8
sample 1:
time = 66733
flags = 0
data = length 18112, hash EC44B35B
track 257:
total output bytes = 1396 total output bytes = 1396
sample count = 5 sample count = 5
format 0: format 0:
id = 1/257 id = 1/256
sampleMimeType = audio/mp4a-latm sampleMimeType = audio/mp4a-latm
codecs = mp4a.40.5 codecs = mp4a.40.5
channelCount = 1 channelCount = 1
...@@ -34,29 +16,23 @@ track 257: ...@@ -34,29 +16,23 @@ track 257:
initializationData: initializationData:
data = length 4, hash 1FE978 data = length 4, hash 1FE978
sample 0: sample 0:
time = -92233 time = 0
flags = 1 flags = 1
data = length 279, hash 79BF9F9B data = length 279, hash 79BF9F9B
sample 1: sample 1:
time = -69014 time = 23219
flags = 1 flags = 1
data = length 279, hash C96F4684 data = length 279, hash C96F4684
sample 2: sample 2:
time = -45795 time = 46438
flags = 1 flags = 1
data = length 279, hash 65670B86 data = length 279, hash 65670B86
sample 3: sample 3:
time = -22576 time = 69657
flags = 1 flags = 1
data = length 280, hash 1AF29BCE data = length 280, hash 1AF29BCE
sample 4: sample 4:
time = 643 time = 92876
flags = 1 flags = 1
data = length 279, hash C96F4684 data = length 279, hash C96F4684
track 8448:
total output bytes = 0
sample count = 0
format 0:
id = 1/8448
sampleMimeType = application/cea-608
tracksEnded = true tracksEnded = true
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