Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(78)

Side by Side Diff: talk/app/webrtc/webrtcsession.h

Issue 1207563002: Add flakiness check if there is no received packets in a certain period. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Changing method names Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 extern const char kDtlsSetupFailureRtcp[]; 77 extern const char kDtlsSetupFailureRtcp[];
78 // Maximum number of received video streams that will be processed by webrtc 78 // Maximum number of received video streams that will be processed by webrtc
79 // even if they are not signalled beforehand. 79 // even if they are not signalled beforehand.
80 extern const int kMaxUnsignalledRecvStreams; 80 extern const int kMaxUnsignalledRecvStreams;
81 81
82 // ICE state callback interface. 82 // ICE state callback interface.
83 class IceObserver { 83 class IceObserver {
84 public: 84 public:
85 IceObserver() {} 85 IceObserver() {}
86 // Called any time the IceConnectionState changes 86 // Called any time the IceConnectionState changes
87 // TODO(honghaiz): Change the name to OnIceConnectionStateChange so as to
88 // conform to the w3c standard.
pthatcher1 2015/07/06 22:04:47 Just one TODO is sufficient. You can remove this
honghaiz3 2015/08/05 23:56:57 I kept this one and removed the other one because
87 virtual void OnIceConnectionChange( 89 virtual void OnIceConnectionChange(
88 PeerConnectionInterface::IceConnectionState new_state) {} 90 PeerConnectionInterface::IceConnectionState new_state) {}
89 // Called any time the IceGatheringState changes 91 // Called any time the IceGatheringState changes
90 virtual void OnIceGatheringChange( 92 virtual void OnIceGatheringChange(
91 PeerConnectionInterface::IceGatheringState new_state) {} 93 PeerConnectionInterface::IceGatheringState new_state) {}
92 // New Ice candidate have been found. 94 // New Ice candidate have been found.
93 virtual void OnIceCandidate(const IceCandidateInterface* candidate) = 0; 95 virtual void OnIceCandidate(const IceCandidateInterface* candidate) = 0;
94 // All Ice candidates have been found. 96 // All Ice candidates have been found.
95 // TODO(bemasc): Remove this once callers transition to OnIceGatheringChange. 97 // TODO(bemasc): Remove this once callers transition to OnIceGatheringChange.
96 // (via PeerConnectionObserver) 98 // (via PeerConnectionObserver)
97 virtual void OnIceComplete() {} 99 virtual void OnIceComplete() {}
98 100
101 // Called anytime when all ICE transport channels started not receiving
102 // packets or at least one channel changes back.
pthatcher1 2015/07/06 22:04:47 Might be more clear with something like: "Called
honghaiz3 2015/08/05 23:56:57 Maybe enough just with the last sentence.
103 virtual void OnIceConnectionReceivingChange(bool receiving) {}
104
99 protected: 105 protected:
100 ~IceObserver() {} 106 ~IceObserver() {}
101 107
102 private: 108 private:
103 DISALLOW_COPY_AND_ASSIGN(IceObserver); 109 DISALLOW_COPY_AND_ASSIGN(IceObserver);
104 }; 110 };
105 111
106 class WebRtcSession : public cricket::BaseSession, 112 class WebRtcSession : public cricket::BaseSession,
107 public AudioProviderInterface, 113 public AudioProviderInterface,
108 public DataChannelFactory, 114 public DataChannelFactory,
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 // Transport related callbacks, override from cricket::BaseSession. 297 // Transport related callbacks, override from cricket::BaseSession.
292 virtual void OnTransportRequestSignaling(cricket::Transport* transport); 298 virtual void OnTransportRequestSignaling(cricket::Transport* transport);
293 virtual void OnTransportConnecting(cricket::Transport* transport); 299 virtual void OnTransportConnecting(cricket::Transport* transport);
294 virtual void OnTransportWritable(cricket::Transport* transport); 300 virtual void OnTransportWritable(cricket::Transport* transport);
295 virtual void OnTransportCompleted(cricket::Transport* transport); 301 virtual void OnTransportCompleted(cricket::Transport* transport);
296 virtual void OnTransportFailed(cricket::Transport* transport); 302 virtual void OnTransportFailed(cricket::Transport* transport);
297 virtual void OnTransportProxyCandidatesReady( 303 virtual void OnTransportProxyCandidatesReady(
298 cricket::TransportProxy* proxy, 304 cricket::TransportProxy* proxy,
299 const cricket::Candidates& candidates); 305 const cricket::Candidates& candidates);
300 virtual void OnCandidatesAllocationDone(); 306 virtual void OnCandidatesAllocationDone();
307 void OnTransportReceiving(cricket::Transport* transport) override;
301 308
302 // Enables media channels to allow sending of media. 309 // Enables media channels to allow sending of media.
303 void EnableChannels(); 310 void EnableChannels();
304 // Creates a JsepIceCandidate and adds it to the local session description 311 // Creates a JsepIceCandidate and adds it to the local session description
305 // and notify observers. Called when a new local candidate have been found. 312 // and notify observers. Called when a new local candidate have been found.
306 void ProcessNewLocalCandidate(const std::string& content_name, 313 void ProcessNewLocalCandidate(const std::string& content_name,
307 const cricket::Candidates& candidates); 314 const cricket::Candidates& candidates);
308 // Returns the media index for a local ice candidate given the content name. 315 // Returns the media index for a local ice candidate given the content name.
309 // Returns false if the local session description does not have a media 316 // Returns false if the local session description does not have a media
310 // content called |content_name|. 317 // content called |content_name|.
(...skipping 24 matching lines...) Expand all
335 void CopySavedCandidates(SessionDescriptionInterface* dest_desc); 342 void CopySavedCandidates(SessionDescriptionInterface* dest_desc);
336 343
337 // Listens to SCTP CONTROL messages on unused SIDs and process them as OPEN 344 // Listens to SCTP CONTROL messages on unused SIDs and process them as OPEN
338 // messages. 345 // messages.
339 void OnDataChannelMessageReceived(cricket::DataChannel* channel, 346 void OnDataChannelMessageReceived(cricket::DataChannel* channel,
340 const cricket::ReceiveDataParams& params, 347 const cricket::ReceiveDataParams& params,
341 const rtc::Buffer& payload); 348 const rtc::Buffer& payload);
342 349
343 std::string BadStateErrMsg(State state); 350 std::string BadStateErrMsg(State state);
344 void SetIceConnectionState(PeerConnectionInterface::IceConnectionState state); 351 void SetIceConnectionState(PeerConnectionInterface::IceConnectionState state);
352 void SetIceConnectionReceiving(bool receiving);
345 353
346 bool ValidateBundleSettings(const cricket::SessionDescription* desc); 354 bool ValidateBundleSettings(const cricket::SessionDescription* desc);
347 bool HasRtcpMuxEnabled(const cricket::ContentInfo* content); 355 bool HasRtcpMuxEnabled(const cricket::ContentInfo* content);
348 // Below methods are helper methods which verifies SDP. 356 // Below methods are helper methods which verifies SDP.
349 bool ValidateSessionDescription(const SessionDescriptionInterface* sdesc, 357 bool ValidateSessionDescription(const SessionDescriptionInterface* sdesc,
350 cricket::ContentSource source, 358 cricket::ContentSource source,
351 std::string* err_desc); 359 std::string* err_desc);
352 360
353 // Check if a call to SetLocalDescription is acceptable with |action|. 361 // Check if a call to SetLocalDescription is acceptable with |action|.
354 bool ExpectSetLocalDescription(Action action); 362 bool ExpectSetLocalDescription(Action action);
(...skipping 19 matching lines...) Expand all
374 382
375 void ReportNegotiatedCiphers(const cricket::TransportStats& stats); 383 void ReportNegotiatedCiphers(const cricket::TransportStats& stats);
376 384
377 rtc::scoped_ptr<cricket::VoiceChannel> voice_channel_; 385 rtc::scoped_ptr<cricket::VoiceChannel> voice_channel_;
378 rtc::scoped_ptr<cricket::VideoChannel> video_channel_; 386 rtc::scoped_ptr<cricket::VideoChannel> video_channel_;
379 rtc::scoped_ptr<cricket::DataChannel> data_channel_; 387 rtc::scoped_ptr<cricket::DataChannel> data_channel_;
380 cricket::ChannelManager* channel_manager_; 388 cricket::ChannelManager* channel_manager_;
381 MediaStreamSignaling* mediastream_signaling_; 389 MediaStreamSignaling* mediastream_signaling_;
382 IceObserver* ice_observer_; 390 IceObserver* ice_observer_;
383 PeerConnectionInterface::IceConnectionState ice_connection_state_; 391 PeerConnectionInterface::IceConnectionState ice_connection_state_;
392 bool ice_connection_receiving_;
384 rtc::scoped_ptr<SessionDescriptionInterface> local_desc_; 393 rtc::scoped_ptr<SessionDescriptionInterface> local_desc_;
385 rtc::scoped_ptr<SessionDescriptionInterface> remote_desc_; 394 rtc::scoped_ptr<SessionDescriptionInterface> remote_desc_;
386 // Candidates that arrived before the remote description was set. 395 // Candidates that arrived before the remote description was set.
387 std::vector<IceCandidateInterface*> saved_candidates_; 396 std::vector<IceCandidateInterface*> saved_candidates_;
388 // If the remote peer is using a older version of implementation. 397 // If the remote peer is using a older version of implementation.
389 bool older_version_remote_peer_; 398 bool older_version_remote_peer_;
390 bool dtls_enabled_; 399 bool dtls_enabled_;
391 // Specifies which kind of data channel is allowed. This is controlled 400 // Specifies which kind of data channel is allowed. This is controlled
392 // by the chrome command-line flag and constraints: 401 // by the chrome command-line flag and constraints:
393 // 1. If chrome command-line switch 'enable-sctp-data-channels' is enabled, 402 // 1. If chrome command-line switch 'enable-sctp-data-channels' is enabled,
(...skipping 20 matching lines...) Expand all
414 PeerConnectionInterface::BundlePolicy bundle_policy_; 423 PeerConnectionInterface::BundlePolicy bundle_policy_;
415 424
416 // Declares the RTCP mux policy for the WebRTCSession. 425 // Declares the RTCP mux policy for the WebRTCSession.
417 PeerConnectionInterface::RtcpMuxPolicy rtcp_mux_policy_; 426 PeerConnectionInterface::RtcpMuxPolicy rtcp_mux_policy_;
418 427
419 DISALLOW_COPY_AND_ASSIGN(WebRtcSession); 428 DISALLOW_COPY_AND_ASSIGN(WebRtcSession);
420 }; 429 };
421 } // namespace webrtc 430 } // namespace webrtc
422 431
423 #endif // TALK_APP_WEBRTC_WEBRTCSESSION_H_ 432 #endif // TALK_APP_WEBRTC_WEBRTCSESSION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698