improved some comments

main
Tom Early 4 years ago
parent e692099f7e
commit d21ec9d597

@ -140,17 +140,20 @@ void CController::IncrementDStarVocoder()
current_dstar_vocoder = (current_dstar_vocoder + 1) % dstar_vocoder_count;
}
// Incoming packets from clients with different starting codecs, DStar, DMR, and M17. The transcoder fills
// in the missing data.
// AMBE codecs go to the DVSI hardware for decoding to audio. No need to transcode between M17 codecs.
// DMR and YSF use the exact same codec, both AMBE.
// Incoming packets from clients have different starting codecs, AMBE or M17.
// The transcoder's task is to fill in the missing data.
// Incoming AMBE codecs go to the DVSI hardware for decoding to audio. The ambeThread will finish up.
// Incoming M17 codecs are decoded in software and the audio data send to the two different AMBE encoders.
// There is no need to transcode between M17 codecs.
void CController::ReadReflector()
{
while (keep_running) {
STCPacket tcpack;
// wait up to 40 ms to read something on the unix port
if (reader.Receive(&tcpack, 40)) {
//create a std::shared_ptr to a new packet
// create a shared pointer to a new packet
// there is only one CTranscoderPacket created for each new STCPacket received from the reflector
auto packet = std::make_shared<CTranscoderPacket>(tcpack);
#ifdef DEBUG
Dump(packet, "Incoming TC Packet:");
@ -287,11 +290,11 @@ void CController::ReadAmbeDevices()
}
}
// Any audio packet recevied from the DVSI vocoders means that the codec_in was AMBE (DStar or DMR).
// Any audio packet recevied from the DVSI vocoders means that the original codec was AMBE (DStar or DMR).
// These audio packets need to be encoded, by the complimentary AMBE vocoder _and_ M17.
// Since code_in was AMBE, the audio will be encoded to c2_3200, and copied to the packet.
// If we have read AMBE data, it needs to be put back into the packet.
// If the packet is complete, it can be sent back to the reflector.
// If we have read AMBE data from the vocoder, it needs to be put back into the packet.
// Finally if the packet is complete, it can be sent back to the reflector.
void CController::ReadDevice(std::shared_ptr<CDV3003> device, EAmbeType type)
{
//save the dmr/dstar type
@ -376,6 +379,7 @@ void CController::ReadDevice(std::shared_ptr<CDV3003> device, EAmbeType type)
}
else /* the response is ambe data */
{
// put the AMBE data in the packet
if (type == EAmbeType::dmr)
{
spPacket->SetDMRData(devpacket.payload.ambe.data);

@ -110,7 +110,7 @@ public:
std::string GetProductID() const;
std::string GetVersion() const;
CPacketQueue packet_queue[3];
CPacketQueue packet_queue[3]; // we need a queue for each vocoder
private:
const Encoding type;
int fd;

Loading…
Cancel
Save

Powered by TurnKey Linux.