| 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 <utility> | 5 #include <utility> |
| 6 | 6 |
| 7 #include "base/base64.h" | 7 #include "base/base64.h" |
| 8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 void OnSessionConfig(const protocol::SessionConfig& config) override {} | 124 void OnSessionConfig(const protocol::SessionConfig& config) override {} |
| 125 protocol::VideoStub* GetVideoStub() override { return this; } | 125 protocol::VideoStub* GetVideoStub() override { return this; } |
| 126 protocol::FrameConsumer* GetFrameConsumer() override { | 126 protocol::FrameConsumer* GetFrameConsumer() override { |
| 127 NOTREACHED(); | 127 NOTREACHED(); |
| 128 return nullptr; | 128 return nullptr; |
| 129 } | 129 } |
| 130 | 130 |
| 131 // protocol::VideoStub interface. | 131 // protocol::VideoStub interface. |
| 132 void ProcessVideoPacket(scoped_ptr<VideoPacket> video_packet, | 132 void ProcessVideoPacket(scoped_ptr<VideoPacket> video_packet, |
| 133 const base::Closure& done) override { | 133 const base::Closure& done) override { |
| 134 if (video_packet->data().empty()) { | 134 done.Run(); |
| 135 // Ignore keep-alive packets | 135 |
| 136 done.Run(); | 136 // Ignore keep-alive packets. |
| 137 if (video_packet->data().empty()) |
| 137 return; | 138 return; |
| 138 } | |
| 139 | 139 |
| 140 last_video_packet_ = std::move(video_packet); | 140 last_video_packet_ = std::move(video_packet); |
| 141 | 141 |
| 142 if (!on_frame_task_.is_null()) | 142 if (!on_frame_task_.is_null()) |
| 143 on_frame_task_.Run(); | 143 on_frame_task_.Run(); |
| 144 | 144 |
| 145 done.Run(); | 145 done.Run(); |
| 146 } | 146 } |
| 147 | 147 |
| 148 // HostStatusObserver interface. | 148 // HostStatusObserver interface. |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 486 << "ms Encode: " << last_video_packet_->encode_time_ms() | 486 << "ms Encode: " << last_video_packet_->encode_time_ms() |
| 487 << "ms Capture: " << last_video_packet_->capture_time_ms() | 487 << "ms Capture: " << last_video_packet_->capture_time_ms() |
| 488 << "ms"; | 488 << "ms"; |
| 489 sum += latency; | 489 sum += latency; |
| 490 } | 490 } |
| 491 | 491 |
| 492 LOG(INFO) << "Average: " << (sum / kFrames).InMillisecondsF(); | 492 LOG(INFO) << "Average: " << (sum / kFrames).InMillisecondsF(); |
| 493 } | 493 } |
| 494 | 494 |
| 495 } // namespace remoting | 495 } // namespace remoting |
| OLD | NEW |