Hello chromium-mojo folks!
I am working on a prototype to send some video frames from JS to native C++ through mojo but encountered a throughput problem, here is the situation:
Get a MediaStreamVideoTrack from a webRtcConnection
Fetch video frames through MediaStreamTrackProcessor from webRtcConnection
Send the frames from JS to native C++ through mojo(3.2 MB per frame, sync call)
Found native C++ only can receive 4~5 frames per second which means the throughput is about 12 ~ 16MB
Assuming I want to send 30 fps frames(3.2MB per frame) from JS to native C++, I would need 96 MB throughput but it seems the sync call doesn’t have the bigger enough throughput.
Here are some of my questions, it would be very helpful if I can get some suggestions from the team :)
I am not sure my testing result of throughput is correct. May I know what is the throughput of a mojo sync call to send data?
If it is a real limitation of sync call(JS to C++), do I have other options? For example I found Data Pipes but it seems only for C++, not sure I can use Data Pipes from JS to C++ and how?
How about using WebScoket as an IPC between JS and C++? I also found websocket.mojom but I'm not sure if it is appropriate and possible to communicate between JS and C++.
Any help would be much appreciated!
Thanks.
--
You received this message because you are subscribed to the Google Groups "chromium-mojo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-moj...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-mojo/CAOvTs4syz0aGiyoHL6FCTjojSS%3D-fkSWCeyGFQZGAwvP01x17A%40mail.gmail.com.
Hello chromium-mojo folks!
I am working on a prototype to send some video frames from JS to native C++ through mojo but encountered a throughput problem, here is the situation:
Get a MediaStreamVideoTrack from a webRtcConnection
Fetch video frames through MediaStreamTrackProcessor from webRtcConnection
Send the frames from JS to native C++ through mojo(3.2 MB per frame, sync call)
Found native C++ only can receive 4~5 frames per second which means the throughput is about 12 ~ 16MB
Assuming I want to send 30 fps frames(3.2MB per frame) from JS to native C++, I would need 96 MB throughput but it seems the sync call doesn’t have the bigger enough throughput.
Here are some of my questions, it would be very helpful if I can get some suggestions from the team :)
I am not sure my testing result of throughput is correct. May I know what is the throughput of a mojo sync call to send data?
If it is a real limitation of sync call(JS to C++), do I have other options? For example I found Data Pipes but it seems only for C++, not sure I can use Data Pipes from JS to C++ and how?
How about using WebScoket as an IPC between JS and C++? I also found websocket.mojom but I'm not sure if it is appropriate and possible to communicate between JS and C++.
Any help would be much appreciated!
Thanks.