more debug tracing of last packet

main
Tom Early 4 years ago
parent 4a8066bd53
commit 253ebf9dd8

@ -352,7 +352,7 @@ void CController::AppendM17(const std::shared_ptr<CTranscoderPacket> packet) con
void CController::Dump(const std::shared_ptr<CTranscoderPacket> p, const std::string &title) const
{
std::stringstream line;
line << title << ": Mod='" << p->GetModule() << "' SID=" << std::showbase << std::hex << ntohs(p->GetStreamId()) << std::noshowbase;
line << title << " Mod='" << p->GetModule() << "' SID=" << std::showbase << std::hex << ntohs(p->GetStreamId()) << std::noshowbase;
ECodecType in = p->GetCodecIn();
if (p->DStarIsSet())

@ -39,6 +39,7 @@ public:
void Stop();
void RouteDstPacket(std::shared_ptr<CTranscoderPacket> packet);
void RouteDmrPacket(std::shared_ptr<CTranscoderPacket> packet);
void Dump(const std::shared_ptr<CTranscoderPacket> packet, const std::string &title) const;
protected:
std::atomic<bool> keep_running;
@ -65,6 +66,5 @@ protected:
#ifdef DEBUG
void AppendWave(const std::shared_ptr<CTranscoderPacket> packet) const;
void AppendM17(const std::shared_ptr<CTranscoderPacket> packet) const;
void Dump(const std::shared_ptr<CTranscoderPacket> packet, const std::string &title) const;
#endif
};

@ -417,6 +417,10 @@ void CDV3003::FeedDevice()
{
SendData(current_vocoder, (Encoding::dstar==type) ? packet->GetDStarData() : packet->GetDMRData());
ch_depth++;
#ifdef DEBUG
if (packet->IsLast())
Controller.Dump(packet, "Queued for decoding:");
#endif
}
else
{
@ -424,7 +428,7 @@ void CDV3003::FeedDevice()
sp_depth++;
#ifdef DEBUG
if (packet->IsLast())
std::cout << "Sent audio to " << devicepath << std::endl;
Controller.Dump(packet, "Queued for encoding:");
#endif
}
if(++current_vocoder > 2)
@ -474,6 +478,11 @@ void CDV3003::ReadDevice()
packet->SetDStarData(p.payload.ambe.data);
else
packet->SetDMRData(p.payload.ambe.data);
#ifdef DEBUG
if (packet->IsLast())
Controller.Dump(packet, "Data from device is now set:");
#endif
}
else if (PKT_SPEECH == p.header.packet_type)
{
@ -481,6 +490,11 @@ void CDV3003::ReadDevice()
auto pPCM = packet->GetAudio();
for (unsigned int i=0; i<160; i++)
pPCM[i] = ntohs(p.payload.audio.samples[i]);
#ifdef DEBUG
if (packet->IsLast())
Controller.Dump(packet, "Audio from device is now set:");
#endif
}
else
{

Loading…
Cancel
Save

Powered by TurnKey Linux.