| 173 | } |
| 174 | |
| 175 | void PluginEventRouter::SendAnswerSdpToRemote(const std::shared_ptr<GrPluginBaseEvent>& event) { |
| 176 | auto target_event = std::dynamic_pointer_cast<GrPluginRtcAnswerSdpEvent>(event); |
| 177 | auto stream_id = target_event->stream_id_; |
| 178 | |
| 179 | tc::Message pt_msg; |
| 180 | pt_msg.set_type(MessageType::kSigAnswerSdpMessage); |
| 181 | auto sub = pt_msg.mutable_sig_answer_sdp(); |
| 182 | sub->set_sdp(target_event->sdp_); |
| 183 | auto msg = ProtoAsData(&pt_msg); |
| 184 | |
| 185 | plugin_manager_->VisitNetPlugins([=, this](GrNetPlugin* plugin) { |
| 186 | if (plugin->GetPluginId() == kRelayPluginId) { |
| 187 | if (stream_id.empty()) { |
| 188 | plugin->PostProtoMessage(msg, true); |
| 189 | } |
| 190 | else { |
| 191 | plugin->PostTargetStreamProtoMessage(stream_id, msg, true); |
| 192 | } |
| 193 | LOGI("Send SDP by relay: {}", stream_id); |
| 194 | } |
| 195 | }); |
| 196 | } |
| 197 | |
| 198 | void PluginEventRouter::SendIceToRemote(const std::shared_ptr<GrPluginBaseEvent>& event) { |
| 199 | auto target_event = std::dynamic_pointer_cast<GrPluginRtcIceEvent>(event); |
no test coverage detected