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

Side by Side Diff: content/renderer/media/audio_device.h

Issue 10537121: Adds AudioDevice factory for all audio clients in Chrome (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Minor cleanup Created 8 years, 6 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 // Audio rendering unit utilizing audio output stream provided by browser 5 // Audio rendering unit utilizing audio output stream provided by browser
6 // process through IPC. 6 // process through IPC.
7 // 7 //
8 // Relationship of classes. 8 // Relationship of classes.
9 // 9 //
10 // AudioOutputController AudioDevice 10 // AudioOutputController AudioDevice
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 #include "base/memory/scoped_ptr.h" 69 #include "base/memory/scoped_ptr.h"
70 #include "base/message_loop.h" 70 #include "base/message_loop.h"
71 #include "base/shared_memory.h" 71 #include "base/shared_memory.h"
72 #include "content/common/content_export.h" 72 #include "content/common/content_export.h"
73 #include "content/renderer/media/audio_device_thread.h" 73 #include "content/renderer/media/audio_device_thread.h"
74 #include "content/renderer/media/audio_message_filter.h" 74 #include "content/renderer/media/audio_message_filter.h"
75 #include "content/renderer/media/scoped_loop_observer.h" 75 #include "content/renderer/media/scoped_loop_observer.h"
76 #include "media/audio/audio_parameters.h" 76 #include "media/audio/audio_parameters.h"
77 #include "media/base/audio_renderer_sink.h" 77 #include "media/base/audio_renderer_sink.h"
78 78
79 class AudioMessageFilter;
80
79 namespace media { 81 namespace media {
80 class AudioParameters; 82 class AudioParameters;
81 } 83 }
82 84
83 class CONTENT_EXPORT AudioDevice 85 class CONTENT_EXPORT AudioDevice
84 : NON_EXPORTED_BASE(public media::AudioRendererSink), 86 : NON_EXPORTED_BASE(public media::AudioRendererSink),
85 public AudioMessageFilter::Delegate, 87 public AudioMessageFilter::Delegate,
86 NON_EXPORTED_BASE(public ScopedLoopObserver) { 88 NON_EXPORTED_BASE(public ScopedLoopObserver) {
87 public: 89 public:
88 // Methods called on main render thread ------------------------------------- 90 // Methods called on main render thread -------------------------------------
89 91
90 // Minimal constructor where Initialize() must be called later. 92 // Minimal constructors where Initialize() must be called later.
91 AudioDevice(); 93 AudioDevice();
92 94 explicit AudioDevice(AudioMessageFilter* filter);
Chris Rogers 2012/06/25 20:05:17 I wouldn't mind making this constructor (taking th
henrika (OOO until Aug 14) 2012/06/26 11:17:27 Good comment. Given that I have not added a unit t
93 AudioDevice(const media::AudioParameters& params, RenderCallback* callback);
94 95
95 // AudioRendererSink implementation. 96 // AudioRendererSink implementation.
96 virtual void Initialize(const media::AudioParameters& params, 97 virtual void Initialize(const media::AudioParameters& params,
97 RenderCallback* callback) OVERRIDE; 98 RenderCallback* callback) OVERRIDE;
98 virtual void Start() OVERRIDE; 99 virtual void Start() OVERRIDE;
99 virtual void Stop() OVERRIDE; 100 virtual void Stop() OVERRIDE;
100 virtual void Play() OVERRIDE; 101 virtual void Play() OVERRIDE;
101 virtual void Pause(bool flush) OVERRIDE; 102 virtual void Pause(bool flush) OVERRIDE;
102 virtual bool SetVolume(double volume) OVERRIDE; 103 virtual bool SetVolume(double volume) OVERRIDE;
103 virtual void GetVolume(double* volume) OVERRIDE; 104 virtual void GetVolume(double* volume) OVERRIDE;
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 // guard to control stopping and starting the audio thread. 162 // guard to control stopping and starting the audio thread.
162 base::Lock audio_thread_lock_; 163 base::Lock audio_thread_lock_;
163 AudioDeviceThread audio_thread_; 164 AudioDeviceThread audio_thread_;
164 scoped_ptr<AudioDevice::AudioThreadCallback> audio_callback_; 165 scoped_ptr<AudioDevice::AudioThreadCallback> audio_callback_;
165 166
166 167
167 DISALLOW_COPY_AND_ASSIGN(AudioDevice); 168 DISALLOW_COPY_AND_ASSIGN(AudioDevice);
168 }; 169 };
169 170
170 #endif // CONTENT_RENDERER_MEDIA_AUDIO_DEVICE_H_ 171 #endif // CONTENT_RENDERER_MEDIA_AUDIO_DEVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698