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 "base/base64.h" | 5 #include "base/base64.h" |
6 #include "base/files/file_util.h" | 6 #include "base/files/file_util.h" |
7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
8 #include "base/rand_util.h" | 8 #include "base/rand_util.h" |
9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 void StartHostAndClient(protocol::ChannelConfig::Codec video_codec) { | 194 void StartHostAndClient(protocol::ChannelConfig::Codec video_codec) { |
195 fake_network_dispatcher_ = new FakeNetworkDispatcher(); | 195 fake_network_dispatcher_ = new FakeNetworkDispatcher(); |
196 | 196 |
197 client_signaling_.reset(new FakeSignalStrategy(kClientJid)); | 197 client_signaling_.reset(new FakeSignalStrategy(kClientJid)); |
198 | 198 |
199 jingle_glue::JingleThreadWrapper::EnsureForCurrentMessageLoop(); | 199 jingle_glue::JingleThreadWrapper::EnsureForCurrentMessageLoop(); |
200 | 200 |
201 protocol_config_ = protocol::CandidateSessionConfig::CreateDefault(); | 201 protocol_config_ = protocol::CandidateSessionConfig::CreateDefault(); |
202 protocol_config_->DisableAudioChannel(); | 202 protocol_config_->DisableAudioChannel(); |
203 protocol_config_->mutable_video_configs()->clear(); | 203 protocol_config_->mutable_video_configs()->clear(); |
204 protocol_config_->mutable_video_configs()->push_back( | 204 protocol_config_->EnableVideoCodec(video_codec); |
205 protocol::ChannelConfig( | |
206 protocol::ChannelConfig::TRANSPORT_STREAM, 2, video_codec)); | |
207 | 205 |
208 host_thread_.message_loop_proxy()->PostTask( | 206 host_thread_.message_loop_proxy()->PostTask( |
209 FROM_HERE, | 207 FROM_HERE, |
210 base::Bind(&ProtocolPerfTest::StartHost, base::Unretained(this))); | 208 base::Bind(&ProtocolPerfTest::StartHost, base::Unretained(this))); |
211 } | 209 } |
212 | 210 |
213 void StartHost() { | 211 void StartHost() { |
214 DCHECK(host_thread_.message_loop_proxy()->BelongsToCurrentThread()); | 212 DCHECK(host_thread_.message_loop_proxy()->BelongsToCurrentThread()); |
215 | 213 |
216 jingle_glue::JingleThreadWrapper::EnsureForCurrentMessageLoop(); | 214 jingle_glue::JingleThreadWrapper::EnsureForCurrentMessageLoop(); |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
484 << "ms Encode: " << last_video_packet_->encode_time_ms() | 482 << "ms Encode: " << last_video_packet_->encode_time_ms() |
485 << "ms Capture: " << last_video_packet_->capture_time_ms() | 483 << "ms Capture: " << last_video_packet_->capture_time_ms() |
486 << "ms"; | 484 << "ms"; |
487 sum += latency; | 485 sum += latency; |
488 } | 486 } |
489 | 487 |
490 LOG(INFO) << "Average: " << (sum / kFrames).InMillisecondsF(); | 488 LOG(INFO) << "Average: " << (sum / kFrames).InMillisecondsF(); |
491 } | 489 } |
492 | 490 |
493 } // namespace remoting | 491 } // namespace remoting |
OLD | NEW |