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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 collection->AddAudioRenderer(audio_renderer); | 235 collection->AddAudioRenderer(audio_renderer); |
236 return collection.Pass(); | 236 return collection.Pass(); |
237 } | 237 } |
238 | 238 |
239 void PipelineIntegrationTestBase::SetDecryptor( | 239 void PipelineIntegrationTestBase::SetDecryptor( |
240 Decryptor* decryptor, | 240 Decryptor* decryptor, |
241 const DecryptorReadyCB& decryptor_ready_cb) { | 241 const DecryptorReadyCB& decryptor_ready_cb) { |
242 decryptor_ready_cb.Run(decryptor); | 242 decryptor_ready_cb.Run(decryptor); |
243 } | 243 } |
244 | 244 |
245 void PipelineIntegrationTestBase::OnVideoRendererPaint() { | 245 void PipelineIntegrationTestBase::OnVideoRendererPaint( |
| 246 const scoped_refptr<VideoFrame>& frame) { |
246 if (!hashing_enabled_) | 247 if (!hashing_enabled_) |
247 return; | 248 return; |
248 scoped_refptr<VideoFrame> frame; | 249 frame->HashFrameForTesting(&md5_context_); |
249 renderer_->GetCurrentFrame(&frame); | |
250 if (frame) | |
251 frame->HashFrameForTesting(&md5_context_); | |
252 renderer_->PutCurrentFrame(frame); | |
253 } | 250 } |
254 | 251 |
255 std::string PipelineIntegrationTestBase::GetVideoHash() { | 252 std::string PipelineIntegrationTestBase::GetVideoHash() { |
256 DCHECK(hashing_enabled_); | 253 DCHECK(hashing_enabled_); |
257 base::MD5Digest digest; | 254 base::MD5Digest digest; |
258 base::MD5Final(&digest, &md5_context_); | 255 base::MD5Final(&digest, &md5_context_); |
259 return base::MD5DigestToBase16(digest); | 256 return base::MD5DigestToBase16(digest); |
260 } | 257 } |
261 | 258 |
262 std::string PipelineIntegrationTestBase::GetAudioHash() { | 259 std::string PipelineIntegrationTestBase::GetAudioHash() { |
263 DCHECK(hashing_enabled_); | 260 DCHECK(hashing_enabled_); |
264 return audio_sink_->GetAudioHashForTesting(); | 261 return audio_sink_->GetAudioHashForTesting(); |
265 } | 262 } |
266 | 263 |
267 } // namespace media | 264 } // namespace media |
OLD | NEW |