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 743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
754 } | 754 } |
755 | 755 |
756 void WebRtcSession::SetSdesPolicy(cricket::SecurePolicy secure_policy) { | 756 void WebRtcSession::SetSdesPolicy(cricket::SecurePolicy secure_policy) { |
757 webrtc_session_desc_factory_->SetSdesPolicy(secure_policy); | 757 webrtc_session_desc_factory_->SetSdesPolicy(secure_policy); |
758 } | 758 } |
759 | 759 |
760 cricket::SecurePolicy WebRtcSession::SdesPolicy() const { | 760 cricket::SecurePolicy WebRtcSession::SdesPolicy() const { |
761 return webrtc_session_desc_factory_->SdesPolicy(); | 761 return webrtc_session_desc_factory_->SdesPolicy(); |
762 } | 762 } |
763 | 763 |
764 bool WebRtcSession::GetSslRole(rtc::SSLRole* role) { | 764 bool WebRtcSession::GetSslRole(const std::string& transport_name, |
765 rtc::SSLRole* role) { | |
765 if (!local_desc_ || !remote_desc_) { | 766 if (!local_desc_ || !remote_desc_) { |
766 LOG(LS_INFO) << "Local and Remote descriptions must be applied to get " | 767 LOG(LS_INFO) << "Local and Remote descriptions must be applied to get " |
767 << "SSL Role of the session."; | 768 << "SSL Role of the session."; |
768 return false; | 769 return false; |
769 } | 770 } |
770 | 771 |
771 return transport_controller_->GetSslRole(role); | 772 return transport_controller_->GetSslRole(transport_name, role); |
772 } | 773 } |
773 | 774 |
774 void WebRtcSession::CreateOffer( | 775 void WebRtcSession::CreateOffer( |
775 CreateSessionDescriptionObserver* observer, | 776 CreateSessionDescriptionObserver* observer, |
776 const PeerConnectionInterface::RTCOfferAnswerOptions& options, | 777 const PeerConnectionInterface::RTCOfferAnswerOptions& options, |
777 const cricket::MediaSessionOptions& session_options) { | 778 const cricket::MediaSessionOptions& session_options) { |
778 webrtc_session_desc_factory_->CreateOffer(observer, options, session_options); | 779 webrtc_session_desc_factory_->CreateOffer(observer, options, session_options); |
779 } | 780 } |
780 | 781 |
781 void WebRtcSession::CreateAnswer( | 782 void WebRtcSession::CreateAnswer( |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
963 EnableChannels(); | 964 EnableChannels(); |
964 SetState(source == cricket::CS_LOCAL ? STATE_SENTPRANSWER | 965 SetState(source == cricket::CS_LOCAL ? STATE_SENTPRANSWER |
965 : STATE_RECEIVEDPRANSWER); | 966 : STATE_RECEIVEDPRANSWER); |
966 if (!PushdownMediaDescription(cricket::CA_PRANSWER, source, err_desc)) { | 967 if (!PushdownMediaDescription(cricket::CA_PRANSWER, source, err_desc)) { |
967 SetError(ERROR_CONTENT, *err_desc); | 968 SetError(ERROR_CONTENT, *err_desc); |
968 } | 969 } |
969 if (error() != ERROR_NONE) { | 970 if (error() != ERROR_NONE) { |
970 return BadPranswerSdp(source, GetSessionErrorMsg(), err_desc); | 971 return BadPranswerSdp(source, GetSessionErrorMsg(), err_desc); |
971 } | 972 } |
972 } else if (action == kAnswer) { | 973 } else if (action == kAnswer) { |
973 if (!PushdownTransportDescription(source, cricket::CA_ANSWER, &td_err)) { | |
974 return BadAnswerSdp(source, MakeTdErrorString(td_err), err_desc); | |
975 } | |
976 const cricket::ContentGroup* local_bundle = | 974 const cricket::ContentGroup* local_bundle = |
977 local_desc_->description()->GetGroupByName(cricket::GROUP_TYPE_BUNDLE); | 975 local_desc_->description()->GetGroupByName(cricket::GROUP_TYPE_BUNDLE); |
978 const cricket::ContentGroup* remote_bundle = | 976 const cricket::ContentGroup* remote_bundle = |
979 remote_desc_->description()->GetGroupByName(cricket::GROUP_TYPE_BUNDLE); | 977 remote_desc_->description()->GetGroupByName(cricket::GROUP_TYPE_BUNDLE); |
980 if (local_bundle && remote_bundle) { | 978 if (local_bundle && remote_bundle) { |
981 // The answerer decides the transport to bundle on | 979 // The answerer decides the transport to bundle on. |
982 const cricket::ContentGroup* answer_bundle = | 980 const cricket::ContentGroup* answer_bundle = |
983 (source == cricket::CS_LOCAL ? local_bundle : remote_bundle); | 981 (source == cricket::CS_LOCAL ? local_bundle : remote_bundle); |
984 if (!EnableBundle(*answer_bundle)) { | 982 if (!EnableBundle(*answer_bundle)) { |
985 LOG(LS_WARNING) << "Failed to enable BUNDLE."; | 983 LOG(LS_WARNING) << "Failed to enable BUNDLE."; |
986 return BadAnswerSdp(source, kEnableBundleFailed, err_desc); | 984 return BadAnswerSdp(source, kEnableBundleFailed, err_desc); |
987 } | 985 } |
988 } | 986 } |
987 if (!PushdownTransportDescription(source, cricket::CA_ANSWER, &td_err)) { | |
988 return BadAnswerSdp(source, MakeTdErrorString(td_err), err_desc); | |
989 } | |
pthatcher1
2016/01/07 21:12:03
What effect does moving this down have? Can you l
Taylor Brandstetter
2016/01/07 22:25:55
If somehow the DTLS roles were "active" for audio
| |
989 EnableChannels(); | 990 EnableChannels(); |
990 SetState(STATE_INPROGRESS); | 991 SetState(STATE_INPROGRESS); |
991 if (!PushdownMediaDescription(cricket::CA_ANSWER, source, err_desc)) { | 992 if (!PushdownMediaDescription(cricket::CA_ANSWER, source, err_desc)) { |
992 SetError(ERROR_CONTENT, *err_desc); | 993 SetError(ERROR_CONTENT, *err_desc); |
993 } | 994 } |
994 if (error() != ERROR_NONE) { | 995 if (error() != ERROR_NONE) { |
995 return BadAnswerSdp(source, GetSessionErrorMsg(), err_desc); | 996 return BadAnswerSdp(source, GetSessionErrorMsg(), err_desc); |
996 } | 997 } |
997 } | 998 } |
998 return true; | 999 return true; |
(...skipping 1197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2196 } | 2197 } |
2197 } | 2198 } |
2198 | 2199 |
2199 void WebRtcSession::OnSentPacket_w(cricket::TransportChannel* channel, | 2200 void WebRtcSession::OnSentPacket_w(cricket::TransportChannel* channel, |
2200 const rtc::SentPacket& sent_packet) { | 2201 const rtc::SentPacket& sent_packet) { |
2201 RTC_DCHECK(worker_thread()->IsCurrent()); | 2202 RTC_DCHECK(worker_thread()->IsCurrent()); |
2202 media_controller_->call_w()->OnSentPacket(sent_packet); | 2203 media_controller_->call_w()->OnSentPacket(sent_packet); |
2203 } | 2204 } |
2204 | 2205 |
2205 } // namespace webrtc | 2206 } // namespace webrtc |
OLD | NEW |