Chromium Code Reviews| 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 b4e9d3f329a009039635d0fc80ed1d0cba4e7133..2057bf64b46e7a57277fbbb97f2c27cd006300c5 100644 |
| --- a/content/browser/renderer_host/media/audio_renderer_host.h |
| +++ b/content/browser/renderer_host/media/audio_renderer_host.h |
| @@ -51,6 +51,7 @@ |
| #include "base/gtest_prod_util.h" |
| #include "base/macros.h" |
| #include "base/memory/ref_counted.h" |
| +#include "base/memory/shared_memory.h" |
| #include "base/process/process.h" |
| #include "base/sequenced_task_runner_helpers.h" |
| #include "content/browser/renderer_host/media/audio_output_device_enumerator.h" |
| @@ -63,6 +64,7 @@ |
| #include "media/audio/audio_logging.h" |
| #include "media/audio/audio_output_controller.h" |
| #include "media/audio/simple_sources.h" |
| +#include "media/mojo/interfaces/audio_output.mojom.h" |
| #include "url/origin.h" |
| namespace media { |
| @@ -73,6 +75,8 @@ class AudioParameters; |
| namespace content { |
| class AudioMirroringManager; |
| +class AudioOutputImpl; |
| +class AudioOutputStreamImpl; |
| class MediaInternals; |
| class MediaStreamManager; |
| class MediaStreamUIProxy; |
| @@ -107,6 +111,9 @@ class CONTENT_EXPORT AudioRendererHost : public BrowserMessageFilter { |
| bool RenderFrameHasActiveAudio(int render_frame_id) const; |
| private: |
| + friend class AudioEntry; |
| + friend class AudioOutputImpl; |
| + friend class AudioOutputStreamImpl; |
| friend class AudioRendererHostTest; |
| friend class BrowserThread; |
| friend class base::DeleteHelper<AudioRendererHost>; |
| @@ -152,9 +159,10 @@ class CONTENT_EXPORT AudioRendererHost : public BrowserMessageFilter { |
| // 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, |
| + void CreateStream(int stream_id, |
| int render_frame_id, |
|
tommi (sloooow) - chröme
2016/04/26 15:29:53
fix indent
rchtara
2016/04/29 12:54:46
Done.
|
| - const media::AudioParameters& params); |
| + const media::AudioParameters& params, |
| + const mojom::AudioOutput::CreateStreamCallback& callback); |
| // Play the audio stream referenced by |stream_id|. |
| void OnPlayStream(int stream_id); |
| @@ -186,12 +194,15 @@ class CONTENT_EXPORT AudioRendererHost : public BrowserMessageFilter { |
| void DoCreateStream(int stream_id, |
| int render_frame_id, |
| const media::AudioParameters& params, |
| - const std::string& device_unique_id); |
| + const std::string& device_unique_id, |
| + const mojom::AudioOutput::CreateStreamCallback& callback); |
| // 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); |
| + void DoCompleteCreation( |
| + int stream_id, |
| + const mojom::AudioOutput::CreateStreamCallback& callback); |
| // Send playing/paused status to the renderer. |
| void DoNotifyStreamStateChanged(int stream_id, bool is_playing); |
| @@ -208,6 +219,11 @@ class CONTENT_EXPORT AudioRendererHost : public BrowserMessageFilter { |
| // Send an error message to the renderer, then close the stream. |
| void ReportErrorAndClose(int stream_id); |
| + // Send an error message to the renderer, then close the stream. |
| + void ReportErrorAndCloseStream( |
| + int stream_id, |
| + const mojom::AudioOutput::CreateStreamCallback& callback); |
| + |
| // A helper method to look up a AudioEntry identified by |stream_id|. |
| // Returns NULL if not found. |
| AudioEntry* LookupById(int stream_id); |
| @@ -243,6 +259,7 @@ class CONTENT_EXPORT AudioRendererHost : public BrowserMessageFilter { |
| media::AudioManager* const audio_manager_; |
| AudioMirroringManager* const mirroring_manager_; |
| std::unique_ptr<media::AudioLog> audio_log_; |
| + AudioOutputImpl* audio_output_impl_; |
| // Used to access to AudioInputDeviceManager. |
| MediaStreamManager* media_stream_manager_; |
| @@ -267,6 +284,8 @@ class CONTENT_EXPORT AudioRendererHost : public BrowserMessageFilter { |
| // host. Reported as UMA stat at shutdown. |
| size_t max_simultaneous_streams_; |
| + mojom::AudioOutputStreamPtr stream_ptr_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(AudioRendererHost); |
| }; |