diff --git a/libraries/extractor/src/test/java/androidx/media3/extractor/ts/TsExtractorTest.java b/libraries/extractor/src/test/java/androidx/media3/extractor/ts/TsExtractorTest.java index 0ccfe6910f..1b30c3f412 100644 --- a/libraries/extractor/src/test/java/androidx/media3/extractor/ts/TsExtractorTest.java +++ b/libraries/extractor/src/test/java/androidx/media3/extractor/ts/TsExtractorTest.java @@ -95,6 +95,14 @@ public final class TsExtractorTest { simulationConfig); } + @Test + public void sampleWithH264AndIFramesOnly() throws Exception { + ExtractorAsserts.assertBehavior( + getExtractorFactory(subtitlesParsedDuringExtraction), + "media/ts/sample_h264_iframes_only.ts", + simulationConfig); + } + @Test public void sampleWithH264AndMpegAudio() throws Exception { ExtractorAsserts.assertBehavior( diff --git a/libraries/test_data/src/test/assets/extractordumps/ts/sample_h264_iframes_only.ts.0.dump b/libraries/test_data/src/test/assets/extractordumps/ts/sample_h264_iframes_only.ts.0.dump new file mode 100644 index 0000000000..53c260629c --- /dev/null +++ b/libraries/test_data/src/test/assets/extractordumps/ts/sample_h264_iframes_only.ts.0.dump @@ -0,0 +1,140 @@ +seekMap: + isSeekable = true + duration = 966666 + getPosition(0) = [[timeUs=0, position=0]] + getPosition(1) = [[timeUs=1, position=0]] + getPosition(483333) = [[timeUs=483333, position=103846]] + getPosition(966666) = [[timeUs=966666, position=207881]] +numberOfTracks = 1 +track 256: + total output bytes = 207313 + sample count = 29 + format 0: + id = 1/256 + sampleMimeType = video/avc + codecs = avc1.64101F + width = 854 + height = 480 + colorInfo: + lumaBitdepth = 8 + chromaBitdepth = 8 + initializationData: + data = length 25, hash 8F89F820 + data = length 8, hash 9BAAE288 + sample 0: + time = 0 + flags = 1 + data = length 774, hash 72202772 + sample 1: + time = 33333 + flags = 1 + data = length 3340, hash DBB55E8B + sample 2: + time = 66666 + flags = 1 + data = length 5499, hash 6B17E43 + sample 3: + time = 100000 + flags = 1 + data = length 6409, hash 8F315700 + sample 4: + time = 133333 + flags = 1 + data = length 7254, hash FF49E98C + sample 5: + time = 166666 + flags = 1 + data = length 7638, hash 8FCCA884 + sample 6: + time = 200000 + flags = 1 + data = length 7555, hash 3FAA49AD + sample 7: + time = 233333 + flags = 1 + data = length 7549, hash 5FC03E0C + sample 8: + time = 266666 + flags = 1 + data = length 7506, hash D649BB10 + sample 9: + time = 300000 + flags = 1 + data = length 7496, hash F58C0476 + sample 10: + time = 333333 + flags = 1 + data = length 7344, hash 3B8E291C + sample 11: + time = 366666 + flags = 1 + data = length 7343, hash A8389647 + sample 12: + time = 400000 + flags = 1 + data = length 7316, hash FD7A4579 + sample 13: + time = 433333 + flags = 1 + data = length 7302, hash D701AB2 + sample 14: + time = 466666 + flags = 1 + data = length 7324, hash 1B8B56B4 + sample 15: + time = 500000 + flags = 1 + data = length 7273, hash 6E72090F + sample 16: + time = 533333 + flags = 1 + data = length 7298, hash 4CAD6DE6 + sample 17: + time = 566666 + flags = 1 + data = length 7287, hash 310B4416 + sample 18: + time = 600000 + flags = 1 + data = length 7268, hash DEDEAAE6 + sample 19: + time = 633333 + flags = 1 + data = length 7243, hash B5CFF1BB + sample 20: + time = 666666 + flags = 1 + data = length 7335, hash B9E7BA4C + sample 21: + time = 700000 + flags = 1 + data = length 7326, hash 69DDD01 + sample 22: + time = 733333 + flags = 1 + data = length 7379, hash 8EA6EDC8 + sample 23: + time = 766666 + flags = 1 + data = length 7341, hash 751383 + sample 24: + time = 800000 + flags = 1 + data = length 7323, hash E6D08DC8 + sample 25: + time = 833333 + flags = 1 + data = length 7302, hash DADFB1AC + sample 26: + time = 866666 + flags = 1 + data = length 7327, hash 401FE473 + sample 27: + time = 900000 + flags = 1 + data = length 7340, hash DAAC756E + sample 28: + time = 933333 + flags = 1 + data = length 7334, hash 614FA397 +tracksEnded = true diff --git a/libraries/test_data/src/test/assets/extractordumps/ts/sample_h264_iframes_only.ts.1.dump b/libraries/test_data/src/test/assets/extractordumps/ts/sample_h264_iframes_only.ts.1.dump new file mode 100644 index 0000000000..dba6260300 --- /dev/null +++ b/libraries/test_data/src/test/assets/extractordumps/ts/sample_h264_iframes_only.ts.1.dump @@ -0,0 +1,104 @@ +seekMap: + isSeekable = true + duration = 966666 + getPosition(0) = [[timeUs=0, position=0]] + getPosition(1) = [[timeUs=1, position=0]] + getPosition(483333) = [[timeUs=483333, position=103846]] + getPosition(966666) = [[timeUs=966666, position=207881]] +numberOfTracks = 1 +track 256: + total output bytes = 153789 + sample count = 20 + format 0: + id = 1/256 + sampleMimeType = video/avc + codecs = avc1.64101F + width = 854 + height = 480 + colorInfo: + lumaBitdepth = 8 + chromaBitdepth = 8 + initializationData: + data = length 25, hash 8F89F820 + data = length 8, hash 9BAAE288 + sample 0: + time = 300000 + flags = 1 + data = length 7496, hash F58C0476 + sample 1: + time = 333333 + flags = 1 + data = length 7344, hash 3B8E291C + sample 2: + time = 366666 + flags = 1 + data = length 7343, hash A8389647 + sample 3: + time = 400000 + flags = 1 + data = length 7316, hash FD7A4579 + sample 4: + time = 433333 + flags = 1 + data = length 7302, hash D701AB2 + sample 5: + time = 466666 + flags = 1 + data = length 7324, hash 1B8B56B4 + sample 6: + time = 500000 + flags = 1 + data = length 7273, hash 6E72090F + sample 7: + time = 533333 + flags = 1 + data = length 7298, hash 4CAD6DE6 + sample 8: + time = 566666 + flags = 1 + data = length 7287, hash 310B4416 + sample 9: + time = 600000 + flags = 1 + data = length 7268, hash DEDEAAE6 + sample 10: + time = 633333 + flags = 1 + data = length 7243, hash B5CFF1BB + sample 11: + time = 666666 + flags = 1 + data = length 7335, hash B9E7BA4C + sample 12: + time = 700000 + flags = 1 + data = length 7326, hash 69DDD01 + sample 13: + time = 733333 + flags = 1 + data = length 7379, hash 8EA6EDC8 + sample 14: + time = 766666 + flags = 1 + data = length 7341, hash 751383 + sample 15: + time = 800000 + flags = 1 + data = length 7323, hash E6D08DC8 + sample 16: + time = 833333 + flags = 1 + data = length 7302, hash DADFB1AC + sample 17: + time = 866666 + flags = 1 + data = length 7327, hash 401FE473 + sample 18: + time = 900000 + flags = 1 + data = length 7340, hash DAAC756E + sample 19: + time = 933333 + flags = 1 + data = length 7334, hash 614FA397 +tracksEnded = true diff --git a/libraries/test_data/src/test/assets/extractordumps/ts/sample_h264_iframes_only.ts.2.dump b/libraries/test_data/src/test/assets/extractordumps/ts/sample_h264_iframes_only.ts.2.dump new file mode 100644 index 0000000000..6c9e31fc73 --- /dev/null +++ b/libraries/test_data/src/test/assets/extractordumps/ts/sample_h264_iframes_only.ts.2.dump @@ -0,0 +1,68 @@ +seekMap: + isSeekable = true + duration = 966666 + getPosition(0) = [[timeUs=0, position=0]] + getPosition(1) = [[timeUs=1, position=0]] + getPosition(483333) = [[timeUs=483333, position=103846]] + getPosition(966666) = [[timeUs=966666, position=207881]] +numberOfTracks = 1 +track 256: + total output bytes = 87806 + sample count = 11 + format 0: + id = 1/256 + sampleMimeType = video/avc + codecs = avc1.64101F + width = 854 + height = 480 + colorInfo: + lumaBitdepth = 8 + chromaBitdepth = 8 + initializationData: + data = length 25, hash 8F89F820 + data = length 8, hash 9BAAE288 + sample 0: + time = 600000 + flags = 1 + data = length 7268, hash DEDEAAE6 + sample 1: + time = 633333 + flags = 1 + data = length 7243, hash B5CFF1BB + sample 2: + time = 666666 + flags = 1 + data = length 7335, hash B9E7BA4C + sample 3: + time = 700000 + flags = 1 + data = length 7326, hash 69DDD01 + sample 4: + time = 733333 + flags = 1 + data = length 7379, hash 8EA6EDC8 + sample 5: + time = 766666 + flags = 1 + data = length 7341, hash 751383 + sample 6: + time = 800000 + flags = 1 + data = length 7323, hash E6D08DC8 + sample 7: + time = 833333 + flags = 1 + data = length 7302, hash DADFB1AC + sample 8: + time = 866666 + flags = 1 + data = length 7327, hash 401FE473 + sample 9: + time = 900000 + flags = 1 + data = length 7340, hash DAAC756E + sample 10: + time = 933333 + flags = 1 + data = length 7334, hash 614FA397 +tracksEnded = true diff --git a/libraries/test_data/src/test/assets/extractordumps/ts/sample_h264_iframes_only.ts.3.dump b/libraries/test_data/src/test/assets/extractordumps/ts/sample_h264_iframes_only.ts.3.dump new file mode 100644 index 0000000000..2ee6d90e32 --- /dev/null +++ b/libraries/test_data/src/test/assets/extractordumps/ts/sample_h264_iframes_only.ts.3.dump @@ -0,0 +1,24 @@ +seekMap: + isSeekable = true + duration = 966666 + getPosition(0) = [[timeUs=0, position=0]] + getPosition(1) = [[timeUs=1, position=0]] + getPosition(483333) = [[timeUs=483333, position=103846]] + getPosition(966666) = [[timeUs=966666, position=207881]] +numberOfTracks = 1 +track 256: + total output bytes = 7288 + sample count = 0 + format 0: + id = 1/256 + sampleMimeType = video/avc + codecs = avc1.64101F + width = 854 + height = 480 + colorInfo: + lumaBitdepth = 8 + chromaBitdepth = 8 + initializationData: + data = length 25, hash 8F89F820 + data = length 8, hash 9BAAE288 +tracksEnded = true diff --git a/libraries/test_data/src/test/assets/extractordumps/ts/sample_h264_iframes_only.ts.unknown_length.dump b/libraries/test_data/src/test/assets/extractordumps/ts/sample_h264_iframes_only.ts.unknown_length.dump new file mode 100644 index 0000000000..1aa2502d19 --- /dev/null +++ b/libraries/test_data/src/test/assets/extractordumps/ts/sample_h264_iframes_only.ts.unknown_length.dump @@ -0,0 +1,137 @@ +seekMap: + isSeekable = false + duration = UNSET TIME + getPosition(0) = [[timeUs=0, position=0]] +numberOfTracks = 1 +track 256: + total output bytes = 207313 + sample count = 29 + format 0: + id = 1/256 + sampleMimeType = video/avc + codecs = avc1.64101F + width = 854 + height = 480 + colorInfo: + lumaBitdepth = 8 + chromaBitdepth = 8 + initializationData: + data = length 25, hash 8F89F820 + data = length 8, hash 9BAAE288 + sample 0: + time = 0 + flags = 1 + data = length 774, hash 72202772 + sample 1: + time = 33333 + flags = 1 + data = length 3340, hash DBB55E8B + sample 2: + time = 66666 + flags = 1 + data = length 5499, hash 6B17E43 + sample 3: + time = 100000 + flags = 1 + data = length 6409, hash 8F315700 + sample 4: + time = 133333 + flags = 1 + data = length 7254, hash FF49E98C + sample 5: + time = 166666 + flags = 1 + data = length 7638, hash 8FCCA884 + sample 6: + time = 200000 + flags = 1 + data = length 7555, hash 3FAA49AD + sample 7: + time = 233333 + flags = 1 + data = length 7549, hash 5FC03E0C + sample 8: + time = 266666 + flags = 1 + data = length 7506, hash D649BB10 + sample 9: + time = 300000 + flags = 1 + data = length 7496, hash F58C0476 + sample 10: + time = 333333 + flags = 1 + data = length 7344, hash 3B8E291C + sample 11: + time = 366666 + flags = 1 + data = length 7343, hash A8389647 + sample 12: + time = 400000 + flags = 1 + data = length 7316, hash FD7A4579 + sample 13: + time = 433333 + flags = 1 + data = length 7302, hash D701AB2 + sample 14: + time = 466666 + flags = 1 + data = length 7324, hash 1B8B56B4 + sample 15: + time = 500000 + flags = 1 + data = length 7273, hash 6E72090F + sample 16: + time = 533333 + flags = 1 + data = length 7298, hash 4CAD6DE6 + sample 17: + time = 566666 + flags = 1 + data = length 7287, hash 310B4416 + sample 18: + time = 600000 + flags = 1 + data = length 7268, hash DEDEAAE6 + sample 19: + time = 633333 + flags = 1 + data = length 7243, hash B5CFF1BB + sample 20: + time = 666666 + flags = 1 + data = length 7335, hash B9E7BA4C + sample 21: + time = 700000 + flags = 1 + data = length 7326, hash 69DDD01 + sample 22: + time = 733333 + flags = 1 + data = length 7379, hash 8EA6EDC8 + sample 23: + time = 766666 + flags = 1 + data = length 7341, hash 751383 + sample 24: + time = 800000 + flags = 1 + data = length 7323, hash E6D08DC8 + sample 25: + time = 833333 + flags = 1 + data = length 7302, hash DADFB1AC + sample 26: + time = 866666 + flags = 1 + data = length 7327, hash 401FE473 + sample 27: + time = 900000 + flags = 1 + data = length 7340, hash DAAC756E + sample 28: + time = 933333 + flags = 1 + data = length 7334, hash 614FA397 +tracksEnded = true diff --git a/libraries/test_data/src/test/assets/media/ts/sample_h264_iframes_only.ts b/libraries/test_data/src/test/assets/media/ts/sample_h264_iframes_only.ts new file mode 100644 index 0000000000..eb1566f011 Binary files /dev/null and b/libraries/test_data/src/test/assets/media/ts/sample_h264_iframes_only.ts differ