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..787a0470993ddb49aa60d3ca2d19a043f474ec62 100644 |
--- a/content/renderer/media/webrtc_audio_capturer.h |
+++ b/content/renderer/media/webrtc_audio_capturer.h |
@@ -136,7 +136,7 @@ class CONTENT_EXPORT WebRtcAudioCapturer |
// Audio parameters utilized by the audio capturer. Can be utilized by |
// a local renderer to set up a renderer using identical parameters as the |
// capturer. |
phoglund_chromium
2013/02/08 16:10:38
Removing const looks silly, but I actually have to
tommi (sloooow) - chröme
2013/02/08 16:32:04
You could make the lock mutable which is common in
phoglund_chromium
2013/02/08 17:06:00
Yeah, I wrote a TODO on the accessor.
|
- const media::AudioParameters& audio_parameter() const { return params_; } |
+ const media::AudioParameters& audio_parameter(); |
tommi (sloooow) - chröme
2013/02/08 16:32:04
nit: audio_parameters() (plural) or just params()
phoglund_chromium
2013/02/08 17:06:00
Done.
|
// AudioCapturerSource::CaptureCallback implementation. |
// Called on the AudioInputDevice audio thread. |
@@ -165,11 +165,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_|. |
base::Lock lock_; |
// A list of sinks that the audio data is fed to. |
@@ -178,12 +183,10 @@ class CONTENT_EXPORT WebRtcAudioCapturer |
// The audio data source from the browser process. |
scoped_refptr<media::AudioCapturerSource> source_; |
- // Cached values of utilized audio parameters. Platform dependent. |
- media::AudioParameters params_; |
- |
// Buffers used for temporary storage during capture callbacks. |
// Allocated during initialization. |
- scoped_array<int16> buffer_; |
+ class ConfiguredBuffer; |
+ scoped_refptr<ConfiguredBuffer> buffer_; |
std::string device_id_; |
bool running_; |