MCPcopy Create free account
hub / github.com/RGAA-Software/GoDesk / SendIceToRemote

Method SendIceToRemote

src/render/plugins/plugin_event_router.cpp:198–221  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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]() {

Callers 1

ProcessPluginEventMethod · 0.95

Calls 4

VisitNetPluginsMethod · 0.80
GetPluginIdMethod · 0.45
PostProtoMessageMethod · 0.45

Tested by

no test coverage detected