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

Unified Diff: content/renderer/media/audio_message_filter.h

Issue 11359196: Associate audio streams with their source/destination RenderView. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased; and numerous clean-ups. Created 8 years, 1 month 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/audio_message_filter.h
diff --git a/content/renderer/media/audio_message_filter.h b/content/renderer/media/audio_message_filter.h
index 3e3c9c9b067e9f6ba1a97dc3ef368960446ea9ff..c4ba6bca6b2baaf634df9dc9494130bbff703bae 100644
--- a/content/renderer/media/audio_message_filter.h
+++ b/content/renderer/media/audio_message_filter.h
@@ -12,6 +12,7 @@
#include "base/gtest_prod_util.h"
#include "base/id_map.h"
+#include "base/memory/ref_counted.h"
#include "base/shared_memory.h"
#include "base/sync_socket.h"
#include "content/common/content_export.h"
@@ -19,6 +20,10 @@
#include "media/audio/audio_buffers_state.h"
#include "media/audio/audio_output_ipc.h"
+namespace media {
+class AudioOutputDevice;
+}
+
namespace content {
class CONTENT_EXPORT AudioMessageFilter
@@ -30,7 +35,16 @@ class CONTENT_EXPORT AudioMessageFilter
// Getter for the one AudioMessageFilter object.
static AudioMessageFilter* Get();
- // media::AudioOutputIPCDelegate implementation.
+ // Associates |render_view_id| as the source of audio rendered for a stream.
+ void AssociateStreamWithProducer(int stream_id, int render_view_id);
+
+ // Convenience method to associate an AudioOutputDevice with its producer.
+ // Unlike the other methods, this may be called from any thread.
+ void AssociateDeviceWithProducer(
+ const scoped_refptr<media::AudioOutputDevice>& device,
+ int render_view_id);
+
+ // media::AudioOutputIPC implementation.
virtual int AddDelegate(media::AudioOutputIPCDelegate* delegate) OVERRIDE;
virtual void RemoveDelegate(int id) OVERRIDE;
virtual void CreateStream(int stream_id,
@@ -71,6 +85,10 @@ class CONTENT_EXPORT AudioMessageFilter
void OnStreamStateChanged(int stream_id,
media::AudioOutputIPCDelegate::State state);
+ void AssociateDeviceWithProducerOnIOThread(
+ const scoped_refptr<media::AudioOutputDevice>& device,
+ int render_view_id);
+
// The singleton instance for this filter.
static AudioMessageFilter* filter_;

Powered by Google App Engine
This is Rietveld 408576698