summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/media
diff options
context:
space:
mode:
authorhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-20 05:02:56 +0000
committerhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-20 05:02:56 +0000
commit6f56d48b6d12eb675aeb78c503cc72c100b243f3 (patch)
tree36b0b18addb8543521297401ccd88f69f712f6fd /chrome/renderer/media
parentf8fae18a398d4925bd59e80e81890c12195146cc (diff)
downloadchromium_src-6f56d48b6d12eb675aeb78c503cc72c100b243f3.zip
chromium_src-6f56d48b6d12eb675aeb78c503cc72c100b243f3.tar.gz
chromium_src-6f56d48b6d12eb675aeb78c503cc72c100b243f3.tar.bz2
Audio related IPC messages and handlers from browser to
renderer 1. Added 4 IPC messages and corresponding handlers for audio: - RequestAudioPacket(int stream_id) Browser process is hungry for audio packet, notify renderer process to provide more. - NotifyAudioStreamCreated(int stream_id, SharedMemoryHandler buffer, int len) Notify stream created event and provide buffer for filling in the future. - NotifyAudioStreamStateChanged(int stream_id, enum state, nt info) The internal state of the audio stream has chagned, notify renderer process of the change. int info provides additional information of the change, e.g. platform specific error code. - NotifyAudioStreamVolume(int stream_id, double left, double right) Notify the current volume for the audio stream. 2. Added methods to RenderView for creating audio streams and delegate audio related requests to browser process with IPC. Now the registration and bookkeeping of AudioRendererImpl happens in RenderView (see audio_renderers_). The reason being that the code is almost just an base::IDMap that doesn't worth creating a new class. Review URL: http://codereview.chromium.org/20410 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10078 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/media')
-rw-r--r--chrome/renderer/media/audio_renderer_impl.cc18
-rw-r--r--chrome/renderer/media/audio_renderer_impl.h7
2 files changed, 25 insertions, 0 deletions
diff --git a/chrome/renderer/media/audio_renderer_impl.cc b/chrome/renderer/media/audio_renderer_impl.cc
index 113d700..9dbd392 100644
--- a/chrome/renderer/media/audio_renderer_impl.cc
+++ b/chrome/renderer/media/audio_renderer_impl.cc
@@ -32,3 +32,21 @@ bool AudioRendererImpl::IsMediaFormatSupported(
// TODO(hclam): check the format correct.
return true;
}
+
+void AudioRendererImpl::OnRequestPacket() {
+ // TODO(hclam): implement this.
+}
+
+void AudioRendererImpl::OnCreated(base::SharedMemoryHandle handle,
+ size_t length) {
+ // TODO(hclam): implement this.
+}
+
+void AudioRendererImpl::OnStateChanged(AudioOutputStream::State state,
+ int info) {
+ // TODO(hclam): implement this.
+}
+
+void AudioRendererImpl::OnVolume(double left, double right) {
+ // TODO(hclam): implement this.
+}
diff --git a/chrome/renderer/media/audio_renderer_impl.h b/chrome/renderer/media/audio_renderer_impl.h
index e76bf64..9d6b0b4 100644
--- a/chrome/renderer/media/audio_renderer_impl.h
+++ b/chrome/renderer/media/audio_renderer_impl.h
@@ -5,6 +5,8 @@
#ifndef CHROME_RENDERER_MEDIA_AUDIO_RENDERER_IMPL_H_
#define CHROME_RENDERER_MEDIA_AUDIO_RENDERER_IMPL_H_
+#include "base/shared_memory.h"
+#include "media/audio/audio_output.h"
#include "media/base/factory.h"
#include "media/base/filters.h"
@@ -31,6 +33,11 @@ class AudioRendererImpl : public media::AudioRenderer {
// Answers question from the factory to see if we accept |format|.
static bool IsMediaFormatSupported(const media::MediaFormat* format);
+ void OnRequestPacket();
+ void OnStateChanged(AudioOutputStream::State state, int info);
+ void OnCreated(base::SharedMemoryHandle handle, size_t length);
+ void OnVolume(double left, double right);
+
protected:
virtual ~AudioRendererImpl();