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

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..89a5805e6e30f66c3d1432541fce85b7c29a16be 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 fetching audio data from the AudioCapturer
+// and encoding it before passing it to the AudioStub for delivery to the
+// client. 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 capture and encoding tasks are dispatched via the
+ // |audio_task_runner|. |audio_stub| tasks are dispatched via the
+ // |network_task_runner|. The 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