| 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 17 matching lines...) Expand all Loading... |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "platform/mediastream/MediaStreamSource.h" | 31 #include "platform/mediastream/MediaStreamSource.h" |
| 32 | 32 |
| 33 namespace blink { | 33 namespace blink { |
| 34 | 34 |
| 35 MediaStreamSource* MediaStreamSource::create(const String& id, | 35 MediaStreamSource* MediaStreamSource::create(const String& id, |
| 36 StreamType type, | 36 StreamType type, |
| 37 const String& name, | 37 const String& name, |
| 38 bool remote, | |
| 39 ReadyState readyState, | 38 ReadyState readyState, |
| 40 bool requiresConsumer) { | 39 bool requiresConsumer) { |
| 41 return new MediaStreamSource(id, type, name, remote, readyState, | 40 return new MediaStreamSource(id, type, name, readyState, requiresConsumer); |
| 42 requiresConsumer); | |
| 43 } | 41 } |
| 44 | 42 |
| 45 MediaStreamSource::MediaStreamSource(const String& id, | 43 MediaStreamSource::MediaStreamSource(const String& id, |
| 46 StreamType type, | 44 StreamType type, |
| 47 const String& name, | 45 const String& name, |
| 48 bool remote, | |
| 49 ReadyState readyState, | 46 ReadyState readyState, |
| 50 bool requiresConsumer) | 47 bool requiresConsumer) |
| 51 : m_id(id), | 48 : m_id(id), |
| 52 m_type(type), | 49 m_type(type), |
| 53 m_name(name), | 50 m_name(name), |
| 54 m_remote(remote), | |
| 55 m_readyState(readyState), | 51 m_readyState(readyState), |
| 56 m_requiresConsumer(requiresConsumer) {} | 52 m_requiresConsumer(requiresConsumer) {} |
| 57 | 53 |
| 58 MediaStreamSource::~MediaStreamSource() { | 54 MediaStreamSource::~MediaStreamSource() { |
| 59 // Verify that the audio thread isn't consuming audio. | 55 // Verify that the audio thread isn't consuming audio. |
| 60 // TODO(sof): remove once crbug.com/682945 has been diagnosed. | 56 // TODO(sof): remove once crbug.com/682945 has been diagnosed. |
| 61 MutexTryLocker tryLocker(m_audioConsumersLock); | 57 MutexTryLocker tryLocker(m_audioConsumersLock); |
| 62 CHECK(tryLocker.locked()); | 58 CHECK(tryLocker.locked()); |
| 63 } | 59 } |
| 64 | 60 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 it != m_audioConsumers.end(); ++it) | 115 it != m_audioConsumers.end(); ++it) |
| 120 (*it)->consumeAudio(bus, numberOfFrames); | 116 (*it)->consumeAudio(bus, numberOfFrames); |
| 121 } | 117 } |
| 122 | 118 |
| 123 DEFINE_TRACE(MediaStreamSource) { | 119 DEFINE_TRACE(MediaStreamSource) { |
| 124 visitor->trace(m_observers); | 120 visitor->trace(m_observers); |
| 125 visitor->trace(m_audioConsumers); | 121 visitor->trace(m_audioConsumers); |
| 126 } | 122 } |
| 127 | 123 |
| 128 } // namespace blink | 124 } // namespace blink |
| OLD | NEW |