3
0
Fork 0
mirror of https://github.com/lubosz/overte.git synced 2025-04-26 20:35:27 +02:00

Merge and resolve conflict on APplication.cpp

This commit is contained in:
Sam Gateau 2014-11-10 10:07:24 -08:00
commit 7ccb7495c7
15 changed files with 58 additions and 34 deletions

View file

@ -48,7 +48,7 @@
#include <OctreeConstants.h>
#include <PacketHeaders.h>
#include <SharedUtil.h>
#include <StdDev.h>
#include <StDev.h>
#include <UUID.h>
#include "AudioRingBuffer.h"
@ -61,7 +61,7 @@
const float LOUDNESS_TO_DISTANCE_RATIO = 0.00001f;
const float DEFAULT_ATTENUATION_PER_DOUBLING_IN_DISTANCE = 0.18;
const float DEFAULT_NOISE_MUTING_THRESHOLD = 0.003f;
const float DEFAULT_NOISE_MUTING_THRESHOLD = 0.001f;
const QString AUDIO_MIXER_LOGGING_TARGET_NAME = "audio-mixer";
const QString AUDIO_ENV_GROUP_KEY = "audio_env";
const QString AUDIO_BUFFER_GROUP_KEY = "audio_buffer";
@ -78,7 +78,7 @@ bool AudioMixer::_printStreamStats = false;
bool AudioMixer::_enableFilter = true;
bool AudioMixer::shouldMute(float quietestFrame, float loudestFrame) {
bool AudioMixer::shouldMute(float quietestFrame) {
return (quietestFrame > _noiseMutingThreshold);
}
@ -142,7 +142,7 @@ int AudioMixer::addStreamToMixForListeningNodeWithStream(AudioMixerClientData* l
}
// if the stream should be muted, bail
if (shouldMute(streamToAdd->getQuietestTrailingFrameLoudness(), streamToAdd->getLoudestTrailingFrameLoudness())) {
if (shouldMute(streamToAdd->getQuietestFrameLoudness())) {
return 0;
}

View file

@ -60,7 +60,7 @@ private:
void perSecondActions();
bool shouldMute(float quietestFrame, float loudestFrame);
bool shouldMute(float quietestFrame);
QString getReadPendingDatagramsCallsPerSecondsStatsString() const;
QString getReadPendingDatagramsPacketsPerCallStatsString() const;

View file

@ -93,8 +93,8 @@
"name": "noise_muting_threshold",
"label": "Noise Muting Threshold",
"help": "Loudness value for noise background between 0 and 1.0 (0: mute everyone, 1.0: never mute)",
"placeholder": "0.003",
"default": "0.003",
"placeholder": "0.001",
"default": "0.001",
"advanced": false
},
{

View file

@ -108,8 +108,8 @@ static unsigned STARFIELD_SEED = 1;
static const int BANDWIDTH_METER_CLICK_MAX_DRAG_LENGTH = 6; // farther dragged clicks are ignored
//const unsigned MAXIMUM_CACHE_SIZE = 10737418240; // 10GB
const quint64 MAXIMUM_CACHE_SIZE = 10737418240L; // 10GB
const qint64 MAXIMUM_CACHE_SIZE = 10737418240; // 10GB
static QTimer* idleTimer = NULL;

View file

@ -35,7 +35,7 @@
#include <NodeList.h>
#include <PacketHeaders.h>
#include <SharedUtil.h>
#include <StdDev.h>
#include <StDev.h>
#include <UUID.h>
#include <glm/glm.hpp>

View file

@ -40,12 +40,12 @@
#include <QByteArray>
#include <AbstractAudioInterface.h>
#include <StdDev.h>
#include <StDev.h>
#include "MixedProcessedAudioStream.h"
#include "AudioEffectOptions.h"
#include <AudioRingBuffer.h>
#include <StdDev.h>
#include <StDev.h>
extern "C" {
#include <gverb.h>

View file

@ -90,6 +90,17 @@ Hair::Hair(int strands,
}
}
Hair::~Hair() {
delete[] _hairPosition;
delete[] _hairOriginalPosition;
delete[] _hairLastPosition;
delete[] _hairQuadDelta;
delete[] _hairNormals;
delete[] _hairColors;
delete[] _hairIsMoveable;
delete[] _hairConstraints;
}
const float SOUND_THRESHOLD = 40.0f;
void Hair::simulate(float deltaTime) {

View file

@ -37,6 +37,7 @@ public:
float radius = DEFAULT_HAIR_RADIUS,
float linkLength = DEFAULT_HAIR_LINK_LENGTH,
float hairThickness = DEFAULT_HAIR_THICKNESS);
~Hair();
void simulate(float deltaTime);
void render();
void setAcceleration(const glm::vec3& acceleration) { _acceleration = acceleration; }

View file

@ -18,7 +18,7 @@
#include "SequenceNumberStats.h"
#include "AudioStreamStats.h"
#include "PacketHeaders.h"
#include "StdDev.h"
#include "StDev.h"
#include "TimeWeightedAvg.h"
// This adds some number of frames to the desired jitter buffer frames target we use when we're dropping frames.

View file

@ -33,7 +33,7 @@ PositionalAudioStream::PositionalAudioStream(PositionalAudioStream::Type type, b
_lastPopOutputTrailingLoudness(0.0f),
_lastPopOutputLoudness(0.0f),
_quietestTrailingFrameLoudness(std::numeric_limits<float>::max()),
_loudestTrailingFrameLoudness(0.0f),
_quietestFrameLoudness(0.0f),
_frameCounter(0)
{
}
@ -62,16 +62,14 @@ void PositionalAudioStream::updateLastPopOutputLoudnessAndTrailingLoudness() {
}
}
if (_frameCounter++ == TRAILING_MUTE_THRESHOLD_FRAMES) {
_quietestFrameLoudness = _quietestTrailingFrameLoudness;
_frameCounter = 0;
_quietestTrailingFrameLoudness = std::numeric_limits<float>::max();
_loudestTrailingFrameLoudness = 0.0f;
}
if (_lastPopOutputLoudness < _quietestTrailingFrameLoudness) {
_quietestTrailingFrameLoudness = _lastPopOutputLoudness;
}
if (_lastPopOutputLoudness > _loudestTrailingFrameLoudness) {
_loudestTrailingFrameLoudness = _lastPopOutputLoudness;
}
}
int PositionalAudioStream::parsePositionalData(const QByteArray& positionalByteArray) {

View file

@ -36,8 +36,7 @@ public:
void updateLastPopOutputLoudnessAndTrailingLoudness();
float getLastPopOutputTrailingLoudness() const { return _lastPopOutputTrailingLoudness; }
float getLastPopOutputLoudness() const { return _lastPopOutputLoudness; }
float getQuietestTrailingFrameLoudness() const { return _quietestTrailingFrameLoudness; }
float getLoudestTrailingFrameLoudness() const { return _loudestTrailingFrameLoudness; }
float getQuietestFrameLoudness() const { return _quietestFrameLoudness; }
bool shouldLoopbackForNode() const { return _shouldLoopbackForNode; }
bool isStereo() const { return _isStereo; }
@ -67,7 +66,7 @@ protected:
float _lastPopOutputTrailingLoudness;
float _lastPopOutputLoudness;
float _quietestTrailingFrameLoudness;
float _loudestTrailingFrameLoudness;
float _quietestFrameLoudness;
int _frameCounter;
};

View file

@ -68,7 +68,8 @@ void OctreeElement::init(unsigned char * octalCode) {
// set up the _children union
_childBitmask = 0;
_childrenExternal = false;
#ifdef BLENDED_UNION_CHILDREN
_children.external = NULL;
_singleChildrenCount++;
@ -660,6 +661,11 @@ void OctreeElement::deleteAllChildren() {
delete childAt;
}
}
if (_childrenExternal) {
// if the children_t union represents _children.external we need to delete it here
delete[] _children.external;
}
#ifdef BLENDED_UNION_CHILDREN
// now, reset our internal state and ANY and all population data
@ -757,6 +763,8 @@ void OctreeElement::setChildAtIndex(int childIndex, OctreeElement* child) {
memset(_children.external, 0, sizeof(OctreeElement*) * NUMBER_OF_CHILDREN);
_children.external[firstIndex] = previousChild;
_children.external[childIndex] = child;
_childrenExternal = true;
_externalChildrenMemoryUsage += NUMBER_OF_CHILDREN * sizeof(OctreeElement*);
@ -764,7 +772,10 @@ void OctreeElement::setChildAtIndex(int childIndex, OctreeElement* child) {
assert(!child); // we are removing a child, so this must be true!
OctreeElement* previousFirstChild = _children.external[firstIndex];
OctreeElement* previousSecondChild = _children.external[secondIndex];
delete[] _children.external;
_childrenExternal = false;
_externalChildrenMemoryUsage -= NUMBER_OF_CHILDREN * sizeof(OctreeElement*);
if (childIndex == firstIndex) {
_children.single = previousSecondChild;

View file

@ -1,5 +1,5 @@
//
// StdDev.cpp
// StDev.cpp
// libraries/shared/src
//
// Created by Philip Rosedale on 3/12/13.
@ -11,16 +11,18 @@
#include <limits>
#include <cmath>
#include "StdDev.h"
#include <cstring>
const int NUM_SAMPLES = 1000;
#include "StDev.h"
StDev::StDev() {
_data = new float[NUM_SAMPLES];
_sampleCount = 0;
StDev::StDev() :
_sampleCount(0)
{
reset();
}
void StDev::reset() {
memset(&_data, 0, sizeof(_data));
_sampleCount = 0;
}

View file

@ -1,5 +1,5 @@
//
// StdDev.h
// StDev.h
// libraries/shared/src
//
// Created by Philip Rosedale on 3/12/13.
@ -9,8 +9,10 @@
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
#ifndef hifi_StdDev_h
#define hifi_StdDev_h
#ifndef hifi_StDev_h
#define hifi_StDev_h
const int NUM_SAMPLES = 1000;
class StDev {
public:
@ -21,8 +23,8 @@ public:
float getStDev() const;
int getSamples() const { return _sampleCount; }
private:
float* _data;
float _data[NUM_SAMPLES];
int _sampleCount;
};
#endif // hifi_StdDev_h
#endif // hifi_StDev_h

View file

@ -20,7 +20,7 @@
#include <SequenceNumberStats.h>
#include <SharedUtil.h> // for usecTimestampNow
#include <SimpleMovingAverage.h>
#include <StdDev.h>
#include <StDev.h>
const quint64 MSEC_TO_USEC = 1000;
const quint64 LARGE_STATS_TIME = 500; // we don't expect stats calculation to take more than this many usecs