OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <stddef.h> | 5 #include <stddef.h> |
6 #include <stdint.h> | 6 #include <stdint.h> |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 13 matching lines...) Expand all Loading... |
24 #include "media/base/content_decryption_module.h" | 24 #include "media/base/content_decryption_module.h" |
25 #include "media/base/decoder_buffer.h" | 25 #include "media/base/decoder_buffer.h" |
26 #include "media/base/media.h" | 26 #include "media/base/media.h" |
27 #include "media/base/media_switches.h" | 27 #include "media/base/media_switches.h" |
28 #include "media/base/media_tracks.h" | 28 #include "media/base/media_tracks.h" |
29 #include "media/base/test_data_util.h" | 29 #include "media/base/test_data_util.h" |
30 #include "media/base/timestamp_constants.h" | 30 #include "media/base/timestamp_constants.h" |
31 #include "media/cdm/aes_decryptor.h" | 31 #include "media/cdm/aes_decryptor.h" |
32 #include "media/cdm/json_web_key.h" | 32 #include "media/cdm/json_web_key.h" |
33 #include "media/filters/chunk_demuxer.h" | 33 #include "media/filters/chunk_demuxer.h" |
| 34 #include "media/media_features.h" |
34 #include "media/renderers/renderer_impl.h" | 35 #include "media/renderers/renderer_impl.h" |
35 #include "media/test/pipeline_integration_test_base.h" | 36 #include "media/test/pipeline_integration_test_base.h" |
36 #include "testing/gmock/include/gmock/gmock.h" | 37 #include "testing/gmock/include/gmock/gmock.h" |
37 #include "url/gurl.h" | 38 #include "url/gurl.h" |
38 | 39 |
39 #if defined(MOJO_RENDERER) | 40 #if defined(MOJO_RENDERER) |
40 #include "media/mojo/clients/mojo_renderer.h" | 41 #include "media/mojo/clients/mojo_renderer.h" |
41 #include "media/mojo/interfaces/interface_factory.mojom.h" | 42 #include "media/mojo/interfaces/interface_factory.mojom.h" |
42 #include "media/mojo/interfaces/renderer.mojom.h" | 43 #include "media/mojo/interfaces/renderer.mojom.h" |
43 #include "services/service_manager/public/cpp/connect.h" | 44 #include "services/service_manager/public/cpp/connect.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 | 94 |
94 namespace media { | 95 namespace media { |
95 | 96 |
96 const char kSourceId[] = "SourceId"; | 97 const char kSourceId[] = "SourceId"; |
97 | 98 |
98 const char kWebM[] = "video/webm; codecs=\"vp8,vorbis\""; | 99 const char kWebM[] = "video/webm; codecs=\"vp8,vorbis\""; |
99 const char kWebMVP9[] = "video/webm; codecs=\"vp9\""; | 100 const char kWebMVP9[] = "video/webm; codecs=\"vp9\""; |
100 const char kAudioOnlyWebM[] = "video/webm; codecs=\"vorbis\""; | 101 const char kAudioOnlyWebM[] = "video/webm; codecs=\"vorbis\""; |
101 const char kOpusAudioOnlyWebM[] = "video/webm; codecs=\"opus\""; | 102 const char kOpusAudioOnlyWebM[] = "video/webm; codecs=\"opus\""; |
102 const char kVideoOnlyWebM[] = "video/webm; codecs=\"vp8\""; | 103 const char kVideoOnlyWebM[] = "video/webm; codecs=\"vp8\""; |
103 #if defined(USE_PROPRIETARY_CODECS) | 104 #if BUILDFLAG(USE_PROPRIETARY_CODECS) |
104 const char kADTS[] = "audio/aac"; | 105 const char kADTS[] = "audio/aac"; |
105 const char kMP4[] = "video/mp4; codecs=\"avc1.4D4041,mp4a.40.2\""; | 106 const char kMP4[] = "video/mp4; codecs=\"avc1.4D4041,mp4a.40.2\""; |
106 const char kMP4VideoAVC3[] = "video/mp4; codecs=\"avc3.64001f\""; | 107 const char kMP4VideoAVC3[] = "video/mp4; codecs=\"avc3.64001f\""; |
107 const char kMP4VideoVP9[] = "video/mp4; codecs=\"vp09.00.00.08.01.01.00.00\""; | 108 const char kMP4VideoVP9[] = "video/mp4; codecs=\"vp09.00.00.08.01.01.00.00\""; |
108 const char kMP4VideoHEVC1[] = "video/mp4; codecs=\"hvc1.1.6.L93.B0\""; | 109 const char kMP4VideoHEVC1[] = "video/mp4; codecs=\"hvc1.1.6.L93.B0\""; |
109 const char kMP4VideoHEVC2[] = "video/mp4; codecs=\"hev1.1.6.L93.B0\""; | 110 const char kMP4VideoHEVC2[] = "video/mp4; codecs=\"hev1.1.6.L93.B0\""; |
110 const char kMP4Video[] = "video/mp4; codecs=\"avc1.4D4041\""; | 111 const char kMP4Video[] = "video/mp4; codecs=\"avc1.4D4041\""; |
111 const char kMP4Audio[] = "audio/mp4; codecs=\"mp4a.40.2\""; | 112 const char kMP4Audio[] = "audio/mp4; codecs=\"mp4a.40.2\""; |
112 const char kMP3[] = "audio/mpeg"; | 113 const char kMP3[] = "audio/mpeg"; |
113 const char kMP2AudioSBR[] = "video/mp2t; codecs=\"avc1.4D4041,mp4a.40.5\""; | 114 const char kMP2AudioSBR[] = "video/mp2t; codecs=\"avc1.4D4041,mp4a.40.5\""; |
114 #endif // defined(USE_PROPRIETARY_CODECS) | 115 #endif // BUILDFLAG(USE_PROPRIETARY_CODECS) |
115 | 116 |
116 const size_t kAppendWholeFile = std::numeric_limits<size_t>::max(); | 117 const size_t kAppendWholeFile = std::numeric_limits<size_t>::max(); |
117 | 118 |
118 // Constants for the Media Source config change tests. | 119 // Constants for the Media Source config change tests. |
119 const int kAppendTimeSec = 1; | 120 const int kAppendTimeSec = 1; |
120 const int kAppendTimeMs = kAppendTimeSec * 1000; | 121 const int kAppendTimeMs = kAppendTimeSec * 1000; |
121 const int k320WebMFileDurationMs = 2736; | 122 const int k320WebMFileDurationMs = 2736; |
122 const int k320EncWebMFileDurationMs = 2737; | 123 const int k320EncWebMFileDurationMs = 2737; |
123 const int k640WebMFileDurationMs = 2749; | 124 const int k640WebMFileDurationMs = 2749; |
124 const int kOpusEndTrimmingWebMFileDurationMs = 2741; | 125 const int kOpusEndTrimmingWebMFileDurationMs = 2741; |
(...skipping 25 matching lines...) Expand all Loading... |
150 "-13.28,-14.35,-13.67,-11.68,-10.18,-10.46,"; | 151 "-13.28,-14.35,-13.67,-11.68,-10.18,-10.46,"; |
151 // Hash for a full playthrough of "bear-opus.webm". | 152 // Hash for a full playthrough of "bear-opus.webm". |
152 static const char kOpusSmallCodecDelayHash_1[] = | 153 static const char kOpusSmallCodecDelayHash_1[] = |
153 "-0.47,-0.09,1.28,1.07,1.55,-0.22,"; | 154 "-0.47,-0.09,1.28,1.07,1.55,-0.22,"; |
154 // The above hash, plus an additional playthrough starting from T=1.414s. | 155 // The above hash, plus an additional playthrough starting from T=1.414s. |
155 static const char kOpusSmallCodecDelayHash_2[] = | 156 static const char kOpusSmallCodecDelayHash_2[] = |
156 "0.31,0.15,-0.18,0.25,0.70,0.84,"; | 157 "0.31,0.15,-0.18,0.25,0.70,0.84,"; |
157 #endif // defined(OPUS_FIXED_POINT) | 158 #endif // defined(OPUS_FIXED_POINT) |
158 #endif // !defined(MOJO_RENDERER) | 159 #endif // !defined(MOJO_RENDERER) |
159 | 160 |
160 #if defined(USE_PROPRIETARY_CODECS) | 161 #if BUILDFLAG(USE_PROPRIETARY_CODECS) |
161 const int k640IsoFileDurationMs = 2737; | 162 const int k640IsoFileDurationMs = 2737; |
162 const int k640IsoCencFileDurationMs = 2736; | 163 const int k640IsoCencFileDurationMs = 2736; |
163 const int k1280IsoFileDurationMs = 2736; | 164 const int k1280IsoFileDurationMs = 2736; |
164 const int k1280IsoAVC3FileDurationMs = 2736; | 165 const int k1280IsoAVC3FileDurationMs = 2736; |
165 #endif // defined(USE_PROPRIETARY_CODECS) | 166 #endif // BUILDFLAG(USE_PROPRIETARY_CODECS) |
166 | 167 |
167 // Return a timeline offset for bear-320x240-live.webm. | 168 // Return a timeline offset for bear-320x240-live.webm. |
168 static base::Time kLiveTimelineOffset() { | 169 static base::Time kLiveTimelineOffset() { |
169 // The file contians the following UTC timeline offset: | 170 // The file contians the following UTC timeline offset: |
170 // 2012-11-10 12:34:56.789123456 | 171 // 2012-11-10 12:34:56.789123456 |
171 // Since base::Time only has a resolution of microseconds, | 172 // Since base::Time only has a resolution of microseconds, |
172 // construct a base::Time for 2012-11-10 12:34:56.789123. | 173 // construct a base::Time for 2012-11-10 12:34:56.789123. |
173 base::Time::Exploded exploded_time; | 174 base::Time::Exploded exploded_time; |
174 exploded_time.year = 2012; | 175 exploded_time.year = 2012; |
175 exploded_time.month = 11; | 176 exploded_time.month = 11; |
(...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
857 | 858 |
858 Play(); | 859 Play(); |
859 | 860 |
860 ASSERT_TRUE(WaitUntilOnEnded()); | 861 ASSERT_TRUE(WaitUntilOnEnded()); |
861 | 862 |
862 EXPECT_TRUE(demuxer_->GetTimelineOffset().is_null()); | 863 EXPECT_TRUE(demuxer_->GetTimelineOffset().is_null()); |
863 source.Shutdown(); | 864 source.Shutdown(); |
864 Stop(); | 865 Stop(); |
865 } | 866 } |
866 | 867 |
867 #if defined(USE_PROPRIETARY_CODECS) | 868 #if BUILDFLAG(USE_PROPRIETARY_CODECS) |
868 | 869 |
869 const PlaybackTestData kADTSTests[] = { | 870 const PlaybackTestData kADTSTests[] = { |
870 {"bear-audio-main-aac.aac", 0, 2724}, | 871 {"bear-audio-main-aac.aac", 0, 2724}, |
871 {"bear-audio-lc-aac.aac", 0, 2858}, | 872 {"bear-audio-lc-aac.aac", 0, 2858}, |
872 {"bear-audio-implicit-he-aac-v1.aac", 0, 2812}, | 873 {"bear-audio-implicit-he-aac-v1.aac", 0, 2812}, |
873 {"bear-audio-implicit-he-aac-v2.aac", 0, 3047}, | 874 {"bear-audio-implicit-he-aac-v2.aac", 0, 3047}, |
874 }; | 875 }; |
875 | 876 |
876 // TODO(chcunningham): Migrate other basic playback tests to TEST_P. | 877 // TODO(chcunningham): Migrate other basic playback tests to TEST_P. |
877 INSTANTIATE_TEST_CASE_P(PropritaryCodecs, | 878 INSTANTIATE_TEST_CASE_P(PropritaryCodecs, |
878 BasicPlaybackTest, | 879 BasicPlaybackTest, |
879 testing::ValuesIn(kADTSTests)); | 880 testing::ValuesIn(kADTSTests)); |
880 | 881 |
881 const MSEPlaybackTestData kMediaSourceADTSTests[] = { | 882 const MSEPlaybackTestData kMediaSourceADTSTests[] = { |
882 {"bear-audio-main-aac.aac", kADTS, kAppendWholeFile, 2773}, | 883 {"bear-audio-main-aac.aac", kADTS, kAppendWholeFile, 2773}, |
883 {"bear-audio-lc-aac.aac", kADTS, kAppendWholeFile, 2794}, | 884 {"bear-audio-lc-aac.aac", kADTS, kAppendWholeFile, 2794}, |
884 {"bear-audio-implicit-he-aac-v1.aac", kADTS, kAppendWholeFile, 2858}, | 885 {"bear-audio-implicit-he-aac-v1.aac", kADTS, kAppendWholeFile, 2858}, |
885 {"bear-audio-implicit-he-aac-v2.aac", kADTS, kAppendWholeFile, 2901}, | 886 {"bear-audio-implicit-he-aac-v2.aac", kADTS, kAppendWholeFile, 2901}, |
886 }; | 887 }; |
887 | 888 |
888 // TODO(chcunningham): Migrate other basic MSE playback tests to TEST_P. | 889 // TODO(chcunningham): Migrate other basic MSE playback tests to TEST_P. |
889 INSTANTIATE_TEST_CASE_P(PropritaryCodecs, | 890 INSTANTIATE_TEST_CASE_P(PropritaryCodecs, |
890 BasicMSEPlaybackTest, | 891 BasicMSEPlaybackTest, |
891 testing::ValuesIn(kMediaSourceADTSTests)); | 892 testing::ValuesIn(kMediaSourceADTSTests)); |
892 | 893 |
893 #endif // defined(USE_PROPRIETARY_CODECS) | 894 #endif // BUILDFLAG(USE_PROPRIETARY_CODECS) |
894 | 895 |
895 TEST_F(PipelineIntegrationTest, BasicPlayback) { | 896 TEST_F(PipelineIntegrationTest, BasicPlayback) { |
896 ASSERT_EQ(PIPELINE_OK, Start("bear-320x240.webm")); | 897 ASSERT_EQ(PIPELINE_OK, Start("bear-320x240.webm")); |
897 | 898 |
898 Play(); | 899 Play(); |
899 | 900 |
900 ASSERT_TRUE(WaitUntilOnEnded()); | 901 ASSERT_TRUE(WaitUntilOnEnded()); |
901 } | 902 } |
902 | 903 |
903 TEST_F(PipelineIntegrationTest, BasicPlaybackOpusOgg) { | 904 TEST_F(PipelineIntegrationTest, BasicPlaybackOpusOgg) { |
(...skipping 700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1604 | 1605 |
1605 TEST_F(PipelineIntegrationTest, BasicPlaybackHi12PVP9) { | 1606 TEST_F(PipelineIntegrationTest, BasicPlaybackHi12PVP9) { |
1606 ASSERT_EQ(PIPELINE_OK, Start("bear-320x180-hi12p-vp9.webm", kClockless)); | 1607 ASSERT_EQ(PIPELINE_OK, Start("bear-320x180-hi12p-vp9.webm", kClockless)); |
1607 | 1608 |
1608 Play(); | 1609 Play(); |
1609 | 1610 |
1610 ASSERT_TRUE(WaitUntilOnEnded()); | 1611 ASSERT_TRUE(WaitUntilOnEnded()); |
1611 } | 1612 } |
1612 #endif | 1613 #endif |
1613 | 1614 |
1614 #if defined(USE_PROPRIETARY_CODECS) | 1615 #if BUILDFLAG(USE_PROPRIETARY_CODECS) |
1615 | 1616 |
1616 TEST_F(PipelineIntegrationTest, BasicPlaybackHi10P) { | 1617 TEST_F(PipelineIntegrationTest, BasicPlaybackHi10P) { |
1617 ASSERT_EQ(PIPELINE_OK, Start("bear-320x180-hi10p.mp4", kClockless)); | 1618 ASSERT_EQ(PIPELINE_OK, Start("bear-320x180-hi10p.mp4", kClockless)); |
1618 | 1619 |
1619 Play(); | 1620 Play(); |
1620 | 1621 |
1621 ASSERT_TRUE(WaitUntilOnEnded()); | 1622 ASSERT_TRUE(WaitUntilOnEnded()); |
1622 } | 1623 } |
1623 | 1624 |
1624 TEST_F(PipelineIntegrationTest, BasicFallback) { | 1625 TEST_F(PipelineIntegrationTest, BasicFallback) { |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1961 EXPECT_EQ(CHUNK_DEMUXER_ERROR_APPEND_FAILED, WaitUntilEndedOrError()); | 1962 EXPECT_EQ(CHUNK_DEMUXER_ERROR_APPEND_FAILED, WaitUntilEndedOrError()); |
1962 source.Shutdown(); | 1963 source.Shutdown(); |
1963 } | 1964 } |
1964 | 1965 |
1965 // Verify files which change configuration midstream fail gracefully. | 1966 // Verify files which change configuration midstream fail gracefully. |
1966 TEST_F(PipelineIntegrationTest, MidStreamConfigChangesFail) { | 1967 TEST_F(PipelineIntegrationTest, MidStreamConfigChangesFail) { |
1967 ASSERT_EQ(PIPELINE_OK, Start("midstream_config_change.mp3")); | 1968 ASSERT_EQ(PIPELINE_OK, Start("midstream_config_change.mp3")); |
1968 Play(); | 1969 Play(); |
1969 ASSERT_EQ(WaitUntilEndedOrError(), PIPELINE_ERROR_DECODE); | 1970 ASSERT_EQ(WaitUntilEndedOrError(), PIPELINE_ERROR_DECODE); |
1970 } | 1971 } |
1971 #endif // defined(USE_PROPRIETARY_CODECS) | 1972 #endif // BUILDFLAG(USE_PROPRIETARY_CODECS) |
1972 | 1973 |
1973 TEST_F(PipelineIntegrationTest, BasicPlayback_16x9AspectRatio) { | 1974 TEST_F(PipelineIntegrationTest, BasicPlayback_16x9AspectRatio) { |
1974 ASSERT_EQ(PIPELINE_OK, Start("bear-320x240-16x9-aspect.webm")); | 1975 ASSERT_EQ(PIPELINE_OK, Start("bear-320x240-16x9-aspect.webm")); |
1975 Play(); | 1976 Play(); |
1976 ASSERT_TRUE(WaitUntilOnEnded()); | 1977 ASSERT_TRUE(WaitUntilOnEnded()); |
1977 } | 1978 } |
1978 | 1979 |
1979 TEST_F(PipelineIntegrationTest, MAYBE_EME(EncryptedPlayback_WebM)) { | 1980 TEST_F(PipelineIntegrationTest, MAYBE_EME(EncryptedPlayback_WebM)) { |
1980 MockMediaSource source("bear-320x240-av_enc-av.webm", kWebM, 219816); | 1981 MockMediaSource source("bear-320x240-av_enc-av.webm", kWebM, 219816); |
1981 FakeEncryptedMedia encrypted_media(new KeyProvidingApp()); | 1982 FakeEncryptedMedia encrypted_media(new KeyProvidingApp()); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2020 source.EndOfStream(); | 2021 source.EndOfStream(); |
2021 ASSERT_EQ(PIPELINE_OK, pipeline_status_); | 2022 ASSERT_EQ(PIPELINE_OK, pipeline_status_); |
2022 | 2023 |
2023 Play(); | 2024 Play(); |
2024 | 2025 |
2025 ASSERT_TRUE(WaitUntilOnEnded()); | 2026 ASSERT_TRUE(WaitUntilOnEnded()); |
2026 source.Shutdown(); | 2027 source.Shutdown(); |
2027 Stop(); | 2028 Stop(); |
2028 } | 2029 } |
2029 | 2030 |
2030 #if defined(USE_PROPRIETARY_CODECS) | 2031 #if BUILDFLAG(USE_PROPRIETARY_CODECS) |
2031 TEST_F(PipelineIntegrationTest, | 2032 TEST_F(PipelineIntegrationTest, |
2032 MAYBE_EME(EncryptedPlayback_MP4_CENC_VideoOnly)) { | 2033 MAYBE_EME(EncryptedPlayback_MP4_CENC_VideoOnly)) { |
2033 MockMediaSource source("bear-1280x720-v_frag-cenc.mp4", kMP4Video, | 2034 MockMediaSource source("bear-1280x720-v_frag-cenc.mp4", kMP4Video, |
2034 kAppendWholeFile); | 2035 kAppendWholeFile); |
2035 FakeEncryptedMedia encrypted_media(new KeyProvidingApp()); | 2036 FakeEncryptedMedia encrypted_media(new KeyProvidingApp()); |
2036 EXPECT_EQ(PIPELINE_OK, | 2037 EXPECT_EQ(PIPELINE_OK, |
2037 StartPipelineWithEncryptedMedia(&source, &encrypted_media)); | 2038 StartPipelineWithEncryptedMedia(&source, &encrypted_media)); |
2038 | 2039 |
2039 source.EndOfStream(); | 2040 source.EndOfStream(); |
2040 ASSERT_EQ(PIPELINE_OK, pipeline_status_); | 2041 ASSERT_EQ(PIPELINE_OK, pipeline_status_); |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2281 #if BUILDFLAG(ENABLE_HEVC_DEMUXING) | 2282 #if BUILDFLAG(ENABLE_HEVC_DEMUXING) |
2282 PipelineStatus status = StartPipelineWithMediaSource(&source); | 2283 PipelineStatus status = StartPipelineWithMediaSource(&source); |
2283 EXPECT_TRUE(status == PIPELINE_OK || status == DECODER_ERROR_NOT_SUPPORTED); | 2284 EXPECT_TRUE(status == PIPELINE_OK || status == DECODER_ERROR_NOT_SUPPORTED); |
2284 #else | 2285 #else |
2285 EXPECT_EQ( | 2286 EXPECT_EQ( |
2286 DEMUXER_ERROR_COULD_NOT_OPEN, | 2287 DEMUXER_ERROR_COULD_NOT_OPEN, |
2287 StartPipelineWithMediaSource(&source, kExpectDemuxerFailure, nullptr)); | 2288 StartPipelineWithMediaSource(&source, kExpectDemuxerFailure, nullptr)); |
2288 #endif | 2289 #endif |
2289 } | 2290 } |
2290 | 2291 |
2291 #endif // defined(USE_PROPRIETARY_CODECS) | 2292 #endif // BUILDFLAG(USE_PROPRIETARY_CODECS) |
2292 | 2293 |
2293 TEST_F(PipelineIntegrationTest, SeekWhilePaused) { | 2294 TEST_F(PipelineIntegrationTest, SeekWhilePaused) { |
2294 ASSERT_EQ(PIPELINE_OK, Start("bear-320x240.webm")); | 2295 ASSERT_EQ(PIPELINE_OK, Start("bear-320x240.webm")); |
2295 | 2296 |
2296 base::TimeDelta duration(pipeline_->GetMediaDuration()); | 2297 base::TimeDelta duration(pipeline_->GetMediaDuration()); |
2297 base::TimeDelta start_seek_time(duration / 4); | 2298 base::TimeDelta start_seek_time(duration / 4); |
2298 base::TimeDelta seek_time(duration * 3 / 4); | 2299 base::TimeDelta seek_time(duration * 3 / 4); |
2299 | 2300 |
2300 Play(); | 2301 Play(); |
2301 ASSERT_TRUE(WaitUntilCurrentTimeIsAfter(start_seek_time)); | 2302 ASSERT_TRUE(WaitUntilCurrentTimeIsAfter(start_seek_time)); |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2371 // Resuming the pipeline will create a new Renderer, | 2372 // Resuming the pipeline will create a new Renderer, |
2372 // which in turn will trigger video size and opacity notifications. | 2373 // which in turn will trigger video size and opacity notifications. |
2373 EXPECT_CALL(*this, OnVideoNaturalSizeChange(gfx::Size(320, 240))).Times(1); | 2374 EXPECT_CALL(*this, OnVideoNaturalSizeChange(gfx::Size(320, 240))).Times(1); |
2374 EXPECT_CALL(*this, OnVideoOpacityChange(true)).Times(1); | 2375 EXPECT_CALL(*this, OnVideoOpacityChange(true)).Times(1); |
2375 | 2376 |
2376 ASSERT_TRUE(Resume(seek_time)); | 2377 ASSERT_TRUE(Resume(seek_time)); |
2377 EXPECT_GE(pipeline_->GetMediaTime(), seek_time); | 2378 EXPECT_GE(pipeline_->GetMediaTime(), seek_time); |
2378 ASSERT_TRUE(WaitUntilOnEnded()); | 2379 ASSERT_TRUE(WaitUntilOnEnded()); |
2379 } | 2380 } |
2380 | 2381 |
2381 #if defined(USE_PROPRIETARY_CODECS) | 2382 #if BUILDFLAG(USE_PROPRIETARY_CODECS) |
2382 TEST_F(PipelineIntegrationTest, Rotated_Metadata_0) { | 2383 TEST_F(PipelineIntegrationTest, Rotated_Metadata_0) { |
2383 ASSERT_EQ(PIPELINE_OK, Start("bear_rotate_0.mp4")); | 2384 ASSERT_EQ(PIPELINE_OK, Start("bear_rotate_0.mp4")); |
2384 ASSERT_EQ(VIDEO_ROTATION_0, metadata_.video_rotation); | 2385 ASSERT_EQ(VIDEO_ROTATION_0, metadata_.video_rotation); |
2385 } | 2386 } |
2386 | 2387 |
2387 TEST_F(PipelineIntegrationTest, Rotated_Metadata_90) { | 2388 TEST_F(PipelineIntegrationTest, Rotated_Metadata_90) { |
2388 ASSERT_EQ(PIPELINE_OK, Start("bear_rotate_90.mp4")); | 2389 ASSERT_EQ(PIPELINE_OK, Start("bear_rotate_90.mp4")); |
2389 ASSERT_EQ(VIDEO_ROTATION_90, metadata_.video_rotation); | 2390 ASSERT_EQ(VIDEO_ROTATION_90, metadata_.video_rotation); |
2390 } | 2391 } |
2391 | 2392 |
2392 TEST_F(PipelineIntegrationTest, Rotated_Metadata_180) { | 2393 TEST_F(PipelineIntegrationTest, Rotated_Metadata_180) { |
2393 ASSERT_EQ(PIPELINE_OK, Start("bear_rotate_180.mp4")); | 2394 ASSERT_EQ(PIPELINE_OK, Start("bear_rotate_180.mp4")); |
2394 ASSERT_EQ(VIDEO_ROTATION_180, metadata_.video_rotation); | 2395 ASSERT_EQ(VIDEO_ROTATION_180, metadata_.video_rotation); |
2395 } | 2396 } |
2396 | 2397 |
2397 TEST_F(PipelineIntegrationTest, Rotated_Metadata_270) { | 2398 TEST_F(PipelineIntegrationTest, Rotated_Metadata_270) { |
2398 ASSERT_EQ(PIPELINE_OK, Start("bear_rotate_270.mp4")); | 2399 ASSERT_EQ(PIPELINE_OK, Start("bear_rotate_270.mp4")); |
2399 ASSERT_EQ(VIDEO_ROTATION_270, metadata_.video_rotation); | 2400 ASSERT_EQ(VIDEO_ROTATION_270, metadata_.video_rotation); |
2400 } | 2401 } |
2401 #endif // defined(USE_PROPRIETARY_CODECS) | 2402 #endif // BUILDFLAG(USE_PROPRIETARY_CODECS) |
2402 | 2403 |
2403 // Verify audio decoder & renderer can handle aborted demuxer reads. | 2404 // Verify audio decoder & renderer can handle aborted demuxer reads. |
2404 TEST_F(PipelineIntegrationTest, ChunkDemuxerAbortRead_AudioOnly) { | 2405 TEST_F(PipelineIntegrationTest, ChunkDemuxerAbortRead_AudioOnly) { |
2405 ASSERT_TRUE(TestSeekDuringRead("bear-320x240-audio-only.webm", kAudioOnlyWebM, | 2406 ASSERT_TRUE(TestSeekDuringRead("bear-320x240-audio-only.webm", kAudioOnlyWebM, |
2406 16384, base::TimeDelta::FromMilliseconds(464), | 2407 16384, base::TimeDelta::FromMilliseconds(464), |
2407 base::TimeDelta::FromMilliseconds(617), 0x10CA, | 2408 base::TimeDelta::FromMilliseconds(617), 0x10CA, |
2408 19730)); | 2409 19730)); |
2409 } | 2410 } |
2410 | 2411 |
2411 // Verify video decoder & renderer can handle aborted demuxer reads. | 2412 // Verify video decoder & renderer can handle aborted demuxer reads. |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2582 | 2583 |
2583 TEST_F(PipelineIntegrationTest, BasicPlaybackPositiveStartTime) { | 2584 TEST_F(PipelineIntegrationTest, BasicPlaybackPositiveStartTime) { |
2584 ASSERT_EQ(PIPELINE_OK, Start("nonzero-start-time.webm")); | 2585 ASSERT_EQ(PIPELINE_OK, Start("nonzero-start-time.webm")); |
2585 Play(); | 2586 Play(); |
2586 ASSERT_TRUE(WaitUntilOnEnded()); | 2587 ASSERT_TRUE(WaitUntilOnEnded()); |
2587 ASSERT_EQ(base::TimeDelta::FromMicroseconds(396000), | 2588 ASSERT_EQ(base::TimeDelta::FromMicroseconds(396000), |
2588 demuxer_->GetStartTime()); | 2589 demuxer_->GetStartTime()); |
2589 } | 2590 } |
2590 | 2591 |
2591 } // namespace media | 2592 } // namespace media |
OLD | NEW |