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(); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 default: | 236 default: |
239 NOTREACHED(); | 237 NOTREACHED(); |
240 return; | 238 return; |
241 } | 239 } |
242 client_->didChangeReadyState(ready_state); | 240 client_->didChangeReadyState(ready_state); |
243 break; | 241 break; |
244 case kIceState: | 242 case kIceState: |
245 // TODO(grunell): Implement when available in native PeerConnection. | 243 // TODO(grunell): Implement when available in native PeerConnection. |
246 NOTIMPLEMENTED(); | 244 NOTIMPLEMENTED(); |
247 break; | 245 break; |
248 case kSdpState: | |
249 // Not used by JSEP. | |
250 NOTREACHED(); | |
251 break; | |
252 default: | 246 default: |
253 NOTREACHED(); | 247 NOTREACHED(); |
254 break; | 248 break; |
255 } | 249 } |
256 } | 250 } |
257 | 251 |
258 void PeerConnectionHandlerJsep::OnAddStream( | 252 void PeerConnectionHandlerJsep::OnAddStream( |
259 webrtc::MediaStreamInterface* stream) { | 253 webrtc::MediaStreamInterface* stream) { |
260 if (!stream) | 254 if (!stream) |
261 return; | 255 return; |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 break; | 367 break; |
374 case ActionSDPAnswer: | 368 case ActionSDPAnswer: |
375 *native_action = webrtc::PeerConnectionInterface::kAnswer; | 369 *native_action = webrtc::PeerConnectionInterface::kAnswer; |
376 break; | 370 break; |
377 default: | 371 default: |
378 NOTREACHED(); | 372 NOTREACHED(); |
379 return false; | 373 return false; |
380 } | 374 } |
381 return true; | 375 return true; |
382 } | 376 } |
OLD | NEW |