OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |