OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // This is an application of a minimal host process in a Chromoting | 5 // This is an application of a minimal host process in a Chromoting |
6 // system. It serves the purpose of gluing different pieces together | 6 // system. It serves the purpose of gluing different pieces together |
7 // to make a functional host process for testing. | 7 // to make a functional host process for testing. |
8 // | 8 // |
9 // It peforms the following functionality: | 9 // It peforms the following functionality: |
10 // 1. Connect to the GTalk network and register the machine as a host. | 10 // 1. Connect to the GTalk network and register the machine as a host. |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
82 const char kVideoSwitchName[] = "video"; | 82 const char kVideoSwitchName[] = "video"; |
83 | 83 |
84 const char kVideoSwitchValueVerbatim[] = "verbatim"; | 84 const char kVideoSwitchValueVerbatim[] = "verbatim"; |
85 const char kVideoSwitchValueZip[] = "zip"; | 85 const char kVideoSwitchValueZip[] = "zip"; |
86 const char kVideoSwitchValueVp8[] = "vp8"; | 86 const char kVideoSwitchValueVp8[] = "vp8"; |
87 const char kVideoSwitchValueVp8Rtp[] = "vp8rtp"; | 87 const char kVideoSwitchValueVp8Rtp[] = "vp8rtp"; |
88 | 88 |
89 // Glue class to print out the access code for Me2Mom. | 89 // Glue class to print out the access code for Me2Mom. |
90 void SetMe2MomAccessCode(remoting::SupportAccessVerifier* access_verifier, | 90 void SetMe2MomAccessCode(remoting::SupportAccessVerifier* access_verifier, |
91 bool successful, const std::string& support_id) { | 91 bool successful, const std::string& support_id) { |
92 access_verifier->OnMe2MomHostRegistered(successful, support_id); | |
awong
2011/06/08 18:34:45
Why did we move this higher up?
Jamie
2011/06/08 18:37:43
Because the error message is printed out by the ac
| |
92 if (successful) { | 93 if (successful) { |
93 std::cout << "Support id: " << support_id << "-" | 94 std::cout << "Support id: " << support_id << "-" |
94 << access_verifier->host_secret() << std::endl; | 95 << access_verifier->host_secret() << std::endl; |
96 } else { | |
97 LOG(ERROR) << "If you haven't done so recently, try running" | |
98 << " remoting/tools/register_host.py."; | |
95 } | 99 } |
96 access_verifier->OnMe2MomHostRegistered(successful, support_id); | |
97 } | 100 } |
98 | 101 |
99 class SimpleHost { | 102 class SimpleHost { |
100 public: | 103 public: |
101 SimpleHost() | 104 SimpleHost() |
102 : fake_(false), | 105 : fake_(false), |
103 is_me2mom_(false) { | 106 is_me2mom_(false) { |
104 } | 107 } |
105 | 108 |
106 int Run() { | 109 int Run() { |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
290 LOG(ERROR) << "Unknown video codec: " << video_codec; | 293 LOG(ERROR) << "Unknown video codec: " << video_codec; |
291 return 1; | 294 return 1; |
292 } | 295 } |
293 config->mutable_video_configs()->push_back(ChannelConfig( | 296 config->mutable_video_configs()->push_back(ChannelConfig( |
294 transport, remoting::protocol::kDefaultStreamVersion, codec)); | 297 transport, remoting::protocol::kDefaultStreamVersion, codec)); |
295 simple_host.set_protocol_config(config.release()); | 298 simple_host.set_protocol_config(config.release()); |
296 } | 299 } |
297 | 300 |
298 return simple_host.Run(); | 301 return simple_host.Run(); |
299 } | 302 } |
OLD | NEW |