hello world example returns empty packets on packet.get() after converting to wasm #3252
Labels
platform:c++
Issues specific to C++ framework in mediapipe
platform:javascript
MediaPipe Javascript issues
type:build/install
For Build and Installation issues
Hello,
I'm trying to make the mediapipe hello world cpp example run in the browser by converting the cpp file to web assembly. I have converted it to webassembly and loaded the wasm file into the browser and received debug messages via cout strings as output in the chrome browser console. I followed this repo to achieve this. However, the wasm hangs at poller.next(&packet), as is evident from observing the debug flags I had put in the cpp code from the console. I did some digging in the internet and found out that it is hanging because poller.next() waits until the next packet is available. The same code is working properly when run from the terminal as a cpp file but upon converting to wasm something is not working. It would be great if someone could provide more information on why the code behaves as such upon being converted to wasm.
build file for cpp helloworld
cpp helloworld code that runs properly
output as expected in the terminal
build file for the wasm helloworld:
cpp code used to compile the wasm file:
the output from chrome console:
The chrome tab hangs and will need multiple clicks to close upon loading the wasm file. I guess it is not throwing any errors since packet.next() function is behaving as it is intended to behave, however, I would like to understand why the packets aren't in the queue like it is in the cpp example when run in the terminal.
The machine I used to compile the code to wasm is mac m1 running MacOS Montenery.
Any help is much appreciated.
The text was updated successfully, but these errors were encountered: