Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(501)

Side by Side Diff: media/test/pipeline_integration_test_base.cc

Issue 1260193005: Fix incorrect opus seek preroll and flaky pre-skip removal. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix mojo renderer. Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « media/test/pipeline_integration_test_base.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "media/test/pipeline_integration_test_base.h" 5 #include "media/test/pipeline_integration_test_base.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/scoped_vector.h" 8 #include "base/memory/scoped_vector.h"
9 #include "media/base/cdm_context.h" 9 #include "media/base/cdm_context.h"
10 #include "media/base/media_log.h" 10 #include "media/base/media_log.h"
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 base::Unretained(this)), 141 base::Unretained(this)),
142 base::Closure(), base::Bind(&PipelineIntegrationTestBase::OnAddTextTrack, 142 base::Closure(), base::Bind(&PipelineIntegrationTestBase::OnAddTextTrack,
143 base::Unretained(this)), 143 base::Unretained(this)),
144 base::Bind(&PipelineIntegrationTestBase::OnWaitingForDecryptionKey, 144 base::Bind(&PipelineIntegrationTestBase::OnWaitingForDecryptionKey,
145 base::Unretained(this))); 145 base::Unretained(this)));
146 message_loop_.Run(); 146 message_loop_.Run();
147 return pipeline_status_; 147 return pipeline_status_;
148 } 148 }
149 149
150 PipelineStatus PipelineIntegrationTestBase::Start(const std::string& filename, 150 PipelineStatus PipelineIntegrationTestBase::Start(const std::string& filename,
151 kTestType test_type) { 151 uint8_t test_type) {
152 hashing_enabled_ = test_type == kHashed; 152 hashing_enabled_ = test_type & kHashed;
153 clockless_playback_ = test_type == kClockless; 153 clockless_playback_ = test_type & kClockless;
154 return Start(filename); 154 return Start(filename);
155 } 155 }
156 156
157 void PipelineIntegrationTestBase::Play() { 157 void PipelineIntegrationTestBase::Play() {
158 pipeline_->SetPlaybackRate(1); 158 pipeline_->SetPlaybackRate(1);
159 } 159 }
160 160
161 void PipelineIntegrationTestBase::Pause() { 161 void PipelineIntegrationTestBase::Pause() {
162 pipeline_->SetPlaybackRate(0); 162 pipeline_->SetPlaybackRate(0);
163 } 163 }
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 ScopedVector<AudioDecoder> audio_decoders; 261 ScopedVector<AudioDecoder> audio_decoders;
262 262
263 #if !defined(MEDIA_DISABLE_FFMPEG) 263 #if !defined(MEDIA_DISABLE_FFMPEG)
264 audio_decoders.push_back( 264 audio_decoders.push_back(
265 new FFmpegAudioDecoder(message_loop_.task_runner(), new MediaLog())); 265 new FFmpegAudioDecoder(message_loop_.task_runner(), new MediaLog()));
266 #endif 266 #endif
267 267
268 audio_decoders.push_back( 268 audio_decoders.push_back(
269 new OpusAudioDecoder(message_loop_.task_runner())); 269 new OpusAudioDecoder(message_loop_.task_runner()));
270 270
271 AudioParameters out_params(AudioParameters::AUDIO_PCM_LOW_LATENCY, 271 // Don't allow the audio renderer to resample buffers if hashing is enabled.
272 CHANNEL_LAYOUT_STEREO, 272 if (!hashing_enabled_) {
273 44100, 273 AudioParameters out_params(AudioParameters::AUDIO_PCM_LOW_LATENCY,
274 16, 274 CHANNEL_LAYOUT_STEREO,
275 512); 275 44100,
276 hardware_config_.UpdateOutputConfig(out_params); 276 16,
277 512);
278 hardware_config_.UpdateOutputConfig(out_params);
279 }
277 280
278 scoped_ptr<AudioRenderer> audio_renderer(new AudioRendererImpl( 281 scoped_ptr<AudioRenderer> audio_renderer(new AudioRendererImpl(
279 message_loop_.task_runner(), 282 message_loop_.task_runner(),
280 (clockless_playback_) 283 (clockless_playback_)
281 ? static_cast<AudioRendererSink*>(clockless_audio_sink_.get()) 284 ? static_cast<AudioRendererSink*>(clockless_audio_sink_.get())
282 : audio_sink_.get(), 285 : audio_sink_.get(),
283 audio_decoders.Pass(), hardware_config_, new MediaLog())); 286 audio_decoders.Pass(), hardware_config_, new MediaLog()));
284 if (hashing_enabled_) 287 if (hashing_enabled_) {
285 audio_sink_->StartAudioHashForTesting(); 288 if (clockless_playback_)
289 clockless_audio_sink_->StartAudioHashForTesting();
290 else
291 audio_sink_->StartAudioHashForTesting();
292 }
286 293
287 scoped_ptr<RendererImpl> renderer_impl( 294 scoped_ptr<RendererImpl> renderer_impl(
288 new RendererImpl(message_loop_.task_runner(), 295 new RendererImpl(message_loop_.task_runner(),
289 audio_renderer.Pass(), 296 audio_renderer.Pass(),
290 video_renderer.Pass())); 297 video_renderer.Pass()));
291 298
292 // Prevent non-deterministic buffering state callbacks from firing (e.g., slow 299 // Prevent non-deterministic buffering state callbacks from firing (e.g., slow
293 // machine, valgrind). 300 // machine, valgrind).
294 renderer_impl->DisableUnderflowForTesting(); 301 renderer_impl->DisableUnderflowForTesting();
295 302
(...skipping 16 matching lines...) Expand all
312 319
313 std::string PipelineIntegrationTestBase::GetVideoHash() { 320 std::string PipelineIntegrationTestBase::GetVideoHash() {
314 DCHECK(hashing_enabled_); 321 DCHECK(hashing_enabled_);
315 base::MD5Digest digest; 322 base::MD5Digest digest;
316 base::MD5Final(&digest, &md5_context_); 323 base::MD5Final(&digest, &md5_context_);
317 return base::MD5DigestToBase16(digest); 324 return base::MD5DigestToBase16(digest);
318 } 325 }
319 326
320 std::string PipelineIntegrationTestBase::GetAudioHash() { 327 std::string PipelineIntegrationTestBase::GetAudioHash() {
321 DCHECK(hashing_enabled_); 328 DCHECK(hashing_enabled_);
329
330 if (clockless_playback_)
331 return clockless_audio_sink_->GetAudioHashForTesting();
322 return audio_sink_->GetAudioHashForTesting(); 332 return audio_sink_->GetAudioHashForTesting();
323 } 333 }
324 334
325 base::TimeDelta PipelineIntegrationTestBase::GetAudioTime() { 335 base::TimeDelta PipelineIntegrationTestBase::GetAudioTime() {
326 DCHECK(clockless_playback_); 336 DCHECK(clockless_playback_);
327 return clockless_audio_sink_->render_time(); 337 return clockless_audio_sink_->render_time();
328 } 338 }
329 339
330 base::TimeTicks DummyTickClock::NowTicks() { 340 base::TimeTicks DummyTickClock::NowTicks() {
331 now_ += base::TimeDelta::FromSeconds(60); 341 now_ += base::TimeDelta::FromSeconds(60);
332 return now_; 342 return now_;
333 } 343 }
334 344
335 } // namespace media 345 } // namespace media
OLDNEW
« no previous file with comments | « media/test/pipeline_integration_test_base.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698