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

Side by Side Diff: remoting/client/software_video_renderer.cc

Issue 910343002: Decompose VideoRenderer from VideoStub. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix perf test Created 5 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
« no previous file with comments | « remoting/client/software_video_renderer.h ('k') | remoting/client/video_renderer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "remoting/client/software_video_renderer.h" 5 #include "remoting/client/software_video_renderer.h"
6 6
7 #include <list> 7 #include <list>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 decode_task_runner_->PostTask( 334 decode_task_runner_->PostTask(
335 FROM_HERE, base::Bind(&SoftwareVideoRenderer::Core::OnSessionConfig, 335 FROM_HERE, base::Bind(&SoftwareVideoRenderer::Core::OnSessionConfig,
336 base::Unretained(core_.get()), config)); 336 base::Unretained(core_.get()), config));
337 } 337 }
338 338
339 ChromotingStats* SoftwareVideoRenderer::GetStats() { 339 ChromotingStats* SoftwareVideoRenderer::GetStats() {
340 DCHECK(CalledOnValidThread()); 340 DCHECK(CalledOnValidThread());
341 return &stats_; 341 return &stats_;
342 } 342 }
343 343
344 protocol::VideoStub* SoftwareVideoRenderer::GetVideoStub() {
345 return this;
346 }
347
344 void SoftwareVideoRenderer::ProcessVideoPacket(scoped_ptr<VideoPacket> packet, 348 void SoftwareVideoRenderer::ProcessVideoPacket(scoped_ptr<VideoPacket> packet,
345 const base::Closure& done) { 349 const base::Closure& done) {
346 DCHECK(CalledOnValidThread()); 350 DCHECK(CalledOnValidThread());
347 351
348 // If the video packet is empty then drop it. Empty packets are used to 352 // If the video packet is empty then drop it. Empty packets are used to
349 // maintain activity on the network. 353 // maintain activity on the network.
350 if (!packet->has_data() || packet->data().size() == 0) { 354 if (!packet->has_data() || packet->data().size() == 0) {
351 done.Run(); 355 done.Run();
352 return; 356 return;
353 } 357 }
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
416 DCHECK(CalledOnValidThread()); 420 DCHECK(CalledOnValidThread());
417 421
418 // Record the latency between the packet being received and presented. 422 // Record the latency between the packet being received and presented.
419 stats_.video_decode_ms()->Record( 423 stats_.video_decode_ms()->Record(
420 (base::Time::Now() - decode_start).InMilliseconds()); 424 (base::Time::Now() - decode_start).InMilliseconds());
421 425
422 done.Run(); 426 done.Run();
423 } 427 }
424 428
425 } // namespace remoting 429 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/client/software_video_renderer.h ('k') | remoting/client/video_renderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698