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

Unified Diff: content/renderer/renderer_webaudiosourceprovider_impl.h

Issue 7631033: Very early implementation for HTMLMediaElement / Web Audio API integration (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/renderer_webaudiosourceprovider_impl.h
===================================================================
--- content/renderer/renderer_webaudiosourceprovider_impl.h (revision 0)
+++ content/renderer/renderer_webaudiosourceprovider_impl.h (revision 0)
@@ -0,0 +1,39 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_RENDERER_RENDERER_WEBAUDIOSOURCEPROVIDER_IMPL_H_
+#define CONTENT_RENDERER_RENDERER_WEBAUDIOSOURCEPROVIDER_IMPL_H_
+
+#include <vector>
+
+#include "base/memory/ref_counted.h"
+#include "content/renderer/media/audio_device.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebAudioSourceProvider.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebVector.h"
+
+class RendererWebAudioSourceProviderImpl : public WebKit::WebAudioSourceProvider,
scherkus (not reviewing) 2011/08/23 15:16:01 naming nit... similar to how WebViewClient -> Rend
scherkus (not reviewing) 2011/08/23 15:16:01 docs for this class
Chris Rogers 2011/08/24 00:41:52 Ok, sounds good. I've renamed this class to Rende
Chris Rogers 2011/08/24 00:41:52 I've added some comments here. I can add more det
+ public AudioSink {
+ public:
+ RendererWebAudioSourceProviderImpl(AudioSink::RenderCallback* callback);
+ virtual ~RendererWebAudioSourceProviderImpl() { }
+
+ // WebKit::WebAudioSourceProvider implementation.
+ // WebKit calls this to get the rendered audio stream.
+ virtual void provideInput(const WebKit::WebVector<float*>& audio_data,
+ size_t number_of_frames);
+
+ // AudioSink implementation.
+ virtual bool Start();
+ virtual bool Stop();
+ virtual bool SetVolume(double volume);
+
+ private:
+ bool is_running_;
+ double volume_;
+ AudioSink::RenderCallback* callback_;
+
+ DISALLOW_COPY_AND_ASSIGN(RendererWebAudioSourceProviderImpl);
+};
+
+#endif // CONTENT_RENDERER_RENDERER_WEBAUDIOSOURCEPROVIDER_IMPL_H_

Powered by Google App Engine
This is Rietveld 408576698