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..4a97375269a53852a07cd204dbdae93c65f2c4e3 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; |
@@ -107,11 +120,16 @@ class CONTENT_EXPORT AudioRendererHost : public BrowserMessageFilter { |
bool RenderFrameHasActiveAudio(int render_frame_id) const; |
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 +167,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 +191,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 +214,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|. |
@@ -234,7 +243,7 @@ class CONTENT_EXPORT AudioRendererHost : public BrowserMessageFilter { |
const AudioOutputDeviceEnumeration& enumeration); |
// Helper method to check if the authorization procedure for stream |
- // |stream_id| has started. |
+ // |streaa_id| has started. |
nasko
2016/05/25 20:50:42
stream?
rchtara
2016/05/27 15:24:39
Done.
|
bool IsAuthorizationStarted(int stream_id); |
// ID of the RenderProcessHost that owns this instance. |
@@ -243,6 +252,7 @@ class CONTENT_EXPORT AudioRendererHost : public BrowserMessageFilter { |
media::AudioManager* const audio_manager_; |
AudioMirroringManager* const mirroring_manager_; |
std::unique_ptr<media::AudioLog> audio_log_; |
+ std::map<int, int> renderer_frame_ids_; |
nasko
2016/05/25 20:50:42
This is never used.
rchtara
2016/05/27 15:24:39
Done.
|
// Used to access to AudioInputDeviceManager. |
MediaStreamManager* media_stream_manager_; |