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

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: Rebased 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..31829023f43485214447caf9b6d6e1e4d973a84b 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"
tommi (sloooow) - chröme 2013/02/08 14:56:57 remove
phoglund_chromium 2013/02/08 16:10:38 Done.
#include "base/synchronization/lock.h"
#include "base/threading/thread_checker.h"
#include "content/renderer/media/webrtc_audio_device_impl.h"
@@ -26,6 +27,7 @@ namespace content {
class WebRtcAudioCapturerSink;
class WebRtcLocalAudioRenderer;
+class CaptureBuffer;
tommi (sloooow) - chröme 2013/02/08 14:56:57 can we make this a private class inside WebRtcAudi
phoglund_chromium 2013/02/08 16:10:38 Done.
// This class manages the capture data flow by getting data from its
// |source_|, and passing it to its |sink_|.
@@ -165,11 +167,16 @@ 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/08 14:56:57 params_
phoglund_chromium 2013/02/08 16:10:38 Done.
base::Lock lock_;
// A list of sinks that the audio data is fed to.
@@ -183,7 +190,7 @@ class CONTENT_EXPORT WebRtcAudioCapturer
// Buffers used for temporary storage during capture callbacks.
// Allocated during initialization.
- scoped_array<int16> buffer_;
+ scoped_refptr<CaptureBuffer> buffer_;
std::string device_id_;
bool running_;
« 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