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

Side by Side Diff: media/audio/audio_input_device.h

Issue 66183002: Replace MessageLoopProxy with SingleThreadTaskRunner for the rest of media/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix win and audio tests Created 6 years, 11 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
« no previous file with comments | « media/audio/audio_input_controller.cc ('k') | media/audio/audio_input_device.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // Low-latency audio capturing class utilizing audio input stream provided 5 // Low-latency audio capturing class utilizing audio input stream provided
6 // by a server (browser) process by use of an IPC interface. 6 // by a server (browser) process by use of an IPC interface.
7 // 7 //
8 // Relationship of classes: 8 // Relationship of classes:
9 // 9 //
10 // AudioInputController AudioInputDevice 10 // AudioInputController AudioInputDevice
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 55
56 #include <string> 56 #include <string>
57 57
58 #include "base/basictypes.h" 58 #include "base/basictypes.h"
59 #include "base/compiler_specific.h" 59 #include "base/compiler_specific.h"
60 #include "base/memory/scoped_ptr.h" 60 #include "base/memory/scoped_ptr.h"
61 #include "base/memory/shared_memory.h" 61 #include "base/memory/shared_memory.h"
62 #include "media/audio/audio_device_thread.h" 62 #include "media/audio/audio_device_thread.h"
63 #include "media/audio/audio_input_ipc.h" 63 #include "media/audio/audio_input_ipc.h"
64 #include "media/audio/audio_parameters.h" 64 #include "media/audio/audio_parameters.h"
65 #include "media/audio/scoped_loop_observer.h" 65 #include "media/audio/scoped_task_runner_observer.h"
66 #include "media/base/audio_capturer_source.h" 66 #include "media/base/audio_capturer_source.h"
67 #include "media/base/media_export.h" 67 #include "media/base/media_export.h"
68 68
69 namespace media { 69 namespace media {
70 70
71 // TODO(henrika): This class is based on the AudioOutputDevice class and it has 71 // TODO(henrika): This class is based on the AudioOutputDevice class and it has
72 // many components in common. Investigate potential for re-factoring. 72 // many components in common. Investigate potential for re-factoring.
73 // See http://crbug.com/179597. 73 // See http://crbug.com/179597.
74 // TODO(henrika): Add support for event handling (e.g. OnStateChanged, 74 // TODO(henrika): Add support for event handling (e.g. OnStateChanged,
75 // OnCaptureStopped etc.) and ensure that we can deliver these notifications 75 // OnCaptureStopped etc.) and ensure that we can deliver these notifications
76 // to any clients using this class. 76 // to any clients using this class.
77 class MEDIA_EXPORT AudioInputDevice 77 class MEDIA_EXPORT AudioInputDevice
78 : NON_EXPORTED_BASE(public AudioCapturerSource), 78 : NON_EXPORTED_BASE(public AudioCapturerSource),
79 NON_EXPORTED_BASE(public AudioInputIPCDelegate), 79 NON_EXPORTED_BASE(public AudioInputIPCDelegate),
80 NON_EXPORTED_BASE(public ScopedLoopObserver) { 80 NON_EXPORTED_BASE(public ScopedTaskRunnerObserver) {
81 public: 81 public:
82 // NOTE: Clients must call Initialize() before using. 82 // NOTE: Clients must call Initialize() before using.
83 AudioInputDevice(scoped_ptr<AudioInputIPC> ipc, 83 AudioInputDevice(
84 const scoped_refptr<base::MessageLoopProxy>& io_loop); 84 scoped_ptr<AudioInputIPC> ipc,
85 const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner);
85 86
86 // AudioCapturerSource implementation. 87 // AudioCapturerSource implementation.
87 virtual void Initialize(const AudioParameters& params, 88 virtual void Initialize(const AudioParameters& params,
88 CaptureCallback* callback, 89 CaptureCallback* callback,
89 int session_id) OVERRIDE; 90 int session_id) OVERRIDE;
90 virtual void Start() OVERRIDE; 91 virtual void Start() OVERRIDE;
91 virtual void Stop() OVERRIDE; 92 virtual void Stop() OVERRIDE;
92 virtual void SetVolume(double volume) OVERRIDE; 93 virtual void SetVolume(double volume) OVERRIDE;
93 virtual void SetAutomaticGainControl(bool enabled) OVERRIDE; 94 virtual void SetAutomaticGainControl(bool enabled) OVERRIDE;
94 95
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 // TODO(miu): Replace this by changing AudioCapturerSource to accept the 167 // TODO(miu): Replace this by changing AudioCapturerSource to accept the
167 // callback via Start(). See http://crbug.com/151051 for details. 168 // callback via Start(). See http://crbug.com/151051 for details.
168 bool stopping_hack_; 169 bool stopping_hack_;
169 170
170 DISALLOW_IMPLICIT_CONSTRUCTORS(AudioInputDevice); 171 DISALLOW_IMPLICIT_CONSTRUCTORS(AudioInputDevice);
171 }; 172 };
172 173
173 } // namespace media 174 } // namespace media
174 175
175 #endif // MEDIA_AUDIO_AUDIO_INPUT_DEVICE_H_ 176 #endif // MEDIA_AUDIO_AUDIO_INPUT_DEVICE_H_
OLDNEW
« no previous file with comments | « media/audio/audio_input_controller.cc ('k') | media/audio/audio_input_device.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698