diff options
author | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-16 19:03:25 +0000 |
---|---|---|
committer | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-16 19:03:25 +0000 |
commit | 5fb88964b6a7df7fc3be69811a734ff08fbcbdc5 (patch) | |
tree | 55a1acb1ab3dd33c822773bfce170946def82c0b /chrome/renderer/render_view.h | |
parent | b7e62b5dcc16b6a7e87e1af59d2673ecd7edde6a (diff) | |
download | chromium_src-5fb88964b6a7df7fc3be69811a734ff08fbcbdc5.zip chromium_src-5fb88964b6a7df7fc3be69811a734ff08fbcbdc5.tar.gz chromium_src-5fb88964b6a7df7fc3be69811a734ff08fbcbdc5.tar.bz2 |
Handles audio messages on IO thread in render process
First step to have smoother audio playback. We previously
performed audio messages handling on render thread, which
gave us huge amount of latency, especially when renderer
is busy compositing or is blocked by synchronous IPC call.
A lot of these latencies are eliminated by moving audio
messages handling to IO thread, this is the first step to
see if sharing the regular IPC channel for audio messages
is creating too much stress for the IPC channel. Also
doubled the audio packet size to 8192 samples, ~194ms of
audio for 16bit/44.1khz/2ch.
Review URL: http://codereview.chromium.org/62125
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13863 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/render_view.h')
-rw-r--r-- | chrome/renderer/render_view.h | 40 |
1 files changed, 8 insertions, 32 deletions
diff --git a/chrome/renderer/render_view.h b/chrome/renderer/render_view.h index d0264f3..f6bd01b 100644 --- a/chrome/renderer/render_view.h +++ b/chrome/renderer/render_view.h @@ -26,7 +26,6 @@ #include "chrome/renderer/external_host_bindings.h" #include "chrome/renderer/external_js_object.h" #include "chrome/renderer/render_widget.h" -#include "media/audio/audio_output.h" #include "testing/gtest/include/gtest/gtest_prod.h" #include "third_party/WebKit/WebKit/chromium/public/WebConsoleMessage.h" #include "webkit/glue/dom_serializer_delegate.h" @@ -44,7 +43,7 @@ #pragma warning(disable: 4250) #endif -class AudioRendererImpl; +class AudioMessageFilter; class DictionaryValue; class DebugMessageHandler; class DevToolsAgent; @@ -372,18 +371,7 @@ class RenderView : public RenderWidget, // the renderer, which processes all IPC, to any I/O should be non-blocking. MessageLoop* GetMessageLoopForIO(); - // Register the audio renderer and try to create an audio output stream in the - // browser process. Always return a stream id. Audio renderer will then - // receive state change notification messages. - int32 CreateAudioStream(AudioRendererImpl* renderer, - AudioManager::Format format, int channels, - int sample_rate, int bits_per_sample, - size_t packet_size); - void StartAudioStream(int stream_id); - void CloseAudioStream(int stream_id); - void NotifyAudioPacketReady(int stream_id, size_t size); - void GetAudioVolume(int stream_id); - void SetAudioVolume(int stream_id, double left, double right); + AudioMessageFilter* audio_message_filter() { return audio_message_filter_; } void OnClearFocusedNode(); @@ -591,21 +579,6 @@ class RenderView : public RenderWidget, // grouping, and should form our own grouping. void OnDisassociateFromPopupCount(); - // Received when browser process wants more audio packet. - void OnRequestAudioPacket(int stream_id); - - // Received when browser process has created an audio output stream for us. - void OnAudioStreamCreated(int stream_id, base::SharedMemoryHandle handle, - int length); - - // Received when internal state of browser process' audio output device has - // changed. - void OnAudioStreamStateChanged(int stream_id, AudioOutputStream::State state, - int info); - - // Notification of volume property of an audio output stream. - void OnAudioStreamVolume(int stream_id, double left, double right); - // Sends the selection text to the browser. void OnRequestSelectionText(); @@ -833,12 +806,15 @@ class RenderView : public RenderWidget, // change but is overridden by tests. int delay_seconds_for_form_state_sync_; - // A set of audio renderers registered to use IPC for audio output. - IDMap<AudioRendererImpl> audio_renderers_; - // Maps pending callback IDs to their frames. IDMap<WebFrame> pending_extension_callbacks_; + scoped_refptr<AudioMessageFilter> audio_message_filter_; + + // The currently selected text. This is currently only updated on Linux, where + // it's for the selection clipboard. + std::string selection_text_; + DISALLOW_COPY_AND_ASSIGN(RenderView); }; |