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

Unified Diff: remoting/host/audio_scheduler.h

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, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | remoting/host/audio_scheduler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/audio_scheduler.h
diff --git a/remoting/host/audio_scheduler.h b/remoting/host/audio_scheduler.h
index d82de21a5d7064440f1818b1f308a8ec5cd7ab60..f15a4207ef633cc23d78fd5a1f5b46b3bc8cb505 100644
--- a/remoting/host/audio_scheduler.h
+++ b/remoting/host/audio_scheduler.h
@@ -24,26 +24,18 @@ class AudioCapturer;
class AudioEncoder;
class AudioPacket;
-// A class for controlling AudioCapturer and forwarding audio packets to the
-// client.
-//
-// THREADING
-//
-// This class works on two threads: the capture and network threads.
-// Any encoding that is done on the audio samples will be done on the capture
-// thread.
-//
-// AudioScheduler is responsible for:
-// 1. managing the AudioCapturer.
-// 2. sending packets of audio samples over the network to the client.
+// AudioScheduler is responsible for getting audio stream from audio capturer,
+// encoding it and then sending encoded data over the network to the client.
Wez 2012/08/31 04:44:52 nit: Suggest "... responsible for fetching audio d
Sergey Ulanov 2012/08/31 20:18:49 Done.
+// Audio is captured and encoded on the audio thread and then passed to
+// AudioStub on the network thread.
class AudioScheduler : public base::RefCountedThreadSafe<AudioScheduler> {
public:
- // Construct an AudioScheduler. TaskRunners are used for message passing
- // among the capturer and network threads. The caller is responsible for
- // ensuring that the |audio_capturer| and |audio_stub| outlive the
- // AudioScheduler.
+ // |audio_task_runner| defines the thread on which audio is captured and
+ // encoded. |audio_stub| is used on the |network_task_runner| thread. The
Wez 2012/08/31 04:44:52 nit: Suggest rewording "Audio capture and encoding
Sergey Ulanov 2012/08/31 20:18:49 Done.
+ // caller must ensure that the |audio_capturer| and |audio_stub| exist until
+ // the scheduler is stopped using Stop() method.
AudioScheduler(
- scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner,
+ scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner,
scoped_refptr<base::SingleThreadTaskRunner> network_task_runner,
AudioCapturer* audio_capturer,
scoped_ptr<AudioEncoder> audio_encoder,
@@ -72,7 +64,7 @@ class AudioScheduler : public base::RefCountedThreadSafe<AudioScheduler> {
// Called when an AudioPacket has been delivered to the client.
void OnCaptureCallbackNotified();
- scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner_;
+ scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner_;
scoped_refptr<base::SingleThreadTaskRunner> network_task_runner_;
AudioCapturer* audio_capturer_;
« no previous file with comments | « no previous file | remoting/host/audio_scheduler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698