diff options
author | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-01 17:55:04 +0000 |
---|---|---|
committer | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-01 17:55:04 +0000 |
commit | 032d9ddf5a2497550e94c78b56f8c33a09ae32c5 (patch) | |
tree | d6ed852bcda5be6fe665ed2d4fc737ccc5c8be12 /remoting | |
parent | 0abfae3eba136896a2c6ef8aa1a68ca8fcb78aaa (diff) | |
download | chromium_src-032d9ddf5a2497550e94c78b56f8c33a09ae32c5.zip chromium_src-032d9ddf5a2497550e94c78b56f8c33a09ae32c5.tar.gz chromium_src-032d9ddf5a2497550e94c78b56f8c33a09ae32c5.tar.bz2 |
Use correct thread for audio capturing and encoding.
Previously video capture thread was passed to AudioScheduler instead of the dedicated audio thread. Fixed ChromotingHost so that the correct thread is given to AudioScheduler.
BUG=157992
Review URL: https://codereview.chromium.org/11260053
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@165426 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting')
-rw-r--r-- | remoting/host/chromoting_host.cc | 3 | ||||
-rw-r--r-- | remoting/host/chromoting_host.h | 2 | ||||
-rw-r--r-- | remoting/host/chromoting_host_unittest.cc | 2 | ||||
-rw-r--r-- | remoting/host/client_session.cc | 4 | ||||
-rw-r--r-- | remoting/host/client_session.h | 2 | ||||
-rw-r--r-- | remoting/host/client_session_unittest.cc | 1 | ||||
-rw-r--r-- | remoting/host/plugin/host_script_object.cc | 1 | ||||
-rw-r--r-- | remoting/host/remoting_me2me_host.cc | 1 |
8 files changed, 15 insertions, 1 deletions
diff --git a/remoting/host/chromoting_host.cc b/remoting/host/chromoting_host.cc index 6fe3d11..8abeda2 100644 --- a/remoting/host/chromoting_host.cc +++ b/remoting/host/chromoting_host.cc @@ -59,11 +59,13 @@ ChromotingHost::ChromotingHost( SignalStrategy* signal_strategy, DesktopEnvironmentFactory* desktop_environment_factory, scoped_ptr<protocol::SessionManager> session_manager, + scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner, scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner, scoped_refptr<base::SingleThreadTaskRunner> encode_task_runner, scoped_refptr<base::SingleThreadTaskRunner> network_task_runner) : desktop_environment_factory_(desktop_environment_factory), session_manager_(session_manager.Pass()), + audio_task_runner_(audio_task_runner), capture_task_runner_(capture_task_runner), encode_task_runner_(encode_task_runner), network_task_runner_(network_task_runner), @@ -311,6 +313,7 @@ void ChromotingHost::OnIncomingSession( new protocol::ConnectionToClient(session)); scoped_refptr<ClientSession> client = new ClientSession( this, + audio_task_runner_, capture_task_runner_, encode_task_runner_, network_task_runner_, diff --git a/remoting/host/chromoting_host.h b/remoting/host/chromoting_host.h index 9136359..19865c6 100644 --- a/remoting/host/chromoting_host.h +++ b/remoting/host/chromoting_host.h @@ -72,6 +72,7 @@ class ChromotingHost : public base::RefCountedThreadSafe<ChromotingHost>, SignalStrategy* signal_strategy, DesktopEnvironmentFactory* desktop_environment_factory, scoped_ptr<protocol::SessionManager> session_manager, + scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner, scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner, scoped_refptr<base::SingleThreadTaskRunner> encode_task_runner, scoped_refptr<base::SingleThreadTaskRunner> network_task_runner); @@ -183,6 +184,7 @@ class ChromotingHost : public base::RefCountedThreadSafe<ChromotingHost>, // Parameters specified when the host was created. DesktopEnvironmentFactory* desktop_environment_factory_; scoped_ptr<protocol::SessionManager> session_manager_; + scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner_; scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner_; scoped_refptr<base::SingleThreadTaskRunner> encode_task_runner_; scoped_refptr<base::SingleThreadTaskRunner> network_task_runner_; diff --git a/remoting/host/chromoting_host_unittest.cc b/remoting/host/chromoting_host_unittest.cc index cf7aa24..6333e24 100644 --- a/remoting/host/chromoting_host_unittest.cc +++ b/remoting/host/chromoting_host_unittest.cc @@ -145,6 +145,7 @@ class ChromotingHostTest : public testing::Test { &signal_strategy_, desktop_environment_factory_.get(), scoped_ptr<protocol::SessionManager>(session_manager_), + context_.audio_task_runner(), context_.capture_task_runner(), context_.encode_task_runner(), context_.network_task_runner()); @@ -251,6 +252,7 @@ class ChromotingHostTest : public testing::Test { protocol::ConnectionToClient* connection_ptr = connection.get(); scoped_refptr<ClientSession> client = new ClientSession( host_.get(), + context_.audio_task_runner(), context_.capture_task_runner(), context_.encode_task_runner(), context_.network_task_runner(), diff --git a/remoting/host/client_session.cc b/remoting/host/client_session.cc index e6acb58..0fa76ae 100644 --- a/remoting/host/client_session.cc +++ b/remoting/host/client_session.cc @@ -29,6 +29,7 @@ namespace remoting { ClientSession::ClientSession( EventHandler* event_handler, + scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner, scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner, scoped_refptr<base::SingleThreadTaskRunner> encode_task_runner, scoped_refptr<base::SingleThreadTaskRunner> network_task_runner, @@ -52,6 +53,7 @@ ClientSession::ClientSession( auth_clipboard_filter_(&disable_clipboard_filter_), client_clipboard_factory_(clipboard_echo_filter_.client_filter()), max_duration_(max_duration), + audio_task_runner_(audio_task_runner), capture_task_runner_(capture_task_runner), encode_task_runner_(encode_task_runner), network_task_runner_(network_task_runner), @@ -146,7 +148,7 @@ void ClientSession::OnConnectionChannelsConnected( scoped_ptr<AudioEncoder> audio_encoder = CreateAudioEncoder(connection_->session()->config()); audio_scheduler_ = new AudioScheduler( - capture_task_runner_, + audio_task_runner_, network_task_runner_, desktop_environment_->audio_capturer(), audio_encoder.Pass(), diff --git a/remoting/host/client_session.h b/remoting/host/client_session.h index 7623cbf..fd011e9 100644 --- a/remoting/host/client_session.h +++ b/remoting/host/client_session.h @@ -89,6 +89,7 @@ class ClientSession // |event_handler| must outlive |this|. |desktop_environment_factory| is only // used by the constructor to create an instance of DesktopEnvironment. ClientSession(EventHandler* event_handler, + scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner, scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner, scoped_refptr<base::SingleThreadTaskRunner> encode_task_runner, scoped_refptr<base::SingleThreadTaskRunner> network_task_runner, @@ -216,6 +217,7 @@ class ClientSession // is reached. base::OneShotTimer<ClientSession> max_duration_timer_; + scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner_; scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner_; scoped_refptr<base::SingleThreadTaskRunner> encode_task_runner_; scoped_refptr<base::SingleThreadTaskRunner> network_task_runner_; diff --git a/remoting/host/client_session_unittest.cc b/remoting/host/client_session_unittest.cc index bc7c9c3..4678dbc 100644 --- a/remoting/host/client_session_unittest.cc +++ b/remoting/host/client_session_unittest.cc @@ -72,6 +72,7 @@ class ClientSessionTest : public testing::Test { client_session_ = new ClientSession( &session_event_handler_, + ui_task_runner_, // Audio thread. ui_task_runner_, // Capture thread. ui_task_runner_, // Encode thread. ui_task_runner_, // Network thread. diff --git a/remoting/host/plugin/host_script_object.cc b/remoting/host/plugin/host_script_object.cc index 52b7cf3..52129fd 100644 --- a/remoting/host/plugin/host_script_object.cc +++ b/remoting/host/plugin/host_script_object.cc @@ -368,6 +368,7 @@ void HostNPScriptObject::It2MeImpl::FinishConnect( desktop_environment_factory_.get(), CreateHostSessionManager(network_settings, host_context_->url_request_context_getter()), + host_context_->audio_task_runner(), host_context_->capture_task_runner(), host_context_->encode_task_runner(), host_context_->network_task_runner()); diff --git a/remoting/host/remoting_me2me_host.cc b/remoting/host/remoting_me2me_host.cc index 8dd59e8..c049d50 100644 --- a/remoting/host/remoting_me2me_host.cc +++ b/remoting/host/remoting_me2me_host.cc @@ -779,6 +779,7 @@ void HostProcess::StartHost() { desktop_environment_factory_.get(), CreateHostSessionManager(network_settings, context_->url_request_context_getter()), + context_->audio_task_runner(), context_->capture_task_runner(), context_->encode_task_runner(), context_->network_task_runner()); |