[fix] move connection cleanup off the UI thread

This commit is contained in:
dijunkun
2026-09-07 10:54:18 +08:00
parent e0cd761bdc
commit fe1178e26f
19 changed files with 514 additions and 115 deletions
@@ -11,6 +11,7 @@
#include <string>
#include "minirtc.h"
#include "runtime/session_lifecycle.h"
namespace crossdesk {
@@ -21,6 +22,10 @@ class PeerEventHandler {
public:
explicit PeerEventHandler(GuiRuntime &owner);
bool IsActive() const { return callbacks_.IsActive(); }
auto EnterCallback() { return callbacks_.Enter(); }
void Deactivate() { callbacks_.Close(); }
static void OnReceiveVideoBuffer(const MiniRtcVideoFrame *video_frame,
const char *user_id, size_t user_id_size,
const char *src_id, size_t src_id_size,
@@ -49,6 +54,7 @@ private:
static void SendClientInfo(PeerPtr *peer, const std::string &client_id);
GuiRuntime &owner_;
gui_detail::SessionCallbackGate callbacks_;
};
} // namespace crossdesk