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

Unified Diff: content/renderer/media/webrtc_audio_capturer.h

Issue 12220063: Possible solution to synchronization problems in webrtc audio capturer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/media/webrtc_audio_capturer.h
diff --git a/content/renderer/media/webrtc_audio_capturer.h b/content/renderer/media/webrtc_audio_capturer.h
index afb072f5f7ab8204e1863eff744ac7d889ce963b..453a0b0308103daccc690512adbef43e5e643f55 100644
--- a/content/renderer/media/webrtc_audio_capturer.h
+++ b/content/renderer/media/webrtc_audio_capturer.h
@@ -10,6 +10,7 @@
#include "base/callback.h"
#include "base/memory/ref_counted.h"
+#include "base/synchronization/condition_variable.h"
#include "base/synchronization/lock.h"
#include "base/threading/thread_checker.h"
#include "content/renderer/media/webrtc_audio_device_impl.h"
@@ -165,13 +166,22 @@ class CONTENT_EXPORT WebRtcAudioCapturer
WebRtcAudioCapturer();
+ // Reconfigures the capturer with a new buffer size and capture parameters.
+ // Must be called without holding the lock. Returns true on success.
+ bool Reconfigure(int sample_rate, media::AudioParameters::Format format,
+ media::ChannelLayout channel_layout);
+
// Used to DCHECK that we are called on the correct thread.
base::ThreadChecker thread_checker_;
// Protects |source_|, |sinks_|, |running_|, |on_device_stopped_cb_|,
- // |loopback_fifo_| and |buffering_|.
+ // |loopback_fifo_|, |params| and |buffering_|.
tommi (sloooow) - chröme 2013/02/07 14:57:47 params_
base::Lock lock_;
+ // Keeps us from reconfiguring the buffer while the buffer is being used.
+ base::ConditionVariable buffer_in_use_cv_;
+ bool buffer_in_use_;
+
// A list of sinks that the audio data is fed to.
SinkList sinks_;
« no previous file with comments | « no previous file | content/renderer/media/webrtc_audio_capturer.cc » ('j') | content/renderer/media/webrtc_audio_capturer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698