Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions reflector/AudioRecorder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ void CAudioRecorder::Cleanup()
m_PcmBuffer.clear();
}

std::string CAudioRecorder::Start(const std::string& directory)
std::string CAudioRecorder::Start(const std::string& directory, char module)
{
std::lock_guard<std::mutex> lock(m_Mutex);
Cleanup();
Expand All @@ -61,7 +61,7 @@ std::string CAudioRecorder::Start(const std::string& directory)
char uuid_str[37];
uuidv7_to_string(uuid, uuid_str);

m_Filename = "hearing_" + std::string(uuid_str) + ".opus";
m_Filename = "hearing_Mod" + std::string(1, module) + "_" + std::string(uuid_str) + ".opus";
if (directory.back() == '/')
m_FullPath = directory + m_Filename;
else
Expand Down
2 changes: 1 addition & 1 deletion reflector/AudioRecorder.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class CAudioRecorder
// Generates a UUIDv7 based filename if path is a directory,
// or uses the provided path + generated filename.
// Returns the filename (without path) for notification.
std::string Start(const std::string& directory);
std::string Start(const std::string& directory, char module);

// Writes signed 16-bit PCM samples (8kHz mono)
void Write(const int16_t* samples, int count);
Expand Down
4 changes: 2 additions & 2 deletions reflector/CodecStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ void CCodecStream::ResetStats(uint16_t streamid, ECodecType type)
if (g_Configure.GetBoolean(g_Keys.audio.enable))
{
std::string path = g_Configure.GetString(g_Keys.audio.path);
m_Filename = m_Recorder.Start(path);
m_Filename = m_Recorder.Start(path, m_CSModule);
}
else
{
Expand Down Expand Up @@ -246,7 +246,7 @@ void CCodecStream::TxThread(void)
{
// update important stuff in Frame->m_TCPack for the transcoder
// sets the packet counter, stream id, last_packet, module and start the trip timer
Frame->SetTCParams(m_uiTotalPackets++);
Frame->SetTCParams(m_uiTotalPackets++, m_CSModule);

// now send to transcoder
int fd = g_TCServer.GetFD(Frame->GetCodecPacket()->module);
Expand Down
7 changes: 4 additions & 3 deletions reflector/DVFramePacket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ CDvFramePacket::CDvFramePacket(const CBuffer &buf) : CPacket(buf)
memcpy(m_TCPack.m17, data+off, sizeof(m_TCPack.m17)); off += sizeof(m_TCPack.m17);
memcpy(m_TCPack.p25, data+off, sizeof(m_TCPack.p25)); off += sizeof(m_TCPack.p25);
memcpy(m_TCPack.usrp, data+off, sizeof(m_TCPack.usrp));
SetTCParams(seq);
SetTCParams(seq, m_cModule);
}
else
std::cerr << "CBuffer is too small to initialize a CDvFramePacket" << std::endl;
Expand Down Expand Up @@ -252,10 +252,11 @@ void CDvFramePacket::SetCodecData(const STCPacket *pack)
memcpy(&m_TCPack, pack, sizeof(STCPacket));
}

void CDvFramePacket::SetTCParams(uint32_t seq)
void CDvFramePacket::SetTCParams(uint32_t seq, char module)
{
m_TCPack.sequence = seq;
m_TCPack.streamid = m_uiStreamId;
m_TCPack.is_last = m_bLastPacket;
m_TCPack.module = m_cModule;
m_TCPack.module = module;
m_cModule = module;
}
2 changes: 1 addition & 1 deletion reflector/DVFramePacket.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class CDvFramePacket : public CPacket
// set
void SetDvData(const uint8_t *);
void SetCodecData(const STCPacket *pack);
void SetTCParams(uint32_t seq);
void SetTCParams(uint32_t seq, char module);

// the round-trip timer
CTimer m_rtTimer;
Expand Down