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

Side by Side Diff: content/browser/renderer_host/media/audio_renderer_host.h

Issue 10836025: Part 1: Plumb render view ID to render host (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 months 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // AudioRendererHost serves audio related requests from AudioRenderer which 5 // AudioRendererHost serves audio related requests from AudioRenderer which
6 // lives inside the render process and provide access to audio hardware. 6 // lives inside the render process and provide access to audio hardware.
7 // 7 //
8 // This class is owned by BrowserRenderProcessHost, and instantiated on UI 8 // This class is owned by BrowserRenderProcessHost, and instantiated on UI
9 // thread, but all other operations and method calls happen on IO thread, so we 9 // thread, but all other operations and method calls happen on IO thread, so we
10 // need to be extra careful about the lifetime of this object. AudioManager is a 10 // need to be extra careful about the lifetime of this object. AudioManager is a
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 FRIEND_TEST_ALL_PREFIXES(AudioRendererHostTest, MockStreamDataConversation); 115 FRIEND_TEST_ALL_PREFIXES(AudioRendererHostTest, MockStreamDataConversation);
116 116
117 virtual ~AudioRendererHost(); 117 virtual ~AudioRendererHost();
118 118
119 // Methods called on IO thread ---------------------------------------------- 119 // Methods called on IO thread ----------------------------------------------
120 120
121 // Audio related IPC message handlers. 121 // Audio related IPC message handlers.
122 // Creates an audio output stream with the specified format. If this call is 122 // Creates an audio output stream with the specified format. If this call is
123 // successful this object would keep an internal entry of the stream for the 123 // successful this object would keep an internal entry of the stream for the
124 // required properties. 124 // required properties.
125 void OnCreateStream(int stream_id, const media::AudioParameters& params); 125 void OnCreateStream(int render_view_id,
126 int stream_id,
127 const media::AudioParameters& params);
126 128
127 // Play the audio stream referenced by |stream_id|. 129 // Play the audio stream referenced by |stream_id|.
128 void OnPlayStream(int stream_id); 130 void OnPlayStream(int render_view_id, int stream_id);
tommi (sloooow) - chröme 2012/07/31 10:52:41 just including the render view id in OnCreateStrea
sail 2012/07/31 22:02:08 Done.
129 131
130 // Pause the audio stream referenced by |stream_id|. 132 // Pause the audio stream referenced by |stream_id|.
131 void OnPauseStream(int stream_id); 133 void OnPauseStream(int render_view_id, int stream_id);
132 134
133 // Discard all audio data in stream referenced by |stream_id|. 135 // Discard all audio data in stream referenced by |stream_id|.
134 void OnFlushStream(int stream_id); 136 void OnFlushStream(int render_view_id, int stream_id);
135 137
136 // Close the audio stream referenced by |stream_id|. 138 // Close the audio stream referenced by |stream_id|.
137 void OnCloseStream(int stream_id); 139 void OnCloseStream(int render_view_id, int stream_id);
138 140
139 // Set the volume of the audio stream referenced by |stream_id|. 141 // Set the volume of the audio stream referenced by |stream_id|.
140 void OnSetVolume(int stream_id, double volume); 142 void OnSetVolume(int render_view_id, int stream_id, double volume);
141 143
142 // Complete the process of creating an audio stream. This will set up the 144 // Complete the process of creating an audio stream. This will set up the
143 // shared memory or shared socket in low latency mode. 145 // shared memory or shared socket in low latency mode.
144 void DoCompleteCreation(media::AudioOutputController* controller); 146 void DoCompleteCreation(media::AudioOutputController* controller);
145 147
146 // Send a state change message to the renderer. 148 // Send a state change message to the renderer.
147 void DoSendPlayingMessage(media::AudioOutputController* controller); 149 void DoSendPlayingMessage(media::AudioOutputController* controller);
148 void DoSendPausedMessage(media::AudioOutputController* controller); 150 void DoSendPausedMessage(media::AudioOutputController* controller);
149 151
150 // Handle error coming from audio stream. 152 // Handle error coming from audio stream.
(...skipping 28 matching lines...) Expand all
179 // A map of stream IDs to audio sources. 181 // A map of stream IDs to audio sources.
180 AudioEntryMap audio_entries_; 182 AudioEntryMap audio_entries_;
181 183
182 media::AudioManager* audio_manager_; 184 media::AudioManager* audio_manager_;
183 content::MediaObserver* media_observer_; 185 content::MediaObserver* media_observer_;
184 186
185 DISALLOW_COPY_AND_ASSIGN(AudioRendererHost); 187 DISALLOW_COPY_AND_ASSIGN(AudioRendererHost);
186 }; 188 };
187 189
188 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_RENDERER_HOST_H_ 190 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_RENDERER_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698