 |
ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
|
Go to the documentation of this file.
18 namespace visualization {
19 namespace webrtc_server {
39 static std::shared_ptr<WebRTCWindowSystem>
GetInstance();
91 const std::string& class_name,
92 const std::function<std::string(
const std::string&)>
callback);
95 void OnFrame(
const std::string& window_uid,
96 const std::shared_ptr<core::Tensor>& im);
120 std::string
CallHttpAPI(
const std::string& entry_point,
121 const std::string& query_string =
"",
122 const std::string&
data =
"")
const;
139 std::unique_ptr<Impl> impl_;
static std::string GetCustomSTUNServer()
Definition: WebRTCWindowSystem.cpp:63
Generic file read and write utility for python interface.
Definition: CloudViewerConfig.cpp:12
void SetWindowSize(OSWindow w, int width, int height) override
Definition: BitmapWindowSystem.cpp:247
bool FromJson(const Json::Value &value)
Definition: Events.cpp:70
std::string CallHttpAPI(const std::string &entry_point, const std::string &query_string="", const std::string &data="") const
Call PeerConnectionManager's web request API.
Definition: WebRTCWindowSystem.cpp:421
std::string http_address_
Definition: WebRTCWindowSystem.cpp:97
static const std::list< std::string > s_cloudViewer_ice_servers
Definition: WebRTCWindowSystem.cpp:43
void SplitString(std::vector< std::string > &tokens, const std::string &str, const std::string &delimiters=" ", bool trim_empty_str=true)
Definition: Helper.cpp:197
void SendInitFrames(const std::string &window_uid)
Definition: WebRTCWindowSystem.cpp:407
void OnFrame(const std::string &window_uid, const std::shared_ptr< core::Tensor > &im)
Server -> client frame.
Definition: WebRTCWindowSystem.cpp:402
Json::Value StringToJson(const std::string &json_str)
Parse string and conver to Json::value. Throws exception if the conversion is invalid.
Definition: IJsonConvertible.cpp:21
filament::Texture::InternalFormat format
Definition: FilamentResourceManager.cpp:181
GraphType data
Definition: graph_cut.cc:138
static std::string GetEnvWebRTCIP()
Definition: WebRTCWindowSystem.cpp:71
std::unordered_map< WebRTCWindowSystem::OSWindow, std::string > os_window_to_uid_
Definition: WebRTCWindowSystem.cpp:89
std::function< Json::Value(const struct mg_request_info *req_info, const Json::Value &)> HttpFunction
Definition: HttpServerRequestHandler.h:35
void CloseWindowConnections(const std::string &window_uid)
Close all WebRTC connections that correspond to a Window.
Definition: WebRTCWindowSystem.cpp:497
void PostMouseEvent(OSWindow w, const MouseEvent &e)
Definition: BitmapWindowSystem.cpp:209
std::string OnDataChannelMessage(const std::string &message)
Definition: WebRTCWindowSystem.cpp:357
OSWindow GetOSWindowByUID(const std::string &uid) const
Definition: WebRTCWindowSystem.cpp:245
core::Tensor result
Definition: VtkUtils.cpp:76
int width
Definition: FileIOFactory.cpp:142
void DestroyWindow(OSWindow w) override
Definition: WebRTCWindowSystem.cpp:220
int height
Definition: FileIOFactory.cpp:143
std::unique_ptr< PeerConnectionManager > peer_connection_manager_
Definition: WebRTCWindowSystem.cpp:102
const double * e
Definition: essential_matrix_poly.h:10
#define LogDebug(...)
Definition: Logging.h:90
static Application & GetInstance()
Definition: Application.cpp:179
void PostRedrawEvent(OSWindow w) override
Definition: BitmapWindowSystem.cpp:204
static const std::list< std::string > s_public_ice_servers
Definition: WebRTCWindowSystem.cpp:38
std::function< void(std::shared_ptr< core::Tensor >)> callback
Definition: FilamentRenderer.cpp:183
static std::shared_ptr< WebRTCWindowSystem > GetInstance()
Definition: WebRTCWindowSystem.cpp:111
WindowSystem::OSWindow GetOSWindow() const
Definition: Window.cpp:701
std::string GetWindowUID(OSWindow w) const
Definition: WebRTCWindowSystem.cpp:236
Definition: BitmapWindowSystem.h:28
std::unordered_map< std::string, std::function< std::string(std::string)> > data_channel_message_callbacks_
Definition: WebRTCWindowSystem.cpp:108
#define LogError(...)
Definition: Logging.h:60
void StartWebRTCServer()
Start WebRTC server in a background thread.
Definition: WebRTCWindowSystem.cpp:257
std::string GenerateUID()
Definition: WebRTCWindowSystem.cpp:90
Definition: HttpServerRequestHandler.h:31
bool http_handshake_enabled_
Definition: WebRTCWindowSystem.cpp:96
#define LogInfo(...)
Definition: Logging.h:81
void SetWindowSystem(std::shared_ptr< WindowSystem > ws)
Definition: Application.cpp:349
int count
Definition: FileIOFactory.cpp:132
void RegisterDataChannelMessageCallback(const std::string &class_name, const std::function< std::string(const std::string &)> callback)
Definition: WebRTCWindowSystem.cpp:393
void EnableWebRTC()
Definition: WebRTCWindowSystem.cpp:487
static std::string GetEnvWebRTCPort()
Definition: WebRTCWindowSystem.cpp:79
#define LogWarning(...)
Definition: Logging.h:72
WebRTCWindowSystem is a BitmapWindowSystem with a WebRTC server that sends video frames to remote cli...
Definition: WebRTCWindowSystem.h:37
virtual ~WebRTCWindowSystem()
Definition: WebRTCWindowSystem.cpp:199
Window * o3d_window
Definition: BitmapWindowSystem.cpp:30
static vtkPVTrivialProducerStaticInternal Value
Definition: vtkDistributedTrivialProducer.cxx:65
OSWindow CreateOSWindow(gui::Window *o3d_window, int width, int height, const char *title, int flags) override
Definition: WebRTCWindowSystem.cpp:204
std::string web_root_
Definition: WebRTCWindowSystem.cpp:98
std::thread webrtc_thread_
Definition: WebRTCWindowSystem.cpp:104
std::vector< std::string > GetWindowUIDs() const
List available windows.
Definition: WebRTCWindowSystem.cpp:228
std::string to_string(const T &n)
Definition: Common.h:20
std::string JsonToString(const Json::Value &json)
Serialize a Json::Value to a string.
Definition: IJsonConvertible.cpp:33
void SetOnWindowDraw(OnDrawCallback callback)
Definition: BitmapWindowSystem.cpp:150
bool sever_started_
Definition: WebRTCWindowSystem.cpp:105
Definition: WebRTCWindowSystem.cpp:87
void * OSWindow
Definition: WindowSystem.h:29
void DisableHttpHandshake()
Definition: WebRTCWindowSystem.cpp:492