| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Ericsson AB. All rights reserved. | 2 * Copyright (C) 2011 Ericsson AB. All rights reserved. |
| 3 * Copyright (C) 2012 Google Inc. All rights reserved. | 3 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 void setAudioFormat(size_t numberOfChannels, float sampleRate); | 97 void setAudioFormat(size_t numberOfChannels, float sampleRate); |
| 98 void consumeAudio(AudioBus*, size_t numberOfFrames); | 98 void consumeAudio(AudioBus*, size_t numberOfFrames); |
| 99 | 99 |
| 100 bool requiresAudioConsumer() const { return m_requiresConsumer; } | 100 bool requiresAudioConsumer() const { return m_requiresConsumer; } |
| 101 void addAudioConsumer(AudioDestinationConsumer*); | 101 void addAudioConsumer(AudioDestinationConsumer*); |
| 102 bool removeAudioConsumer(AudioDestinationConsumer*); | 102 bool removeAudioConsumer(AudioDestinationConsumer*); |
| 103 const HeapHashSet<Member<AudioDestinationConsumer>>& audioConsumers() { | 103 const HeapHashSet<Member<AudioDestinationConsumer>>& audioConsumers() { |
| 104 return m_audioConsumers; | 104 return m_audioConsumers; |
| 105 } | 105 } |
| 106 | 106 |
| 107 // |m_extraData| may hold pointers to GC objects, and it may touch them in des
truction. | 107 // |m_extraData| may hold pointers to GC objects, and it may touch them in |
| 108 // So this class is eagerly finalized to finalize |m_extraData| promptly. | 108 // destruction. So this class is eagerly finalized to finalize |m_extraData| |
| 109 // promptly. |
| 109 EAGERLY_FINALIZE(); | 110 EAGERLY_FINALIZE(); |
| 110 DECLARE_TRACE(); | 111 DECLARE_TRACE(); |
| 111 | 112 |
| 112 private: | 113 private: |
| 113 MediaStreamSource(const String& id, | 114 MediaStreamSource(const String& id, |
| 114 StreamType, | 115 StreamType, |
| 115 const String& name, | 116 const String& name, |
| 116 bool remote, | 117 bool remote, |
| 117 ReadyState, | 118 ReadyState, |
| 118 bool requiresConsumer); | 119 bool requiresConsumer); |
| 119 | 120 |
| 120 String m_id; | 121 String m_id; |
| 121 StreamType m_type; | 122 StreamType m_type; |
| 122 String m_name; | 123 String m_name; |
| 123 bool m_remote; | 124 bool m_remote; |
| 124 ReadyState m_readyState; | 125 ReadyState m_readyState; |
| 125 bool m_requiresConsumer; | 126 bool m_requiresConsumer; |
| 126 HeapHashSet<WeakMember<Observer>> m_observers; | 127 HeapHashSet<WeakMember<Observer>> m_observers; |
| 127 Mutex m_audioConsumersLock; | 128 Mutex m_audioConsumersLock; |
| 128 HeapHashSet<Member<AudioDestinationConsumer>> m_audioConsumers; | 129 HeapHashSet<Member<AudioDestinationConsumer>> m_audioConsumers; |
| 129 std::unique_ptr<ExtraData> m_extraData; | 130 std::unique_ptr<ExtraData> m_extraData; |
| 130 WebMediaConstraints m_constraints; | 131 WebMediaConstraints m_constraints; |
| 131 }; | 132 }; |
| 132 | 133 |
| 133 typedef HeapVector<Member<MediaStreamSource>> MediaStreamSourceVector; | 134 typedef HeapVector<Member<MediaStreamSource>> MediaStreamSourceVector; |
| 134 | 135 |
| 135 } // namespace blink | 136 } // namespace blink |
| 136 | 137 |
| 137 #endif // MediaStreamSource_h | 138 #endif // MediaStreamSource_h |
| OLD | NEW |