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 3737 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3748 m_client = new HTMLMediaElement::AudioClientImpl(client); | 3748 m_client = new HTMLMediaElement::AudioClientImpl(client); |
3749 else | 3749 else |
3750 m_client.clear(); | 3750 m_client.clear(); |
3751 | 3751 |
3752 if (m_webAudioSourceProvider) | 3752 if (m_webAudioSourceProvider) |
3753 m_webAudioSourceProvider->setClient(m_client.get()); | 3753 m_webAudioSourceProvider->setClient(m_client.get()); |
3754 } | 3754 } |
3755 | 3755 |
3756 void HTMLMediaElement::AudioSourceProviderImpl::provideInput(AudioBus* bus, size
_t framesToProcess) | 3756 void HTMLMediaElement::AudioSourceProviderImpl::provideInput(AudioBus* bus, size
_t framesToProcess) |
3757 { | 3757 { |
3758 // TODO(srirama.m): Investigate whether the bus can be null or not | |
3759 // and remove either ASSERT or null check appropriately. | |
3760 ASSERT(bus); | 3758 ASSERT(bus); |
3761 if (!bus) | |
3762 return; | |
3763 | 3759 |
3764 MutexTryLocker tryLocker(provideInputLock); | 3760 MutexTryLocker tryLocker(provideInputLock); |
3765 if (!tryLocker.locked() || !m_webAudioSourceProvider || !m_client.get()) { | 3761 if (!tryLocker.locked() || !m_webAudioSourceProvider || !m_client.get()) { |
3766 bus->zero(); | 3762 bus->zero(); |
3767 return; | 3763 return; |
3768 } | 3764 } |
3769 | 3765 |
3770 // Wrap the AudioBus channel data using WebVector. | 3766 // Wrap the AudioBus channel data using WebVector. |
3771 size_t n = bus->numberOfChannels(); | 3767 size_t n = bus->numberOfChannels(); |
3772 WebVector<float*> webAudioData(n); | 3768 WebVector<float*> webAudioData(n); |
(...skipping 14 matching lines...) Expand all Loading... |
3787 visitor->trace(m_client); | 3783 visitor->trace(m_client); |
3788 } | 3784 } |
3789 | 3785 |
3790 DEFINE_TRACE(HTMLMediaElement::AudioSourceProviderImpl) | 3786 DEFINE_TRACE(HTMLMediaElement::AudioSourceProviderImpl) |
3791 { | 3787 { |
3792 visitor->trace(m_client); | 3788 visitor->trace(m_client); |
3793 } | 3789 } |
3794 #endif | 3790 #endif |
3795 | 3791 |
3796 } | 3792 } |
OLD | NEW |