Adding two new stats to VoiceReceiverInfo

There have been requests of two new stats namely

speech_expand_rate and secondary_decoded_rate.

BUG=3867
R=henrik.lundin@webrtc.org, henrika@webrtc.org, tommi@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/40789004

Cr-Commit-Position: refs/heads/master@{#8415}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8415 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
minyue@webrtc.org
2015-02-18 15:24:13 +00:00
parent 8fbdcfd73f
commit c0bd7be0df
17 changed files with 100 additions and 85 deletions

View File

@ -639,7 +639,7 @@ int AcmReceiver::LastAudioCodec(CodecInst* codec) const {
return 0;
}
void AcmReceiver::NetworkStatistics(ACMNetworkStatistics* acm_stat) {
void AcmReceiver::GetNetworkStatistics(NetworkStatistics* acm_stat) {
NetEqNetworkStatistics neteq_stat;
// NetEq function always returns zero, so we don't check the return value.
neteq_->NetworkStatistics(&neteq_stat);
@ -650,8 +650,10 @@ void AcmReceiver::NetworkStatistics(ACMNetworkStatistics* acm_stat) {
acm_stat->currentPacketLossRate = neteq_stat.packet_loss_rate;
acm_stat->currentDiscardRate = neteq_stat.packet_discard_rate;
acm_stat->currentExpandRate = neteq_stat.expand_rate;
acm_stat->currentSpeechExpandRate = neteq_stat.speech_expand_rate;
acm_stat->currentPreemptiveRate = neteq_stat.preemptive_rate;
acm_stat->currentAccelerateRate = neteq_stat.accelerate_rate;
acm_stat->currentSecondaryDecodedRate = neteq_stat.secondary_decoded_rate;
acm_stat->clockDriftPPM = neteq_stat.clockdrift_ppm;
acm_stat->addedSamples = neteq_stat.added_zero_samples;

View File

@ -191,7 +191,7 @@ class AcmReceiver {
// Output:
// - statistics : The current network statistics.
//
void NetworkStatistics(ACMNetworkStatistics* statistics);
void GetNetworkStatistics(NetworkStatistics* statistics);
//
// Enable post-decoding VAD.

View File

@ -1451,8 +1451,8 @@ int AudioCodingModuleImpl::PlayoutData10Ms(int desired_freq_hz,
// TODO(turajs) change the return value to void. Also change the corresponding
// NetEq function.
int AudioCodingModuleImpl::NetworkStatistics(ACMNetworkStatistics* statistics) {
receiver_.NetworkStatistics(statistics);
int AudioCodingModuleImpl::GetNetworkStatistics(NetworkStatistics* statistics) {
receiver_.GetNetworkStatistics(statistics);
return 0;
}
@ -1841,8 +1841,8 @@ bool AudioCodingImpl::Get10MsAudio(AudioFrame* audio_frame) {
return acm_old_->PlayoutData10Ms(playout_frequency_hz_, audio_frame) == 0;
}
bool AudioCodingImpl::NetworkStatistics(
ACMNetworkStatistics* network_statistics) {
bool AudioCodingImpl::GetNetworkStatistics(
NetworkStatistics* network_statistics) {
FATAL() << "Not implemented yet.";
return false;
}

View File

@ -198,7 +198,7 @@ class AudioCodingModuleImpl : public AudioCodingModule {
// Statistics
//
virtual int NetworkStatistics(ACMNetworkStatistics* statistics) OVERRIDE;
virtual int GetNetworkStatistics(NetworkStatistics* statistics) OVERRIDE;
// GET RED payload for iSAC. The method id called when 'this' ACM is
// the default ACM.
@ -418,8 +418,8 @@ class AudioCodingImpl : public AudioCoding {
virtual bool Get10MsAudio(AudioFrame* audio_frame) OVERRIDE;
virtual bool NetworkStatistics(
ACMNetworkStatistics* network_statistics) OVERRIDE;
virtual bool GetNetworkStatistics(
NetworkStatistics* network_statistics) OVERRIDE;
virtual bool EnableNack(size_t max_nack_list_size) OVERRIDE;

View File

@ -909,7 +909,7 @@ class AudioCodingModule: public Module {
//
///////////////////////////////////////////////////////////////////////////
// int32_t NetworkStatistics()
// int32_t GetNetworkStatistics()
// Get network statistics. Note that the internal statistics of NetEq are
// reset by this call.
//
@ -920,8 +920,8 @@ class AudioCodingModule: public Module {
// -1 if failed to set the network statistics,
// 0 if statistics are set successfully.
//
virtual int32_t NetworkStatistics(
ACMNetworkStatistics* network_statistics) = 0;
virtual int32_t GetNetworkStatistics(
NetworkStatistics* network_statistics) = 0;
//
// Set an initial delay for playout.
@ -1107,7 +1107,7 @@ class AudioCoding {
// Returns the network statistics. Note that the internal statistics of NetEq
// are reset by this call. Returns true if successful, false otherwise.
virtual bool NetworkStatistics(ACMNetworkStatistics* network_statistics) = 0;
virtual bool GetNetworkStatistics(NetworkStatistics* network_statistics) = 0;
// Enables NACK and sets the maximum size of the NACK list. If NACK is already
// enabled then the maximum NACK list size is modified accordingly. Returns

View File

@ -144,48 +144,6 @@ enum ACMAMRPackingFormat {
AMRFileStorage = 2
};
///////////////////////////////////////////////////////////////////////////
//
// Struct containing network statistics
//
// -currentBufferSize : current jitter buffer size in ms
// -preferredBufferSize : preferred (optimal) buffer size in ms
// -jitterPeaksFound : indicate if peaky-jitter mode is engaged, that is,
// if severe but sparse network delays have occurred.
// -currentPacketLossRate : loss rate (network + late) (in Q14)
// -currentDiscardRate : late loss rate (in Q14)
// -currentExpandRate : fraction (of original stream) of synthesized
// speech inserted through expansion (in Q14)
// -currentPreemptiveRate : fraction of synthesized speech inserted through
// pre-emptive expansion (in Q14)
// -currentAccelerateRate : fraction of data removed through acceleration
// (in Q14)
// -clockDriftPPM : clock-drift between sender and receiver in parts-
// per-million. Positive means that receiver sample
// rate is higher than sender sample rate.
// -meanWaitingTimeMs : average packet waiting time in the buffer
// -medianWaitingTimeMs : median packet waiting time in the buffer
// -minWaitingTimeMs : min packet waiting time in the buffer
// -maxWaitingTimeMs : max packet waiting time in the buffer
// -addedSamples : samples inserted because of packet loss in off mode
typedef struct {
uint16_t currentBufferSize;
uint16_t preferredBufferSize;
bool jitterPeaksFound;
uint16_t currentPacketLossRate;
uint16_t currentDiscardRate;
uint16_t currentExpandRate;
uint16_t currentPreemptiveRate;
uint16_t currentAccelerateRate;
int32_t clockDriftPPM;
int meanWaitingTimeMs;
int medianWaitingTimeMs;
int minWaitingTimeMs;
int maxWaitingTimeMs;
int addedSamples;
} ACMNetworkStatistics;
///////////////////////////////////////////////////////////////////////////
//
// Enumeration of background noise mode a mapping from NetEQ interface.

View File

@ -785,8 +785,8 @@ void APITest::TestDelay(char side) {
*myMinDelay = (rand() % 1000) + 1;
ACMNetworkStatistics networkStat;
CHECK_ERROR_MT(myACM->NetworkStatistics(&networkStat));
NetworkStatistics networkStat;
CHECK_ERROR_MT(myACM->GetNetworkStatistics(&networkStat));
if (!_randomTest) {
fprintf(stdout, "\n\nJitter Statistics at Side %c\n", side);
@ -803,10 +803,14 @@ void APITest::TestDelay(char side) {
networkStat.currentDiscardRate);
fprintf(stdout, "expand rate............. %d\n",
networkStat.currentExpandRate);
fprintf(stdout, "speech expand rate...... %d\n",
networkStat.currentSpeechExpandRate);
fprintf(stdout, "Preemptive rate......... %d\n",
networkStat.currentPreemptiveRate);
fprintf(stdout, "Accelerate rate......... %d\n",
networkStat.currentAccelerateRate);
fprintf(stdout, "Secondary decoded rate.. %d\n",
networkStat.currentSecondaryDecodedRate);
fprintf(stdout, "Clock-drift............. %d\n", networkStat.clockDriftPPM);
fprintf(stdout, "Mean waiting time....... %d\n",
networkStat.meanWaitingTimeMs);

View File

@ -196,8 +196,8 @@ class DelayTest {
// Print delay information every 16 frame
if ((num_frames & 0x3F) == 0x3F) {
ACMNetworkStatistics statistics;
acm_b_->NetworkStatistics(&statistics);
NetworkStatistics statistics;
acm_b_->GetNetworkStatistics(&statistics);
fprintf(stdout, "delay: min=%3d max=%3d mean=%3d median=%3d"
" ts-based average = %6.3f, "
"curr buff-lev = %4u opt buff-lev = %4u \n",

View File

@ -219,8 +219,8 @@ class InsertPacketWithTiming {
// Jitter buffer delay.
void Delay(int* optimal_delay, int* current_delay) {
ACMNetworkStatistics statistics;
receive_acm_->NetworkStatistics(&statistics);
NetworkStatistics statistics;
receive_acm_->GetNetworkStatistics(&statistics);
*optimal_delay = statistics.preferredBufferSize;
*current_delay = statistics.currentBufferSize;
}

View File

@ -185,8 +185,8 @@ class TargetDelayTest : public ::testing::Test {
}
int GetCurrentOptimalDelayMs() {
ACMNetworkStatistics stats;
acm_->NetworkStatistics(&stats);
NetworkStatistics stats;
acm_->GetNetworkStatistics(&stats);
return stats.preferredBufferSize;
}