| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 { | 75 { |
| 76 ASSERT(m_requiresConsumer); | 76 ASSERT(m_requiresConsumer); |
| 77 MutexLocker locker(m_audioConsumersLock); | 77 MutexLocker locker(m_audioConsumersLock); |
| 78 m_audioConsumers.add(consumer); | 78 m_audioConsumers.add(consumer); |
| 79 } | 79 } |
| 80 | 80 |
| 81 bool MediaStreamSource::removeAudioConsumer(AudioDestinationConsumer* consumer) | 81 bool MediaStreamSource::removeAudioConsumer(AudioDestinationConsumer* consumer) |
| 82 { | 82 { |
| 83 ASSERT(m_requiresConsumer); | 83 ASSERT(m_requiresConsumer); |
| 84 MutexLocker locker(m_audioConsumersLock); | 84 MutexLocker locker(m_audioConsumersLock); |
| 85 HeapHashSet<Member<AudioDestinationConsumer> >::iterator it = m_audioConsume
rs.find(consumer); | 85 HeapHashSet<Member<AudioDestinationConsumer>>::iterator it = m_audioConsumer
s.find(consumer); |
| 86 if (it == m_audioConsumers.end()) | 86 if (it == m_audioConsumers.end()) |
| 87 return false; | 87 return false; |
| 88 m_audioConsumers.remove(it); | 88 m_audioConsumers.remove(it); |
| 89 return true; | 89 return true; |
| 90 } | 90 } |
| 91 | 91 |
| 92 void MediaStreamSource::setAudioFormat(size_t numberOfChannels, float sampleRate
) | 92 void MediaStreamSource::setAudioFormat(size_t numberOfChannels, float sampleRate
) |
| 93 { | 93 { |
| 94 ASSERT(m_requiresConsumer); | 94 ASSERT(m_requiresConsumer); |
| 95 MutexLocker locker(m_audioConsumersLock); | 95 MutexLocker locker(m_audioConsumersLock); |
| 96 for (HeapHashSet<Member<AudioDestinationConsumer> >::iterator it = m_audioCo
nsumers.begin(); it != m_audioConsumers.end(); ++it) | 96 for (HeapHashSet<Member<AudioDestinationConsumer>>::iterator it = m_audioCon
sumers.begin(); it != m_audioConsumers.end(); ++it) |
| 97 (*it)->setFormat(numberOfChannels, sampleRate); | 97 (*it)->setFormat(numberOfChannels, sampleRate); |
| 98 } | 98 } |
| 99 | 99 |
| 100 void MediaStreamSource::consumeAudio(AudioBus* bus, size_t numberOfFrames) | 100 void MediaStreamSource::consumeAudio(AudioBus* bus, size_t numberOfFrames) |
| 101 { | 101 { |
| 102 ASSERT(m_requiresConsumer); | 102 ASSERT(m_requiresConsumer); |
| 103 MutexLocker locker(m_audioConsumersLock); | 103 MutexLocker locker(m_audioConsumersLock); |
| 104 for (HeapHashSet<Member<AudioDestinationConsumer> >::iterator it = m_audioCo
nsumers.begin(); it != m_audioConsumers.end(); ++it) | 104 for (HeapHashSet<Member<AudioDestinationConsumer>>::iterator it = m_audioCon
sumers.begin(); it != m_audioConsumers.end(); ++it) |
| 105 (*it)->consumeAudio(bus, numberOfFrames); | 105 (*it)->consumeAudio(bus, numberOfFrames); |
| 106 } | 106 } |
| 107 | 107 |
| 108 } // namespace blink | 108 } // namespace blink |
| OLD | NEW |