OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/renderer/media/peer_connection_handler_jsep.h" | 5 #include "content/renderer/media/peer_connection_handler_jsep.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 bool return_value = | 175 bool return_value = |
176 native_peer_connection_->ProcessIceMessage(native_candidate.get()); | 176 native_peer_connection_->ProcessIceMessage(native_candidate.get()); |
177 if (!return_value) | 177 if (!return_value) |
178 LOG(ERROR) << "Error processing ICE message"; | 178 LOG(ERROR) << "Error processing ICE message"; |
179 return return_value; | 179 return return_value; |
180 } | 180 } |
181 | 181 |
182 void PeerConnectionHandlerJsep::addStream( | 182 void PeerConnectionHandlerJsep::addStream( |
183 const WebKit::WebMediaStreamDescriptor& stream) { | 183 const WebKit::WebMediaStreamDescriptor& stream) { |
184 AddStream(stream); | 184 AddStream(stream); |
185 native_peer_connection_->CommitStreamChanges(); | |
186 } | 185 } |
187 | 186 |
188 void PeerConnectionHandlerJsep::removeStream( | 187 void PeerConnectionHandlerJsep::removeStream( |
189 const WebKit::WebMediaStreamDescriptor& stream) { | 188 const WebKit::WebMediaStreamDescriptor& stream) { |
190 RemoveStream(stream); | 189 RemoveStream(stream); |
191 native_peer_connection_->CommitStreamChanges(); | |
192 } | 190 } |
193 | 191 |
194 void PeerConnectionHandlerJsep::stop() { | 192 void PeerConnectionHandlerJsep::stop() { |
195 DVLOG(1) << "PeerConnectionHandlerJsep::stop"; | 193 DVLOG(1) << "PeerConnectionHandlerJsep::stop"; |
196 native_peer_connection_ = NULL; | 194 native_peer_connection_ = NULL; |
197 } | 195 } |
198 | 196 |
199 void PeerConnectionHandlerJsep::OnError() { | 197 void PeerConnectionHandlerJsep::OnError() { |
200 // TODO(grunell): Implement. | 198 // TODO(grunell): Implement. |
201 NOTIMPLEMENTED(); | 199 NOTIMPLEMENTED(); |
202 } | 200 } |
203 | 201 |
204 void PeerConnectionHandlerJsep::OnMessage(const std::string& msg) { | |
205 // TODO(grunell): Implement. | |
206 NOTIMPLEMENTED(); | |
207 } | |
208 | |
209 void PeerConnectionHandlerJsep::OnSignalingMessage(const std::string& msg) { | |
210 // Not used by JSEP PeerConnection. | |
211 NOTREACHED(); | |
212 } | |
213 | |
214 void PeerConnectionHandlerJsep::OnStateChange(StateType state_changed) { | 202 void PeerConnectionHandlerJsep::OnStateChange(StateType state_changed) { |
215 switch (state_changed) { | 203 switch (state_changed) { |
216 case kReadyState: | 204 case kReadyState: |
217 WebKit::WebPeerConnection00HandlerClient::ReadyState ready_state; | 205 WebKit::WebPeerConnection00HandlerClient::ReadyState ready_state; |
218 switch (native_peer_connection_->ready_state()) { | 206 switch (native_peer_connection_->ready_state()) { |
219 case webrtc::PeerConnectionInterface::kNew: | 207 case webrtc::PeerConnectionInterface::kNew: |
220 ready_state = WebKit::WebPeerConnection00HandlerClient::ReadyStateNew; | 208 ready_state = WebKit::WebPeerConnection00HandlerClient::ReadyStateNew; |
221 break; | 209 break; |
222 case webrtc::PeerConnectionInterface::kOpening: | 210 case webrtc::PeerConnectionInterface::kOpening: |
223 ready_state = | 211 ready_state = |
(...skipping 14 matching lines...) Expand all Loading... |
238 default: | 226 default: |
239 NOTREACHED(); | 227 NOTREACHED(); |
240 return; | 228 return; |
241 } | 229 } |
242 client_->didChangeReadyState(ready_state); | 230 client_->didChangeReadyState(ready_state); |
243 break; | 231 break; |
244 case kIceState: | 232 case kIceState: |
245 // TODO(grunell): Implement when available in native PeerConnection. | 233 // TODO(grunell): Implement when available in native PeerConnection. |
246 NOTIMPLEMENTED(); | 234 NOTIMPLEMENTED(); |
247 break; | 235 break; |
248 case kSdpState: | |
249 // Not used by JSEP. | |
250 NOTREACHED(); | |
251 break; | |
252 default: | 236 default: |
253 NOTREACHED(); | 237 NOTREACHED(); |
254 break; | 238 break; |
255 } | 239 } |
256 } | 240 } |
257 | 241 |
258 void PeerConnectionHandlerJsep::OnAddStream( | 242 void PeerConnectionHandlerJsep::OnAddStream( |
259 webrtc::MediaStreamInterface* stream) { | 243 webrtc::MediaStreamInterface* stream) { |
260 if (!stream) | 244 if (!stream) |
261 return; | 245 return; |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 break; | 357 break; |
374 case ActionSDPAnswer: | 358 case ActionSDPAnswer: |
375 *native_action = webrtc::PeerConnectionInterface::kAnswer; | 359 *native_action = webrtc::PeerConnectionInterface::kAnswer; |
376 break; | 360 break; |
377 default: | 361 default: |
378 NOTREACHED(); | 362 NOTREACHED(); |
379 return false; | 363 return false; |
380 } | 364 } |
381 return true; | 365 return true; |
382 } | 366 } |
OLD | NEW |