mirror of
https://github.com/g4klx/MMDVMHost
synced 2025-12-24 09:35:40 +08:00
Detect DV Fast Data on a per-frame basis
This commit adds a maybeFixupVoiceFrame() function that is used by both the RF and Net code to manage FEC regeneration and DTMF blanking in voice frames. The presence of Fast Data is discovered by reading the mini-header in every second data frame. If found, FEC regeneration and DTMF blanking are disabled for the current and next voice frames. An exception is voice frames that have a sync frame instead of a data frame. This commit always disables FEC regeneration and DTMF blanking for these frames. A later commit will add support for these frames by setting aside the voice frame until the next data frame can be read. This commit also includes a number of debugging statements that will be removed in a later commit.
This commit is contained in:
@@ -98,6 +98,28 @@ private:
|
||||
unsigned int m_rssiCount;
|
||||
bool m_enabled;
|
||||
FILE* m_fp;
|
||||
unsigned char* m_rfVoiceSyncData;
|
||||
unsigned int m_rfVoiceSyncDataLen;
|
||||
unsigned char* m_netVoiceSyncData;
|
||||
unsigned int m_netVoiceSyncDataLen;
|
||||
bool m_rfNextFrameIsFastData;
|
||||
bool m_netNextFrameIsFastData;
|
||||
unsigned int m_rfSkipDTMFBlankingFrames;
|
||||
unsigned int m_netSkipDTMFBlankingFrames;
|
||||
|
||||
|
||||
unsigned int maybeFixupVoiceFrame(
|
||||
unsigned char* data,
|
||||
unsigned int len,
|
||||
unsigned int offset,
|
||||
const char* log_prefix,
|
||||
unsigned char n,
|
||||
bool blank_dtmf,
|
||||
unsigned char* voice_sync_data,
|
||||
unsigned int* voice_sync_data_len,
|
||||
bool* next_frame_is_fast_data,
|
||||
unsigned int* skip_dtmf_blanking_frames
|
||||
);
|
||||
|
||||
void writeNetwork();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user