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" |
11 #include "base/synchronization/waitable_event.h" | 11 #include "base/synchronization/waitable_event.h" |
12 #include "base/thread_task_runner_handle.h" | 12 #include "base/thread_task_runner_handle.h" |
13 #include "jingle/glue/thread_wrapper.h" | 13 #include "jingle/glue/thread_wrapper.h" |
14 #include "net/base/test_data_directory.h" | 14 #include "net/base/test_data_directory.h" |
15 #include "net/url_request/url_request_context_getter.h" | 15 #include "net/url_request/url_request_context_getter.h" |
16 #include "remoting/base/rsa_key_pair.h" | 16 #include "remoting/base/rsa_key_pair.h" |
17 #include "remoting/client/audio_player.h" | 17 #include "remoting/client/audio_player.h" |
18 #include "remoting/client/chromoting_client.h" | 18 #include "remoting/client/chromoting_client.h" |
19 #include "remoting/client/client_context.h" | 19 #include "remoting/client/client_context.h" |
20 #include "remoting/client/client_user_interface.h" | 20 #include "remoting/client/client_user_interface.h" |
21 #include "remoting/client/video_renderer.h" | 21 #include "remoting/client/video_renderer.h" |
22 #include "remoting/host/chromoting_host.h" | 22 #include "remoting/host/chromoting_host.h" |
23 #include "remoting/host/chromoting_host_context.h" | 23 #include "remoting/host/chromoting_host_context.h" |
24 #include "remoting/host/fake_desktop_environment.h" | 24 #include "remoting/host/fake_desktop_environment.h" |
25 #include "remoting/host/video_frame_pump.h" | 25 #include "remoting/host/video_frame_pump.h" |
| 26 #include "remoting/protocol/ice_transport_factory.h" |
26 #include "remoting/protocol/jingle_session_manager.h" | 27 #include "remoting/protocol/jingle_session_manager.h" |
27 #include "remoting/protocol/libjingle_transport_factory.h" | |
28 #include "remoting/protocol/me2me_host_authenticator_factory.h" | 28 #include "remoting/protocol/me2me_host_authenticator_factory.h" |
29 #include "remoting/protocol/negotiating_client_authenticator.h" | 29 #include "remoting/protocol/negotiating_client_authenticator.h" |
30 #include "remoting/protocol/session_config.h" | 30 #include "remoting/protocol/session_config.h" |
31 #include "remoting/signaling/fake_signal_strategy.h" | 31 #include "remoting/signaling/fake_signal_strategy.h" |
32 #include "remoting/test/fake_network_dispatcher.h" | 32 #include "remoting/test/fake_network_dispatcher.h" |
33 #include "remoting/test/fake_port_allocator.h" | 33 #include "remoting/test/fake_port_allocator.h" |
34 #include "remoting/test/fake_socket_factory.h" | 34 #include "remoting/test/fake_socket_factory.h" |
35 #include "testing/gtest/include/gtest/gtest.h" | 35 #include "testing/gtest/include/gtest/gtest.h" |
36 | 36 |
37 namespace remoting { | 37 namespace remoting { |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 | 226 |
227 scoped_ptr<FakePortAllocator> port_allocator( | 227 scoped_ptr<FakePortAllocator> port_allocator( |
228 FakePortAllocator::Create(fake_network_dispatcher_)); | 228 FakePortAllocator::Create(fake_network_dispatcher_)); |
229 port_allocator->socket_factory()->SetBandwidth(GetParam().bandwidth, | 229 port_allocator->socket_factory()->SetBandwidth(GetParam().bandwidth, |
230 GetParam().max_buffers); | 230 GetParam().max_buffers); |
231 port_allocator->socket_factory()->SetLatency(GetParam().latency_average, | 231 port_allocator->socket_factory()->SetLatency(GetParam().latency_average, |
232 GetParam().latency_stddev); | 232 GetParam().latency_stddev); |
233 port_allocator->socket_factory()->set_out_of_order_rate( | 233 port_allocator->socket_factory()->set_out_of_order_rate( |
234 GetParam().out_of_order_rate); | 234 GetParam().out_of_order_rate); |
235 scoped_ptr<protocol::TransportFactory> host_transport_factory( | 235 scoped_ptr<protocol::TransportFactory> host_transport_factory( |
236 new protocol::LibjingleTransportFactory( | 236 new protocol::IceTransportFactory( |
237 host_signaling_.get(), port_allocator.Pass(), network_settings, | 237 host_signaling_.get(), port_allocator.Pass(), network_settings, |
238 protocol::TransportRole::SERVER)); | 238 protocol::TransportRole::SERVER)); |
239 | 239 |
240 scoped_ptr<protocol::SessionManager> session_manager( | 240 scoped_ptr<protocol::SessionManager> session_manager( |
241 new protocol::JingleSessionManager(host_transport_factory.Pass())); | 241 new protocol::JingleSessionManager(host_transport_factory.Pass())); |
242 session_manager->set_protocol_config(protocol_config_->Clone()); | 242 session_manager->set_protocol_config(protocol_config_->Clone()); |
243 | 243 |
244 // Encoder runs on a separate thread, main thread is used for everything | 244 // Encoder runs on a separate thread, main thread is used for everything |
245 // else. | 245 // else. |
246 host_.reset(new ChromotingHost(host_signaling_.get(), | 246 host_.reset(new ChromotingHost(host_signaling_.get(), |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 | 296 |
297 scoped_ptr<FakePortAllocator> port_allocator( | 297 scoped_ptr<FakePortAllocator> port_allocator( |
298 FakePortAllocator::Create(fake_network_dispatcher_)); | 298 FakePortAllocator::Create(fake_network_dispatcher_)); |
299 port_allocator->socket_factory()->SetBandwidth(GetParam().bandwidth, | 299 port_allocator->socket_factory()->SetBandwidth(GetParam().bandwidth, |
300 GetParam().max_buffers); | 300 GetParam().max_buffers); |
301 port_allocator->socket_factory()->SetLatency(GetParam().latency_average, | 301 port_allocator->socket_factory()->SetLatency(GetParam().latency_average, |
302 GetParam().latency_stddev); | 302 GetParam().latency_stddev); |
303 port_allocator->socket_factory()->set_out_of_order_rate( | 303 port_allocator->socket_factory()->set_out_of_order_rate( |
304 GetParam().out_of_order_rate); | 304 GetParam().out_of_order_rate); |
305 scoped_ptr<protocol::TransportFactory> client_transport_factory( | 305 scoped_ptr<protocol::TransportFactory> client_transport_factory( |
306 new protocol::LibjingleTransportFactory( | 306 new protocol::IceTransportFactory( |
307 client_signaling_.get(), port_allocator.Pass(), network_settings, | 307 client_signaling_.get(), port_allocator.Pass(), network_settings, |
308 protocol::TransportRole::CLIENT)); | 308 protocol::TransportRole::CLIENT)); |
309 | 309 |
310 std::vector<protocol::AuthenticationMethod> auth_methods; | 310 std::vector<protocol::AuthenticationMethod> auth_methods; |
311 auth_methods.push_back(protocol::AuthenticationMethod::Spake2( | 311 auth_methods.push_back(protocol::AuthenticationMethod::Spake2( |
312 protocol::AuthenticationMethod::NONE)); | 312 protocol::AuthenticationMethod::NONE)); |
313 scoped_ptr<protocol::Authenticator> client_authenticator( | 313 scoped_ptr<protocol::Authenticator> client_authenticator( |
314 new protocol::NegotiatingClientAuthenticator( | 314 new protocol::NegotiatingClientAuthenticator( |
315 std::string(), // client_pairing_id | 315 std::string(), // client_pairing_id |
316 std::string(), // client_pairing_secret | 316 std::string(), // client_pairing_secret |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
485 << "ms Encode: " << last_video_packet_->encode_time_ms() | 485 << "ms Encode: " << last_video_packet_->encode_time_ms() |
486 << "ms Capture: " << last_video_packet_->capture_time_ms() | 486 << "ms Capture: " << last_video_packet_->capture_time_ms() |
487 << "ms"; | 487 << "ms"; |
488 sum += latency; | 488 sum += latency; |
489 } | 489 } |
490 | 490 |
491 LOG(INFO) << "Average: " << (sum / kFrames).InMillisecondsF(); | 491 LOG(INFO) << "Average: " << (sum / kFrames).InMillisecondsF(); |
492 } | 492 } |
493 | 493 |
494 } // namespace remoting | 494 } // namespace remoting |
OLD | NEW |