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 #ifndef CONTENT_RENDERER_MEDIA_RTC_PEER_CONNECTION_HANDLER_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_RTC_PEER_CONNECTION_HANDLER_H_ |
6 #define CONTENT_RENDERER_MEDIA_RTC_PEER_CONNECTION_HANDLER_H_ | 6 #define CONTENT_RENDERER_MEDIA_RTC_PEER_CONNECTION_HANDLER_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 const blink::WebRTCICECandidate& candidate) override; | 140 const blink::WebRTCICECandidate& candidate) override; |
141 virtual void OnaddICECandidateResult(const blink::WebRTCVoidRequest& request, | 141 virtual void OnaddICECandidateResult(const blink::WebRTCVoidRequest& request, |
142 bool result); | 142 bool result); |
143 | 143 |
144 bool addStream(const blink::WebMediaStream& stream, | 144 bool addStream(const blink::WebMediaStream& stream, |
145 const blink::WebMediaConstraints& options) override; | 145 const blink::WebMediaConstraints& options) override; |
146 void removeStream(const blink::WebMediaStream& stream) override; | 146 void removeStream(const blink::WebMediaStream& stream) override; |
147 void getStats(const blink::WebRTCStatsRequest& request) override; | 147 void getStats(const blink::WebRTCStatsRequest& request) override; |
148 void getStats( | 148 void getStats( |
149 std::unique_ptr<blink::WebRTCStatsReportCallback> callback) override; | 149 std::unique_ptr<blink::WebRTCStatsReportCallback> callback) override; |
| 150 blink::WebVector<std::unique_ptr<blink::WebRTCRtpReceiver>> getReceivers() |
| 151 override; |
150 blink::WebRTCDataChannelHandler* createDataChannel( | 152 blink::WebRTCDataChannelHandler* createDataChannel( |
151 const blink::WebString& label, | 153 const blink::WebString& label, |
152 const blink::WebRTCDataChannelInit& init) override; | 154 const blink::WebRTCDataChannelInit& init) override; |
153 blink::WebRTCDTMFSenderHandler* createDTMFSender( | 155 blink::WebRTCDTMFSenderHandler* createDTMFSender( |
154 const blink::WebMediaStreamTrack& track) override; | 156 const blink::WebMediaStreamTrack& track) override; |
155 void stop() override; | 157 void stop() override; |
156 | 158 |
157 // Delegate functions to allow for mocking of WebKit interfaces. | 159 // Delegate functions to allow for mocking of WebKit interfaces. |
158 // getStats takes ownership of request parameter. | 160 // getStats takes ownership of request parameter. |
159 virtual void getStats(const scoped_refptr<LocalRTCStatsRequest>& request); | 161 virtual void getStats(const scoped_refptr<LocalRTCStatsRequest>& request); |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 void ReportFirstSessionDescriptions( | 228 void ReportFirstSessionDescriptions( |
227 const FirstSessionDescription& local, | 229 const FirstSessionDescription& local, |
228 const FirstSessionDescription& remote); | 230 const FirstSessionDescription& remote); |
229 | 231 |
230 // Virtual to allow mocks to override. | 232 // Virtual to allow mocks to override. |
231 virtual scoped_refptr<base::SingleThreadTaskRunner> signaling_thread() const; | 233 virtual scoped_refptr<base::SingleThreadTaskRunner> signaling_thread() const; |
232 | 234 |
233 void RunSynchronousClosureOnSignalingThread(const base::Closure& closure, | 235 void RunSynchronousClosureOnSignalingThread(const base::Closure& closure, |
234 const char* trace_event_name); | 236 const char* trace_event_name); |
235 | 237 |
| 238 // If a track is not found with the specified id, the returned track's |
| 239 // |isNull| will return true. |
| 240 blink::WebMediaStreamTrack GetRemoteAudioTrack( |
| 241 const std::string& track_id) const; |
| 242 blink::WebMediaStreamTrack GetRemoteVideoTrack( |
| 243 const std::string& track_id) const; |
| 244 |
236 base::ThreadChecker thread_checker_; | 245 base::ThreadChecker thread_checker_; |
237 | 246 |
238 // |client_| is a weak pointer to the blink object (blink::RTCPeerConnection) | 247 // |client_| is a weak pointer to the blink object (blink::RTCPeerConnection) |
239 // that owns this object. | 248 // that owns this object. |
240 // It is valid for the lifetime of this object. | 249 // It is valid for the lifetime of this object. |
241 blink::WebRTCPeerConnectionHandlerClient* const client_; | 250 blink::WebRTCPeerConnectionHandlerClient* const client_; |
242 // True if this PeerConnection has been closed. | 251 // True if this PeerConnection has been closed. |
243 // After the PeerConnection has been closed, this object may no longer | 252 // After the PeerConnection has been closed, this object may no longer |
244 // forward callbacks to blink. | 253 // forward callbacks to blink. |
245 bool is_closed_; | 254 bool is_closed_; |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 bool ice_state_seen_[webrtc::PeerConnectionInterface::kIceConnectionMax] = {}; | 301 bool ice_state_seen_[webrtc::PeerConnectionInterface::kIceConnectionMax] = {}; |
293 | 302 |
294 base::WeakPtrFactory<RTCPeerConnectionHandler> weak_factory_; | 303 base::WeakPtrFactory<RTCPeerConnectionHandler> weak_factory_; |
295 | 304 |
296 DISALLOW_COPY_AND_ASSIGN(RTCPeerConnectionHandler); | 305 DISALLOW_COPY_AND_ASSIGN(RTCPeerConnectionHandler); |
297 }; | 306 }; |
298 | 307 |
299 } // namespace content | 308 } // namespace content |
300 | 309 |
301 #endif // CONTENT_RENDERER_MEDIA_RTC_PEER_CONNECTION_HANDLER_H_ | 310 #endif // CONTENT_RENDERER_MEDIA_RTC_PEER_CONNECTION_HANDLER_H_ |
OLD | NEW |