diff --git a/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/mp4/Mp4ExtractorTest.java b/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/mp4/Mp4ExtractorTest.java index a270ee02a3..4408ffab83 100644 --- a/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/mp4/Mp4ExtractorTest.java +++ b/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/mp4/Mp4ExtractorTest.java @@ -96,4 +96,10 @@ public final class Mp4ExtractorTest { ExtractorAsserts.assertBehavior( Mp4Extractor::new, "media/mp4/sample_mpegh_mhm1.mp4", simulationConfig); } + + @Test + public void mp4SampleWithColorInfo() throws Exception { + ExtractorAsserts.assertBehavior( + Mp4Extractor::new, "media/mp4/sample_with_color_info.mp4", simulationConfig); + } } diff --git a/testdata/src/test/assets/extractordumps/mp4/sample_with_color_info.mp4.0.dump b/testdata/src/test/assets/extractordumps/mp4/sample_with_color_info.mp4.0.dump new file mode 100644 index 0000000000..5fd303aed3 --- /dev/null +++ b/testdata/src/test/assets/extractordumps/mp4/sample_with_color_info.mp4.0.dump @@ -0,0 +1,138 @@ +seekMap: + isSeekable = true + duration = 298333 + getPosition(0) = [[timeUs=0, position=36]] + getPosition(1) = [[timeUs=0, position=36]] + getPosition(149166) = [[timeUs=0, position=36]] + getPosition(298333) = [[timeUs=0, position=36]] +numberOfTracks = 2 +track 0: + total output bytes = 122447 + sample count = 9 + format 0: + id = 1 + sampleMimeType = video/dolby-vision + codecs = hev1.08.04 + maxInputSize = 40550 + width = 1920 + height = 1080 + frameRate = 30.167633 + rotationDegrees = 90 + colorInfo: + colorSpace = 6 + colorRange = 2 + colorTransfer = 7 + hdrStaticInfo = length 0, hash 0 + initializationData: + data = length 526, hash 7B3FC433 + sample 0: + time = 0 + flags = 1 + data = length 40520, hash 6B3C7ED3 + sample 1: + time = 133333 + flags = 0 + data = length 11652, hash 24B95831 + sample 2: + time = 66666 + flags = 0 + data = length 9546, hash A8965647 + sample 3: + time = 33333 + flags = 0 + data = length 7587, hash 624A0ECE + sample 4: + time = 100000 + flags = 0 + data = length 8584, hash 8F104D88 + sample 5: + time = 266666 + flags = 0 + data = length 18275, hash E7639088 + sample 6: + time = 200000 + flags = 0 + data = length 12112, hash 7CCEBA45 + sample 7: + time = 166666 + flags = 0 + data = length 7180, hash 4E965EBB + sample 8: + time = 233333 + flags = 536870912 + data = length 6991, hash 84F4EA41 +track 1: + total output bytes = 5993 + sample count = 15 + format 0: + id = 2 + sampleMimeType = audio/mp4a-latm + codecs = mp4a.40.2 + maxInputSize = 568 + channelCount = 2 + sampleRate = 44100 + encoderPadding = 2204 + language = und + initializationData: + data = length 2, hash 5FF + sample 0: + time = 0 + flags = 1 + data = length 6, hash 6D3881D1 + sample 1: + time = 23219 + flags = 1 + data = length 272, hash E2040CE0 + sample 2: + time = 46439 + flags = 1 + data = length 476, hash E09EC12F + sample 3: + time = 69659 + flags = 1 + data = length 445, hash D23AB210 + sample 4: + time = 92879 + flags = 1 + data = length 487, hash F68FF5DD + sample 5: + time = 116099 + flags = 1 + data = length 446, hash 62477362 + sample 6: + time = 139319 + flags = 1 + data = length 429, hash BA59B5B5 + sample 7: + time = 162539 + flags = 1 + data = length 431, hash 1A0A41B3 + sample 8: + time = 185759 + flags = 1 + data = length 538, hash 9F604E03 + sample 9: + time = 208979 + flags = 1 + data = length 485, hash 94C855CD + sample 10: + time = 232199 + flags = 1 + data = length 460, hash F6AEAF79 + sample 11: + time = 255419 + flags = 1 + data = length 444, hash F513A8A9 + sample 12: + time = 278639 + flags = 1 + data = length 436, hash 2E976590 + sample 13: + time = 301859 + flags = 1 + data = length 451, hash 45B8B663 + sample 14: + time = 325079 + flags = 536870913 + data = length 187, hash 833755BD +tracksEnded = true diff --git a/testdata/src/test/assets/extractordumps/mp4/sample_with_color_info.mp4.1.dump b/testdata/src/test/assets/extractordumps/mp4/sample_with_color_info.mp4.1.dump new file mode 100644 index 0000000000..fa9e2af42e --- /dev/null +++ b/testdata/src/test/assets/extractordumps/mp4/sample_with_color_info.mp4.1.dump @@ -0,0 +1,122 @@ +seekMap: + isSeekable = true + duration = 298333 + getPosition(0) = [[timeUs=0, position=36]] + getPosition(1) = [[timeUs=0, position=36]] + getPosition(149166) = [[timeUs=0, position=36]] + getPosition(298333) = [[timeUs=0, position=36]] +numberOfTracks = 2 +track 0: + total output bytes = 122447 + sample count = 9 + format 0: + id = 1 + sampleMimeType = video/dolby-vision + codecs = hev1.08.04 + maxInputSize = 40550 + width = 1920 + height = 1080 + frameRate = 30.167633 + rotationDegrees = 90 + colorInfo: + colorSpace = 6 + colorRange = 2 + colorTransfer = 7 + hdrStaticInfo = length 0, hash 0 + initializationData: + data = length 526, hash 7B3FC433 + sample 0: + time = 0 + flags = 1 + data = length 40520, hash 6B3C7ED3 + sample 1: + time = 133333 + flags = 0 + data = length 11652, hash 24B95831 + sample 2: + time = 66666 + flags = 0 + data = length 9546, hash A8965647 + sample 3: + time = 33333 + flags = 0 + data = length 7587, hash 624A0ECE + sample 4: + time = 100000 + flags = 0 + data = length 8584, hash 8F104D88 + sample 5: + time = 266666 + flags = 0 + data = length 18275, hash E7639088 + sample 6: + time = 200000 + flags = 0 + data = length 12112, hash 7CCEBA45 + sample 7: + time = 166666 + flags = 0 + data = length 7180, hash 4E965EBB + sample 8: + time = 233333 + flags = 536870912 + data = length 6991, hash 84F4EA41 +track 1: + total output bytes = 4794 + sample count = 11 + format 0: + id = 2 + sampleMimeType = audio/mp4a-latm + codecs = mp4a.40.2 + maxInputSize = 568 + channelCount = 2 + sampleRate = 44100 + encoderPadding = 2204 + language = und + initializationData: + data = length 2, hash 5FF + sample 0: + time = 92879 + flags = 1 + data = length 487, hash F68FF5DD + sample 1: + time = 116099 + flags = 1 + data = length 446, hash 62477362 + sample 2: + time = 139319 + flags = 1 + data = length 429, hash BA59B5B5 + sample 3: + time = 162539 + flags = 1 + data = length 431, hash 1A0A41B3 + sample 4: + time = 185759 + flags = 1 + data = length 538, hash 9F604E03 + sample 5: + time = 208979 + flags = 1 + data = length 485, hash 94C855CD + sample 6: + time = 232199 + flags = 1 + data = length 460, hash F6AEAF79 + sample 7: + time = 255419 + flags = 1 + data = length 444, hash F513A8A9 + sample 8: + time = 278639 + flags = 1 + data = length 436, hash 2E976590 + sample 9: + time = 301859 + flags = 1 + data = length 451, hash 45B8B663 + sample 10: + time = 325079 + flags = 536870913 + data = length 187, hash 833755BD +tracksEnded = true diff --git a/testdata/src/test/assets/extractordumps/mp4/sample_with_color_info.mp4.2.dump b/testdata/src/test/assets/extractordumps/mp4/sample_with_color_info.mp4.2.dump new file mode 100644 index 0000000000..8b91ab1a5b --- /dev/null +++ b/testdata/src/test/assets/extractordumps/mp4/sample_with_color_info.mp4.2.dump @@ -0,0 +1,106 @@ +seekMap: + isSeekable = true + duration = 298333 + getPosition(0) = [[timeUs=0, position=36]] + getPosition(1) = [[timeUs=0, position=36]] + getPosition(149166) = [[timeUs=0, position=36]] + getPosition(298333) = [[timeUs=0, position=36]] +numberOfTracks = 2 +track 0: + total output bytes = 122447 + sample count = 9 + format 0: + id = 1 + sampleMimeType = video/dolby-vision + codecs = hev1.08.04 + maxInputSize = 40550 + width = 1920 + height = 1080 + frameRate = 30.167633 + rotationDegrees = 90 + colorInfo: + colorSpace = 6 + colorRange = 2 + colorTransfer = 7 + hdrStaticInfo = length 0, hash 0 + initializationData: + data = length 526, hash 7B3FC433 + sample 0: + time = 0 + flags = 1 + data = length 40520, hash 6B3C7ED3 + sample 1: + time = 133333 + flags = 0 + data = length 11652, hash 24B95831 + sample 2: + time = 66666 + flags = 0 + data = length 9546, hash A8965647 + sample 3: + time = 33333 + flags = 0 + data = length 7587, hash 624A0ECE + sample 4: + time = 100000 + flags = 0 + data = length 8584, hash 8F104D88 + sample 5: + time = 266666 + flags = 0 + data = length 18275, hash E7639088 + sample 6: + time = 200000 + flags = 0 + data = length 12112, hash 7CCEBA45 + sample 7: + time = 166666 + flags = 0 + data = length 7180, hash 4E965EBB + sample 8: + time = 233333 + flags = 536870912 + data = length 6991, hash 84F4EA41 +track 1: + total output bytes = 3001 + sample count = 7 + format 0: + id = 2 + sampleMimeType = audio/mp4a-latm + codecs = mp4a.40.2 + maxInputSize = 568 + channelCount = 2 + sampleRate = 44100 + encoderPadding = 2204 + language = und + initializationData: + data = length 2, hash 5FF + sample 0: + time = 185759 + flags = 1 + data = length 538, hash 9F604E03 + sample 1: + time = 208979 + flags = 1 + data = length 485, hash 94C855CD + sample 2: + time = 232199 + flags = 1 + data = length 460, hash F6AEAF79 + sample 3: + time = 255419 + flags = 1 + data = length 444, hash F513A8A9 + sample 4: + time = 278639 + flags = 1 + data = length 436, hash 2E976590 + sample 5: + time = 301859 + flags = 1 + data = length 451, hash 45B8B663 + sample 6: + time = 325079 + flags = 536870913 + data = length 187, hash 833755BD +tracksEnded = true diff --git a/testdata/src/test/assets/extractordumps/mp4/sample_with_color_info.mp4.3.dump b/testdata/src/test/assets/extractordumps/mp4/sample_with_color_info.mp4.3.dump new file mode 100644 index 0000000000..22b236d572 --- /dev/null +++ b/testdata/src/test/assets/extractordumps/mp4/sample_with_color_info.mp4.3.dump @@ -0,0 +1,90 @@ +seekMap: + isSeekable = true + duration = 298333 + getPosition(0) = [[timeUs=0, position=36]] + getPosition(1) = [[timeUs=0, position=36]] + getPosition(149166) = [[timeUs=0, position=36]] + getPosition(298333) = [[timeUs=0, position=36]] +numberOfTracks = 2 +track 0: + total output bytes = 122447 + sample count = 9 + format 0: + id = 1 + sampleMimeType = video/dolby-vision + codecs = hev1.08.04 + maxInputSize = 40550 + width = 1920 + height = 1080 + frameRate = 30.167633 + rotationDegrees = 90 + colorInfo: + colorSpace = 6 + colorRange = 2 + colorTransfer = 7 + hdrStaticInfo = length 0, hash 0 + initializationData: + data = length 526, hash 7B3FC433 + sample 0: + time = 0 + flags = 1 + data = length 40520, hash 6B3C7ED3 + sample 1: + time = 133333 + flags = 0 + data = length 11652, hash 24B95831 + sample 2: + time = 66666 + flags = 0 + data = length 9546, hash A8965647 + sample 3: + time = 33333 + flags = 0 + data = length 7587, hash 624A0ECE + sample 4: + time = 100000 + flags = 0 + data = length 8584, hash 8F104D88 + sample 5: + time = 266666 + flags = 0 + data = length 18275, hash E7639088 + sample 6: + time = 200000 + flags = 0 + data = length 12112, hash 7CCEBA45 + sample 7: + time = 166666 + flags = 0 + data = length 7180, hash 4E965EBB + sample 8: + time = 233333 + flags = 536870912 + data = length 6991, hash 84F4EA41 +track 1: + total output bytes = 1074 + sample count = 3 + format 0: + id = 2 + sampleMimeType = audio/mp4a-latm + codecs = mp4a.40.2 + maxInputSize = 568 + channelCount = 2 + sampleRate = 44100 + encoderPadding = 2204 + language = und + initializationData: + data = length 2, hash 5FF + sample 0: + time = 278639 + flags = 1 + data = length 436, hash 2E976590 + sample 1: + time = 301859 + flags = 1 + data = length 451, hash 45B8B663 + sample 2: + time = 325079 + flags = 536870913 + data = length 187, hash 833755BD +tracksEnded = true diff --git a/testdata/src/test/assets/extractordumps/mp4/sample_with_color_info.mp4.unknown_length.dump b/testdata/src/test/assets/extractordumps/mp4/sample_with_color_info.mp4.unknown_length.dump new file mode 100644 index 0000000000..5fd303aed3 --- /dev/null +++ b/testdata/src/test/assets/extractordumps/mp4/sample_with_color_info.mp4.unknown_length.dump @@ -0,0 +1,138 @@ +seekMap: + isSeekable = true + duration = 298333 + getPosition(0) = [[timeUs=0, position=36]] + getPosition(1) = [[timeUs=0, position=36]] + getPosition(149166) = [[timeUs=0, position=36]] + getPosition(298333) = [[timeUs=0, position=36]] +numberOfTracks = 2 +track 0: + total output bytes = 122447 + sample count = 9 + format 0: + id = 1 + sampleMimeType = video/dolby-vision + codecs = hev1.08.04 + maxInputSize = 40550 + width = 1920 + height = 1080 + frameRate = 30.167633 + rotationDegrees = 90 + colorInfo: + colorSpace = 6 + colorRange = 2 + colorTransfer = 7 + hdrStaticInfo = length 0, hash 0 + initializationData: + data = length 526, hash 7B3FC433 + sample 0: + time = 0 + flags = 1 + data = length 40520, hash 6B3C7ED3 + sample 1: + time = 133333 + flags = 0 + data = length 11652, hash 24B95831 + sample 2: + time = 66666 + flags = 0 + data = length 9546, hash A8965647 + sample 3: + time = 33333 + flags = 0 + data = length 7587, hash 624A0ECE + sample 4: + time = 100000 + flags = 0 + data = length 8584, hash 8F104D88 + sample 5: + time = 266666 + flags = 0 + data = length 18275, hash E7639088 + sample 6: + time = 200000 + flags = 0 + data = length 12112, hash 7CCEBA45 + sample 7: + time = 166666 + flags = 0 + data = length 7180, hash 4E965EBB + sample 8: + time = 233333 + flags = 536870912 + data = length 6991, hash 84F4EA41 +track 1: + total output bytes = 5993 + sample count = 15 + format 0: + id = 2 + sampleMimeType = audio/mp4a-latm + codecs = mp4a.40.2 + maxInputSize = 568 + channelCount = 2 + sampleRate = 44100 + encoderPadding = 2204 + language = und + initializationData: + data = length 2, hash 5FF + sample 0: + time = 0 + flags = 1 + data = length 6, hash 6D3881D1 + sample 1: + time = 23219 + flags = 1 + data = length 272, hash E2040CE0 + sample 2: + time = 46439 + flags = 1 + data = length 476, hash E09EC12F + sample 3: + time = 69659 + flags = 1 + data = length 445, hash D23AB210 + sample 4: + time = 92879 + flags = 1 + data = length 487, hash F68FF5DD + sample 5: + time = 116099 + flags = 1 + data = length 446, hash 62477362 + sample 6: + time = 139319 + flags = 1 + data = length 429, hash BA59B5B5 + sample 7: + time = 162539 + flags = 1 + data = length 431, hash 1A0A41B3 + sample 8: + time = 185759 + flags = 1 + data = length 538, hash 9F604E03 + sample 9: + time = 208979 + flags = 1 + data = length 485, hash 94C855CD + sample 10: + time = 232199 + flags = 1 + data = length 460, hash F6AEAF79 + sample 11: + time = 255419 + flags = 1 + data = length 444, hash F513A8A9 + sample 12: + time = 278639 + flags = 1 + data = length 436, hash 2E976590 + sample 13: + time = 301859 + flags = 1 + data = length 451, hash 45B8B663 + sample 14: + time = 325079 + flags = 536870913 + data = length 187, hash 833755BD +tracksEnded = true diff --git a/testdata/src/test/assets/media/mp4/sample_with_color_info.mp4 b/testdata/src/test/assets/media/mp4/sample_with_color_info.mp4 new file mode 100644 index 0000000000..62d259b81b Binary files /dev/null and b/testdata/src/test/assets/media/mp4/sample_with_color_info.mp4 differ