Index: content/browser/renderer_host/media/audio_renderer_host.h |
diff --git a/content/browser/renderer_host/media/audio_renderer_host.h b/content/browser/renderer_host/media/audio_renderer_host.h |
index 43e9395ac50ff90293b55f24cda1c8a1e59c78cf..a02eeca9cffe1d970cce885014426c8ad003aa92 100644 |
--- a/content/browser/renderer_host/media/audio_renderer_host.h |
+++ b/content/browser/renderer_host/media/audio_renderer_host.h |
@@ -61,13 +61,15 @@ namespace content { |
class MediaObserver; |
class ResourceContext; |
+class WebContentsAudioInputStream; |
class CONTENT_EXPORT AudioRendererHost |
: public BrowserMessageFilter, |
public media::AudioOutputController::EventHandler { |
public: |
// Called from UI thread from the owner of this object. |
- AudioRendererHost(media::AudioManager* audio_manager, |
+ AudioRendererHost(int render_process_id, |
+ media::AudioManager* audio_manager, |
MediaObserver* media_observer); |
// BrowserMessageFilter implementation. |
@@ -83,6 +85,17 @@ class CONTENT_EXPORT AudioRendererHost |
virtual void OnError(media::AudioOutputController* controller, |
int error_code) OVERRIDE; |
+ // Start/stop mirroring all audio output streams associated with |
+ // |render_view_id| to |destination|. |
+ void StartMirroring(int render_view_id, |
+ WebContentsAudioInputStream* destination); |
+ void StopMirroring(int render_view_id, |
Alpha Left Google
2012/11/20 21:49:43
Does a destination associate with multiple render
miu
2012/11/21 08:27:48
I thought about this, and I don't think I needed t
|
+ WebContentsAudioInputStream* destination); |
+ |
+ // Return the AudioRendererHost instance for a render process. |
+ static scoped_refptr<AudioRendererHost> FromRenderProcessID( |
+ int render_process_id); |
+ |
private: |
friend class AudioRendererHostTest; |
friend class BrowserThread; |
@@ -94,6 +107,8 @@ class CONTENT_EXPORT AudioRendererHost |
struct AudioEntry; |
typedef std::map<int, AudioEntry*> AudioEntryMap; |
+ typedef std::map<int, WebContentsAudioInputStream*> MirrorSessionMap; |
+ |
virtual ~AudioRendererHost(); |
// Methods called on IO thread ---------------------------------------------- |
@@ -106,6 +121,10 @@ class CONTENT_EXPORT AudioRendererHost |
const media::AudioParameters& params, |
int input_channels); |
+ // Associate |render_view_id| as the producer of audio for the stream |
+ // referenced by |stream_id|. |
+ void OnAssociateStreamWithProducer(int stream_id, int render_view_id); |
+ |
// Play the audio stream referenced by |stream_id|. |
void OnPlayStream(int stream_id); |
@@ -160,9 +179,15 @@ class CONTENT_EXPORT AudioRendererHost |
media::AudioOutputController* LookupControllerByIdForTesting(int stream_id); |
+ // ID of the RenderProcessImpl that owns this instance. |
+ const int render_process_id_; |
+ |
// A map of stream IDs to audio sources. |
AudioEntryMap audio_entries_; |
+ // A map of render view IDs to the destination for active mirroring sessions. |
+ MirrorSessionMap mirror_sessions_; |
+ |
media::AudioManager* audio_manager_; |
MediaObserver* media_observer_; |