summaryrefslogtreecommitdiffstats
path: root/remoting
diff options
context:
space:
mode:
authorsergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-14 04:11:19 +0000
committersergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-14 04:11:19 +0000
commit16dbfb0e842b3ebb5dc156dc4b0990dc7dfa04db (patch)
tree17eb507379dc017b5801a966475cc90a12976a9a /remoting
parent1b58372bcb3578edfad33f5bb42859c7bdbcab2a (diff)
downloadchromium_src-16dbfb0e842b3ebb5dc156dc4b0990dc7dfa04db.zip
chromium_src-16dbfb0e842b3ebb5dc156dc4b0990dc7dfa04db.tar.gz
chromium_src-16dbfb0e842b3ebb5dc156dc4b0990dc7dfa04db.tar.bz2
Rename capture and encode threads to make it clear that they are for video.
Renamed capture thread to video_capture thread and encode thread to video_encode thread. It's mainly to prevent bugs like crbug.com/157992 Review URL: https://chromiumcodereview.appspot.com/11366226 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167591 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting')
-rw-r--r--remoting/host/chromoting_host.cc12
-rw-r--r--remoting/host/chromoting_host.h8
-rw-r--r--remoting/host/chromoting_host_context.cc28
-rw-r--r--remoting/host/chromoting_host_context.h14
-rw-r--r--remoting/host/chromoting_host_context_unittest.cc4
-rw-r--r--remoting/host/client_session.cc12
-rw-r--r--remoting/host/client_session.h22
-rw-r--r--remoting/host/plugin/host_script_object.cc4
-rw-r--r--remoting/host/remoting_me2me_host.cc4
9 files changed, 56 insertions, 52 deletions
diff --git a/remoting/host/chromoting_host.cc b/remoting/host/chromoting_host.cc
index 8abeda2..8a9c41d 100644
--- a/remoting/host/chromoting_host.cc
+++ b/remoting/host/chromoting_host.cc
@@ -60,14 +60,14 @@ ChromotingHost::ChromotingHost(
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> video_capture_task_runner,
+ scoped_refptr<base::SingleThreadTaskRunner> video_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),
+ video_capture_task_runner_(video_capture_task_runner),
+ video_encode_task_runner_(video_encode_task_runner),
network_task_runner_(network_task_runner),
signal_strategy_(signal_strategy),
clients_count_(0),
@@ -314,8 +314,8 @@ void ChromotingHost::OnIncomingSession(
scoped_refptr<ClientSession> client = new ClientSession(
this,
audio_task_runner_,
- capture_task_runner_,
- encode_task_runner_,
+ video_capture_task_runner_,
+ video_encode_task_runner_,
network_task_runner_,
connection.Pass(),
desktop_environment_factory_,
diff --git a/remoting/host/chromoting_host.h b/remoting/host/chromoting_host.h
index 19865c6..b86cb90 100644
--- a/remoting/host/chromoting_host.h
+++ b/remoting/host/chromoting_host.h
@@ -73,8 +73,8 @@ class ChromotingHost : public base::RefCountedThreadSafe<ChromotingHost>,
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> video_capture_task_runner,
+ scoped_refptr<base::SingleThreadTaskRunner> video_encode_task_runner,
scoped_refptr<base::SingleThreadTaskRunner> network_task_runner);
// Asynchronously start the host process.
@@ -185,8 +185,8 @@ class ChromotingHost : public base::RefCountedThreadSafe<ChromotingHost>,
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> video_capture_task_runner_;
+ scoped_refptr<base::SingleThreadTaskRunner> video_encode_task_runner_;
scoped_refptr<base::SingleThreadTaskRunner> network_task_runner_;
// Connection objects.
diff --git a/remoting/host/chromoting_host_context.cc b/remoting/host/chromoting_host_context.cc
index 81c852a..475255c 100644
--- a/remoting/host/chromoting_host_context.cc
+++ b/remoting/host/chromoting_host_context.cc
@@ -16,8 +16,8 @@ namespace remoting {
ChromotingHostContext::ChromotingHostContext(
scoped_refptr<AutoThreadTaskRunner> ui_task_runner)
: audio_thread_("ChromotingAudioThread"),
- capture_thread_("ChromotingCaptureThread"),
- encode_thread_("ChromotingEncodeThread"),
+ video_capture_thread_("ChromotingCaptureThread"),
+ video_encode_thread_("ChromotingEncodeThread"),
file_thread_("ChromotingFileIOThread"),
input_thread_("ChromotingInputThread"),
network_thread_("ChromotingNetworkThread"),
@@ -30,8 +30,8 @@ ChromotingHostContext::~ChromotingHostContext() {
void ChromotingHostContext::ReleaseTaskRunners() {
url_request_context_getter_ = NULL;
audio_task_runner_ = NULL;
- capture_task_runner_ = NULL;
- encode_task_runner_ = NULL;
+ video_capture_task_runner_ = NULL;
+ video_encode_task_runner_ = NULL;
file_task_runner_ = NULL;
input_task_runner_ = NULL;
network_task_runner_ = NULL;
@@ -42,7 +42,7 @@ bool ChromotingHostContext::Start() {
// Start all the threads.
base::Thread::Options io_thread_options(MessageLoop::TYPE_IO, 0);
- bool started = capture_thread_.Start() && encode_thread_.Start();
+ bool started = video_capture_thread_.Start() && video_encode_thread_.Start();
#if defined(OS_WIN)
// On Windows audio capturer needs to run on a UI thread that has COM
@@ -66,11 +66,11 @@ bool ChromotingHostContext::Start() {
audio_task_runner_ =
new AutoThreadTaskRunner(audio_thread_.message_loop_proxy(),
ui_task_runner_);
- capture_task_runner_ =
- new AutoThreadTaskRunner(capture_thread_.message_loop_proxy(),
+ video_capture_task_runner_ =
+ new AutoThreadTaskRunner(video_capture_thread_.message_loop_proxy(),
ui_task_runner_);
- encode_task_runner_ =
- new AutoThreadTaskRunner(encode_thread_.message_loop_proxy(),
+ video_encode_task_runner_ =
+ new AutoThreadTaskRunner(video_encode_thread_.message_loop_proxy(),
ui_task_runner_);
file_task_runner_ =
new AutoThreadTaskRunner(file_thread_.message_loop_proxy(),
@@ -91,12 +91,14 @@ base::SingleThreadTaskRunner* ChromotingHostContext::audio_task_runner() {
return audio_task_runner_;
}
-base::SingleThreadTaskRunner* ChromotingHostContext::capture_task_runner() {
- return capture_task_runner_;
+base::SingleThreadTaskRunner*
+ChromotingHostContext::video_capture_task_runner() {
+ return video_capture_task_runner_;
}
-base::SingleThreadTaskRunner* ChromotingHostContext::encode_task_runner() {
- return encode_task_runner_;
+base::SingleThreadTaskRunner*
+ChromotingHostContext::video_encode_task_runner() {
+ return video_encode_task_runner_;
}
base::SingleThreadTaskRunner* ChromotingHostContext::file_task_runner() {
diff --git a/remoting/host/chromoting_host_context.h b/remoting/host/chromoting_host_context.h
index 0250f06..ed55963 100644
--- a/remoting/host/chromoting_host_context.h
+++ b/remoting/host/chromoting_host_context.h
@@ -44,10 +44,10 @@ class ChromotingHostContext {
// Task runner for the thread used by the ScreenRecorder to capture
// the screen.
- virtual base::SingleThreadTaskRunner* capture_task_runner();
+ virtual base::SingleThreadTaskRunner* video_capture_task_runner();
// Task runner for the thread used to encode video streams.
- virtual base::SingleThreadTaskRunner* encode_task_runner();
+ virtual base::SingleThreadTaskRunner* video_encode_task_runner();
// Task runner for the thread that is used for blocking file
// IO. This thread is used by the URLRequestContext to read proxy
@@ -79,10 +79,10 @@ class ChromotingHostContext {
base::Thread audio_thread_;
// A thread that hosts screen capture.
- base::Thread capture_thread_;
+ base::Thread video_capture_thread_;
- // A thread that hosts all encode operations.
- base::Thread encode_thread_;
+ // A thread that hosts video encode operations.
+ base::Thread video_encode_thread_;
// Thread for blocking IO operations.
base::Thread file_thread_;
@@ -96,8 +96,8 @@ class ChromotingHostContext {
// Task runners wrapping the above threads. These should be declared after
// the corresponding threads to guarantee proper order of destruction.
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> video_capture_task_runner_;
+ scoped_refptr<base::SingleThreadTaskRunner> video_encode_task_runner_;
scoped_refptr<base::SingleThreadTaskRunner> file_task_runner_;
scoped_refptr<base::SingleThreadTaskRunner> input_task_runner_;
scoped_refptr<base::SingleThreadTaskRunner> network_task_runner_;
diff --git a/remoting/host/chromoting_host_context_unittest.cc b/remoting/host/chromoting_host_context_unittest.cc
index 64010e9..3c3858e 100644
--- a/remoting/host/chromoting_host_context_unittest.cc
+++ b/remoting/host/chromoting_host_context_unittest.cc
@@ -19,8 +19,8 @@ TEST(ChromotingHostContextTest, StartAndStop) {
context.Start();
EXPECT_TRUE(context.audio_task_runner());
- EXPECT_TRUE(context.capture_task_runner());
- EXPECT_TRUE(context.encode_task_runner());
+ EXPECT_TRUE(context.video_capture_task_runner());
+ EXPECT_TRUE(context.video_encode_task_runner());
EXPECT_TRUE(context.file_task_runner());
EXPECT_TRUE(context.input_task_runner());
EXPECT_TRUE(context.network_task_runner());
diff --git a/remoting/host/client_session.cc b/remoting/host/client_session.cc
index 0fa76ae..1ed7503 100644
--- a/remoting/host/client_session.cc
+++ b/remoting/host/client_session.cc
@@ -30,8 +30,8 @@ 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> video_capture_task_runner,
+ scoped_refptr<base::SingleThreadTaskRunner> video_encode_task_runner,
scoped_refptr<base::SingleThreadTaskRunner> network_task_runner,
scoped_ptr<protocol::ConnectionToClient> connection,
DesktopEnvironmentFactory* desktop_environment_factory,
@@ -54,8 +54,8 @@ ClientSession::ClientSession(
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),
+ video_capture_task_runner_(video_capture_task_runner),
+ video_encode_task_runner_(video_encode_task_runner),
network_task_runner_(network_task_runner),
active_recorders_(0) {
connection_->SetEventHandler(this);
@@ -134,8 +134,8 @@ void ClientSession::OnConnectionChannelsConnected(
CreateVideoEncoder(connection_->session()->config());
// Create a VideoScheduler to pump frames from the capturer to the client.
- video_scheduler_ = new VideoScheduler(capture_task_runner_,
- encode_task_runner_,
+ video_scheduler_ = new VideoScheduler(video_capture_task_runner_,
+ video_encode_task_runner_,
network_task_runner_,
desktop_environment_->video_capturer(),
video_encoder.Pass(),
diff --git a/remoting/host/client_session.h b/remoting/host/client_session.h
index fd011e9..0d19d18 100644
--- a/remoting/host/client_session.h
+++ b/remoting/host/client_session.h
@@ -88,14 +88,15 @@ 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,
- scoped_ptr<protocol::ConnectionToClient> connection,
- DesktopEnvironmentFactory* desktop_environment_factory,
- const base::TimeDelta& max_duration);
+ ClientSession(
+ EventHandler* event_handler,
+ scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner,
+ scoped_refptr<base::SingleThreadTaskRunner> video_capture_task_runner,
+ scoped_refptr<base::SingleThreadTaskRunner> video_encode_task_runner,
+ scoped_refptr<base::SingleThreadTaskRunner> network_task_runner,
+ scoped_ptr<protocol::ConnectionToClient> connection,
+ DesktopEnvironmentFactory* desktop_environment_factory,
+ const base::TimeDelta& max_duration);
// protocol::HostStub interface.
virtual void NotifyClientDimensions(
@@ -217,9 +218,10 @@ 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> video_capture_task_runner_;
+ scoped_refptr<base::SingleThreadTaskRunner> video_encode_task_runner_;
scoped_refptr<base::SingleThreadTaskRunner> network_task_runner_;
// Schedulers for audio and video capture.
diff --git a/remoting/host/plugin/host_script_object.cc b/remoting/host/plugin/host_script_object.cc
index 52129fd..a83bd3b 100644
--- a/remoting/host/plugin/host_script_object.cc
+++ b/remoting/host/plugin/host_script_object.cc
@@ -369,8 +369,8 @@ void HostNPScriptObject::It2MeImpl::FinishConnect(
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_->video_capture_task_runner(),
+ host_context_->video_encode_task_runner(),
host_context_->network_task_runner());
host_->AddStatusObserver(this);
log_to_server_.reset(
diff --git a/remoting/host/remoting_me2me_host.cc b/remoting/host/remoting_me2me_host.cc
index fbcc7fa..7b3e480 100644
--- a/remoting/host/remoting_me2me_host.cc
+++ b/remoting/host/remoting_me2me_host.cc
@@ -809,8 +809,8 @@ void HostProcess::StartHost() {
CreateHostSessionManager(network_settings,
context_->url_request_context_getter()),
context_->audio_task_runner(),
- context_->capture_task_runner(),
- context_->encode_task_runner(),
+ context_->video_capture_task_runner(),
+ context_->video_encode_task_runner(),
context_->network_task_runner());
// TODO(simonmorris): Get the maximum session duration from a policy.