| 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 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 protocol::VideoStub* SoftwareVideoRenderer::GetVideoStub() { | 345 protocol::VideoStub* SoftwareVideoRenderer::GetVideoStub() { |
| 346 return this; | 346 return this; |
| 347 } | 347 } |
| 348 | 348 |
| 349 void SoftwareVideoRenderer::ProcessVideoPacket(scoped_ptr<VideoPacket> packet, | 349 void SoftwareVideoRenderer::ProcessVideoPacket(scoped_ptr<VideoPacket> packet, |
| 350 const base::Closure& done) { | 350 const base::Closure& done) { |
| 351 DCHECK(CalledOnValidThread()); | 351 DCHECK(CalledOnValidThread()); |
| 352 | 352 |
| 353 // If the video packet is empty then drop it. Empty packets are used to | 353 // If the video packet is empty then drop it. Empty packets are used to |
| 354 // maintain activity on the network. | 354 // maintain activity on the network. |
| 355 stats_.video_packet_rate_uma()->Record(1); |
| 355 if (!packet->has_data() || packet->data().size() == 0) { | 356 if (!packet->has_data() || packet->data().size() == 0) { |
| 356 done.Run(); | 357 done.Run(); |
| 357 return; | 358 return; |
| 358 } | 359 } |
| 359 | 360 |
| 360 // Add one frame to the counter. | 361 // Add one frame to the video frame rate counters. |
| 361 stats_.video_frame_rate()->Record(1); | 362 stats_.video_bandwidth_display()->Record(1); |
| 363 stats_.video_bandwidth_uma()->Record(1); |
| 362 | 364 |
| 363 // Record other statistics received from host. | 365 // Record other statistics received from host. |
| 364 stats_.video_bandwidth()->Record(packet->data().size()); | 366 stats_.video_frame_rate_display()->Record(packet->data().size()); |
| 367 stats_.video_frame_rate_uma()->Record(packet->data().size()); |
| 365 if (packet->has_capture_time_ms()) | 368 if (packet->has_capture_time_ms()) |
| 366 stats_.video_capture_ms()->Record(packet->capture_time_ms()); | 369 stats_.video_capture_ms()->Record(packet->capture_time_ms()); |
| 367 if (packet->has_encode_time_ms()) | 370 if (packet->has_encode_time_ms()) |
| 368 stats_.video_encode_ms()->Record(packet->encode_time_ms()); | 371 stats_.video_encode_ms()->Record(packet->encode_time_ms()); |
| 369 if (packet->has_latest_event_timestamp() && | 372 if (packet->has_latest_event_timestamp() && |
| 370 packet->latest_event_timestamp() > latest_event_timestamp_) { | 373 packet->latest_event_timestamp() > latest_event_timestamp_) { |
| 371 latest_event_timestamp_ = packet->latest_event_timestamp(); | 374 latest_event_timestamp_ = packet->latest_event_timestamp(); |
| 372 base::TimeDelta round_trip_latency = | 375 base::TimeDelta round_trip_latency = |
| 373 base::Time::Now() - | 376 base::Time::Now() - |
| 374 base::Time::FromInternalValue(packet->latest_event_timestamp()); | 377 base::Time::FromInternalValue(packet->latest_event_timestamp()); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 DCHECK(CalledOnValidThread()); | 424 DCHECK(CalledOnValidThread()); |
| 422 | 425 |
| 423 // Record the latency between the packet being received and presented. | 426 // Record the latency between the packet being received and presented. |
| 424 stats_.video_decode_ms()->Record( | 427 stats_.video_decode_ms()->Record( |
| 425 (base::Time::Now() - decode_start).InMilliseconds()); | 428 (base::Time::Now() - decode_start).InMilliseconds()); |
| 426 | 429 |
| 427 done.Run(); | 430 done.Run(); |
| 428 } | 431 } |
| 429 | 432 |
| 430 } // namespace remoting | 433 } // namespace remoting |
| OLD | NEW |