Chromium Code Reviews| 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 2116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2127 // calculated incorrectly and that leads to gaps in buffered ranges (so this | 2127 // calculated incorrectly and that leads to gaps in buffered ranges (so this |
| 2128 // check will fail) and eventually leads to stalled playback. | 2128 // check will fail) and eventually leads to stalled playback. |
| 2129 EXPECT_EQ(1u, pipeline_->GetBufferedTimeRanges().size()); | 2129 EXPECT_EQ(1u, pipeline_->GetBufferedTimeRanges().size()); |
| 2130 #else | 2130 #else |
| 2131 EXPECT_EQ( | 2131 EXPECT_EQ( |
| 2132 DEMUXER_ERROR_COULD_NOT_OPEN, | 2132 DEMUXER_ERROR_COULD_NOT_OPEN, |
| 2133 StartPipelineWithMediaSource(&source, kExpectDemuxerFailure, nullptr)); | 2133 StartPipelineWithMediaSource(&source, kExpectDemuxerFailure, nullptr)); |
| 2134 #endif | 2134 #endif |
| 2135 } | 2135 } |
| 2136 | 2136 |
| 2137 TEST_F(PipelineIntegrationTest, Mpeg2ts_MP3Audio_Mp4a_6B) { | |
| 2138 MockMediaSource source("bear-mp3-audio.ts", | |
| 2139 "video/mp2t; codecs=\"avc1.4D4041,mp4a.6B\"", | |
| 2140 kAppendWholeFile); | |
| 2141 #if BUILDFLAG(ENABLE_MSE_MPEG2TS_STREAM_PARSER) | |
| 2142 EXPECT_EQ(PIPELINE_OK, StartPipelineWithMediaSource(&source)); | |
| 2143 source.EndOfStream(); | |
| 2144 ASSERT_EQ(PIPELINE_OK, pipeline_status_); | |
| 2145 #else | |
| 2146 EXPECT_EQ( | |
| 2147 DEMUXER_ERROR_COULD_NOT_OPEN, | |
| 2148 StartPipelineWithMediaSource(&source, kExpectDemuxerFailure, nullptr)); | |
| 2149 #endif | |
| 2150 } | |
| 2151 | |
| 2152 TEST_F(PipelineIntegrationTest, Mpeg2ts_MP3Audio_Mp4a_69) { | |
| 2153 MockMediaSource source("bear-mp3-audio.ts", | |
|
wolenetz
2017/03/24 17:34:25
nit: is this test file really both .69 and .6B com
servolk
2017/03/27 20:10:39
I've made a couple of new test files in the latest
| |
| 2154 "video/mp2t; codecs=\"avc1.4D4041,mp4a.69\"", | |
| 2155 kAppendWholeFile); | |
| 2156 #if BUILDFLAG(ENABLE_MSE_MPEG2TS_STREAM_PARSER) | |
| 2157 EXPECT_EQ(PIPELINE_OK, StartPipelineWithMediaSource(&source)); | |
| 2158 source.EndOfStream(); | |
| 2159 ASSERT_EQ(PIPELINE_OK, pipeline_status_); | |
| 2160 #else | |
| 2161 EXPECT_EQ( | |
| 2162 DEMUXER_ERROR_COULD_NOT_OPEN, | |
| 2163 StartPipelineWithMediaSource(&source, kExpectDemuxerFailure, nullptr)); | |
| 2164 #endif | |
| 2165 } | |
| 2166 | |
| 2137 TEST_F(PipelineIntegrationTest, | 2167 TEST_F(PipelineIntegrationTest, |
| 2138 MAYBE_EME(EncryptedPlayback_NoEncryptedFrames_MP4_CENC_AudioOnly)) { | 2168 MAYBE_EME(EncryptedPlayback_NoEncryptedFrames_MP4_CENC_AudioOnly)) { |
| 2139 MockMediaSource source("bear-1280x720-a_frag-cenc_clear-all.mp4", kMP4Audio, | 2169 MockMediaSource source("bear-1280x720-a_frag-cenc_clear-all.mp4", kMP4Audio, |
| 2140 kAppendWholeFile); | 2170 kAppendWholeFile); |
| 2141 FakeEncryptedMedia encrypted_media(new NoResponseApp()); | 2171 FakeEncryptedMedia encrypted_media(new NoResponseApp()); |
| 2142 EXPECT_EQ(PIPELINE_OK, | 2172 EXPECT_EQ(PIPELINE_OK, |
| 2143 StartPipelineWithEncryptedMedia(&source, &encrypted_media)); | 2173 StartPipelineWithEncryptedMedia(&source, &encrypted_media)); |
| 2144 | 2174 |
| 2145 source.EndOfStream(); | 2175 source.EndOfStream(); |
| 2146 | 2176 |
| (...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2616 | 2646 |
| 2617 TEST_F(PipelineIntegrationTest, BasicPlaybackPositiveStartTime) { | 2647 TEST_F(PipelineIntegrationTest, BasicPlaybackPositiveStartTime) { |
| 2618 ASSERT_EQ(PIPELINE_OK, Start("nonzero-start-time.webm")); | 2648 ASSERT_EQ(PIPELINE_OK, Start("nonzero-start-time.webm")); |
| 2619 Play(); | 2649 Play(); |
| 2620 ASSERT_TRUE(WaitUntilOnEnded()); | 2650 ASSERT_TRUE(WaitUntilOnEnded()); |
| 2621 ASSERT_EQ(base::TimeDelta::FromMicroseconds(396000), | 2651 ASSERT_EQ(base::TimeDelta::FromMicroseconds(396000), |
| 2622 demuxer_->GetStartTime()); | 2652 demuxer_->GetStartTime()); |
| 2623 } | 2653 } |
| 2624 | 2654 |
| 2625 } // namespace media | 2655 } // namespace media |
| OLD | NEW |