| 196 | } |
| 197 | |
| 198 | void PluginEventRouter::SendIceToRemote(const std::shared_ptr<GrPluginBaseEvent>& event) { |
| 199 | auto target_event = std::dynamic_pointer_cast<GrPluginRtcIceEvent>(event); |
| 200 | auto stream_id = target_event->stream_id_; |
| 201 | |
| 202 | tc::Message pt_msg; |
| 203 | pt_msg.set_type(MessageType::kSigIceMessage); |
| 204 | auto sub = pt_msg.mutable_sig_ice(); |
| 205 | sub->set_ice(target_event->ice_); |
| 206 | sub->set_mid(target_event->mid_); |
| 207 | sub->set_sdp_mline_index(target_event->sdp_mline_index_); |
| 208 | auto msg = ProtoAsData(&pt_msg);//.SerializeAsString(); |
| 209 | |
| 210 | plugin_manager_->VisitNetPlugins([=, this](GrNetPlugin* plugin) { |
| 211 | if (plugin->GetPluginId() == kRelayPluginId) { |
| 212 | if (stream_id.empty()) { |
| 213 | plugin->PostProtoMessage(msg, true); |
| 214 | } |
| 215 | else { |
| 216 | plugin->PostTargetStreamProtoMessage(stream_id, msg, true); |
| 217 | } |
| 218 | LOGI("Send ICE by relay: {}", target_event->ice_); |
| 219 | } |
| 220 | }); |
| 221 | } |
| 222 | |
| 223 | void PluginEventRouter::ReportFileTransferBegin(const std::shared_ptr<GrPluginFileTransferBegin>& event) { |
| 224 | app_->PostGlobalTask([=, this]() { |
no test coverage detected