OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 file implements a standalone host process for Me2Me. | 5 // This file implements a standalone host process for Me2Me. |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 1506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1517 #else // !defined(NDEBUG) | 1517 #else // !defined(NDEBUG) |
1518 LOG(ERROR) << "WebRTC is enabled only in debug builds."; | 1518 LOG(ERROR) << "WebRTC is enabled only in debug builds."; |
1519 ShutdownHost(kUsageExitCode); | 1519 ShutdownHost(kUsageExitCode); |
1520 return; | 1520 return; |
1521 #endif // defined(NDEBUG) | 1521 #endif // defined(NDEBUG) |
1522 } else { | 1522 } else { |
1523 transport_factory.reset( | 1523 transport_factory.reset( |
1524 new protocol::IceTransportFactory(transport_context)); | 1524 new protocol::IceTransportFactory(transport_context)); |
1525 } | 1525 } |
1526 scoped_ptr<protocol::SessionManager> session_manager( | 1526 scoped_ptr<protocol::SessionManager> session_manager( |
1527 new protocol::JingleSessionManager(transport_factory.Pass())); | 1527 new protocol::JingleSessionManager(transport_factory.Pass(), |
| 1528 signal_strategy_.get())); |
1528 | 1529 |
1529 scoped_ptr<protocol::CandidateSessionConfig> protocol_config = | 1530 scoped_ptr<protocol::CandidateSessionConfig> protocol_config = |
1530 protocol::CandidateSessionConfig::CreateDefault(); | 1531 protocol::CandidateSessionConfig::CreateDefault(); |
1531 if (!desktop_environment_factory_->SupportsAudioCapture()) | 1532 if (!desktop_environment_factory_->SupportsAudioCapture()) |
1532 protocol_config->DisableAudioChannel(); | 1533 protocol_config->DisableAudioChannel(); |
1533 if (enable_vp9_) | 1534 if (enable_vp9_) |
1534 protocol_config->set_vp9_experiment_enabled(true); | 1535 protocol_config->set_vp9_experiment_enabled(true); |
1535 #if !defined(NDEBUG) | 1536 #if !defined(NDEBUG) |
1536 if (base::CommandLine::ForCurrentProcess()->HasSwitch(kEnableWebrtc)) { | 1537 if (base::CommandLine::ForCurrentProcess()->HasSwitch(kEnableWebrtc)) { |
1537 protocol_config->set_webrtc_supported(true); | 1538 protocol_config->set_webrtc_supported(true); |
1538 } | 1539 } |
1539 #endif // !defined(NDEBUG) | 1540 #endif // !defined(NDEBUG) |
1540 session_manager->set_protocol_config(protocol_config.Pass()); | 1541 session_manager->set_protocol_config(protocol_config.Pass()); |
1541 | 1542 |
1542 host_.reset(new ChromotingHost( | 1543 host_.reset(new ChromotingHost( |
1543 signal_strategy_.get(), desktop_environment_factory_.get(), | 1544 desktop_environment_factory_.get(), |
1544 session_manager.Pass(), context_->audio_task_runner(), | 1545 session_manager.Pass(), context_->audio_task_runner(), |
1545 context_->input_task_runner(), context_->video_capture_task_runner(), | 1546 context_->input_task_runner(), context_->video_capture_task_runner(), |
1546 context_->video_encode_task_runner(), context_->network_task_runner(), | 1547 context_->video_encode_task_runner(), context_->network_task_runner(), |
1547 context_->ui_task_runner())); | 1548 context_->ui_task_runner())); |
1548 | 1549 |
1549 if (frame_recorder_buffer_size_ > 0) { | 1550 if (frame_recorder_buffer_size_ > 0) { |
1550 scoped_ptr<VideoFrameRecorderHostExtension> frame_recorder_extension( | 1551 scoped_ptr<VideoFrameRecorderHostExtension> frame_recorder_extension( |
1551 new VideoFrameRecorderHostExtension()); | 1552 new VideoFrameRecorderHostExtension()); |
1552 frame_recorder_extension->SetMaxContentBytes(frame_recorder_buffer_size_); | 1553 frame_recorder_extension->SetMaxContentBytes(frame_recorder_buffer_size_); |
1553 host_->AddExtension(frame_recorder_extension.Pass()); | 1554 host_->AddExtension(frame_recorder_extension.Pass()); |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1747 base::TimeDelta::FromSeconds(kShutdownTimeoutSeconds)); | 1748 base::TimeDelta::FromSeconds(kShutdownTimeoutSeconds)); |
1748 new HostProcess(context.Pass(), &exit_code, &shutdown_watchdog); | 1749 new HostProcess(context.Pass(), &exit_code, &shutdown_watchdog); |
1749 | 1750 |
1750 // Run the main (also UI) message loop until the host no longer needs it. | 1751 // Run the main (also UI) message loop until the host no longer needs it. |
1751 message_loop.Run(); | 1752 message_loop.Run(); |
1752 | 1753 |
1753 return exit_code; | 1754 return exit_code; |
1754 } | 1755 } |
1755 | 1756 |
1756 } // namespace remoting | 1757 } // namespace remoting |
OLD | NEW |