mirror of
https://github.com/overte-org/overte.git
synced 2025-06-06 17:44:10 +02:00
More style fixes for the Great and Powerful Thoys
This commit is contained in:
parent
f93e47cfcd
commit
fef469cca4
4 changed files with 20 additions and 20 deletions
|
@ -12,5 +12,5 @@ link_hifi_libraries(shared audio plugins)
|
||||||
target_opus()
|
target_opus()
|
||||||
|
|
||||||
if (BUILD_SERVER)
|
if (BUILD_SERVER)
|
||||||
install_beside_console()
|
install_beside_console()
|
||||||
endif ()
|
endif ()
|
||||||
|
|
|
@ -29,7 +29,7 @@ public:
|
||||||
private:
|
private:
|
||||||
int _encodedSize;
|
int _encodedSize;
|
||||||
|
|
||||||
OpusDecoder *_decoder = nullptr;
|
OpusDecoder* _decoder = nullptr;
|
||||||
int _opusSampleRate = 0;
|
int _opusSampleRate = 0;
|
||||||
int _opusNumChannels = 0;
|
int _opusNumChannels = 0;
|
||||||
int _decodedSize = 0;
|
int _decodedSize = 0;
|
||||||
|
|
|
@ -41,7 +41,7 @@ static QString errorToString(int error) {
|
||||||
|
|
||||||
AthenaOpusEncoder::AthenaOpusEncoder(int sampleRate, int numChannels) {
|
AthenaOpusEncoder::AthenaOpusEncoder(int sampleRate, int numChannels) {
|
||||||
_opusSampleRate = sampleRate;
|
_opusSampleRate = sampleRate;
|
||||||
_opusChannels = numChannels;
|
_opusChannels = numChannels;
|
||||||
|
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
|
@ -72,8 +72,8 @@ void AthenaOpusEncoder::encode(const QByteArray& decodedBuffer, QByteArray& enco
|
||||||
PerformanceTimer perfTimer("AthenaOpusEncoder::encode");
|
PerformanceTimer perfTimer("AthenaOpusEncoder::encode");
|
||||||
assert(_encoder);
|
assert(_encoder);
|
||||||
|
|
||||||
encodedBuffer.resize( decodedBuffer.size() );
|
encodedBuffer.resize(decodedBuffer.size());
|
||||||
int frameSize = decodedBuffer.length()/ _opusChannels / static_cast<int>(sizeof(opus_int16));
|
int frameSize = decodedBuffer.length() / _opusChannels / static_cast<int>(sizeof(opus_int16));
|
||||||
|
|
||||||
int bytes = opus_encode(_encoder, reinterpret_cast<const opus_int16*>(decodedBuffer.constData()), frameSize,
|
int bytes = opus_encode(_encoder, reinterpret_cast<const opus_int16*>(decodedBuffer.constData()), frameSize,
|
||||||
reinterpret_cast<unsigned char*>(encodedBuffer.data()), encodedBuffer.size() );
|
reinterpret_cast<unsigned char*>(encodedBuffer.data()), encodedBuffer.size() );
|
||||||
|
@ -231,28 +231,28 @@ int AthenaOpusEncoder::getInbandFEC() const {
|
||||||
return fec;
|
return fec;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AthenaOpusEncoder::setInbandFEC(int fec) {
|
void AthenaOpusEncoder::setInbandFEC(int inBandFEC) {
|
||||||
assert(_encoder);
|
assert(_encoder);
|
||||||
int errorCode = opus_encoder_ctl(_encoder, OPUS_SET_INBAND_FEC(fec));
|
int errorCode = opus_encoder_ctl(_encoder, OPUS_SET_INBAND_FEC(inBandFEC));
|
||||||
|
|
||||||
if (errorCode != OPUS_OK) {
|
if (errorCode != OPUS_OK) {
|
||||||
qCWarning(encoder) << "Error when setting inband FEC to " << fec << ": " << errorToString(errorCode);
|
qCWarning(encoder) << "Error when setting inband FEC to " << inBandFEC << ": " << errorToString(errorCode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int AthenaOpusEncoder::getExpectedPacketLossPercent() const {
|
int AthenaOpusEncoder::getExpectedPacketLossPercentage() const {
|
||||||
assert(_encoder);
|
assert(_encoder);
|
||||||
int lossPercentage;
|
int lossPercentage;
|
||||||
opus_encoder_ctl(_encoder, OPUS_GET_PACKET_LOSS_PERC(&lossPercentage));
|
opus_encoder_ctl(_encoder, OPUS_GET_PACKET_LOSS_PERC(&lossPercentage));
|
||||||
return lossPercentage;
|
return lossPercentage;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AthenaOpusEncoder::setExpectedPacketLossPercentage(int percent) {
|
void AthenaOpusEncoder::setExpectedPacketLossPercentage(int percentage) {
|
||||||
assert(_encoder);
|
assert(_encoder);
|
||||||
int errorCode = opus_encoder_ctl(_encoder, OPUS_SET_PACKET_LOSS_PERC(percent));
|
int errorCode = opus_encoder_ctl(_encoder, OPUS_SET_PACKET_LOSS_PERC(percentage));
|
||||||
|
|
||||||
if (errorCode != OPUS_OK) {
|
if (errorCode != OPUS_OK) {
|
||||||
qCWarning(encoder) << "Error when setting loss percent to " << percent << ": " << errorToString(errorCode);
|
qCWarning(encoder) << "Error when setting loss percent to " << percentage << ": " << errorToString(errorCode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -270,4 +270,4 @@ void AthenaOpusEncoder::setDTX(int dtx) {
|
||||||
if (errorCode != OPUS_OK) {
|
if (errorCode != OPUS_OK) {
|
||||||
qCWarning(encoder) << "Error when setting DTX to " << dtx << ": " << errorToString(errorCode);
|
qCWarning(encoder) << "Error when setting DTX to " << dtx << ": " << errorToString(errorCode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,27 +38,27 @@ public:
|
||||||
void setVBR(int vbr);
|
void setVBR(int vbr);
|
||||||
|
|
||||||
int getVBRConstraint() const;
|
int getVBRConstraint() const;
|
||||||
void setVBRConstraint(int vbr_const);
|
void setVBRConstraint(int vbrConstraint);
|
||||||
|
|
||||||
int getMaxBandwidth() const;
|
int getMaxBandwidth() const;
|
||||||
void setMaxBandwidth(int maxbw);
|
void setMaxBandwidth(int maxBandwidth);
|
||||||
|
|
||||||
int getBandwidth() const;
|
int getBandwidth() const;
|
||||||
void setBandwidth(int bw);
|
void setBandwidth(int bandwidth);
|
||||||
|
|
||||||
int getSignal() const;
|
int getSignal() const;
|
||||||
void setSignal(int signal);
|
void setSignal(int signal);
|
||||||
|
|
||||||
int getApplication() const;
|
int getApplication() const;
|
||||||
void setApplication(int app);
|
void setApplication(int application);
|
||||||
|
|
||||||
int getLookahead() const;
|
int getLookahead() const;
|
||||||
|
|
||||||
int getInbandFEC() const;
|
int getInbandFEC() const;
|
||||||
void setInbandFEC(int fec);
|
void setInbandFEC(int inBandFEC);
|
||||||
|
|
||||||
int getExpectedPacketLossPercent() const;
|
int getExpectedPacketLossPercentage() const;
|
||||||
void setExpectedPacketLossPercentage(int percent);
|
void setExpectedPacketLossPercentage(int percentage);
|
||||||
|
|
||||||
int getDTX() const;
|
int getDTX() const;
|
||||||
void setDTX(int dtx);
|
void setDTX(int dtx);
|
||||||
|
|
Loading…
Reference in a new issue