| 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 | 64 |
| 65 enum ReadyState { | 65 enum ReadyState { |
| 66 ReadyStateLive = 0, | 66 ReadyStateLive = 0, |
| 67 ReadyStateMuted = 1, | 67 ReadyStateMuted = 1, |
| 68 ReadyStateEnded = 2 | 68 ReadyStateEnded = 2 |
| 69 }; | 69 }; |
| 70 | 70 |
| 71 static MediaStreamSource* create(const String& id, | 71 static MediaStreamSource* create(const String& id, |
| 72 StreamType, | 72 StreamType, |
| 73 const String& name, | 73 const String& name, |
| 74 bool remote, | |
| 75 ReadyState = ReadyStateLive, | 74 ReadyState = ReadyStateLive, |
| 76 bool requiresConsumer = false); | 75 bool requiresConsumer = false); |
| 77 | 76 |
| 78 const String& id() const { return m_id; } | 77 const String& id() const { return m_id; } |
| 79 StreamType type() const { return m_type; } | 78 StreamType type() const { return m_type; } |
| 80 const String& name() const { return m_name; } | 79 const String& name() const { return m_name; } |
| 81 bool remote() const { return m_remote; } | |
| 82 | 80 |
| 83 void setReadyState(ReadyState); | 81 void setReadyState(ReadyState); |
| 84 ReadyState getReadyState() const { return m_readyState; } | 82 ReadyState getReadyState() const { return m_readyState; } |
| 85 | 83 |
| 86 void addObserver(Observer*); | 84 void addObserver(Observer*); |
| 87 | 85 |
| 88 ExtraData* getExtraData() const { return m_extraData.get(); } | 86 ExtraData* getExtraData() const { return m_extraData.get(); } |
| 89 void setExtraData(std::unique_ptr<ExtraData> extraData) { | 87 void setExtraData(std::unique_ptr<ExtraData> extraData) { |
| 90 m_extraData = std::move(extraData); | 88 m_extraData = std::move(extraData); |
| 91 } | 89 } |
| (...skipping 17 matching lines...) Expand all Loading... |
| 109 // |m_extraData| may hold pointers to GC objects, and it may touch them in | 107 // |m_extraData| may hold pointers to GC objects, and it may touch them in |
| 110 // destruction. So this class is eagerly finalized to finalize |m_extraData| | 108 // destruction. So this class is eagerly finalized to finalize |m_extraData| |
| 111 // promptly. | 109 // promptly. |
| 112 EAGERLY_FINALIZE(); | 110 EAGERLY_FINALIZE(); |
| 113 DECLARE_TRACE(); | 111 DECLARE_TRACE(); |
| 114 | 112 |
| 115 private: | 113 private: |
| 116 MediaStreamSource(const String& id, | 114 MediaStreamSource(const String& id, |
| 117 StreamType, | 115 StreamType, |
| 118 const String& name, | 116 const String& name, |
| 119 bool remote, | |
| 120 ReadyState, | 117 ReadyState, |
| 121 bool requiresConsumer); | 118 bool requiresConsumer); |
| 122 | 119 |
| 123 String m_id; | 120 String m_id; |
| 124 StreamType m_type; | 121 StreamType m_type; |
| 125 String m_name; | 122 String m_name; |
| 126 bool m_remote; | |
| 127 ReadyState m_readyState; | 123 ReadyState m_readyState; |
| 128 bool m_requiresConsumer; | 124 bool m_requiresConsumer; |
| 129 HeapHashSet<WeakMember<Observer>> m_observers; | 125 HeapHashSet<WeakMember<Observer>> m_observers; |
| 130 Mutex m_audioConsumersLock; | 126 Mutex m_audioConsumersLock; |
| 131 HeapHashSet<Member<AudioDestinationConsumer>> m_audioConsumers; | 127 HeapHashSet<Member<AudioDestinationConsumer>> m_audioConsumers; |
| 132 std::unique_ptr<ExtraData> m_extraData; | 128 std::unique_ptr<ExtraData> m_extraData; |
| 133 WebMediaConstraints m_constraints; | 129 WebMediaConstraints m_constraints; |
| 134 }; | 130 }; |
| 135 | 131 |
| 136 typedef HeapVector<Member<MediaStreamSource>> MediaStreamSourceVector; | 132 typedef HeapVector<Member<MediaStreamSource>> MediaStreamSourceVector; |
| 137 | 133 |
| 138 } // namespace blink | 134 } // namespace blink |
| 139 | 135 |
| 140 #endif // MediaStreamSource_h | 136 #endif // MediaStreamSource_h |
| OLD | NEW |