| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights
reserved. | 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple 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 3434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3445 m_remoteRoutesAvailable = false; | 3445 m_remoteRoutesAvailable = false; |
| 3446 m_playingRemotely = false; | 3446 m_playingRemotely = false; |
| 3447 | 3447 |
| 3448 #if ENABLE(WEB_AUDIO) | 3448 #if ENABLE(WEB_AUDIO) |
| 3449 if (m_audioSourceNode) | 3449 if (m_audioSourceNode) |
| 3450 audioSourceProvider().setClient(m_audioSourceNode); | 3450 audioSourceProvider().setClient(m_audioSourceNode); |
| 3451 #endif | 3451 #endif |
| 3452 } | 3452 } |
| 3453 | 3453 |
| 3454 #if ENABLE(WEB_AUDIO) | 3454 #if ENABLE(WEB_AUDIO) |
| 3455 AudioSourceProviderClient* HTMLMediaElement::audioSourceNode() | |
| 3456 { | |
| 3457 return m_audioSourceNode; | |
| 3458 } | |
| 3459 | |
| 3460 void HTMLMediaElement::setAudioSourceNode(AudioSourceProviderClient* sourceNode) | 3455 void HTMLMediaElement::setAudioSourceNode(AudioSourceProviderClient* sourceNode) |
| 3461 { | 3456 { |
| 3462 ASSERT(isMainThread()); | 3457 ASSERT(isMainThread()); |
| 3463 m_audioSourceNode = sourceNode; | 3458 m_audioSourceNode = sourceNode; |
| 3464 | 3459 |
| 3465 AudioSourceProviderClientLockScope scope(*this); | 3460 AudioSourceProviderClientLockScope scope(*this); |
| 3466 audioSourceProvider().setClient(m_audioSourceNode); | 3461 audioSourceProvider().setClient(m_audioSourceNode); |
| 3467 } | 3462 } |
| 3468 #endif | 3463 #endif |
| 3469 | 3464 |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3659 | 3654 |
| 3660 // Wrap the AudioBus channel data using WebVector. | 3655 // Wrap the AudioBus channel data using WebVector. |
| 3661 size_t n = bus->numberOfChannels(); | 3656 size_t n = bus->numberOfChannels(); |
| 3662 WebVector<float*> webAudioData(n); | 3657 WebVector<float*> webAudioData(n); |
| 3663 for (size_t i = 0; i < n; ++i) | 3658 for (size_t i = 0; i < n; ++i) |
| 3664 webAudioData[i] = bus->channel(i)->mutableData(); | 3659 webAudioData[i] = bus->channel(i)->mutableData(); |
| 3665 | 3660 |
| 3666 m_webAudioSourceProvider->provideInput(webAudioData, framesToProcess); | 3661 m_webAudioSourceProvider->provideInput(webAudioData, framesToProcess); |
| 3667 } | 3662 } |
| 3668 | 3663 |
| 3669 HTMLMediaElement::AudioClientImpl::AudioClientImpl(AudioSourceProviderClient* cl
ient) | |
| 3670 : m_client(client) | |
| 3671 { | |
| 3672 } | |
| 3673 | |
| 3674 void HTMLMediaElement::AudioClientImpl::setFormat(size_t numberOfChannels, float
sampleRate) | 3664 void HTMLMediaElement::AudioClientImpl::setFormat(size_t numberOfChannels, float
sampleRate) |
| 3675 { | 3665 { |
| 3676 if (m_client) | 3666 if (m_client) |
| 3677 m_client->setFormat(numberOfChannels, sampleRate); | 3667 m_client->setFormat(numberOfChannels, sampleRate); |
| 3678 } | 3668 } |
| 3679 | 3669 |
| 3680 DEFINE_TRACE(HTMLMediaElement::AudioClientImpl) | 3670 DEFINE_TRACE(HTMLMediaElement::AudioClientImpl) |
| 3681 { | 3671 { |
| 3682 visitor->trace(m_client); | 3672 visitor->trace(m_client); |
| 3683 } | 3673 } |
| 3684 | 3674 |
| 3685 DEFINE_TRACE(HTMLMediaElement::AudioSourceProviderImpl) | 3675 DEFINE_TRACE(HTMLMediaElement::AudioSourceProviderImpl) |
| 3686 { | 3676 { |
| 3687 visitor->trace(m_client); | 3677 visitor->trace(m_client); |
| 3688 } | 3678 } |
| 3689 #endif | 3679 #endif |
| 3690 | 3680 |
| 3691 } | 3681 } |
| OLD | NEW |