Communication Audio Functions




Download 0.89 Mb.
bet28/32
Sana22.07.2021
Hajmi0.89 Mb.
#15652
1   ...   24   25   26   27   28   29   30   31   32
6.4.2 Communication Audio Functions
The communication audio functions allow for audio to be passed into the system and sent to the other system, as well as receiving audio and passing it down to the pack subsystem. Below is a list of functions within this part of the subsystem;


  • comms_setup() setups the circular queue used to store the incoming and outgoing packets, as well clearing the semaphores used to send signals to both the comms_recieve and comms_send threads.

  • comms_start() starts both the comms_recieve and comms_send threads processing packets.

  • comms_stop() stops the system from processing packets and clears the circular queues.

  • comms_recieve() thread performs a select operation on the receiving socket to see if there are packets ready to be received, once a packet is ready it is checked to make sure it is the next packet by checking the sequence number, if it is the next packet it is pass down to the pack subsystem, if it is an earlier packet it is discarded. However, for later packet, the missing empty packets are first past to the pack subsystem and then the packet is passed down. The select operation is used to prevent the thread from blocking allowing for the system to send messages to the thread.

  • comms_send() Thread takes packets from the outgoing queue when signalled and sends them via the sending socket to the other machine.

  • comms_audio_out() allows the pack subsystem to pass in packets to be sent to the other machine to be processed, once a packet is passed into the subsystem the send thread is signalled.




Download 0.89 Mb.
1   ...   24   25   26   27   28   29   30   31   32




Download 0.89 Mb.