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