Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010, Google Inc. All rights reserved. | 2 * Copyright (C) 2010, Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 391 ec = INVALID_STATE_ERR; | 391 ec = INVALID_STATE_ERR; |
| 392 return 0; | 392 return 0; |
| 393 } | 393 } |
| 394 | 394 |
| 395 ASSERT(isMainThread()); | 395 ASSERT(isMainThread()); |
| 396 lazyInitialize(); | 396 lazyInitialize(); |
| 397 | 397 |
| 398 AudioSourceProvider* provider = 0; | 398 AudioSourceProvider* provider = 0; |
| 399 | 399 |
| 400 MediaStreamTrackVector audioTracks = mediaStream->getAudioTracks(); | 400 MediaStreamTrackVector audioTracks = mediaStream->getAudioTracks(); |
| 401 if (mediaStream->isLocal() && audioTracks.size()) { | 401 |
| 402 // Enable input for the specific local audio device specified in the Med iaStreamSource. | 402 // FIXME: get a provider for non-local MediaStreams (like from a remote peer ). |
|
Chris Rogers
2013/04/19 18:20:28
We can't just stop checking for isLocal() since we
Tommy Widenflycht
2013/04/22 07:45:23
The MediaStream is loosing in importance for every
| |
| 403 RefPtr<MediaStreamTrack> localAudio = audioTracks[0]; | 403 for (size_t i = 0; i < audioTracks.size(); ++i) { |
| 404 RefPtr<MediaStreamTrack> localAudio = audioTracks[i]; | |
| 404 MediaStreamSource* source = localAudio->component()->source(); | 405 MediaStreamSource* source = localAudio->component()->source(); |
| 405 destination()->enableInput(source->deviceId()); | 406 if (!source->deviceId().isEmpty()) { |
| 406 provider = destination()->localAudioInputProvider(); | 407 destination()->enableInput(source->deviceId()); |
| 407 } else { | 408 provider = destination()->localAudioInputProvider(); |
|
Chris Rogers
2013/04/22 17:38:24
Tommi, thanks for clarifying - seems fine then exc
Tommy Widenflycht
2013/04/23 11:38:53
Doh, thanks. break added.
On 2013/04/22 17:38:24,
| |
| 408 // FIXME: get a provider for non-local MediaStreams (like from a remote peer). | 409 } |
| 409 provider = 0; | |
| 410 } | 410 } |
| 411 | 411 |
| 412 RefPtr<MediaStreamAudioSourceNode> node = MediaStreamAudioSourceNode::create (this, mediaStream, provider); | 412 RefPtr<MediaStreamAudioSourceNode> node = MediaStreamAudioSourceNode::create (this, mediaStream, provider); |
| 413 | 413 |
| 414 // FIXME: Only stereo streams are supported right now. We should be able to accept multi-channel streams. | 414 // FIXME: Only stereo streams are supported right now. We should be able to accept multi-channel streams. |
| 415 node->setFormat(2, sampleRate()); | 415 node->setFormat(2, sampleRate()); |
| 416 | 416 |
| 417 refNode(node.get()); // context keeps reference until node is disconnected | 417 refNode(node.get()); // context keeps reference until node is disconnected |
| 418 return node; | 418 return node; |
| 419 } | 419 } |
| (...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 998 info.addMember(m_deferredFinishDerefList, "deferredFinishDerefList"); | 998 info.addMember(m_deferredFinishDerefList, "deferredFinishDerefList"); |
| 999 info.addMember(m_hrtfDatabaseLoader, "hrtfDatabaseLoader"); | 999 info.addMember(m_hrtfDatabaseLoader, "hrtfDatabaseLoader"); |
| 1000 info.addMember(m_eventTargetData, "eventTargetData"); | 1000 info.addMember(m_eventTargetData, "eventTargetData"); |
| 1001 info.addMember(m_renderTarget, "renderTarget"); | 1001 info.addMember(m_renderTarget, "renderTarget"); |
| 1002 info.addMember(m_audioDecoder, "audioDecoder"); | 1002 info.addMember(m_audioDecoder, "audioDecoder"); |
| 1003 } | 1003 } |
| 1004 | 1004 |
| 1005 } // namespace WebCore | 1005 } // namespace WebCore |
| 1006 | 1006 |
| 1007 #endif // ENABLE(WEB_AUDIO) | 1007 #endif // ENABLE(WEB_AUDIO) |
| OLD | NEW |