emscripten-core / emscripten

Emscripten: An LLVM-to-WebAssembly Compiler
Other
25.35k stars 3.25k forks source link

Get WebRTC backend working again #3818

Open juj opened 8 years ago

juj commented 8 years ago

Poking at the test sockets.test_webrtc, I see that we have removed the whole WebRTC backend from Emscripten altogether. WebRTC used to be implemented in src/library.js, see e.g. at this point of time: https://github.com/kripken/emscripten/blob/3b99bb7bef220ad98760b117d14854098f86db9e/src/library.js#L7032, where the two implementations WebRTC vs WebSockets were chosen based on a #if SOCKET_WEBRTC. Looks like the WebRTC part of it was never integrated as part of the filesystem in src/library_sockfs.js, which only carries WebSockets -specific code.

This commit https://github.com/kripken/emscripten/commit/d92efe09c6bc825539f9ce8f7e10ac2fcde0bdaf removes the sockets specific code from src/library.js, but looks like the WebRTC implementation was not migrated anywhere else, so it got lost as part of the refactoring.

kripken commented 8 years ago

Yes, it was never moved to sockfs, and testing was broken, so I didn't have a reliable way to work on it. We could resurrect it if we figure out how to get testing working again.

luser commented 8 years ago

I've got a patch to fix the webrtc backend on top of master: https://github.com/luser/emscripten/commits/fix-webrtc-sockets

It passes test_webrtc fine here with Firefox. I rebased that patch on top of incoming, but it sounds like more work will be necessary to actually get it working again.

luser commented 8 years ago

So AFAICT, what needs to happen is to port the code from here: https://github.com/kripken/emscripten/blob/3b99bb7bef220ad98760b117d14854098f86db9e/src/library.js#L7032

to library_sockfs.js, in a webrtc_sock_ops like the existing websocket_sock_ops?

kripken commented 8 years ago

Yes, that's correct.

kripken commented 8 years ago

@luser's patches are at https://github.com/luser/emscripten/commits/webrtc-sockets

should be complete and running on master.

kripken commented 8 years ago

Separately the patch for SDL_net in there could be landed, if we add a test.

luser commented 8 years ago

Sorry, I corrected myself on IRC, that was a slightly outdated branch, the working changes are here: https://github.com/luser/emscripten/commits/webrtc-sockets

luser commented 8 years ago

That patch is against master, it'd need a bit of rework to get it working against incoming (as mentioned above, refactoring it to work with sockfs).

kkimdev commented 7 years ago

Hi, what's the status of this?

jkbbwr commented 5 years ago

Hi was there any progress on this?

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 7 days. Feel free to re-open at any time if this issue is still relevant.

VinnyVicious commented 1 year ago

Can this be re-opened?