OLD | NEW |
---|---|
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
226 kRtcpMuxPolicyRequire, | 226 kRtcpMuxPolicyRequire, |
227 }; | 227 }; |
228 | 228 |
229 enum TcpCandidatePolicy { | 229 enum TcpCandidatePolicy { |
230 kTcpCandidatePolicyEnabled, | 230 kTcpCandidatePolicyEnabled, |
231 kTcpCandidatePolicyDisabled | 231 kTcpCandidatePolicyDisabled |
232 }; | 232 }; |
233 | 233 |
234 // TODO(hbos): Change into class with private data and public getters. | 234 // TODO(hbos): Change into class with private data and public getters. |
235 struct RTCConfiguration { | 235 struct RTCConfiguration { |
236 // Default maximum number of packets in the audio jitter buffer. | |
237 static const int kAudioJitterBufferMaxPackets = 50; | |
238 // Default ICE connection receiving timeout value in milliseconds. | |
239 // When this is negative, it has no effect on the internal timeout setting. | |
240 static const int kIceConnectionReceivingTimeout = -1; | |
juberti
2015/08/27 20:31:04
If you are using -1, I don't think we need to have
honghaiz3
2015/08/27 21:02:26
I just used the kUndefined as it was done in the n
| |
236 // TODO(pthatcher): Rename this ice_transport_type, but update | 241 // TODO(pthatcher): Rename this ice_transport_type, but update |
237 // Chromium at the same time. | 242 // Chromium at the same time. |
238 IceTransportsType type; | 243 IceTransportsType type; |
239 // TODO(pthatcher): Rename this ice_servers, but update Chromium | 244 // TODO(pthatcher): Rename this ice_servers, but update Chromium |
240 // at the same time. | 245 // at the same time. |
241 IceServers servers; | 246 IceServers servers; |
242 // A localhost candidate is signaled whenever a candidate with the any | 247 // A localhost candidate is signaled whenever a candidate with the any |
243 // address is allocated. | 248 // address is allocated. |
244 bool enable_localhost_ice_candidate; | 249 bool enable_localhost_ice_candidate; |
245 BundlePolicy bundle_policy; | 250 BundlePolicy bundle_policy; |
246 RtcpMuxPolicy rtcp_mux_policy; | 251 RtcpMuxPolicy rtcp_mux_policy; |
247 TcpCandidatePolicy tcp_candidate_policy; | 252 TcpCandidatePolicy tcp_candidate_policy; |
248 int audio_jitter_buffer_max_packets; | 253 int audio_jitter_buffer_max_packets; |
249 bool audio_jitter_buffer_fast_accelerate; | 254 bool audio_jitter_buffer_fast_accelerate; |
255 int ice_connection_receiving_timeout; | |
250 std::vector<rtc::scoped_refptr<rtc::RTCCertificate>> certificates; | 256 std::vector<rtc::scoped_refptr<rtc::RTCCertificate>> certificates; |
251 | 257 |
252 RTCConfiguration() | 258 RTCConfiguration() |
253 : type(kAll), | 259 : type(kAll), |
254 enable_localhost_ice_candidate(false), | 260 enable_localhost_ice_candidate(false), |
255 bundle_policy(kBundlePolicyBalanced), | 261 bundle_policy(kBundlePolicyBalanced), |
256 rtcp_mux_policy(kRtcpMuxPolicyNegotiate), | 262 rtcp_mux_policy(kRtcpMuxPolicyNegotiate), |
257 tcp_candidate_policy(kTcpCandidatePolicyEnabled), | 263 tcp_candidate_policy(kTcpCandidatePolicyEnabled), |
258 audio_jitter_buffer_max_packets(50), | 264 audio_jitter_buffer_max_packets(kAudioJitterBufferMaxPackets), |
259 audio_jitter_buffer_fast_accelerate(false) {} | 265 audio_jitter_buffer_fast_accelerate(false), |
266 ice_connection_receiving_timeout(kIceConnectionReceivingTimeout) {} | |
260 }; | 267 }; |
261 | 268 |
262 struct RTCOfferAnswerOptions { | 269 struct RTCOfferAnswerOptions { |
263 static const int kUndefined = -1; | 270 static const int kUndefined = -1; |
264 static const int kMaxOfferToReceiveMedia = 1; | 271 static const int kMaxOfferToReceiveMedia = 1; |
265 | 272 |
266 // The default value for constraint offerToReceiveX:true. | 273 // The default value for constraint offerToReceiveX:true. |
267 static const int kOfferToReceiveMediaTrue = 1; | 274 static const int kOfferToReceiveMediaTrue = 1; |
268 | 275 |
269 int offer_to_receive_video; | 276 int offer_to_receive_video; |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
351 // Sets the local session description. | 358 // Sets the local session description. |
352 // JsepInterface takes the ownership of |desc| even if it fails. | 359 // JsepInterface takes the ownership of |desc| even if it fails. |
353 // The |observer| callback will be called when done. | 360 // The |observer| callback will be called when done. |
354 virtual void SetLocalDescription(SetSessionDescriptionObserver* observer, | 361 virtual void SetLocalDescription(SetSessionDescriptionObserver* observer, |
355 SessionDescriptionInterface* desc) = 0; | 362 SessionDescriptionInterface* desc) = 0; |
356 // Sets the remote session description. | 363 // Sets the remote session description. |
357 // JsepInterface takes the ownership of |desc| even if it fails. | 364 // JsepInterface takes the ownership of |desc| even if it fails. |
358 // The |observer| callback will be called when done. | 365 // The |observer| callback will be called when done. |
359 virtual void SetRemoteDescription(SetSessionDescriptionObserver* observer, | 366 virtual void SetRemoteDescription(SetSessionDescriptionObserver* observer, |
360 SessionDescriptionInterface* desc) = 0; | 367 SessionDescriptionInterface* desc) = 0; |
361 // Sets the ICE connection receiving timeout value in milliseconds. | |
362 virtual void SetIceConnectionReceivingTimeout(int timeout_ms) {} | |
363 // Restarts or updates the ICE Agent process of gathering local candidates | 368 // Restarts or updates the ICE Agent process of gathering local candidates |
364 // and pinging remote candidates. | 369 // and pinging remote candidates. |
365 virtual bool UpdateIce(const IceServers& configuration, | 370 virtual bool UpdateIce(const IceServers& configuration, |
366 const MediaConstraintsInterface* constraints) = 0; | 371 const MediaConstraintsInterface* constraints) = 0; |
367 // Provides a remote candidate to the ICE Agent. | 372 // Provides a remote candidate to the ICE Agent. |
368 // A copy of the |candidate| will be created and added to the remote | 373 // A copy of the |candidate| will be created and added to the remote |
369 // description. So the caller of this method still has the ownership of the | 374 // description. So the caller of this method still has the ownership of the |
370 // |candidate|. | 375 // |candidate|. |
371 // TODO(ronghuawu): Consider to change this so that the AddIceCandidate will | 376 // TODO(ronghuawu): Consider to change this so that the AddIceCandidate will |
372 // take the ownership of the |candidate|. | 377 // take the ownership of the |candidate|. |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
601 CreatePeerConnectionFactory( | 606 CreatePeerConnectionFactory( |
602 rtc::Thread* worker_thread, | 607 rtc::Thread* worker_thread, |
603 rtc::Thread* signaling_thread, | 608 rtc::Thread* signaling_thread, |
604 AudioDeviceModule* default_adm, | 609 AudioDeviceModule* default_adm, |
605 cricket::WebRtcVideoEncoderFactory* encoder_factory, | 610 cricket::WebRtcVideoEncoderFactory* encoder_factory, |
606 cricket::WebRtcVideoDecoderFactory* decoder_factory); | 611 cricket::WebRtcVideoDecoderFactory* decoder_factory); |
607 | 612 |
608 } // namespace webrtc | 613 } // namespace webrtc |
609 | 614 |
610 #endif // TALK_APP_WEBRTC_PEERCONNECTIONINTERFACE_H_ | 615 #endif // TALK_APP_WEBRTC_PEERCONNECTIONINTERFACE_H_ |
OLD | NEW |