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

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

Issue 11359196: Associate audio streams with their source/destination RenderView. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Consolidate construct/init/destruct code in AudioOutputDeviceTest. Created 8 years 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 #ifndef CONTENT_RENDERER_MEDIA_MEDIA_RENDERER_WEBAUDIODEVICE_IMPL_H_ 5 #ifndef CONTENT_RENDERER_MEDIA_MEDIA_RENDERER_WEBAUDIODEVICE_IMPL_H_
6 #define CONTENT_RENDERER_MEDIA_MEDIA_RENDERER_WEBAUDIODEVICE_IMPL_H_ 6 #define CONTENT_RENDERER_MEDIA_MEDIA_RENDERER_WEBAUDIODEVICE_IMPL_H_
7 7
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "media/base/audio_renderer_sink.h" 9 #include "media/audio/audio_output_device.h"
10 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebAudioDevi ce.h" 10 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebAudioDevi ce.h"
11 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h" 11 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h"
12 12
13 namespace content { 13 namespace content {
14 14
15 class RendererWebAudioDeviceImpl 15 class RendererWebAudioDeviceImpl
16 : public WebKit::WebAudioDevice, 16 : public WebKit::WebAudioDevice,
17 public media::AudioRendererSink::RenderCallback { 17 public media::AudioRendererSink::RenderCallback {
18 public: 18 public:
19 RendererWebAudioDeviceImpl(const media::AudioParameters& params, 19 RendererWebAudioDeviceImpl(const media::AudioParameters& params,
20 WebKit::WebAudioDevice::RenderCallback* callback); 20 WebKit::WebAudioDevice::RenderCallback* callback);
21 virtual ~RendererWebAudioDeviceImpl(); 21 virtual ~RendererWebAudioDeviceImpl();
22 22
23 // WebKit::WebAudioDevice implementation. 23 // WebKit::WebAudioDevice implementation.
24 virtual void start(); 24 virtual void start();
25 virtual void stop(); 25 virtual void stop();
26 virtual double sampleRate(); 26 virtual double sampleRate();
27 27
28 // AudioRendererSink::RenderCallback implementation. 28 // AudioRendererSink::RenderCallback implementation.
29 virtual int Render(media::AudioBus* dest, 29 virtual int Render(media::AudioBus* dest,
30 int audio_delay_milliseconds) OVERRIDE; 30 int audio_delay_milliseconds) OVERRIDE;
31 31
32 virtual void RenderIO(media::AudioBus* source, 32 virtual void RenderIO(media::AudioBus* source,
33 media::AudioBus* dest, 33 media::AudioBus* dest,
34 int audio_delay_milliseconds) OVERRIDE; 34 int audio_delay_milliseconds) OVERRIDE;
35 35
36 virtual void OnRenderError() OVERRIDE; 36 virtual void OnRenderError() OVERRIDE;
37 37
38 private: 38 private:
39 scoped_refptr<media::AudioRendererSink> audio_device_; 39 scoped_refptr<media::AudioOutputDevice> audio_device_;
40 bool is_running_; 40 bool is_running_;
41 41
42 // Weak reference to the callback into WebKit code. 42 // Weak reference to the callback into WebKit code.
43 WebKit::WebAudioDevice::RenderCallback* client_callback_; 43 WebKit::WebAudioDevice::RenderCallback* client_callback_;
44 44
45 DISALLOW_COPY_AND_ASSIGN(RendererWebAudioDeviceImpl); 45 DISALLOW_COPY_AND_ASSIGN(RendererWebAudioDeviceImpl);
46 }; 46 };
47 47
48 } // namespace content 48 } // namespace content
49 49
50 #endif // CONTENT_RENDERER_MEDIA_MEDIA_RENDERER_WEBAUDIODEVICE_IMPL_H_ 50 #endif // CONTENT_RENDERER_MEDIA_MEDIA_RENDERER_WEBAUDIODEVICE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698