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

Unified Diff: Source/modules/webaudio/AudioContext.cpp

Issue 14188039: MediaStream API: Remove LocalMediaStream (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed tests Created 7 years, 8 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 | « Source/modules/modules.gypi ('k') | Source/modules/webaudio/MediaStreamAudioDestinationNode.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/webaudio/AudioContext.cpp
diff --git a/Source/modules/webaudio/AudioContext.cpp b/Source/modules/webaudio/AudioContext.cpp
index 6731d0cd5af736685949bccf4f5e311168daa64e..ff824990dc908ead474f5bd877b4a3a49b04eeaf 100644
--- a/Source/modules/webaudio/AudioContext.cpp
+++ b/Source/modules/webaudio/AudioContext.cpp
@@ -390,15 +390,16 @@ PassRefPtr<MediaStreamAudioSourceNode> AudioContext::createMediaStreamSource(Med
AudioSourceProvider* provider = 0;
MediaStreamTrackVector audioTracks = mediaStream->getAudioTracks();
- if (mediaStream->isLocal() && audioTracks.size()) {
- // Enable input for the specific local audio device specified in the MediaStreamSource.
- RefPtr<MediaStreamTrack> localAudio = audioTracks[0];
+
+ // FIXME: get a provider for non-local MediaStreams (like from a remote peer).
+ for (size_t i = 0; i < audioTracks.size(); ++i) {
+ RefPtr<MediaStreamTrack> localAudio = audioTracks[i];
MediaStreamSource* source = localAudio->component()->source();
- destination()->enableInput(source->deviceId());
- provider = destination()->localAudioInputProvider();
- } else {
- // FIXME: get a provider for non-local MediaStreams (like from a remote peer).
- provider = 0;
+ if (!source->deviceId().isEmpty()) {
+ destination()->enableInput(source->deviceId());
+ provider = destination()->localAudioInputProvider();
+ break;
+ }
}
RefPtr<MediaStreamAudioSourceNode> node = MediaStreamAudioSourceNode::create(this, mediaStream, provider);
« no previous file with comments | « Source/modules/modules.gypi ('k') | Source/modules/webaudio/MediaStreamAudioDestinationNode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698