diff --git a/interface/src/Menu.h b/interface/src/Menu.h index 20097989df..153b402089 100644 --- a/interface/src/Menu.h +++ b/interface/src/Menu.h @@ -86,7 +86,7 @@ public: QAction* getActionForOption(const QString& menuOption); 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; } void setFieldOfView(float fieldOfView) { _fieldOfView = fieldOfView; } float getRealWorldFieldOfView() const { return _realWorldFieldOfView; } diff --git a/interface/src/ui/PreferencesDialog.cpp b/interface/src/ui/PreferencesDialog.cpp index 7189a74579..bde3cfd65a 100644 --- a/interface/src/ui/PreferencesDialog.cpp +++ b/interface/src/ui/PreferencesDialog.cpp @@ -262,7 +262,7 @@ void PreferencesDialog::savePreferences() { streamSettings._windowSecondsForDesiredCalcOnTooManyStarves = ui.windowSecondsForDesiredCalcOnTooManyStarvesSpin->value(); streamSettings._windowSecondsForDesiredReduction = ui.windowSecondsForDesiredReductionSpin->value(); - Menu::getInstance()->getReceivedAudioStreamSettings(streamSettings); + Menu::getInstance()->setReceivedAudioStreamSettings(streamSettings); Application::getInstance()->getAudio()->setReceivedAudioStreamSettings(streamSettings); Application::getInstance()->resizeGL(Application::getInstance()->getGLWidget()->width(), diff --git a/libraries/audio/src/InboundAudioStream.cpp b/libraries/audio/src/InboundAudioStream.cpp index 54c9de6f2f..c6e18b054e 100644 --- a/libraries/audio/src/InboundAudioStream.cpp +++ b/libraries/audio/src/InboundAudioStream.cpp @@ -351,7 +351,6 @@ void InboundAudioStream::packetReceivedUpdateTimingStats() { } if (_dynamicJitterBuffers) { - // 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. if (_timeGapStatsForDesiredReduction.getNewStatsAvailableFlag() && _timeGapStatsForDesiredReduction.isWindowFilled()) { diff --git a/libraries/audio/src/InboundAudioStream.h b/libraries/audio/src/InboundAudioStream.h index c62cf957d7..3275729850 100644 --- a/libraries/audio/src/InboundAudioStream.h +++ b/libraries/audio/src/InboundAudioStream.h @@ -31,18 +31,15 @@ const int DESIRED_JITTER_BUFFER_FRAMES_PADDING = 1; // _desiredJitterBufferFrames calculation) 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, // _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 INBOUND_RING_BUFFER_FRAME_CAPACITY = 100; - +// default values for members of the Settings struct const int DEFAULT_MAX_FRAMES_OVER_DESIRED = 10; const bool DEFAULT_DYNAMIC_JITTER_BUFFERS = true; const int DEFAULT_STATIC_DESIRED_JITTER_BUFFER_FRAMES = 1; const bool DEFAULT_USE_STDEV_FOR_JITTER_CALC = false; - 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_REDUCTION = 10; @@ -229,7 +226,6 @@ protected: // dropping silent frames right now. int _currentJitterBufferFrames; - MovingMinMaxAvg _timeGapStatsForStatsPacket; }; diff --git a/libraries/shared/src/MovingEvent.h b/libraries/shared/src/MovingEvent.h deleted file mode 100644 index 284ed9d890..0000000000 --- a/libraries/shared/src/MovingEvent.h +++ /dev/null @@ -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 - -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 _samplesSorted; - QList _sampleIds; // incrementally assigned, is cyclic - int _newSampleId; - - int _indexOfPercentile; - float _valueAtPercentile; -}; - -#endif