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

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

Issue 10830268: Allow audio system to handle synchronized low-latency audio I/O (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 3 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 "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "media/base/audio_renderer_sink.h" 9 #include "media/base/audio_renderer_sink.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 class RendererWebAudioDeviceImpl 13 class RendererWebAudioDeviceImpl
14 : public WebKit::WebAudioDevice, 14 : public WebKit::WebAudioDevice,
15 public media::AudioRendererSink::RenderCallback { 15 public media::AudioRendererSink::RenderCallback {
16 public: 16 public:
17 RendererWebAudioDeviceImpl(const media::AudioParameters& params, 17 RendererWebAudioDeviceImpl(const media::AudioParameters& params,
18 WebKit::WebAudioDevice::RenderCallback* callback); 18 WebKit::WebAudioDevice::RenderCallback* callback);
19 virtual ~RendererWebAudioDeviceImpl(); 19 virtual ~RendererWebAudioDeviceImpl();
20 20
21 // WebKit::WebAudioDevice implementation. 21 // WebKit::WebAudioDevice implementation.
22 virtual void start(); 22 virtual void start();
23 virtual void stop(); 23 virtual void stop();
24 virtual double sampleRate(); 24 virtual double sampleRate();
25 25
26 // AudioRendererSink::RenderCallback implementation. 26 // AudioRendererSink::RenderCallback implementation.
27 virtual int Render(media::AudioBus* audio_bus, 27 virtual int Render(media::AudioBus* dest,
28 int audio_delay_milliseconds) OVERRIDE; 28 int audio_delay_milliseconds) OVERRIDE;
29
30 virtual void RenderIO(media::AudioBus* source,
31 media::AudioBus* dest,
32 int audio_delay_milliseconds) OVERRIDE;
33
29 virtual void OnRenderError() OVERRIDE; 34 virtual void OnRenderError() OVERRIDE;
30 35
31 private: 36 private:
32 scoped_refptr<media::AudioRendererSink> audio_device_; 37 scoped_refptr<media::AudioRendererSink> audio_device_;
33 bool is_running_; 38 bool is_running_;
34 39
35 // Weak reference to the callback into WebKit code. 40 // Weak reference to the callback into WebKit code.
36 WebKit::WebAudioDevice::RenderCallback* client_callback_; 41 WebKit::WebAudioDevice::RenderCallback* client_callback_;
37 42
38 DISALLOW_COPY_AND_ASSIGN(RendererWebAudioDeviceImpl); 43 DISALLOW_COPY_AND_ASSIGN(RendererWebAudioDeviceImpl);
39 }; 44 };
40 45
41 #endif // CONTENT_RENDERER_MEDIA_MEDIA_RENDERER_WEBAUDIODEVICE_IMPL_H_ 46 #endif // CONTENT_RENDERER_MEDIA_MEDIA_RENDERER_WEBAUDIODEVICE_IMPL_H_
OLDNEW
« no previous file with comments | « content/renderer/media/audio_message_filter.cc ('k') | content/renderer/media/renderer_webaudiodevice_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698