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

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

Issue 11669004: Add chromium support for MediaStreamAudioDestinationNode - part II (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Nit Created 8 years 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
« no previous file with comments | « content/renderer/media/webaudio_capturer_source.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/webrtc_audio_capturer.cc
diff --git a/content/renderer/media/webrtc_audio_capturer.cc b/content/renderer/media/webrtc_audio_capturer.cc
index 7486e083ccda1410968b7a32d34f30b8ded4b2b8..5d64781e61cba2fab8696e1141ce90840ca6cdc3 100644
--- a/content/renderer/media/webrtc_audio_capturer.cc
+++ b/content/renderer/media/webrtc_audio_capturer.cc
@@ -113,9 +113,34 @@ void WebRtcAudioCapturer::SetCapturerSource(
}
// Detach the old source from normal recording.
- if (old_source)
+ if (old_source) {
old_source->Stop();
+ // TODO(henrika, crogers): I have hard coded parameters given knowledge
+ // of a file source (44.1kHz, mono) here and use these parameters to reset
+ // our member parameters. I then dispatch the new parameters both to the
+ // sink(s) and to the new source. The idea is to get rid of any dependency
+ // of the microphone parameters which are uses as base otherwise.
+
+ // I guess we could add this info to AudioCapturerSource to enable a
+ // query here. E.g.:
+
+ // source->ModifyAudioParameters(&params_);
+
+ params_.Reset(params_.format(),
+ media::CHANNEL_LAYOUT_MONO, // <-- get this from WebKit?
+ 44100, // <-- get this from WebKit?
+ 16, // <-- get this from WebKit?
+ 440); // requires knowledge about WebRTC @ 10ms
+
+ buffer_.reset(new int16[params_.frames_per_buffer() * params_.channels()]);
+
+ for (SinkList::const_iterator it = sinks_.begin();
+ it != sinks_.end(); ++it) {
+ (*it)->SetCaptureFormat(params_);
+ }
+ }
+
if (source)
source->Initialize(params_, this, this);
}
« no previous file with comments | « content/renderer/media/webaudio_capturer_source.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698