MCPcopy Create free account
hub / github.com/GrowthEase/LLS-Player / SetAnswer

Method SetAnswer

src/rtd/src/rtd_engine_impl.cpp:281–303  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

279}
280
281bool 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
305void RtdEngineImpl::ParseStreamInfo(SessionDescriptionInterface* session_description) {
306 cricket::SessionDescription* sdec = session_description->description();

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected