summaryrefslogtreecommitdiff
path: root/indra/llwebrtc
diff options
context:
space:
mode:
authorRoxie Linden <roxie@lindenlab.com>2024-08-18 23:10:00 -0700
committerRoxie Linden <roxie@lindenlab.com>2024-08-18 23:10:00 -0700
commitde0b5afa25e9d0f1a1a6f68cc220610cc8fee55e (patch)
tree3c04a606ed304fdd6b87f1c534e1e791c4fe9fb8 /indra/llwebrtc
parent226f7bc5b78bbaf13485f2e94b4e185ccd1c5608 (diff)
parent28fdd6e78658f9935eeb2b122265e05aecb548ed (diff)
Merge branch 'roxie/webrtc-airpod-fixes' of github.com:secondlife/viewer into roxie/webrtc-airpod-fixes
Diffstat (limited to 'indra/llwebrtc')
-rw-r--r--indra/llwebrtc/llwebrtc.cpp32
1 files changed, 17 insertions, 15 deletions
diff --git a/indra/llwebrtc/llwebrtc.cpp b/indra/llwebrtc/llwebrtc.cpp
index d154bfb8eb..0daa767766 100644
--- a/indra/llwebrtc/llwebrtc.cpp
+++ b/indra/llwebrtc/llwebrtc.cpp
@@ -206,10 +206,10 @@ void LLWebRTCImpl::init()
mTuningDeviceModule->SetAudioDeviceSink(this);
mTuningDeviceModule->InitMicrophone();
mTuningDeviceModule->InitSpeaker();
+ mTuningDeviceModule->SetStereoRecording(false);
+ mTuningDeviceModule->SetStereoPlayout(true);
mTuningDeviceModule->InitRecording();
mTuningDeviceModule->InitPlayout();
- mTuningDeviceModule->SetStereoRecording(true);
- mTuningDeviceModule->SetStereoPlayout(true);
updateDevices();
});
@@ -227,10 +227,6 @@ void LLWebRTCImpl::init()
mPeerDeviceModule->EnableBuiltInAEC(false);
mPeerDeviceModule->InitMicrophone();
mPeerDeviceModule->InitSpeaker();
- mPeerDeviceModule->InitRecording();
- mPeerDeviceModule->InitPlayout();
- mPeerDeviceModule->SetStereoRecording(true);
- mPeerDeviceModule->SetStereoPlayout(true);
});
// The custom processor allows us to retrieve audio data (and levels)
@@ -253,6 +249,8 @@ void LLWebRTCImpl::init()
apm_config.pipeline.multi_channel_render = true;
apm_config.pipeline.multi_channel_capture = false;
+ mAudioProcessingModule->ApplyConfig(apm_config);
+
webrtc::ProcessingConfig processing_config;
processing_config.input_stream().set_num_channels(2);
processing_config.input_stream().set_sample_rate_hz(48000);
@@ -263,10 +261,8 @@ void LLWebRTCImpl::init()
processing_config.reverse_output_stream().set_num_channels(2);
processing_config.reverse_output_stream().set_sample_rate_hz(48000);
- mAudioProcessingModule->ApplyConfig(apm_config);
mAudioProcessingModule->Initialize(processing_config);
-
mPeerConnectionFactory = webrtc::CreatePeerConnectionFactory(mNetworkThread.get(),
mWorkerThread.get(),
mSignalingThread.get(),
@@ -329,6 +325,8 @@ void LLWebRTCImpl::setRecording(bool recording)
{
if (recording)
{
+ mPeerDeviceModule->SetStereoRecording(false);
+ mPeerDeviceModule->InitRecording();
mPeerDeviceModule->StartRecording();
}
else
@@ -345,6 +343,8 @@ void LLWebRTCImpl::setPlayout(bool playing)
{
if (playing)
{
+ mPeerDeviceModule->SetStereoPlayout(true);
+ mPeerDeviceModule->InitPlayout();
mPeerDeviceModule->StartPlayout();
}
else
@@ -430,9 +430,9 @@ void ll_set_device_module_capture_device(rtc::scoped_refptr<webrtc::AudioDeviceM
// has it at 0
device_module->SetRecordingDevice(device + 1);
#endif
+ device_module->SetStereoRecording(false);
device_module->InitMicrophone();
device_module->InitRecording();
- device_module->SetStereoRecording(false);
}
void LLWebRTCImpl::setCaptureDevice(const std::string &id)
@@ -494,9 +494,9 @@ void ll_set_device_module_render_device(rtc::scoped_refptr<webrtc::AudioDeviceMo
#else
device_module->SetPlayoutDevice(device + 1);
#endif
+ device_module->SetStereoPlayout(true);
device_module->InitSpeaker();
device_module->InitPlayout();
- device_module->SetStereoPlayout(true);
}
void LLWebRTCImpl::setRenderDevice(const std::string &id)
@@ -626,6 +626,8 @@ void LLWebRTCImpl::setTuningMode(bool enable)
//mTuningDeviceModule->StopPlayout();
ll_set_device_module_render_device(mPeerDeviceModule, mPlayoutDevice);
ll_set_device_module_capture_device(mPeerDeviceModule, mRecordingDevice);
+ mPeerDeviceModule->SetStereoPlayout(true);
+ mPeerDeviceModule->SetStereoRecording(false);
mPeerDeviceModule->InitPlayout();
mPeerDeviceModule->InitRecording();
mPeerDeviceModule->StartPlayout();
@@ -667,13 +669,13 @@ LLWebRTCPeerConnectionInterface *LLWebRTCImpl::newPeerConnection()
rtc::scoped_refptr<LLWebRTCPeerConnectionImpl> peerConnection = rtc::scoped_refptr<LLWebRTCPeerConnectionImpl>(new rtc::RefCountedObject<LLWebRTCPeerConnectionImpl>());
peerConnection->init(this);
+ mPeerConnections.emplace_back(peerConnection);
+ peerConnection->enableSenderTracks(!mMute);
if (mPeerConnections.empty())
{
setRecording(true);
setPlayout(true);
}
- mPeerConnections.emplace_back(peerConnection);
- peerConnection->enableSenderTracks(!mMute);
return peerConnection.get();
}
@@ -702,7 +704,7 @@ void LLWebRTCImpl::freePeerConnection(LLWebRTCPeerConnectionInterface* peer_conn
LLWebRTCPeerConnectionImpl::LLWebRTCPeerConnectionImpl() :
mWebRTCImpl(nullptr),
mPeerConnection(nullptr),
- mMute(false),
+ mMute(true),
mAnswerReceived(false)
{
}
@@ -724,8 +726,8 @@ void LLWebRTCPeerConnectionImpl::init(LLWebRTCImpl * webrtc_impl)
}
void LLWebRTCPeerConnectionImpl::terminate()
{
- mWebRTCImpl->PostSignalingTask(
- [=]()
+ mWebRTCImpl->SignalingBlockingCall(
+ [this]()
{
if (mPeerConnection)
{