From 834664be4fc56fa4204c89ff05d8c49c8ee318c3 Mon Sep 17 00:00:00 2001 From: Haixia Shi Date: Tue, 24 Oct 2023 09:48:13 -0400 Subject: [PATCH] Add a unit test to Mp4ExtractorTest with a small av1 sample with color info. --- .../extractor/mp4/Mp4ExtractorTest.java | 6 + .../mp4/sample_with_av1c.mp4.0.dump | 146 ++++++++++++++++++ .../mp4/sample_with_av1c.mp4.1.dump | 146 ++++++++++++++++++ .../mp4/sample_with_av1c.mp4.2.dump | 146 ++++++++++++++++++ .../mp4/sample_with_av1c.mp4.3.dump | 146 ++++++++++++++++++ .../sample_with_av1c.mp4.unknown_length.dump | 146 ++++++++++++++++++ .../assets/media/mp4/sample_with_av1c.mp4 | Bin 0 -> 1965 bytes 7 files changed, 736 insertions(+) create mode 100644 libraries/test_data/src/test/assets/extractordumps/mp4/sample_with_av1c.mp4.0.dump create mode 100644 libraries/test_data/src/test/assets/extractordumps/mp4/sample_with_av1c.mp4.1.dump create mode 100644 libraries/test_data/src/test/assets/extractordumps/mp4/sample_with_av1c.mp4.2.dump create mode 100644 libraries/test_data/src/test/assets/extractordumps/mp4/sample_with_av1c.mp4.3.dump create mode 100644 libraries/test_data/src/test/assets/extractordumps/mp4/sample_with_av1c.mp4.unknown_length.dump create mode 100644 libraries/test_data/src/test/assets/media/mp4/sample_with_av1c.mp4 diff --git a/libraries/extractor/src/test/java/androidx/media3/extractor/mp4/Mp4ExtractorTest.java b/libraries/extractor/src/test/java/androidx/media3/extractor/mp4/Mp4ExtractorTest.java index 947f89e8dc..4a52f2bbb8 100644 --- a/libraries/extractor/src/test/java/androidx/media3/extractor/mp4/Mp4ExtractorTest.java +++ b/libraries/extractor/src/test/java/androidx/media3/extractor/mp4/Mp4ExtractorTest.java @@ -134,4 +134,10 @@ public final class Mp4ExtractorTest { "media/mp4/sample_with_original_quicktime_specification.mov", simulationConfig); } + + @Test + public void mp4SampleWithAv1c() throws Exception { + ExtractorAsserts.assertBehavior( + Mp4Extractor::new, "media/mp4/sample_with_av1c.mp4", simulationConfig); + } } diff --git a/libraries/test_data/src/test/assets/extractordumps/mp4/sample_with_av1c.mp4.0.dump b/libraries/test_data/src/test/assets/extractordumps/mp4/sample_with_av1c.mp4.0.dump new file mode 100644 index 0000000000..2677a1f0ba --- /dev/null +++ b/libraries/test_data/src/test/assets/extractordumps/mp4/sample_with_av1c.mp4.0.dump @@ -0,0 +1,146 @@ +seekMap: + isSeekable = true + duration = 1000000 + getPosition(0) = [[timeUs=0, position=48]] + getPosition(1) = [[timeUs=0, position=48]] + getPosition(500000) = [[timeUs=0, position=48]] + getPosition(1000000) = [[timeUs=0, position=48]] +numberOfTracks = 1 +track 0: + total output bytes = 942 + sample count = 30 + format 0: + id = 1 + sampleMimeType = video/av01 + maxInputSize = 188 + width = 720 + height = 1280 + frameRate = 30.0 + colorInfo: + colorSpace = 6 + colorRange = 2 + colorTransfer = 7 + lumaBitdepth = 10 + chromaBitdepth = 10 + metadata = entries=[TSSE: description=null: values=[Lavf60.3.100], Mp4Timestamp: creation time=0, modification time=0, timescale=1000] + sample 0: + time = 0 + flags = 1 + data = length 84, hash 9C46A819 + sample 1: + time = 33333 + flags = 0 + data = length 158, hash 43A1B544 + sample 2: + time = 66666 + flags = 0 + data = length 3, hash D600 + sample 3: + time = 100000 + flags = 0 + data = length 28, hash 27890E81 + sample 4: + time = 133333 + flags = 0 + data = length 3, hash D5F0 + sample 5: + time = 166666 + flags = 0 + data = length 55, hash 9FC5012E + sample 6: + time = 200000 + flags = 0 + data = length 3, hash D600 + sample 7: + time = 233333 + flags = 0 + data = length 27, hash 70CFAC05 + sample 8: + time = 266666 + flags = 0 + data = length 3, hash D5D0 + sample 9: + time = 300000 + flags = 0 + data = length 82, hash 944218D6 + sample 10: + time = 333333 + flags = 0 + data = length 3, hash D600 + sample 11: + time = 366666 + flags = 0 + data = length 27, hash BA4D4A06 + sample 12: + time = 400000 + flags = 0 + data = length 3, hash D5F0 + sample 13: + time = 433333 + flags = 0 + data = length 54, hash A98584CA + sample 14: + time = 466666 + flags = 0 + data = length 3, hash D600 + sample 15: + time = 500000 + flags = 0 + data = length 27, hash 45D733B8 + sample 16: + time = 533333 + flags = 0 + data = length 3, hash D5A0 + sample 17: + time = 566666 + flags = 0 + data = length 112, hash B80B26FD + sample 18: + time = 600000 + flags = 0 + data = length 3, hash D5F0 + sample 19: + time = 633333 + flags = 0 + data = length 27, hash 37DD29D9 + sample 20: + time = 666666 + flags = 0 + data = length 3, hash D5E0 + sample 21: + time = 700000 + flags = 0 + data = length 54, hash 1C15581C + sample 22: + time = 733333 + flags = 0 + data = length 3, hash D5F0 + sample 23: + time = 766666 + flags = 0 + data = length 27, hash 49EC3531 + sample 24: + time = 800000 + flags = 0 + data = length 3, hash D5B0 + sample 25: + time = 833333 + flags = 0 + data = length 84, hash 2025C9F5 + sample 26: + time = 866666 + flags = 0 + data = length 3, hash D5D0 + sample 27: + time = 900000 + flags = 0 + data = length 27, hash B927669C + sample 28: + time = 933333 + flags = 0 + data = length 3, hash D5C0 + sample 29: + time = 966666 + flags = 536870912 + data = length 27, hash 706C58AD +tracksEnded = true diff --git a/libraries/test_data/src/test/assets/extractordumps/mp4/sample_with_av1c.mp4.1.dump b/libraries/test_data/src/test/assets/extractordumps/mp4/sample_with_av1c.mp4.1.dump new file mode 100644 index 0000000000..2677a1f0ba --- /dev/null +++ b/libraries/test_data/src/test/assets/extractordumps/mp4/sample_with_av1c.mp4.1.dump @@ -0,0 +1,146 @@ +seekMap: + isSeekable = true + duration = 1000000 + getPosition(0) = [[timeUs=0, position=48]] + getPosition(1) = [[timeUs=0, position=48]] + getPosition(500000) = [[timeUs=0, position=48]] + getPosition(1000000) = [[timeUs=0, position=48]] +numberOfTracks = 1 +track 0: + total output bytes = 942 + sample count = 30 + format 0: + id = 1 + sampleMimeType = video/av01 + maxInputSize = 188 + width = 720 + height = 1280 + frameRate = 30.0 + colorInfo: + colorSpace = 6 + colorRange = 2 + colorTransfer = 7 + lumaBitdepth = 10 + chromaBitdepth = 10 + metadata = entries=[TSSE: description=null: values=[Lavf60.3.100], Mp4Timestamp: creation time=0, modification time=0, timescale=1000] + sample 0: + time = 0 + flags = 1 + data = length 84, hash 9C46A819 + sample 1: + time = 33333 + flags = 0 + data = length 158, hash 43A1B544 + sample 2: + time = 66666 + flags = 0 + data = length 3, hash D600 + sample 3: + time = 100000 + flags = 0 + data = length 28, hash 27890E81 + sample 4: + time = 133333 + flags = 0 + data = length 3, hash D5F0 + sample 5: + time = 166666 + flags = 0 + data = length 55, hash 9FC5012E + sample 6: + time = 200000 + flags = 0 + data = length 3, hash D600 + sample 7: + time = 233333 + flags = 0 + data = length 27, hash 70CFAC05 + sample 8: + time = 266666 + flags = 0 + data = length 3, hash D5D0 + sample 9: + time = 300000 + flags = 0 + data = length 82, hash 944218D6 + sample 10: + time = 333333 + flags = 0 + data = length 3, hash D600 + sample 11: + time = 366666 + flags = 0 + data = length 27, hash BA4D4A06 + sample 12: + time = 400000 + flags = 0 + data = length 3, hash D5F0 + sample 13: + time = 433333 + flags = 0 + data = length 54, hash A98584CA + sample 14: + time = 466666 + flags = 0 + data = length 3, hash D600 + sample 15: + time = 500000 + flags = 0 + data = length 27, hash 45D733B8 + sample 16: + time = 533333 + flags = 0 + data = length 3, hash D5A0 + sample 17: + time = 566666 + flags = 0 + data = length 112, hash B80B26FD + sample 18: + time = 600000 + flags = 0 + data = length 3, hash D5F0 + sample 19: + time = 633333 + flags = 0 + data = length 27, hash 37DD29D9 + sample 20: + time = 666666 + flags = 0 + data = length 3, hash D5E0 + sample 21: + time = 700000 + flags = 0 + data = length 54, hash 1C15581C + sample 22: + time = 733333 + flags = 0 + data = length 3, hash D5F0 + sample 23: + time = 766666 + flags = 0 + data = length 27, hash 49EC3531 + sample 24: + time = 800000 + flags = 0 + data = length 3, hash D5B0 + sample 25: + time = 833333 + flags = 0 + data = length 84, hash 2025C9F5 + sample 26: + time = 866666 + flags = 0 + data = length 3, hash D5D0 + sample 27: + time = 900000 + flags = 0 + data = length 27, hash B927669C + sample 28: + time = 933333 + flags = 0 + data = length 3, hash D5C0 + sample 29: + time = 966666 + flags = 536870912 + data = length 27, hash 706C58AD +tracksEnded = true diff --git a/libraries/test_data/src/test/assets/extractordumps/mp4/sample_with_av1c.mp4.2.dump b/libraries/test_data/src/test/assets/extractordumps/mp4/sample_with_av1c.mp4.2.dump new file mode 100644 index 0000000000..2677a1f0ba --- /dev/null +++ b/libraries/test_data/src/test/assets/extractordumps/mp4/sample_with_av1c.mp4.2.dump @@ -0,0 +1,146 @@ +seekMap: + isSeekable = true + duration = 1000000 + getPosition(0) = [[timeUs=0, position=48]] + getPosition(1) = [[timeUs=0, position=48]] + getPosition(500000) = [[timeUs=0, position=48]] + getPosition(1000000) = [[timeUs=0, position=48]] +numberOfTracks = 1 +track 0: + total output bytes = 942 + sample count = 30 + format 0: + id = 1 + sampleMimeType = video/av01 + maxInputSize = 188 + width = 720 + height = 1280 + frameRate = 30.0 + colorInfo: + colorSpace = 6 + colorRange = 2 + colorTransfer = 7 + lumaBitdepth = 10 + chromaBitdepth = 10 + metadata = entries=[TSSE: description=null: values=[Lavf60.3.100], Mp4Timestamp: creation time=0, modification time=0, timescale=1000] + sample 0: + time = 0 + flags = 1 + data = length 84, hash 9C46A819 + sample 1: + time = 33333 + flags = 0 + data = length 158, hash 43A1B544 + sample 2: + time = 66666 + flags = 0 + data = length 3, hash D600 + sample 3: + time = 100000 + flags = 0 + data = length 28, hash 27890E81 + sample 4: + time = 133333 + flags = 0 + data = length 3, hash D5F0 + sample 5: + time = 166666 + flags = 0 + data = length 55, hash 9FC5012E + sample 6: + time = 200000 + flags = 0 + data = length 3, hash D600 + sample 7: + time = 233333 + flags = 0 + data = length 27, hash 70CFAC05 + sample 8: + time = 266666 + flags = 0 + data = length 3, hash D5D0 + sample 9: + time = 300000 + flags = 0 + data = length 82, hash 944218D6 + sample 10: + time = 333333 + flags = 0 + data = length 3, hash D600 + sample 11: + time = 366666 + flags = 0 + data = length 27, hash BA4D4A06 + sample 12: + time = 400000 + flags = 0 + data = length 3, hash D5F0 + sample 13: + time = 433333 + flags = 0 + data = length 54, hash A98584CA + sample 14: + time = 466666 + flags = 0 + data = length 3, hash D600 + sample 15: + time = 500000 + flags = 0 + data = length 27, hash 45D733B8 + sample 16: + time = 533333 + flags = 0 + data = length 3, hash D5A0 + sample 17: + time = 566666 + flags = 0 + data = length 112, hash B80B26FD + sample 18: + time = 600000 + flags = 0 + data = length 3, hash D5F0 + sample 19: + time = 633333 + flags = 0 + data = length 27, hash 37DD29D9 + sample 20: + time = 666666 + flags = 0 + data = length 3, hash D5E0 + sample 21: + time = 700000 + flags = 0 + data = length 54, hash 1C15581C + sample 22: + time = 733333 + flags = 0 + data = length 3, hash D5F0 + sample 23: + time = 766666 + flags = 0 + data = length 27, hash 49EC3531 + sample 24: + time = 800000 + flags = 0 + data = length 3, hash D5B0 + sample 25: + time = 833333 + flags = 0 + data = length 84, hash 2025C9F5 + sample 26: + time = 866666 + flags = 0 + data = length 3, hash D5D0 + sample 27: + time = 900000 + flags = 0 + data = length 27, hash B927669C + sample 28: + time = 933333 + flags = 0 + data = length 3, hash D5C0 + sample 29: + time = 966666 + flags = 536870912 + data = length 27, hash 706C58AD +tracksEnded = true diff --git a/libraries/test_data/src/test/assets/extractordumps/mp4/sample_with_av1c.mp4.3.dump b/libraries/test_data/src/test/assets/extractordumps/mp4/sample_with_av1c.mp4.3.dump new file mode 100644 index 0000000000..2677a1f0ba --- /dev/null +++ b/libraries/test_data/src/test/assets/extractordumps/mp4/sample_with_av1c.mp4.3.dump @@ -0,0 +1,146 @@ +seekMap: + isSeekable = true + duration = 1000000 + getPosition(0) = [[timeUs=0, position=48]] + getPosition(1) = [[timeUs=0, position=48]] + getPosition(500000) = [[timeUs=0, position=48]] + getPosition(1000000) = [[timeUs=0, position=48]] +numberOfTracks = 1 +track 0: + total output bytes = 942 + sample count = 30 + format 0: + id = 1 + sampleMimeType = video/av01 + maxInputSize = 188 + width = 720 + height = 1280 + frameRate = 30.0 + colorInfo: + colorSpace = 6 + colorRange = 2 + colorTransfer = 7 + lumaBitdepth = 10 + chromaBitdepth = 10 + metadata = entries=[TSSE: description=null: values=[Lavf60.3.100], Mp4Timestamp: creation time=0, modification time=0, timescale=1000] + sample 0: + time = 0 + flags = 1 + data = length 84, hash 9C46A819 + sample 1: + time = 33333 + flags = 0 + data = length 158, hash 43A1B544 + sample 2: + time = 66666 + flags = 0 + data = length 3, hash D600 + sample 3: + time = 100000 + flags = 0 + data = length 28, hash 27890E81 + sample 4: + time = 133333 + flags = 0 + data = length 3, hash D5F0 + sample 5: + time = 166666 + flags = 0 + data = length 55, hash 9FC5012E + sample 6: + time = 200000 + flags = 0 + data = length 3, hash D600 + sample 7: + time = 233333 + flags = 0 + data = length 27, hash 70CFAC05 + sample 8: + time = 266666 + flags = 0 + data = length 3, hash D5D0 + sample 9: + time = 300000 + flags = 0 + data = length 82, hash 944218D6 + sample 10: + time = 333333 + flags = 0 + data = length 3, hash D600 + sample 11: + time = 366666 + flags = 0 + data = length 27, hash BA4D4A06 + sample 12: + time = 400000 + flags = 0 + data = length 3, hash D5F0 + sample 13: + time = 433333 + flags = 0 + data = length 54, hash A98584CA + sample 14: + time = 466666 + flags = 0 + data = length 3, hash D600 + sample 15: + time = 500000 + flags = 0 + data = length 27, hash 45D733B8 + sample 16: + time = 533333 + flags = 0 + data = length 3, hash D5A0 + sample 17: + time = 566666 + flags = 0 + data = length 112, hash B80B26FD + sample 18: + time = 600000 + flags = 0 + data = length 3, hash D5F0 + sample 19: + time = 633333 + flags = 0 + data = length 27, hash 37DD29D9 + sample 20: + time = 666666 + flags = 0 + data = length 3, hash D5E0 + sample 21: + time = 700000 + flags = 0 + data = length 54, hash 1C15581C + sample 22: + time = 733333 + flags = 0 + data = length 3, hash D5F0 + sample 23: + time = 766666 + flags = 0 + data = length 27, hash 49EC3531 + sample 24: + time = 800000 + flags = 0 + data = length 3, hash D5B0 + sample 25: + time = 833333 + flags = 0 + data = length 84, hash 2025C9F5 + sample 26: + time = 866666 + flags = 0 + data = length 3, hash D5D0 + sample 27: + time = 900000 + flags = 0 + data = length 27, hash B927669C + sample 28: + time = 933333 + flags = 0 + data = length 3, hash D5C0 + sample 29: + time = 966666 + flags = 536870912 + data = length 27, hash 706C58AD +tracksEnded = true diff --git a/libraries/test_data/src/test/assets/extractordumps/mp4/sample_with_av1c.mp4.unknown_length.dump b/libraries/test_data/src/test/assets/extractordumps/mp4/sample_with_av1c.mp4.unknown_length.dump new file mode 100644 index 0000000000..2677a1f0ba --- /dev/null +++ b/libraries/test_data/src/test/assets/extractordumps/mp4/sample_with_av1c.mp4.unknown_length.dump @@ -0,0 +1,146 @@ +seekMap: + isSeekable = true + duration = 1000000 + getPosition(0) = [[timeUs=0, position=48]] + getPosition(1) = [[timeUs=0, position=48]] + getPosition(500000) = [[timeUs=0, position=48]] + getPosition(1000000) = [[timeUs=0, position=48]] +numberOfTracks = 1 +track 0: + total output bytes = 942 + sample count = 30 + format 0: + id = 1 + sampleMimeType = video/av01 + maxInputSize = 188 + width = 720 + height = 1280 + frameRate = 30.0 + colorInfo: + colorSpace = 6 + colorRange = 2 + colorTransfer = 7 + lumaBitdepth = 10 + chromaBitdepth = 10 + metadata = entries=[TSSE: description=null: values=[Lavf60.3.100], Mp4Timestamp: creation time=0, modification time=0, timescale=1000] + sample 0: + time = 0 + flags = 1 + data = length 84, hash 9C46A819 + sample 1: + time = 33333 + flags = 0 + data = length 158, hash 43A1B544 + sample 2: + time = 66666 + flags = 0 + data = length 3, hash D600 + sample 3: + time = 100000 + flags = 0 + data = length 28, hash 27890E81 + sample 4: + time = 133333 + flags = 0 + data = length 3, hash D5F0 + sample 5: + time = 166666 + flags = 0 + data = length 55, hash 9FC5012E + sample 6: + time = 200000 + flags = 0 + data = length 3, hash D600 + sample 7: + time = 233333 + flags = 0 + data = length 27, hash 70CFAC05 + sample 8: + time = 266666 + flags = 0 + data = length 3, hash D5D0 + sample 9: + time = 300000 + flags = 0 + data = length 82, hash 944218D6 + sample 10: + time = 333333 + flags = 0 + data = length 3, hash D600 + sample 11: + time = 366666 + flags = 0 + data = length 27, hash BA4D4A06 + sample 12: + time = 400000 + flags = 0 + data = length 3, hash D5F0 + sample 13: + time = 433333 + flags = 0 + data = length 54, hash A98584CA + sample 14: + time = 466666 + flags = 0 + data = length 3, hash D600 + sample 15: + time = 500000 + flags = 0 + data = length 27, hash 45D733B8 + sample 16: + time = 533333 + flags = 0 + data = length 3, hash D5A0 + sample 17: + time = 566666 + flags = 0 + data = length 112, hash B80B26FD + sample 18: + time = 600000 + flags = 0 + data = length 3, hash D5F0 + sample 19: + time = 633333 + flags = 0 + data = length 27, hash 37DD29D9 + sample 20: + time = 666666 + flags = 0 + data = length 3, hash D5E0 + sample 21: + time = 700000 + flags = 0 + data = length 54, hash 1C15581C + sample 22: + time = 733333 + flags = 0 + data = length 3, hash D5F0 + sample 23: + time = 766666 + flags = 0 + data = length 27, hash 49EC3531 + sample 24: + time = 800000 + flags = 0 + data = length 3, hash D5B0 + sample 25: + time = 833333 + flags = 0 + data = length 84, hash 2025C9F5 + sample 26: + time = 866666 + flags = 0 + data = length 3, hash D5D0 + sample 27: + time = 900000 + flags = 0 + data = length 27, hash B927669C + sample 28: + time = 933333 + flags = 0 + data = length 3, hash D5C0 + sample 29: + time = 966666 + flags = 536870912 + data = length 27, hash 706C58AD +tracksEnded = true diff --git a/libraries/test_data/src/test/assets/media/mp4/sample_with_av1c.mp4 b/libraries/test_data/src/test/assets/media/mp4/sample_with_av1c.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..ef382aabb75b9f11d8b2b4ef620028f0e08a10d9 GIT binary patch literal 1965 zcmZ`)aZDR!6o1!tltOJ9MjKj6?a1jWGCXbqI?*+A#MMlfC^IZ-=D}Uv$sH~2(ZHhS zw#)^le@L|p#*8H<8V$)NE@~HpVS%AbP%%TqxJCU##edxX@Q-Di!S`M7+M}tj{rcYb z{oeb%@7??ED*%LI%1A;?#bp2s5Y45TR@AJVxW5$uDq~4O0I+^0^PE!U!jNC+hY?Gnr!( zkB=W*WgEkllr00Ef>+1Mwr{p|idWl*Z=8x=Yrgj6b=DuY9kXS)tUm$}ffr!ebz$o0 z>peMXgh9+QYRjC-26Sxk-h(H6oXrfbudl0q zY7OBE@X61YhgXrgB3zy23e2Wx*2h$X=h?|Z=$8-Nxmfw_#Y^-!A@(sY@ZX**i{_Bm zN!ymbQFupy|eGi#4Ei~Bc&I7|8^Bpn$cC(7j}iK zPX#>2Ln@+3TMwRF#|wey7EYgMZq8?-jrmG~SP7IxN7?#t9Yi9~;JZLN?1IbUoBuo# z`efhm)-O~nv$heI=t3zQn^r?pJ;yx_deb&O+D4W7O(>fZD`DtiYTr!UoJ`kQ=E^QE? zN8S25{swUE(IcDoLgC_`z3(-0aU)h069q|2wYe`YB?tPXVQ@eV4itBSOC?YfoQ&FD zC823#it>Qai<12i?CAo&MDsm0PrZ-^N2O(|X>F%YVA|NqC04grkrBc3QmG%{=U z8;Bj&ko*r>@5V8SgPgK}t~+#Huj{8u=IteOvNIBI_?O}&hZ!e+SY=-vH4(B;1_w99 wD;(+rvY=@+VT<{6;fYLgi3B+S1!)%ZN0|Odi4(#A{?8H;LJHXCn9=6{0D+;ou>b%7 literal 0 HcmV?d00001