OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 } | 84 } |
85 | 85 |
86 WebMediaStreamSource::operator MediaStreamSource*() const { | 86 WebMediaStreamSource::operator MediaStreamSource*() const { |
87 return m_private.get(); | 87 return m_private.get(); |
88 } | 88 } |
89 | 89 |
90 void WebMediaStreamSource::initialize(const WebString& id, | 90 void WebMediaStreamSource::initialize(const WebString& id, |
91 Type type, | 91 Type type, |
92 const WebString& name) { | 92 const WebString& name) { |
93 m_private = MediaStreamSource::create( | 93 m_private = MediaStreamSource::create( |
94 id, static_cast<MediaStreamSource::StreamType>(type), name, false); | 94 id, static_cast<MediaStreamSource::StreamType>(type), name); |
95 } | |
96 | |
97 void WebMediaStreamSource::initialize(const WebString& id, | |
98 Type type, | |
99 const WebString& name, | |
100 bool remote) { | |
101 m_private = MediaStreamSource::create( | |
102 id, static_cast<MediaStreamSource::StreamType>(type), name, remote); | |
103 } | 95 } |
104 | 96 |
105 WebString WebMediaStreamSource::id() const { | 97 WebString WebMediaStreamSource::id() const { |
106 ASSERT(!m_private.isNull()); | 98 ASSERT(!m_private.isNull()); |
107 return m_private.get()->id(); | 99 return m_private.get()->id(); |
108 } | 100 } |
109 | 101 |
110 WebMediaStreamSource::Type WebMediaStreamSource::getType() const { | 102 WebMediaStreamSource::Type WebMediaStreamSource::getType() const { |
111 ASSERT(!m_private.isNull()); | 103 ASSERT(!m_private.isNull()); |
112 return static_cast<Type>(m_private.get()->type()); | 104 return static_cast<Type>(m_private.get()->type()); |
113 } | 105 } |
114 | 106 |
115 WebString WebMediaStreamSource::name() const { | 107 WebString WebMediaStreamSource::name() const { |
116 ASSERT(!m_private.isNull()); | 108 ASSERT(!m_private.isNull()); |
117 return m_private.get()->name(); | 109 return m_private.get()->name(); |
118 } | 110 } |
119 | 111 |
120 bool WebMediaStreamSource::remote() const { | |
121 ASSERT(!m_private.isNull()); | |
122 return m_private.get()->remote(); | |
123 } | |
124 | |
125 void WebMediaStreamSource::setReadyState(ReadyState state) { | 112 void WebMediaStreamSource::setReadyState(ReadyState state) { |
126 ASSERT(!m_private.isNull()); | 113 ASSERT(!m_private.isNull()); |
127 m_private->setReadyState(static_cast<MediaStreamSource::ReadyState>(state)); | 114 m_private->setReadyState(static_cast<MediaStreamSource::ReadyState>(state)); |
128 } | 115 } |
129 | 116 |
130 WebMediaStreamSource::ReadyState WebMediaStreamSource::getReadyState() const { | 117 WebMediaStreamSource::ReadyState WebMediaStreamSource::getReadyState() const { |
131 ASSERT(!m_private.isNull()); | 118 ASSERT(!m_private.isNull()); |
132 return static_cast<ReadyState>(m_private->getReadyState()); | 119 return static_cast<ReadyState>(m_private->getReadyState()); |
133 } | 120 } |
134 | 121 |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 ConsumerWrapper* wrapper = static_cast<ConsumerWrapper*>(it->get()); | 204 ConsumerWrapper* wrapper = static_cast<ConsumerWrapper*>(it->get()); |
218 if (wrapper->consumer() == consumer) { | 205 if (wrapper->consumer() == consumer) { |
219 m_private->removeAudioConsumer(wrapper); | 206 m_private->removeAudioConsumer(wrapper); |
220 return true; | 207 return true; |
221 } | 208 } |
222 } | 209 } |
223 return false; | 210 return false; |
224 } | 211 } |
225 | 212 |
226 } // namespace blink | 213 } // namespace blink |
OLD | NEW |