hl2ss icon indicating copy to clipboard operation
hl2ss copied to clipboard

cannot send Unity messages when getting hololens video stream

Open lishiyu005 opened this issue 1 year ago • 1 comments

Dear author,

Thank you for your great works. I got an error sending Unity message while getting Hololens video stream. If there is no video stream, message sending works for me. The main issue is that I cannot open video stream client and message client at the same time. There seems to be a conflict between these two clients.

Here is my C++ code:

std::unique_ptrhl2ss::rx_pv client_pv = hl2ss::lnm::rx_pv(host, hl2ss::stream_port::PERSONAL_VIDEO, pv_width, pv_height, pv_fps); std::unique_ptrhl2ss::mt::source source_pv = std::make_uniquehl2ss::mt::source(buffer_size*pv_fps, std::move(client_pv)); source_pv->start();

... std::unique_ptrhl2ss::ipc_umq client = hl2ss::lnm::ipc_umq(host, hl2ss::ipc_port::UNITY_MESSAGE_QUEUE); client->open();

error: Microsoft C++ exception: std::runtime_error at memory location 0x00000042C7AFFAE0. Unhandled exception at 0x00007FFFE529F6FE (ucrtbase.dll) in test_hololens.exe: Fatal program exit requested.

Can you add an C++ example of multi-threading for getting video stream and send messages at the same time? I really have no idea what to do with this error.

Than you very much.

Best regards

lishiyu005 avatar Aug 02 '24 12:08 lishiyu005

Hello, We have added an example: https://github.com/jdibenes/hl2ss/blob/004a8b0219b8c6e78452d9c380f49870f936a60b/extensions/client_cpp/main.cpp#L636 I was unable to reproduce the issue. The C++ client has been updated in recent days, please check that you're using the latest version of the client and server.

jdibenes avatar Aug 02 '24 18:08 jdibenes

After updating the code to the latest version, this issue is solved. Thank you.

lishiyu005 avatar Sep 24 '24 07:09 lishiyu005