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

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: Moved AudioDeviceFactory to content namespace Created 8 years, 5 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 class AudioParameters; 80 class AudioParameters;
81 } 81 }
82 82
83 class CONTENT_EXPORT AudioDevice 83 class CONTENT_EXPORT AudioDevice
84 : NON_EXPORTED_BASE(public media::AudioRendererSink), 84 : NON_EXPORTED_BASE(public media::AudioRendererSink),
85 public AudioMessageFilter::Delegate, 85 public AudioMessageFilter::Delegate,
86 NON_EXPORTED_BASE(public ScopedLoopObserver) { 86 NON_EXPORTED_BASE(public ScopedLoopObserver) {
87 public: 87 public:
88 // Methods called on main render thread ------------------------------------- 88 // Methods called on main render thread -------------------------------------
89 89
90 // Minimal constructor where Initialize() must be called later. 90 // Creates an uninitialized AudioDevice. Clients must call Initialize()
91 // before using.
91 AudioDevice(); 92 AudioDevice();
92 93
93 AudioDevice(const media::AudioParameters& params, RenderCallback* callback);
94
95 // AudioRendererSink implementation. 94 // AudioRendererSink implementation.
96 virtual void Initialize(const media::AudioParameters& params, 95 virtual void Initialize(const media::AudioParameters& params,
97 RenderCallback* callback) OVERRIDE; 96 RenderCallback* callback) OVERRIDE;
98 virtual void Start() OVERRIDE; 97 virtual void Start() OVERRIDE;
99 virtual void Stop() OVERRIDE; 98 virtual void Stop() OVERRIDE;
100 virtual void Play() OVERRIDE; 99 virtual void Play() OVERRIDE;
101 virtual void Pause(bool flush) OVERRIDE; 100 virtual void Pause(bool flush) OVERRIDE;
102 virtual bool SetVolume(double volume) OVERRIDE; 101 virtual bool SetVolume(double volume) OVERRIDE;
103 virtual void GetVolume(double* volume) OVERRIDE; 102 virtual void GetVolume(double* volume) OVERRIDE;
104 103
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 // guard to control stopping and starting the audio thread. 160 // guard to control stopping and starting the audio thread.
162 base::Lock audio_thread_lock_; 161 base::Lock audio_thread_lock_;
163 AudioDeviceThread audio_thread_; 162 AudioDeviceThread audio_thread_;
164 scoped_ptr<AudioDevice::AudioThreadCallback> audio_callback_; 163 scoped_ptr<AudioDevice::AudioThreadCallback> audio_callback_;
165 164
166 165
167 DISALLOW_COPY_AND_ASSIGN(AudioDevice); 166 DISALLOW_COPY_AND_ASSIGN(AudioDevice);
168 }; 167 };
169 168
170 #endif // CONTENT_RENDERER_MEDIA_AUDIO_DEVICE_H_ 169 #endif // CONTENT_RENDERER_MEDIA_AUDIO_DEVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698