| 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 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 | 341 |
| 342 MediaStreamTrackVector audioTracks = mediaStream->getAudioTracks(); | 342 MediaStreamTrackVector audioTracks = mediaStream->getAudioTracks(); |
| 343 if (audioTracks.isEmpty()) { | 343 if (audioTracks.isEmpty()) { |
| 344 exceptionState.throwDOMException( | 344 exceptionState.throwDOMException( |
| 345 InvalidStateError, | 345 InvalidStateError, |
| 346 "MediaStream has no audio track"); | 346 "MediaStream has no audio track"); |
| 347 return nullptr; | 347 return nullptr; |
| 348 } | 348 } |
| 349 | 349 |
| 350 // Use the first audio track in the media stream. | 350 // Use the first audio track in the media stream. |
| 351 RefPtr<MediaStreamTrack> audioTrack = audioTracks[0]; | 351 RefPtrWillBeRawPtr<MediaStreamTrack> audioTrack = audioTracks[0]; |
| 352 OwnPtr<AudioSourceProvider> provider = audioTrack->createWebAudioSource(); | 352 OwnPtr<AudioSourceProvider> provider = audioTrack->createWebAudioSource(); |
| 353 RefPtrWillBeRawPtr<MediaStreamAudioSourceNode> node = MediaStreamAudioSource
Node::create(this, mediaStream, audioTrack.get(), provider.release()); | 353 RefPtrWillBeRawPtr<MediaStreamAudioSourceNode> node = MediaStreamAudioSource
Node::create(this, mediaStream, audioTrack.get(), provider.release()); |
| 354 | 354 |
| 355 // FIXME: Only stereo streams are supported right now. We should be able to
accept multi-channel streams. | 355 // FIXME: Only stereo streams are supported right now. We should be able to
accept multi-channel streams. |
| 356 node->setFormat(2, sampleRate()); | 356 node->setFormat(2, sampleRate()); |
| 357 | 357 |
| 358 refNode(node.get()); // context keeps reference until node is disconnected | 358 refNode(node.get()); // context keeps reference until node is disconnected |
| 359 return node; | 359 return node; |
| 360 } | 360 } |
| 361 | 361 |
| (...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 971 { | 971 { |
| 972 visitor->trace(m_renderTarget); | 972 visitor->trace(m_renderTarget); |
| 973 visitor->trace(m_destinationNode); | 973 visitor->trace(m_destinationNode); |
| 974 visitor->trace(m_listener); | 974 visitor->trace(m_listener); |
| 975 visitor->trace(m_dirtySummingJunctions); | 975 visitor->trace(m_dirtySummingJunctions); |
| 976 } | 976 } |
| 977 | 977 |
| 978 } // namespace WebCore | 978 } // namespace WebCore |
| 979 | 979 |
| 980 #endif // ENABLE(WEB_AUDIO) | 980 #endif // ENABLE(WEB_AUDIO) |
| OLD | NEW |