diff options
author | mallinath@webrtc.org <mallinath@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d> | 2011-10-05 22:49:59 +0000 |
---|---|---|
committer | mallinath@webrtc.org <mallinath@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d> | 2011-10-05 22:49:59 +0000 |
commit | fa41d807a8e6732a7e9f6c92ce82f0c317e8e9d5 (patch) | |
tree | 1f721220415635e95a017fd0245edda58a701537 /third_party_mods | |
parent | 01ca01f6e6ccce68e172f25038f5a54c435e0762 (diff) | |
download | webrtc-fa41d807a8e6732a7e9f6c92ce82f0c317e8e9d5.tar.gz |
Fixes session state transition and registering observer.
Review URL: http://webrtc-codereview.appspot.com/203001
git-svn-id: http://webrtc.googlecode.com/svn/trunk@697 4adac7df-926f-26a2-2b94-8c16560cd09d
Diffstat (limited to 'third_party_mods')
-rw-r--r-- | third_party_mods/libjingle/source/talk/app/webrtc_dev/peerconnectionimpl.cc | 2 | ||||
-rw-r--r-- | third_party_mods/libjingle/source/talk/app/webrtc_dev/webrtcsession.cc | 26 |
2 files changed, 15 insertions, 13 deletions
diff --git a/third_party_mods/libjingle/source/talk/app/webrtc_dev/peerconnectionimpl.cc b/third_party_mods/libjingle/source/talk/app/webrtc_dev/peerconnectionimpl.cc index 5b5a98c713..e2afef016e 100644 --- a/third_party_mods/libjingle/source/talk/app/webrtc_dev/peerconnectionimpl.cc +++ b/third_party_mods/libjingle/source/talk/app/webrtc_dev/peerconnectionimpl.cc @@ -149,6 +149,8 @@ PeerConnectionImpl::PeerConnectionImpl( this, &PeerConnectionImpl::OnRemoteStreamAdded); signaling_->SignalRemoteStreamRemoved.connect( this, &PeerConnectionImpl::OnRemoteStreamRemoved); + // Register with WebRtcSession + session_->RegisterObserver(signaling_.get()); } PeerConnectionImpl::~PeerConnectionImpl() { diff --git a/third_party_mods/libjingle/source/talk/app/webrtc_dev/webrtcsession.cc b/third_party_mods/libjingle/source/talk/app/webrtc_dev/webrtcsession.cc index 4b7863d540..3bcab1430b 100644 --- a/third_party_mods/libjingle/source/talk/app/webrtc_dev/webrtcsession.cc +++ b/third_party_mods/libjingle/source/talk/app/webrtc_dev/webrtcsession.cc @@ -131,7 +131,8 @@ void WebRtcSession::SetRemoteCandidates( cricket::TransportProxy* audio_proxy = GetTransportProxy(cricket::CN_AUDIO); if (audio_proxy) { // CompleteNegotiation will set actual impl's in Proxy. - audio_proxy->CompleteNegotiation(); + if (!audio_proxy->negotiated()) + audio_proxy->CompleteNegotiation(); // TODO(mallinath) - Add a interface to TransportProxy to accept // remote candidate list. audio_proxy->impl()->OnRemoteCandidates(audio_candidates); @@ -144,7 +145,8 @@ void WebRtcSession::SetRemoteCandidates( cricket::TransportProxy* video_proxy = GetTransportProxy(cricket::CN_VIDEO); if (video_proxy) { // CompleteNegotiation will set actual impl's in Proxy. - video_proxy->CompleteNegotiation(); + if (!video_proxy->negotiated()) + video_proxy->CompleteNegotiation(); // TODO(mallinath) - Add a interface to TransportProxy to accept // remote candidate list. video_proxy->impl()->OnRemoteCandidates(video_candidates); @@ -278,15 +280,17 @@ const cricket::SessionDescription* WebRtcSession::ProvideAnswer( } void WebRtcSession::NegotiationDone() { - // No state change after state moved to progress state. + // SetState of session is called after session receives both local and + // remote descriptions. State transition will happen only when session + // is in INIT state. if (state() == STATE_INIT) { SetState(STATE_SENTINITIATE); SetState(STATE_RECEIVEDACCEPT); - } - // Enabling channels - voice_channel_->Enable(true); - video_channel_->Enable(true); + // Enabling voice and video channel. + voice_channel_->Enable(true); + video_channel_->Enable(true); + } const cricket::ContentInfo* audio_info = cricket::GetFirstAudioContent(local_description()); @@ -298,9 +302,7 @@ void WebRtcSession::NegotiationDone() { // we can remove stream from a session by muting it. // TODO(mallinath) - Change needed when multiple send streams support // is available. - if (audio_content->sources().size() == 0) { - voice_channel_->Mute(true); - } + voice_channel_->Mute(audio_content->sources().size() == 0); } const cricket::ContentInfo* video_info = @@ -313,9 +315,7 @@ void WebRtcSession::NegotiationDone() { // we can remove stream from a session by muting it. // TODO(mallinath) - Change needed when multiple send streams support // is available. - if (video_content->sources().size() == 0) { - video_channel_->Mute(true); - } + video_channel_->Mute(video_content->sources().size() == 0); } } |