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

Unified Diff: chrome/renderer/render_view.h

Issue 20410: Audio related IPC messages and handlers from browser to renderer (Closed)
Patch Set: cleanup Created 11 years, 10 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
« no previous file with comments | « chrome/renderer/media/audio_renderer_impl.cc ('k') | chrome/renderer/render_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/render_view.h
diff --git a/chrome/renderer/render_view.h b/chrome/renderer/render_view.h
index 59e2fad808dd615b255cb46dc3d69742ff01cd94..9ff7e06de6a87f846b3bca95662ebcb50fcb9e92 100644
--- a/chrome/renderer/render_view.h
+++ b/chrome/renderer/render_view.h
@@ -11,6 +11,8 @@
#include "base/basictypes.h"
#include "base/gfx/point.h"
#include "base/gfx/rect.h"
+#include "base/id_map.h"
+#include "base/shared_memory.h"
#include "base/timer.h"
#include "base/values.h"
#include "build/build_config.h"
@@ -23,6 +25,7 @@
#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 "webkit/glue/console_message_level.h"
#include "webkit/glue/dom_serializer_delegate.h"
@@ -38,6 +41,7 @@
#pragma warning(disable: 4250)
#endif
+class AudioRendererImpl;
class DictionaryValue;
class DebugMessageHandler;
class FilePath;
@@ -342,6 +346,19 @@ 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);
+ void GetAudioVolume(int stream_id);
+ void SetAudioVolume(int stream_id, double left, double right);
+
private:
FRIEND_TEST(RenderViewTest, OnLoadAlternateHTMLText);
FRIEND_TEST(RenderViewTest, OnNavStateChanged);
@@ -524,6 +541,21 @@ 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);
+
// Switches the frame's CSS media type to "print" and calculate the number of
// printed pages that are to be expected. |frame| will be used to calculate
// the number of expected pages for this frame only.
@@ -752,6 +784,9 @@ 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_;
+
DISALLOW_COPY_AND_ASSIGN(RenderView);
};
« no previous file with comments | « chrome/renderer/media/audio_renderer_impl.cc ('k') | chrome/renderer/render_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698