Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1204)

Side by Side Diff: remoting/host/chromoting_host_context.cc

Issue 10914029: Use a separate thread for audio capturing and encoding. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #include "remoting/host/chromoting_host_context.h" 5 #include "remoting/host/chromoting_host_context.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/threading/thread.h" 10 #include "base/threading/thread.h"
11 #include "remoting/host/url_request_context.h" 11 #include "remoting/host/url_request_context.h"
12 12
13 namespace remoting { 13 namespace remoting {
14 14
15 ChromotingHostContext::ChromotingHostContext( 15 ChromotingHostContext::ChromotingHostContext(
16 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) 16 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner)
17 : network_thread_("ChromotingNetworkThread"), 17 : network_thread_("ChromotingNetworkThread"),
18 capture_thread_("ChromotingCaptureThread"), 18 capture_thread_("ChromotingCaptureThread"),
19 encode_thread_("ChromotingEncodeThread"), 19 encode_thread_("ChromotingEncodeThread"),
20 audio_thread_("ChromotingAudioThread"),
20 desktop_thread_("ChromotingDesktopThread"), 21 desktop_thread_("ChromotingDesktopThread"),
21 file_thread_("ChromotingFileIOThread"), 22 file_thread_("ChromotingFileIOThread"),
22 ui_task_runner_(ui_task_runner) { 23 ui_task_runner_(ui_task_runner) {
23 } 24 }
24 25
25 ChromotingHostContext::~ChromotingHostContext() { 26 ChromotingHostContext::~ChromotingHostContext() {
26 } 27 }
27 28
28 bool ChromotingHostContext::Start() { 29 bool ChromotingHostContext::Start() {
29 // Start all the threads. 30 // Start all the threads.
(...skipping 13 matching lines...) Expand all
43 } 44 }
44 45
45 base::SingleThreadTaskRunner* ChromotingHostContext::capture_task_runner() { 46 base::SingleThreadTaskRunner* ChromotingHostContext::capture_task_runner() {
46 return capture_thread_.message_loop_proxy(); 47 return capture_thread_.message_loop_proxy();
47 } 48 }
48 49
49 base::SingleThreadTaskRunner* ChromotingHostContext::encode_task_runner() { 50 base::SingleThreadTaskRunner* ChromotingHostContext::encode_task_runner() {
50 return encode_thread_.message_loop_proxy(); 51 return encode_thread_.message_loop_proxy();
51 } 52 }
52 53
54 base::SingleThreadTaskRunner* ChromotingHostContext::audio_task_runner() {
55 return audio_thread_.message_loop_proxy();
56 }
57
53 base::SingleThreadTaskRunner* ChromotingHostContext::network_task_runner() { 58 base::SingleThreadTaskRunner* ChromotingHostContext::network_task_runner() {
54 return network_thread_.message_loop_proxy(); 59 return network_thread_.message_loop_proxy();
55 } 60 }
56 61
57 base::SingleThreadTaskRunner* ChromotingHostContext::desktop_task_runner() { 62 base::SingleThreadTaskRunner* ChromotingHostContext::desktop_task_runner() {
58 return desktop_thread_.message_loop_proxy(); 63 return desktop_thread_.message_loop_proxy();
59 } 64 }
60 65
61 base::SingleThreadTaskRunner* ChromotingHostContext::ui_task_runner() { 66 base::SingleThreadTaskRunner* ChromotingHostContext::ui_task_runner() {
62 return ui_task_runner_; 67 return ui_task_runner_;
63 } 68 }
64 69
65 base::SingleThreadTaskRunner* ChromotingHostContext::file_task_runner() { 70 base::SingleThreadTaskRunner* ChromotingHostContext::file_task_runner() {
66 return file_thread_.message_loop_proxy(); 71 return file_thread_.message_loop_proxy();
67 } 72 }
68 73
69 const scoped_refptr<net::URLRequestContextGetter>& 74 const scoped_refptr<net::URLRequestContextGetter>&
70 ChromotingHostContext::url_request_context_getter() { 75 ChromotingHostContext::url_request_context_getter() {
71 DCHECK(url_request_context_getter_.get()); 76 DCHECK(url_request_context_getter_.get());
72 return url_request_context_getter_; 77 return url_request_context_getter_;
73 } 78 }
74 79
75 } // namespace remoting 80 } // namespace remoting
OLDNEW
« remoting/host/audio_scheduler.h ('K') | « remoting/host/chromoting_host_context.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698