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 "media/filters/pipeline_integration_test_base.h" | 5 #include "media/filters/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/media_log.h" | 9 #include "media/base/media_log.h" |
10 #include "media/filters/audio_renderer_impl.h" | 10 #include "media/filters/audio_renderer_impl.h" |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 audio_sink_ = new NullAudioSink(message_loop_.message_loop_proxy()); | 250 audio_sink_ = new NullAudioSink(message_loop_.message_loop_proxy()); |
251 | 251 |
252 ScopedVector<AudioDecoder> audio_decoders; | 252 ScopedVector<AudioDecoder> audio_decoders; |
253 audio_decoders.push_back( | 253 audio_decoders.push_back( |
254 new FFmpegAudioDecoder(message_loop_.message_loop_proxy())); | 254 new FFmpegAudioDecoder(message_loop_.message_loop_proxy())); |
255 audio_decoders.push_back( | 255 audio_decoders.push_back( |
256 new OpusAudioDecoder(message_loop_.message_loop_proxy())); | 256 new OpusAudioDecoder(message_loop_.message_loop_proxy())); |
257 | 257 |
258 AudioRendererImpl* audio_renderer_impl = new AudioRendererImpl( | 258 AudioRendererImpl* audio_renderer_impl = new AudioRendererImpl( |
259 message_loop_.message_loop_proxy(), | 259 message_loop_.message_loop_proxy(), |
260 audio_sink_, | 260 audio_sink_.get(), |
261 audio_decoders.Pass(), | 261 audio_decoders.Pass(), |
262 base::Bind(&PipelineIntegrationTestBase::SetDecryptor, | 262 base::Bind(&PipelineIntegrationTestBase::SetDecryptor, |
263 base::Unretained(this), decryptor)); | 263 base::Unretained(this), |
| 264 decryptor)); |
264 // Disable underflow if hashing is enabled. | 265 // Disable underflow if hashing is enabled. |
265 if (hashing_enabled_) { | 266 if (hashing_enabled_) { |
266 audio_sink_->StartAudioHashForTesting(); | 267 audio_sink_->StartAudioHashForTesting(); |
267 audio_renderer_impl->DisableUnderflowForTesting(); | 268 audio_renderer_impl->DisableUnderflowForTesting(); |
268 } | 269 } |
269 scoped_ptr<AudioRenderer> audio_renderer(audio_renderer_impl); | 270 scoped_ptr<AudioRenderer> audio_renderer(audio_renderer_impl); |
270 collection->SetAudioRenderer(audio_renderer.Pass()); | 271 collection->SetAudioRenderer(audio_renderer.Pass()); |
271 | 272 |
272 return collection.Pass(); | 273 return collection.Pass(); |
273 } | 274 } |
(...skipping 18 matching lines...) Expand all Loading... |
292 base::MD5Final(&digest, &md5_context_); | 293 base::MD5Final(&digest, &md5_context_); |
293 return base::MD5DigestToBase16(digest); | 294 return base::MD5DigestToBase16(digest); |
294 } | 295 } |
295 | 296 |
296 std::string PipelineIntegrationTestBase::GetAudioHash() { | 297 std::string PipelineIntegrationTestBase::GetAudioHash() { |
297 DCHECK(hashing_enabled_); | 298 DCHECK(hashing_enabled_); |
298 return audio_sink_->GetAudioHashForTesting(); | 299 return audio_sink_->GetAudioHashForTesting(); |
299 } | 300 } |
300 | 301 |
301 } // namespace media | 302 } // namespace media |
OLD | NEW |