| 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 4f2747be94790027c10675da740f38ef16530e7b..d629f22b5c1b047187c466e76faaa83ce13be5a3 100644
|
| --- a/content/browser/renderer_host/media/audio_renderer_host.h
|
| +++ b/content/browser/renderer_host/media/audio_renderer_host.h
|
| @@ -73,6 +73,7 @@ class AudioParameters;
|
| namespace content {
|
|
|
| class AudioMirroringManager;
|
| +class AudioOutputImpl;
|
| class MediaInternals;
|
| class MediaStreamManager;
|
| class MediaStreamUIProxy;
|
| @@ -88,10 +89,22 @@ class CONTENT_EXPORT AudioRendererHost : public BrowserMessageFilter {
|
| MediaStreamManager* media_stream_manager,
|
| const ResourceContext::SaltCallback& salt_callback);
|
|
|
| + // Creates an audio output stream with the specified format.
|
| + // Upon success/failure, the peer is notified via the NotifyStreamCreated
|
| + // message.
|
| + virtual void CreateStream(int stream_id,
|
| + int render_frame_id,
|
| + const media::AudioParameters& params,
|
| + AudioOutputImpl* audio_output_impl);
|
| +
|
| + // Close the audio stream referenced by |stream_id|.
|
| + virtual void CloseStream(int stream_id);
|
| +
|
| // Calls |callback| with the list of AudioOutputControllers for this object.
|
| void GetOutputControllers(
|
| const RenderProcessHost::GetAudioOutputControllersCallback&
|
| callback) const;
|
| + media::AudioLog* get_audio_log() { return audio_log_.get(); }
|
|
|
| // BrowserMessageFilter implementation.
|
| void OnChannelClosing() override;
|
| @@ -105,13 +118,19 @@ class CONTENT_EXPORT AudioRendererHost : public BrowserMessageFilter {
|
| // Returns true if any streams managed by the RenderFrame identified by
|
| // |render_frame_id| are actively playing. Can be called from any thread.
|
| bool RenderFrameHasActiveAudio(int render_frame_id) const;
|
| + void CleanAudioOutputImpl(AudioOutputImpl* audio_output_impl);
|
|
|
| private:
|
| + friend class AudioEntry;
|
| + friend class AudioOutputImplTest;
|
| friend class AudioRendererHostTest;
|
| friend class BrowserThread;
|
| friend class base::DeleteHelper<AudioRendererHost>;
|
| friend class MockAudioRendererHost;
|
| + friend class MockAudioOutputAudioRendererHost;
|
| + friend class MockAudioOutputStreamAudioRendererHost;
|
| friend class TestAudioRendererHost;
|
| +
|
| FRIEND_TEST_ALL_PREFIXES(AudioRendererHostTest, CreateMockStream);
|
| FRIEND_TEST_ALL_PREFIXES(AudioRendererHostTest, MockStreamDataConversation);
|
|
|
| @@ -149,22 +168,12 @@ class CONTENT_EXPORT AudioRendererHost : public BrowserMessageFilter {
|
| const std::string& device_id,
|
| const url::Origin& security_origin);
|
|
|
| - // Creates an audio output stream with the specified format.
|
| - // Upon success/failure, the peer is notified via the NotifyStreamCreated
|
| - // message.
|
| - void OnCreateStream(int stream_id,
|
| - int render_frame_id,
|
| - const media::AudioParameters& params);
|
| -
|
| // Play the audio stream referenced by |stream_id|.
|
| void OnPlayStream(int stream_id);
|
|
|
| // Pause the audio stream referenced by |stream_id|.
|
| void OnPauseStream(int stream_id);
|
|
|
| - // Close the audio stream referenced by |stream_id|.
|
| - void OnCloseStream(int stream_id);
|
| -
|
| // Set the volume of the audio stream referenced by |stream_id|.
|
| void OnSetVolume(int stream_id, double volume);
|
|
|
| @@ -183,15 +192,16 @@ class CONTENT_EXPORT AudioRendererHost : public BrowserMessageFilter {
|
|
|
| // Start the actual creation of an audio stream, after the device
|
| // authorization process is complete.
|
| - void DoCreateStream(int stream_id,
|
| - int render_frame_id,
|
| - const media::AudioParameters& params,
|
| - const std::string& device_unique_id);
|
| + virtual void DoCreateStream(int stream_id,
|
| + int render_frame_id,
|
| + const media::AudioParameters& params,
|
| + const std::string& device_unique_id,
|
| + AudioOutputImpl* audio_output_impl);
|
|
|
| // Complete the process of creating an audio stream. This will set up the
|
| // shared memory or shared socket in low latency mode and send the
|
| // NotifyStreamCreated message to the peer.
|
| - void DoCompleteCreation(int stream_id);
|
| + virtual void DoCompleteCreation(int stream_id);
|
|
|
| // Send playing/paused status to the renderer.
|
| void DoNotifyStreamStateChanged(int stream_id, bool is_playing);
|
| @@ -205,7 +215,7 @@ class CONTENT_EXPORT AudioRendererHost : public BrowserMessageFilter {
|
| // AudioOutputController after it has closed.
|
| void DeleteEntry(std::unique_ptr<AudioEntry> entry);
|
|
|
| - // Send an error message to the renderer, then close the stream.
|
| + // Send an error message to the client, then close the stream.
|
| void ReportErrorAndClose(int stream_id);
|
|
|
| // A helper method to look up a AudioEntry identified by |stream_id|.
|
|
|