[feat] update MiniRTC api calling

This commit is contained in:
dijunkun committed 2025-12-19 18:22:34 +08:00
1 parent a967dc72d7
commit d337971de0
5 files changed
+20 -20

No files matched your search

+9 -9
View File
@@ -33,8 +33,8 @@ int Render::SendKeyCommand(int key_code, bool is_down) {
if (props->connection_status_ == ConnectionStatus::Connected) {
std::string msg = remote_action.to_json();
if (props->peer_) {
SendReliableDataFrame(props->peer_, msg.c_str(), msg.size(),
props->data_label_.c_str());
SendDataFrame(props->peer_, msg.c_str(), msg.size(),
props->data_label_.c_str());
}
}
}
@@ -104,8 +104,8 @@ int Render::ProcessMouseEvent(const SDL_Event& event) {
std::string msg = remote_action.to_json();
if (props->peer_) {
SendReliableDataFrame(props->peer_, msg.c_str(), msg.size(),
props->data_label_.c_str());
SendDataFrame(props->peer_, msg.c_str(), msg.size(),
props->data_label_.c_str());
}
} else if (SDL_EVENT_MOUSE_WHEEL == event.type &&
last_mouse_event.button.x >= props->stream_render_rect_.x &&
@@ -151,8 +151,8 @@ int Render::ProcessMouseEvent(const SDL_Event& event) {
std::string msg = remote_action.to_json();
if (props->peer_) {
SendReliableDataFrame(props->peer_, msg.c_str(), msg.size(),
props->data_label_.c_str());
SendDataFrame(props->peer_, msg.c_str(), msg.size(),
props->data_label_.c_str());
}
}
}
@@ -495,12 +495,12 @@ void Render::OnConnectionStatusCb(ConnectionStatus status, const char* user_id,
render->need_to_send_host_info_ = true;
render->start_screen_capturer_ = true;
render->start_speaker_capturer_ = true;
// #ifdef CROSSDESK_DEBUG
#ifdef CROSSDESK_DEBUG
render->start_mouse_controller_ = false;
render->start_keyboard_capturer_ = false;
// #else
#else
render->start_mouse_controller_ = true;
// #endif
#endif
if (std::all_of(render->connection_status_.begin(),
render->connection_status_.end(), [](const auto& kv) {
return kv.first.find("web") != std::string::npos;