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

Side by Side Diff: content/renderer/media/webrtc_audio_device_impl.h

Issue 198303002: Reland "Avoid hitting the thread check when WebRtcAudioRenderer is going away" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #ifndef CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_DEVICE_IMPL_H_ 5 #ifndef CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_DEVICE_IMPL_H_
6 #define CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_DEVICE_IMPL_H_ 6 #define CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_DEVICE_IMPL_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 233
234 // TODO(xians): Merge this interface with WebRtcAudioRendererSource. 234 // TODO(xians): Merge this interface with WebRtcAudioRendererSource.
235 // The reason why we could not do it today is that WebRtcAudioRendererSource 235 // The reason why we could not do it today is that WebRtcAudioRendererSource
236 // gets the data by pulling, while the data is pushed into 236 // gets the data by pulling, while the data is pushed into
237 // WebRtcPlayoutDataSource::Sink. 237 // WebRtcPlayoutDataSource::Sink.
238 class WebRtcPlayoutDataSource { 238 class WebRtcPlayoutDataSource {
239 public: 239 public:
240 class Sink { 240 class Sink {
241 public: 241 public:
242 // Callback to get the playout data. 242 // Callback to get the playout data.
243 // Called on the render audio thread.
243 virtual void OnPlayoutData(media::AudioBus* audio_bus, 244 virtual void OnPlayoutData(media::AudioBus* audio_bus,
244 int sample_rate, 245 int sample_rate,
245 int audio_delay_milliseconds) = 0; 246 int audio_delay_milliseconds) = 0;
247
248 // Callback to notify the sink that the source has changed.
249 // Called on the main render thread.
250 virtual void OnPlayoutDataSourceChanged() = 0;
251
246 protected: 252 protected:
247 virtual ~Sink() {} 253 virtual ~Sink() {}
248 }; 254 };
249 255
250 // Adds/Removes the sink of WebRtcAudioRendererSource to the ADM. 256 // Adds/Removes the sink of WebRtcAudioRendererSource to the ADM.
251 // These methods are used by the MediaStreamAudioProcesssor to get the 257 // These methods are used by the MediaStreamAudioProcesssor to get the
252 // rendered data for AEC. 258 // rendered data for AEC.
253 virtual void AddPlayoutSink(Sink* sink) = 0; 259 virtual void AddPlayoutSink(Sink* sink) = 0;
254 virtual void RemovePlayoutSink(Sink* sink) = 0; 260 virtual void RemovePlayoutSink(Sink* sink) = 0;
255 261
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 452
447 // Used for start the Aec dump on the default capturer. 453 // Used for start the Aec dump on the default capturer.
448 base::PlatformFile aec_dump_file_; 454 base::PlatformFile aec_dump_file_;
449 455
450 DISALLOW_COPY_AND_ASSIGN(WebRtcAudioDeviceImpl); 456 DISALLOW_COPY_AND_ASSIGN(WebRtcAudioDeviceImpl);
451 }; 457 };
452 458
453 } // namespace content 459 } // namespace content
454 460
455 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_DEVICE_IMPL_H_ 461 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_DEVICE_IMPL_H_
OLDNEW
« no previous file with comments | « content/renderer/media/media_stream_audio_processor.cc ('k') | content/renderer/media/webrtc_audio_device_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698