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" | |
26 #include "remoting/protocol/ice_transport_factory.h" | 25 #include "remoting/protocol/ice_transport_factory.h" |
27 #include "remoting/protocol/jingle_session_manager.h" | 26 #include "remoting/protocol/jingle_session_manager.h" |
28 #include "remoting/protocol/me2me_host_authenticator_factory.h" | 27 #include "remoting/protocol/me2me_host_authenticator_factory.h" |
29 #include "remoting/protocol/negotiating_client_authenticator.h" | 28 #include "remoting/protocol/negotiating_client_authenticator.h" |
30 #include "remoting/protocol/session_config.h" | 29 #include "remoting/protocol/session_config.h" |
| 30 #include "remoting/protocol/video_frame_pump.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 { |
38 | 38 |
39 using protocol::ChannelConfig; | 39 using protocol::ChannelConfig; |
40 | 40 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 public testing::WithParamInterface<NetworkPerformanceParams>, | 75 public testing::WithParamInterface<NetworkPerformanceParams>, |
76 public ClientUserInterface, | 76 public ClientUserInterface, |
77 public VideoRenderer, | 77 public VideoRenderer, |
78 public protocol::VideoStub, | 78 public protocol::VideoStub, |
79 public HostStatusObserver { | 79 public HostStatusObserver { |
80 public: | 80 public: |
81 ProtocolPerfTest() | 81 ProtocolPerfTest() |
82 : host_thread_("host"), | 82 : host_thread_("host"), |
83 capture_thread_("capture"), | 83 capture_thread_("capture"), |
84 encode_thread_("encode") { | 84 encode_thread_("encode") { |
85 VideoFramePump::EnableTimestampsForTests(); | 85 protocol::VideoFramePump::EnableTimestampsForTests(); |
86 host_thread_.StartWithOptions( | 86 host_thread_.StartWithOptions( |
87 base::Thread::Options(base::MessageLoop::TYPE_IO, 0)); | 87 base::Thread::Options(base::MessageLoop::TYPE_IO, 0)); |
88 capture_thread_.Start(); | 88 capture_thread_.Start(); |
89 encode_thread_.Start(); | 89 encode_thread_.Start(); |
90 } | 90 } |
91 | 91 |
92 virtual ~ProtocolPerfTest() { | 92 virtual ~ProtocolPerfTest() { |
93 host_thread_.task_runner()->DeleteSoon(FROM_HERE, host_.release()); | 93 host_thread_.task_runner()->DeleteSoon(FROM_HERE, host_.release()); |
94 host_thread_.task_runner()->DeleteSoon(FROM_HERE, | 94 host_thread_.task_runner()->DeleteSoon(FROM_HERE, |
95 host_signaling_.release()); | 95 host_signaling_.release()); |
(...skipping 389 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 |