mirror of
https://github.com/overte-org/overte.git
synced 2025-04-25 17:35:45 +02:00
cleaned up code, fixed typos
This commit is contained in:
parent
b670226ee3
commit
63624fae7d
5 changed files with 3 additions and 44 deletions
|
@ -86,7 +86,7 @@ public:
|
||||||
QAction* getActionForOption(const QString& menuOption);
|
QAction* getActionForOption(const QString& menuOption);
|
||||||
|
|
||||||
const InboundAudioStream::Settings& getReceivedAudioStreamSettings() const { return _receivedAudioStreamSettings; }
|
const InboundAudioStream::Settings& getReceivedAudioStreamSettings() const { return _receivedAudioStreamSettings; }
|
||||||
void getReceivedAudioStreamSettings(const InboundAudioStream::Settings& receivedAudioStreamSettings) { _receivedAudioStreamSettings = receivedAudioStreamSettings; }
|
void setReceivedAudioStreamSettings(const InboundAudioStream::Settings& receivedAudioStreamSettings) { _receivedAudioStreamSettings = receivedAudioStreamSettings; }
|
||||||
float getFieldOfView() const { return _fieldOfView; }
|
float getFieldOfView() const { return _fieldOfView; }
|
||||||
void setFieldOfView(float fieldOfView) { _fieldOfView = fieldOfView; }
|
void setFieldOfView(float fieldOfView) { _fieldOfView = fieldOfView; }
|
||||||
float getRealWorldFieldOfView() const { return _realWorldFieldOfView; }
|
float getRealWorldFieldOfView() const { return _realWorldFieldOfView; }
|
||||||
|
|
|
@ -262,7 +262,7 @@ void PreferencesDialog::savePreferences() {
|
||||||
streamSettings._windowSecondsForDesiredCalcOnTooManyStarves = ui.windowSecondsForDesiredCalcOnTooManyStarvesSpin->value();
|
streamSettings._windowSecondsForDesiredCalcOnTooManyStarves = ui.windowSecondsForDesiredCalcOnTooManyStarvesSpin->value();
|
||||||
streamSettings._windowSecondsForDesiredReduction = ui.windowSecondsForDesiredReductionSpin->value();
|
streamSettings._windowSecondsForDesiredReduction = ui.windowSecondsForDesiredReductionSpin->value();
|
||||||
|
|
||||||
Menu::getInstance()->getReceivedAudioStreamSettings(streamSettings);
|
Menu::getInstance()->setReceivedAudioStreamSettings(streamSettings);
|
||||||
Application::getInstance()->getAudio()->setReceivedAudioStreamSettings(streamSettings);
|
Application::getInstance()->getAudio()->setReceivedAudioStreamSettings(streamSettings);
|
||||||
|
|
||||||
Application::getInstance()->resizeGL(Application::getInstance()->getGLWidget()->width(),
|
Application::getInstance()->resizeGL(Application::getInstance()->getGLWidget()->width(),
|
||||||
|
|
|
@ -351,7 +351,6 @@ void InboundAudioStream::packetReceivedUpdateTimingStats() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_dynamicJitterBuffers) {
|
if (_dynamicJitterBuffers) {
|
||||||
|
|
||||||
// if the max gap in window B (_timeGapStatsForDesiredReduction) corresponds to a smaller number of frames than _desiredJitterBufferFrames,
|
// if the max gap in window B (_timeGapStatsForDesiredReduction) corresponds to a smaller number of frames than _desiredJitterBufferFrames,
|
||||||
// then reduce _desiredJitterBufferFrames to that number of frames.
|
// then reduce _desiredJitterBufferFrames to that number of frames.
|
||||||
if (_timeGapStatsForDesiredReduction.getNewStatsAvailableFlag() && _timeGapStatsForDesiredReduction.isWindowFilled()) {
|
if (_timeGapStatsForDesiredReduction.getNewStatsAvailableFlag() && _timeGapStatsForDesiredReduction.isWindowFilled()) {
|
||||||
|
|
|
@ -31,18 +31,15 @@ const int DESIRED_JITTER_BUFFER_FRAMES_PADDING = 1;
|
||||||
// _desiredJitterBufferFrames calculation)
|
// _desiredJitterBufferFrames calculation)
|
||||||
const int STATS_FOR_STATS_PACKET_WINDOW_SECONDS = 30;
|
const int STATS_FOR_STATS_PACKET_WINDOW_SECONDS = 30;
|
||||||
|
|
||||||
|
|
||||||
// this controls the window size of the time-weighted avg of frames available. Every time the window fills up,
|
// this controls the window size of the time-weighted avg of frames available. Every time the window fills up,
|
||||||
// _currentJitterBufferFrames is updated with the time-weighted avg and the running time-weighted avg is reset.
|
// _currentJitterBufferFrames is updated with the time-weighted avg and the running time-weighted avg is reset.
|
||||||
const int FRAMES_AVAILABLE_STAT_WINDOW_USECS = 2 * USECS_PER_SECOND;
|
const int FRAMES_AVAILABLE_STAT_WINDOW_USECS = 2 * USECS_PER_SECOND;
|
||||||
|
|
||||||
const int INBOUND_RING_BUFFER_FRAME_CAPACITY = 100;
|
// default values for members of the Settings struct
|
||||||
|
|
||||||
const int DEFAULT_MAX_FRAMES_OVER_DESIRED = 10;
|
const int DEFAULT_MAX_FRAMES_OVER_DESIRED = 10;
|
||||||
const bool DEFAULT_DYNAMIC_JITTER_BUFFERS = true;
|
const bool DEFAULT_DYNAMIC_JITTER_BUFFERS = true;
|
||||||
const int DEFAULT_STATIC_DESIRED_JITTER_BUFFER_FRAMES = 1;
|
const int DEFAULT_STATIC_DESIRED_JITTER_BUFFER_FRAMES = 1;
|
||||||
const bool DEFAULT_USE_STDEV_FOR_JITTER_CALC = false;
|
const bool DEFAULT_USE_STDEV_FOR_JITTER_CALC = false;
|
||||||
|
|
||||||
const int DEFAULT_WINDOW_STARVE_THRESHOLD = 3;
|
const int DEFAULT_WINDOW_STARVE_THRESHOLD = 3;
|
||||||
const int DEFAULT_WINDOW_SECONDS_FOR_DESIRED_CALC_ON_TOO_MANY_STARVES = 50;
|
const int DEFAULT_WINDOW_SECONDS_FOR_DESIRED_CALC_ON_TOO_MANY_STARVES = 50;
|
||||||
const int DEFAULT_WINDOW_SECONDS_FOR_DESIRED_REDUCTION = 10;
|
const int DEFAULT_WINDOW_SECONDS_FOR_DESIRED_REDUCTION = 10;
|
||||||
|
@ -229,7 +226,6 @@ protected:
|
||||||
// dropping silent frames right now.
|
// dropping silent frames right now.
|
||||||
int _currentJitterBufferFrames;
|
int _currentJitterBufferFrames;
|
||||||
|
|
||||||
|
|
||||||
MovingMinMaxAvg<quint64> _timeGapStatsForStatsPacket;
|
MovingMinMaxAvg<quint64> _timeGapStatsForStatsPacket;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,36 +0,0 @@
|
||||||
//
|
|
||||||
// MovingPercentile.h
|
|
||||||
// libraries/shared/src
|
|
||||||
//
|
|
||||||
// Created by Yixin Wang on 6/4/2014
|
|
||||||
//
|
|
||||||
// Distributed under the Apache License, Version 2.0.
|
|
||||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
|
||||||
//
|
|
||||||
|
|
||||||
#ifndef hifi_MovingPercentile_h
|
|
||||||
#define hifi_MovingPercentile_h
|
|
||||||
|
|
||||||
#include <qlist.h>
|
|
||||||
|
|
||||||
class MovingPercentile {
|
|
||||||
|
|
||||||
public:
|
|
||||||
MovingPercentile(int numSamples, float percentile = 0.5f);
|
|
||||||
|
|
||||||
void updatePercentile(float sample);
|
|
||||||
float getValueAtPercentile() const { return _valueAtPercentile; }
|
|
||||||
|
|
||||||
private:
|
|
||||||
const int _numSamples;
|
|
||||||
const float _percentile;
|
|
||||||
|
|
||||||
QList<float> _samplesSorted;
|
|
||||||
QList<int> _sampleIds; // incrementally assigned, is cyclic
|
|
||||||
int _newSampleId;
|
|
||||||
|
|
||||||
int _indexOfPercentile;
|
|
||||||
float _valueAtPercentile;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
Loading…
Reference in a new issue