- add stun server IP setting + fix problem when processing incoming audio data

This commit is contained in:
2022-09-08 20:54:01 +03:00
parent 93d53957a2
commit eabc1b5c3d
5 changed files with 26 additions and 10 deletions

View File

@@ -730,7 +730,11 @@ void AudioReceiver::initPvqa()
if (!mPVQA)
{
mPVQA = std::make_shared<sevana::pvqa>();
mPVQA->open(AUDIO_SAMPLERATE, 1, PVQA_INTERVAL);
bool is_opened = mPVQA->open(AUDIO_SAMPLERATE, 1, PVQA_INTERVAL);
if (!is_opened)
{
//
}
}
}
@@ -753,7 +757,11 @@ void AudioReceiver::updatePvqa(const void *data, int size)
int time4pvqa = (int)(frames * PVQA_INTERVAL * 1000);
int size4pvqa = (int)fmt.sizeFromTime(time4pvqa);
ICELogDebug(<< "PVQA buffer has " << time4pvqa << " milliseconds of audio.");
mPVQA->update(mPvqaBuffer->data(), size4pvqa);
bool update_result = mPVQA->update(mPvqaBuffer->data(), size4pvqa);
if (!update_result)
{
//
}
mPvqaBuffer->erase(size4pvqa);
}
}

View File

@@ -132,6 +132,7 @@ CodecList::CodecList(const Settings& settings)
:mSettings(settings)
{
//mFactoryList.push_back(new OpusCodec::OpusFactory(16000, 1));
/*
#if defined(USE_OPUS_CODEC)
if (settings.mOpusSpec.empty())
{
@@ -145,6 +146,7 @@ CodecList::CodecList(const Settings& settings)
}
}
#endif
*/
#if !defined(TARGET_ANDROID) && !defined(TARGET_OPENWRT) && !defined(TARGET_RPI)
#if defined(USE_AMR_CODEC)
@@ -161,14 +163,14 @@ CodecList::CodecList(const Settings& settings)
mFactoryList.push_back(new GsmEfrCodec::GsmEfrFactory(mSettings.mWrapIuUP, mSettings.mGsmEfrPayloadType));
#endif
#endif
mFactoryList.push_back(new IsacCodec::IsacFactory16K(mSettings.mIsac16KPayloadType));
mFactoryList.push_back(new IlbcCodec::IlbcFactory(mSettings.mIlbc20PayloadType, mSettings.mIlbc30PayloadType));
// mFactoryList.push_back(new IsacCodec::IsacFactory16K(mSettings.mIsac16KPayloadType));
// mFactoryList.push_back(new IlbcCodec::IlbcFactory(mSettings.mIlbc20PayloadType, mSettings.mIlbc30PayloadType));
mFactoryList.push_back(new G711Codec::AlawFactory());
mFactoryList.push_back(new G711Codec::UlawFactory());
mFactoryList.push_back(new GsmCodec::GsmFactory(mSettings.mGsmFrPayloadLength == 32 ? GsmCodec::Type::Bytes_32 : GsmCodec::Type::Bytes_33, mSettings.mGsmFrPayloadType));
mFactoryList.push_back(new G722Codec::G722Factory());
mFactoryList.push_back(new G729Codec::G729Factory());
// mFactoryList.push_back(new G722Codec::G722Factory());
// mFactoryList.push_back(new G729Codec::G729Factory());
#ifndef TARGET_ANDROID
mFactoryList.push_back(new GsmHrCodec::GsmHrFactory(mSettings.mGsmHrPayloadType));
#endif