Add minimum waiting time to NetEQ metrics
Adding minWaitingTimeMs to ACMNetworkStatistics and to NetworkStatistics. Also adding unittest. TEST=audio_coding_unittests Review URL: http://webrtc-codereview.appspot.com/350006 git-svn-id: http://webrtc.googlecode.com/svn/trunk@1408 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
40ea5106f6
commit
053c7991e3
@ -271,6 +271,8 @@ struct NetworkStatistics // NETEQ statistics
|
|||||||
int meanWaitingTimeMs;
|
int meanWaitingTimeMs;
|
||||||
// median packet waiting time in the jitter buffer (ms)
|
// median packet waiting time in the jitter buffer (ms)
|
||||||
int medianWaitingTimeMs;
|
int medianWaitingTimeMs;
|
||||||
|
// min packet waiting time in the jitter buffer (ms)
|
||||||
|
int minWaitingTimeMs;
|
||||||
// max packet waiting time in the jitter buffer (ms)
|
// max packet waiting time in the jitter buffer (ms)
|
||||||
int maxWaitingTimeMs;
|
int maxWaitingTimeMs;
|
||||||
};
|
};
|
||||||
|
@ -160,6 +160,7 @@ enum ACMAMRPackingFormat {
|
|||||||
// rate is higher than sender sample rate.
|
// rate is higher than sender sample rate.
|
||||||
// -meanWaitingTimeMs : average packet waiting time in the buffer
|
// -meanWaitingTimeMs : average packet waiting time in the buffer
|
||||||
// -medianWaitingTimeMs : median 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
|
// -maxWaitingTimeMs : max packet waiting time in the buffer
|
||||||
typedef struct {
|
typedef struct {
|
||||||
WebRtc_UWord16 currentBufferSize;
|
WebRtc_UWord16 currentBufferSize;
|
||||||
@ -173,6 +174,7 @@ typedef struct {
|
|||||||
int32_t clockDriftPPM;
|
int32_t clockDriftPPM;
|
||||||
int meanWaitingTimeMs;
|
int meanWaitingTimeMs;
|
||||||
int medianWaitingTimeMs;
|
int medianWaitingTimeMs;
|
||||||
|
int minWaitingTimeMs;
|
||||||
int maxWaitingTimeMs;
|
int maxWaitingTimeMs;
|
||||||
} ACMNetworkStatistics;
|
} ACMNetworkStatistics;
|
||||||
|
|
||||||
|
@ -486,6 +486,7 @@ ACMNetEQ::NetworkStatistics(
|
|||||||
{
|
{
|
||||||
statistics->meanWaitingTimeMs = -1;
|
statistics->meanWaitingTimeMs = -1;
|
||||||
statistics->medianWaitingTimeMs = -1;
|
statistics->medianWaitingTimeMs = -1;
|
||||||
|
statistics->minWaitingTimeMs = -1;
|
||||||
statistics->maxWaitingTimeMs = -1;
|
statistics->maxWaitingTimeMs = -1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -500,6 +501,7 @@ ACMNetEQ::NetworkStatistics(
|
|||||||
{
|
{
|
||||||
statistics->medianWaitingTimeMs = waiting_times_vec[size / 2];
|
statistics->medianWaitingTimeMs = waiting_times_vec[size / 2];
|
||||||
}
|
}
|
||||||
|
statistics->minWaitingTimeMs = waiting_times_vec.front();
|
||||||
statistics->maxWaitingTimeMs = waiting_times_vec.back();
|
statistics->maxWaitingTimeMs = waiting_times_vec.back();
|
||||||
double sum = 0;
|
double sum = 0;
|
||||||
for (size_t i = 0; i < size; ++i) {
|
for (size_t i = 0; i < size; ++i) {
|
||||||
|
@ -113,6 +113,7 @@ TEST_F(AcmNetEqTest, NetworkStatistics) {
|
|||||||
EXPECT_EQ(0, stats.currentAccelerateRate);
|
EXPECT_EQ(0, stats.currentAccelerateRate);
|
||||||
EXPECT_EQ(-916, stats.clockDriftPPM); // Initial value is slightly off.
|
EXPECT_EQ(-916, stats.clockDriftPPM); // Initial value is slightly off.
|
||||||
EXPECT_EQ(300, stats.maxWaitingTimeMs);
|
EXPECT_EQ(300, stats.maxWaitingTimeMs);
|
||||||
|
EXPECT_EQ(10, stats.minWaitingTimeMs);
|
||||||
EXPECT_EQ(159, stats.meanWaitingTimeMs);
|
EXPECT_EQ(159, stats.meanWaitingTimeMs);
|
||||||
EXPECT_EQ(160, stats.medianWaitingTimeMs);
|
EXPECT_EQ(160, stats.medianWaitingTimeMs);
|
||||||
}
|
}
|
||||||
@ -137,6 +138,7 @@ TEST_F(AcmNetEqTest, TestZeroLengthWaitingTimesVector) {
|
|||||||
EXPECT_EQ(0, stats.currentPreemptiveRate);
|
EXPECT_EQ(0, stats.currentPreemptiveRate);
|
||||||
EXPECT_EQ(0, stats.currentAccelerateRate);
|
EXPECT_EQ(0, stats.currentAccelerateRate);
|
||||||
EXPECT_EQ(-916, stats.clockDriftPPM); // Initial value is slightly off.
|
EXPECT_EQ(-916, stats.clockDriftPPM); // Initial value is slightly off.
|
||||||
|
EXPECT_EQ(-1, stats.minWaitingTimeMs);
|
||||||
EXPECT_EQ(-1, stats.maxWaitingTimeMs);
|
EXPECT_EQ(-1, stats.maxWaitingTimeMs);
|
||||||
EXPECT_EQ(-1, stats.meanWaitingTimeMs);
|
EXPECT_EQ(-1, stats.meanWaitingTimeMs);
|
||||||
EXPECT_EQ(-1, stats.medianWaitingTimeMs);
|
EXPECT_EQ(-1, stats.medianWaitingTimeMs);
|
||||||
|
@ -987,6 +987,7 @@ APITest::TestDelay(char side)
|
|||||||
fprintf(stdout, "Clock-drift............. %d\n", networkStat.clockDriftPPM);
|
fprintf(stdout, "Clock-drift............. %d\n", networkStat.clockDriftPPM);
|
||||||
fprintf(stdout, "Mean waiting time....... %d\n", networkStat.meanWaitingTimeMs);
|
fprintf(stdout, "Mean waiting time....... %d\n", networkStat.meanWaitingTimeMs);
|
||||||
fprintf(stdout, "Median waiting time..... %d\n", networkStat.medianWaitingTimeMs);
|
fprintf(stdout, "Median waiting time..... %d\n", networkStat.medianWaitingTimeMs);
|
||||||
|
fprintf(stdout, "Min waiting time........ %d\n", networkStat.minWaitingTimeMs);
|
||||||
fprintf(stdout, "Max waiting time........ %d\n", networkStat.maxWaitingTimeMs);
|
fprintf(stdout, "Max waiting time........ %d\n", networkStat.maxWaitingTimeMs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2593,6 +2593,8 @@ TEST_MUSTPASS(voe_codec_->SetSendCodec(0, ci));
|
|||||||
nStats.meanWaitingTimeMs);
|
nStats.meanWaitingTimeMs);
|
||||||
TEST_LOG(" medianWaitingTimeMs = %i \n",
|
TEST_LOG(" medianWaitingTimeMs = %i \n",
|
||||||
nStats.medianWaitingTimeMs);
|
nStats.medianWaitingTimeMs);
|
||||||
|
TEST_LOG(" minWaitingTimeMs = %i \n",
|
||||||
|
nStats.minWaitingTimeMs);
|
||||||
TEST_LOG(" maxWaitingTimeMs = %i \n",
|
TEST_LOG(" maxWaitingTimeMs = %i \n",
|
||||||
nStats.maxWaitingTimeMs);
|
nStats.maxWaitingTimeMs);
|
||||||
#else
|
#else
|
||||||
|
Loading…
Reference in New Issue
Block a user