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

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

Issue 12096081: Replace VideoRendererBase Get/PutCurrentFrame() with a VideoFrame-containing callback. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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 | Annotate | Revision Log
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/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 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 collection->AddAudioRenderer(audio_renderer); 230 collection->AddAudioRenderer(audio_renderer);
231 return collection.Pass(); 231 return collection.Pass();
232 } 232 }
233 233
234 void PipelineIntegrationTestBase::SetDecryptor( 234 void PipelineIntegrationTestBase::SetDecryptor(
235 Decryptor* decryptor, 235 Decryptor* decryptor,
236 const DecryptorReadyCB& decryptor_ready_cb) { 236 const DecryptorReadyCB& decryptor_ready_cb) {
237 decryptor_ready_cb.Run(decryptor); 237 decryptor_ready_cb.Run(decryptor);
238 } 238 }
239 239
240 void PipelineIntegrationTestBase::OnVideoRendererPaint() { 240 void PipelineIntegrationTestBase::OnVideoRendererPaint(
241 const scoped_refptr<VideoFrame>& frame) {
241 if (!hashing_enabled_) 242 if (!hashing_enabled_)
242 return; 243 return;
243 scoped_refptr<VideoFrame> frame; 244 frame->HashFrameForTesting(&md5_context_);
244 renderer_->GetCurrentFrame(&frame);
245 if (frame)
246 frame->HashFrameForTesting(&md5_context_);
247 renderer_->PutCurrentFrame(frame);
248 } 245 }
249 246
250 std::string PipelineIntegrationTestBase::GetVideoHash() { 247 std::string PipelineIntegrationTestBase::GetVideoHash() {
251 DCHECK(hashing_enabled_); 248 DCHECK(hashing_enabled_);
252 base::MD5Digest digest; 249 base::MD5Digest digest;
253 base::MD5Final(&digest, &md5_context_); 250 base::MD5Final(&digest, &md5_context_);
254 return base::MD5DigestToBase16(digest); 251 return base::MD5DigestToBase16(digest);
255 } 252 }
256 253
257 std::string PipelineIntegrationTestBase::GetAudioHash() { 254 std::string PipelineIntegrationTestBase::GetAudioHash() {
258 DCHECK(hashing_enabled_); 255 DCHECK(hashing_enabled_);
259 return audio_sink_->GetAudioHashForTesting(); 256 return audio_sink_->GetAudioHashForTesting();
260 } 257 }
261 258
262 } // namespace media 259 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698