mirror of
https://github.com/lubosz/overte.git
synced 2025-04-24 03:53:52 +02:00
separated ringbuffer and outputbuffer avg framesAvailable stats in interface
This commit is contained in:
parent
a70eb12245
commit
603974c8a2
3 changed files with 10 additions and 5 deletions
|
@ -130,7 +130,8 @@ Audio::Audio(int16_t initialJitterBufferSamples, QObject* parent) :
|
|||
_outgoingAvatarAudioSequenceNumber(0),
|
||||
_incomingMixedAudioSequenceNumberStats(INCOMING_SEQ_STATS_HISTORY_LENGTH),
|
||||
_interframeTimeGapStats(TIME_GAPS_STATS_INTERVAL_SAMPLES, TIME_GAP_STATS_WINDOW_INTERVALS),
|
||||
_framesAvailableStats(1, FRAMES_AVAILABLE_STATS_WINDOW_SECONDS)
|
||||
_ringBufferFramesAvailableStats(1, FRAMES_AVAILABLE_STATS_WINDOW_SECONDS),
|
||||
_audioOutputBufferFramesAvailableStats(1, FRAMES_AVAILABLE_STATS_WINDOW_SECONDS)
|
||||
{
|
||||
// clear the array of locally injected samples
|
||||
memset(_localProceduralSamples, 0, NETWORK_BUFFER_LENGTH_BYTES_PER_CHANNEL);
|
||||
|
@ -794,7 +795,7 @@ AudioStreamStats Audio::getDownstreamAudioStreamStats() const {
|
|||
stats._timeGapWindowAverage = _interframeTimeGapStats.getWindowAverage();
|
||||
|
||||
stats._ringBufferFramesAvailable = _ringBuffer.framesAvailable();
|
||||
stats._ringBufferFramesAvailableAverage = _framesAvailableStats.getWindowAverage();
|
||||
stats._ringBufferFramesAvailableAverage = _ringBufferFramesAvailableStats.getWindowAverage();
|
||||
stats._ringBufferDesiredJitterBufferFrames = getDesiredJitterBufferFrames();
|
||||
stats._ringBufferStarveCount = _starveCount;
|
||||
stats._ringBufferConsecutiveNotMixedCount = _consecutiveNotMixedCount;
|
||||
|
@ -810,7 +811,8 @@ AudioStreamStats Audio::getDownstreamAudioStreamStats() const {
|
|||
void Audio::sendDownstreamAudioStatsPacket() {
|
||||
|
||||
// since this function is called every second, we'll sample the number of audio frames available here.
|
||||
_framesAvailableStats.update(_ringBuffer.framesAvailable() + getFramesAvailableInAudioOutputBuffer());
|
||||
_ringBufferFramesAvailableStats.update(_ringBuffer.framesAvailable());
|
||||
_audioOutputBufferFramesAvailableStats.update(getFramesAvailableInAudioOutputBuffer());
|
||||
|
||||
// push the current seq number stats into history, which moves the history window forward 1s
|
||||
// (since that's how often pushStatsToHistory() is called)
|
||||
|
|
|
@ -80,6 +80,7 @@ public:
|
|||
const SequenceNumberStats& getIncomingMixedAudioSequenceNumberStats() const { return _incomingMixedAudioSequenceNumberStats; }
|
||||
|
||||
int getFramesAvailableInAudioOutputBuffer() const;
|
||||
int getAverageFramesAvailableInAudioOutputBuffer() const { return (int)_audioOutputBufferFramesAvailableStats.getWindowAverage(); }
|
||||
|
||||
public slots:
|
||||
void start();
|
||||
|
@ -268,7 +269,8 @@ private:
|
|||
SequenceNumberStats _incomingMixedAudioSequenceNumberStats;
|
||||
|
||||
MovingMinMaxAvg<quint64> _interframeTimeGapStats;
|
||||
MovingMinMaxAvg<int> _framesAvailableStats;
|
||||
MovingMinMaxAvg<int> _ringBufferFramesAvailableStats;
|
||||
MovingMinMaxAvg<int> _audioOutputBufferFramesAvailableStats;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -339,9 +339,10 @@ void Stats::display(
|
|||
|
||||
AudioStreamStats downstreamAudioStreamStats = audio->getDownstreamAudioStreamStats();
|
||||
|
||||
sprintf(downstreamAudioStatsString, " mix: %.2f%%/%.2f%%, %u/%u/%u+%u", downstreamAudioStreamStats._packetStreamStats.getLostRate()*100.0f,
|
||||
sprintf(downstreamAudioStatsString, " mix: %.2f%%/%.2f%%, %u/%u+%d/%u+%d", downstreamAudioStreamStats._packetStreamStats.getLostRate()*100.0f,
|
||||
downstreamAudioStreamStats._packetStreamWindowStats.getLostRate() * 100.0f,
|
||||
downstreamAudioStreamStats._ringBufferDesiredJitterBufferFrames, downstreamAudioStreamStats._ringBufferFramesAvailableAverage,
|
||||
audio->getAverageFramesAvailableInAudioOutputBuffer(),
|
||||
downstreamAudioStreamStats._ringBufferFramesAvailable, audio->getFramesAvailableInAudioOutputBuffer());
|
||||
|
||||
verticalOffset += STATS_PELS_PER_LINE;
|
||||
|
|
Loading…
Reference in a new issue