| 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 "media/base/media_log.h" | 8 #include "media/base/media_log.h" |
| 9 #include "media/filters/audio_renderer_impl.h" | 9 #include "media/filters/audio_renderer_impl.h" |
| 10 #include "media/filters/chunk_demuxer.h" | 10 #include "media/filters/chunk_demuxer.h" |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 base::Bind(&PipelineIntegrationTestBase::OnVideoRendererPaint, | 210 base::Bind(&PipelineIntegrationTestBase::OnVideoRendererPaint, |
| 211 base::Unretained(this)), | 211 base::Unretained(this)), |
| 212 base::Bind(&PipelineIntegrationTestBase::OnSetOpaque, | 212 base::Bind(&PipelineIntegrationTestBase::OnSetOpaque, |
| 213 base::Unretained(this)), | 213 base::Unretained(this)), |
| 214 !hashing_enabled_); | 214 !hashing_enabled_); |
| 215 collection->AddVideoRenderer(renderer_); | 215 collection->AddVideoRenderer(renderer_); |
| 216 audio_sink_ = new NullAudioSink(); | 216 audio_sink_ = new NullAudioSink(); |
| 217 if (hashing_enabled_) | 217 if (hashing_enabled_) |
| 218 audio_sink_->StartAudioHashForTesting(); | 218 audio_sink_->StartAudioHashForTesting(); |
| 219 scoped_refptr<AudioRendererImpl> audio_renderer(new AudioRendererImpl( | 219 scoped_refptr<AudioRendererImpl> audio_renderer(new AudioRendererImpl( |
| 220 audio_sink_)); | 220 audio_sink_, SetDecryptorReadyCB())); |
| 221 // Disable underflow if hashing is enabled. | 221 // Disable underflow if hashing is enabled. |
| 222 if (hashing_enabled_) | 222 if (hashing_enabled_) |
| 223 audio_renderer->DisableUnderflowForTesting(); | 223 audio_renderer->DisableUnderflowForTesting(); |
| 224 collection->AddAudioRenderer(audio_renderer); | 224 collection->AddAudioRenderer(audio_renderer); |
| 225 return collection.Pass(); | 225 return collection.Pass(); |
| 226 } | 226 } |
| 227 | 227 |
| 228 void PipelineIntegrationTestBase::OnVideoRendererPaint() { | 228 void PipelineIntegrationTestBase::OnVideoRendererPaint() { |
| 229 if (!hashing_enabled_) | 229 if (!hashing_enabled_) |
| 230 return; | 230 return; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 241 base::MD5Final(&digest, &md5_context_); | 241 base::MD5Final(&digest, &md5_context_); |
| 242 return base::MD5DigestToBase16(digest); | 242 return base::MD5DigestToBase16(digest); |
| 243 } | 243 } |
| 244 | 244 |
| 245 std::string PipelineIntegrationTestBase::GetAudioHash() { | 245 std::string PipelineIntegrationTestBase::GetAudioHash() { |
| 246 DCHECK(hashing_enabled_); | 246 DCHECK(hashing_enabled_); |
| 247 return audio_sink_->GetAudioHashForTesting(); | 247 return audio_sink_->GetAudioHashForTesting(); |
| 248 } | 248 } |
| 249 | 249 |
| 250 } // namespace media | 250 } // namespace media |
| OLD | NEW |