We are developing p2p applications using C ++, which transfers voice to another peer using UDP.
We capture a microphone signal in a buffer in a stream that captures voice for one second in a loop while. For every second voice recorded in the buffer, it breaks it into packets and sends it to another peer . Now I need the correct data structure at the destination, which handles real-time transmission. The same data structure that I am going to use to capture the screen. Here are two approaches using the queue I was thinking about.
OneSecVoice/Imageobjects will contain the total number of packets , packets buffer for this particular Image/OneSecVoice.
In real time, one thread will continuously scan for the queue and display the last completed one Image/OneSecVoice , putting it Image/OneSecVoiceout of the queue.
So, to select Queue Implementation using a linked list or Queue Implementation using a static array .
Me and my friend are fighting for it, so we decided to post here.
Xinus source
share