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

Unified 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: Rebased. Plus, removed CalledOnValidThread DCHECK from sampleRate() call since nothing mutates. 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/media/renderer_webaudiodevice_impl.h
diff --git a/content/renderer/media/renderer_webaudiodevice_impl.h b/content/renderer/media/renderer_webaudiodevice_impl.h
index 2e747c948ecc375e068519e50f5cc6aad7944299..fb58a2c7c453824a8024ba486d2c3cb6177013c1 100644
--- a/content/renderer/media/renderer_webaudiodevice_impl.h
+++ b/content/renderer/media/renderer_webaudiodevice_impl.h
@@ -6,12 +6,16 @@
#define CONTENT_RENDERER_MEDIA_MEDIA_RENDERER_WEBAUDIODEVICE_IMPL_H_
#include "base/memory/ref_counted.h"
+#include "base/threading/thread_checker.h"
+#include "media/audio/audio_parameters.h"
#include "media/base/audio_renderer_sink.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebAudioDevice.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h"
namespace content {
+class RendererAudioOutputDevice;
+
class RendererWebAudioDeviceImpl
: public WebKit::WebAudioDevice,
public media::AudioRendererSink::RenderCallback {
@@ -36,11 +40,17 @@ class RendererWebAudioDeviceImpl
virtual void OnRenderError() OVERRIDE;
private:
- scoped_refptr<media::AudioRendererSink> audio_device_;
- bool is_running_;
+ const media::AudioParameters params_;
// Weak reference to the callback into WebKit code.
- WebKit::WebAudioDevice::RenderCallback* client_callback_;
+ WebKit::WebAudioDevice::RenderCallback* const client_callback_;
+
+ // To avoid the need for locking, ensure the control methods of the
+ // WebKit::WebAudioDevice implementation are called on the same thread.
+ base::ThreadChecker thread_checker_;
+
+ // When non-NULL, we are started. When NULL, we are stopped.
+ scoped_refptr<RendererAudioOutputDevice> output_device_;
DISALLOW_COPY_AND_ASSIGN(RendererWebAudioDeviceImpl);
};
« no previous file with comments | « content/renderer/media/renderer_audio_output_device.cc ('k') | content/renderer/media/renderer_webaudiodevice_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698