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

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

Issue 178153007: Avoid hitting the thread check when WebRtcAudioRenderer is going away. (Closed) Base URL: http://git.chromium.org/chromium/src.git@libjingle_get_stats
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
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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 // gets the data by pulling, while the data is pushed into 235 // gets the data by pulling, while the data is pushed into
236 // WebRtcPlayoutDataSource::Sink. 236 // WebRtcPlayoutDataSource::Sink.
237 class WebRtcPlayoutDataSource { 237 class WebRtcPlayoutDataSource {
238 public: 238 public:
239 class Sink { 239 class Sink {
240 public: 240 public:
241 // Callback to get the playout data. 241 // Callback to get the playout data.
242 virtual void OnPlayoutData(media::AudioBus* audio_bus, 242 virtual void OnPlayoutData(media::AudioBus* audio_bus,
243 int sample_rate, 243 int sample_rate,
244 int audio_delay_milliseconds) = 0; 244 int audio_delay_milliseconds) = 0;
245
246 // Callback to notify the sink that the source has changed.
247 virtual void OnPlayoutDataSourceChanged() = 0;
tommi (sloooow) - chröme 2014/03/04 20:48:39 also document thread semantics
no longer working on chromium 2014/03/05 13:01:04 Done.
248
245 protected: 249 protected:
246 virtual ~Sink() {} 250 virtual ~Sink() {}
247 }; 251 };
248 252
249 // Adds/Removes the sink of WebRtcAudioRendererSource to the ADM. 253 // Adds/Removes the sink of WebRtcAudioRendererSource to the ADM.
250 // These methods are used by the MediaStreamAudioProcesssor to get the 254 // These methods are used by the MediaStreamAudioProcesssor to get the
251 // rendered data for AEC. 255 // rendered data for AEC.
252 virtual void AddPlayoutSink(Sink* sink) = 0; 256 virtual void AddPlayoutSink(Sink* sink) = 0;
253 virtual void RemovePlayoutSink(Sink* sink) = 0; 257 virtual void RemovePlayoutSink(Sink* sink) = 0;
254 258
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 // Buffer used for temporary storage during render callback. 434 // Buffer used for temporary storage during render callback.
431 // It is only accessed by the audio render thread. 435 // It is only accessed by the audio render thread.
432 std::vector<int16> render_buffer_; 436 std::vector<int16> render_buffer_;
433 437
434 DISALLOW_COPY_AND_ASSIGN(WebRtcAudioDeviceImpl); 438 DISALLOW_COPY_AND_ASSIGN(WebRtcAudioDeviceImpl);
435 }; 439 };
436 440
437 } // namespace content 441 } // namespace content
438 442
439 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_DEVICE_IMPL_H_ 443 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_DEVICE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698