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

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

Issue 10823175: Switch AudioRenderSink::Callback to use AudioBus. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Gotta catch'em all! 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 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 <vector>
9
10 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
11 #include "media/base/audio_renderer_sink.h" 9 #include "media/base/audio_renderer_sink.h"
12 #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"
13 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h" 11 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h"
14 12
15 namespace media {
16 class AudioRendererSink;
17 }
18
19 class RendererWebAudioDeviceImpl 13 class RendererWebAudioDeviceImpl
20 : public WebKit::WebAudioDevice, 14 : public WebKit::WebAudioDevice,
21 public media::AudioRendererSink::RenderCallback { 15 public media::AudioRendererSink::RenderCallback {
22 public: 16 public:
23 RendererWebAudioDeviceImpl(const media::AudioParameters& params, 17 RendererWebAudioDeviceImpl(const media::AudioParameters& params,
24 WebKit::WebAudioDevice::RenderCallback* callback); 18 WebKit::WebAudioDevice::RenderCallback* callback);
25 virtual ~RendererWebAudioDeviceImpl(); 19 virtual ~RendererWebAudioDeviceImpl();
26 20
27 // WebKit::WebAudioDevice implementation. 21 // WebKit::WebAudioDevice implementation.
28 virtual void start(); 22 virtual void start();
29 virtual void stop(); 23 virtual void stop();
30 virtual double sampleRate(); 24 virtual double sampleRate();
31 25
32 // AudioRendererSink::RenderCallback implementation. 26 // AudioRendererSink::RenderCallback implementation.
33 virtual int Render(const std::vector<float*>& audio_data, 27 virtual int Render(media::AudioBus* audio_bus,
34 int number_of_frames, 28 int number_of_frames,
35 int audio_delay_milliseconds) OVERRIDE; 29 int audio_delay_milliseconds) OVERRIDE;
36 virtual void OnRenderError() OVERRIDE; 30 virtual void OnRenderError() OVERRIDE;
37 31
38 private: 32 private:
39 scoped_refptr<media::AudioRendererSink> audio_device_; 33 scoped_refptr<media::AudioRendererSink> audio_device_;
40 bool is_running_; 34 bool is_running_;
41 35
42 // Weak reference to the callback into WebKit code. 36 // Weak reference to the callback into WebKit code.
43 WebKit::WebAudioDevice::RenderCallback* client_callback_; 37 WebKit::WebAudioDevice::RenderCallback* client_callback_;
44 38
45 DISALLOW_COPY_AND_ASSIGN(RendererWebAudioDeviceImpl); 39 DISALLOW_COPY_AND_ASSIGN(RendererWebAudioDeviceImpl);
46 }; 40 };
47 41
48 #endif // CONTENT_RENDERER_MEDIA_MEDIA_RENDERER_WEBAUDIODEVICE_IMPL_H_ 42 #endif // CONTENT_RENDERER_MEDIA_MEDIA_RENDERER_WEBAUDIODEVICE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698