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.h" | 5 #include "content/renderer/media/peer_connection_handler.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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 video_track->SetRenderer(renderer); | 44 video_track->SetRenderer(renderer); |
45 return; | 45 return; |
46 } | 46 } |
47 } | 47 } |
48 DVLOG(1) << "No enabled video track."; | 48 DVLOG(1) << "No enabled video track."; |
49 } | 49 } |
50 | 50 |
51 void PeerConnectionHandler::initialize( | 51 void PeerConnectionHandler::initialize( |
52 const WebKit::WebString& server_configuration, | 52 const WebKit::WebString& server_configuration, |
53 const WebKit::WebSecurityOrigin& security_origin) { | 53 const WebKit::WebSecurityOrigin& security_origin) { |
54 native_peer_connection_ = dependency_factory_->CreatePeerConnection( | 54 native_peer_connection_ = dependency_factory_->CreateRoapPeerConnection( |
55 UTF16ToUTF8(server_configuration), | 55 UTF16ToUTF8(server_configuration), |
56 this); | 56 this); |
57 CHECK(native_peer_connection_); | 57 CHECK(native_peer_connection_); |
58 } | 58 } |
59 | 59 |
60 void PeerConnectionHandler::produceInitialOffer( | 60 void PeerConnectionHandler::produceInitialOffer( |
61 const WebKit::WebVector<WebKit::WebMediaStreamDescriptor>& | 61 const WebKit::WebVector<WebKit::WebMediaStreamDescriptor>& |
62 pending_add_streams) { | 62 pending_add_streams) { |
63 AddStreams(pending_add_streams); | 63 AddStreams(pending_add_streams); |
64 native_peer_connection_->CommitStreamChanges(); | 64 native_peer_connection_->CommitStreamChanges(); |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 if (!message_loop_proxy_->BelongsToCurrentThread()) { | 145 if (!message_loop_proxy_->BelongsToCurrentThread()) { |
146 message_loop_proxy_->PostTask(FROM_HERE, base::Bind( | 146 message_loop_proxy_->PostTask(FROM_HERE, base::Bind( |
147 &PeerConnectionHandler::OnRemoveStreamCallback, | 147 &PeerConnectionHandler::OnRemoveStreamCallback, |
148 base::Unretained(this), | 148 base::Unretained(this), |
149 stream)); | 149 stream)); |
150 } else { | 150 } else { |
151 OnRemoveStreamCallback(stream); | 151 OnRemoveStreamCallback(stream); |
152 } | 152 } |
153 } | 153 } |
154 | 154 |
| 155 void PeerConnectionHandler::OnIceCandidate( |
| 156 const webrtc::IceCandidateInterface* candidate) { |
| 157 // TODO(grunell): Implement. |
| 158 NOTIMPLEMENTED(); |
| 159 } |
| 160 |
| 161 void PeerConnectionHandler::OnIceComplete() { |
| 162 // TODO(grunell): Implement. |
| 163 NOTIMPLEMENTED(); |
| 164 } |
| 165 |
155 void PeerConnectionHandler::AddStreams( | 166 void PeerConnectionHandler::AddStreams( |
156 const WebKit::WebVector<WebKit::WebMediaStreamDescriptor>& streams) { | 167 const WebKit::WebVector<WebKit::WebMediaStreamDescriptor>& streams) { |
157 for (size_t i = 0; i < streams.size(); ++i) { | 168 for (size_t i = 0; i < streams.size(); ++i) { |
158 talk_base::scoped_refptr<webrtc::LocalMediaStreamInterface> stream = | 169 talk_base::scoped_refptr<webrtc::LocalMediaStreamInterface> stream = |
159 dependency_factory_->CreateLocalMediaStream( | 170 dependency_factory_->CreateLocalMediaStream( |
160 UTF16ToUTF8(streams[i].label())); | 171 UTF16ToUTF8(streams[i].label())); |
161 WebKit::WebVector<WebKit::WebMediaStreamSource> source_vector; | 172 WebKit::WebVector<WebKit::WebMediaStreamSource> source_vector; |
162 streams[i].sources(source_vector); | 173 streams[i].sources(source_vector); |
163 | 174 |
164 // Get and add all tracks. | 175 // Get and add all tracks. |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 UTF8ToUTF16(video_track->label()), | 253 UTF8ToUTF16(video_track->label()), |
243 WebKit::WebMediaStreamSource::TypeVideo, | 254 WebKit::WebMediaStreamSource::TypeVideo, |
244 UTF8ToUTF16(video_track->label())); | 255 UTF8ToUTF16(video_track->label())); |
245 } | 256 } |
246 | 257 |
247 WebKit::WebMediaStreamDescriptor descriptor; | 258 WebKit::WebMediaStreamDescriptor descriptor; |
248 descriptor.initialize(UTF8ToUTF16(stream->label()), source_vector); | 259 descriptor.initialize(UTF8ToUTF16(stream->label()), source_vector); |
249 | 260 |
250 return descriptor; | 261 return descriptor; |
251 } | 262 } |
OLD | NEW |