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

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

Issue 166363002: Use the current default capture for the webaudio track to get the correct delay value (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: new solution, ready for review. Created 6 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
« no previous file with comments | « no previous file | content/renderer/media/webrtc_audio_device_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/media_stream_dependency_factory.cc
diff --git a/content/renderer/media/media_stream_dependency_factory.cc b/content/renderer/media/media_stream_dependency_factory.cc
index 42f18278fad9d170deae4c79ef4f7271076014b4..49fe4dddd75f29c4807df7d8136d5ec6666f2674 100644
--- a/content/renderer/media/media_stream_dependency_factory.cc
+++ b/content/renderer/media/media_stream_dependency_factory.cc
@@ -285,13 +285,23 @@ MediaStreamDependencyFactory::CreateNativeAudioMediaStreamTrack(
static_cast<MediaStreamAudioSource*>(source.extraData());
scoped_refptr<WebAudioCapturerSource> webaudio_source;
- if (!source_data) {
+ scoped_refptr<WebRtcAudioCapturer> capturer;
+ if (source_data) {
+ capturer = source_data->GetAudioCapturer();
+ } else {
if (source.requiresAudioConsumer()) {
// We're adding a WebAudio MediaStream.
// Create a specific capturer for each WebAudio consumer.
webaudio_source = CreateWebAudioSource(&source);
source_data =
static_cast<MediaStreamAudioSource*>(source.extraData());
+
+ // Use the current default capturer for the WebAudio track so that the
+ // WebAudio track can pass a valid delay value and |need_audio_processing|
+ // flag to PeerConnection.
+ // TODO(xians): Remove this after moving APM to Chrome.
+ if (GetWebRtcAudioDevice())
+ capturer = GetWebRtcAudioDevice()->GetDefaultCapturer();
} else {
// TODO(perkj): Implement support for sources from
// remote MediaStreams.
@@ -301,7 +311,7 @@ MediaStreamDependencyFactory::CreateNativeAudioMediaStreamTrack(
}
return CreateLocalAudioTrack(track,
- source_data->GetAudioCapturer(),
+ capturer,
webaudio_source.get(),
source_data->local_audio_source());
}
« no previous file with comments | « no previous file | content/renderer/media/webrtc_audio_device_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698