| 279 | } |
| 280 | |
| 281 | bool RtdEngineImpl::SetAnswer(const std::string& answer_sdp) { |
| 282 | if (!signaling_thread_->IsCurrent()) { |
| 283 | return signaling_thread_->Invoke<bool>(RTC_FROM_HERE, [this, &answer_sdp] { return SetAnswer(answer_sdp); }); |
| 284 | } |
| 285 | RTC_LOG(LS_INFO) << "RtcEngineImpl::SetAnswer() sdp:" << answer_sdp; |
| 286 | if (!peer_connection_) { |
| 287 | RTC_LOG(LS_ERROR) << "peerconnection is nullptr."; |
| 288 | return false; |
| 289 | } |
| 290 | SdpParseError error; |
| 291 | SessionDescriptionInterface* session_description = |
| 292 | CreateSessionDescription(SessionDescriptionInterface::kAnswer, answer_sdp, &error); |
| 293 | if (!session_description) { |
| 294 | RTC_LOG(LS_ERROR) << "create answer description failed."; |
| 295 | return false; |
| 296 | } |
| 297 | |
| 298 | ParseStreamInfo(session_description); |
| 299 | |
| 300 | RTC_LOG(LS_INFO) << "RtcEngineImpl::SetRemoteDescription()"; |
| 301 | peer_connection_->SetRemoteDescription(RtcSetRemoteSessionDescriptionObserver::Create(), session_description); |
| 302 | return true; |
| 303 | } |
| 304 | |
| 305 | void RtdEngineImpl::ParseStreamInfo(SessionDescriptionInterface* session_description) { |
| 306 | cricket::SessionDescription* sdec = session_description->description(); |
nothing calls this directly
no outgoing calls
no test coverage detected