Hello, I need to understand how webRTC manages network, signaling and worker threads for a scenario where two peer connections (PC) are created.
So far what I have understood is that when we create two PCs through peer connection factory for setting up a call to two connected peers, we specify network, signaling and worker threads in create_peer_connection() function arguments. In case if we do not specify these threads then webRTC initializes each of these threads by default. Worker thread is basically the one, I am interested in the most as it is known for taking care of resource intensive tasks including sending, recording, encoding, receiving and playing.
I have read about libuv and it says webRTC implements it to handle tasks in a multithreaded fashion. I am not sure where I can find the implementation of it.
I have found a few more things related to worker threads by developing a standalone application. I have put a few logs to print thread ids inside functions including add10MsData from audio_coding_module.cc file and sendData from channel_send.cc file. When I create two PC through peer connection factory without specifying threads then logs prints two distinct thread ids meaning each worker thread calls these methods for resource intensive tasks. Moving a bit further, I stamped my recording samples and printed the stamps inside these functions along with thread ids. Now, when I setup a call to two peers, the logs prints stamps and thread ids and interestingly, it appears to me that no two worker threads process the same recording sample twice. WebRTC audio pipeline is optimized to this much extent which is quite intriguing. Need verification of this assumption.
So far I have gone through this much and need to confirm a few things. Any suggestion or assistance or any lead or document for perusal shall be appreciated.
thankyou,