| 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 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 if (audioTracks.isEmpty()) { | 302 if (audioTracks.isEmpty()) { |
| 303 exceptionState.throwDOMException( | 303 exceptionState.throwDOMException( |
| 304 InvalidStateError, | 304 InvalidStateError, |
| 305 "MediaStream has no audio track"); | 305 "MediaStream has no audio track"); |
| 306 return nullptr; | 306 return nullptr; |
| 307 } | 307 } |
| 308 | 308 |
| 309 // Use the first audio track in the media stream. | 309 // Use the first audio track in the media stream. |
| 310 MediaStreamTrack* audioTrack = audioTracks[0]; | 310 MediaStreamTrack* audioTrack = audioTracks[0]; |
| 311 OwnPtr<AudioSourceProvider> provider = audioTrack->createWebAudioSource(); | 311 OwnPtr<AudioSourceProvider> provider = audioTrack->createWebAudioSource(); |
| 312 MediaStreamAudioSourceNode* node = MediaStreamAudioSourceNode::create(*this,
*mediaStream, audioTrack, provider.release()); | 312 MediaStreamAudioSourceNode* node = MediaStreamAudioSourceNode::create(*this,
*mediaStream, audioTrack, std::move(provider)); |
| 313 | 313 |
| 314 // FIXME: Only stereo streams are supported right now. We should be able to
accept multi-channel streams. | 314 // FIXME: Only stereo streams are supported right now. We should be able to
accept multi-channel streams. |
| 315 node->setFormat(2, sampleRate()); | 315 node->setFormat(2, sampleRate()); |
| 316 | 316 |
| 317 notifySourceNodeStartedProcessing(node); // context keeps reference until no
de is disconnected | 317 notifySourceNodeStartedProcessing(node); // context keeps reference until no
de is disconnected |
| 318 return node; | 318 return node; |
| 319 } | 319 } |
| 320 | 320 |
| 321 MediaStreamAudioDestinationNode* AbstractAudioContext::createMediaStreamDestinat
ion(ExceptionState& exceptionState) | 321 MediaStreamAudioDestinationNode* AbstractAudioContext::createMediaStreamDestinat
ion(ExceptionState& exceptionState) |
| 322 { | 322 { |
| (...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 976 | 976 |
| 977 SecurityOrigin* AbstractAudioContext::getSecurityOrigin() const | 977 SecurityOrigin* AbstractAudioContext::getSecurityOrigin() const |
| 978 { | 978 { |
| 979 if (getExecutionContext()) | 979 if (getExecutionContext()) |
| 980 return getExecutionContext()->getSecurityOrigin(); | 980 return getExecutionContext()->getSecurityOrigin(); |
| 981 | 981 |
| 982 return nullptr; | 982 return nullptr; |
| 983 } | 983 } |
| 984 | 984 |
| 985 } // namespace blink | 985 } // namespace blink |
| OLD | NEW |