Merge branch 'release/2025.07' of https://github.com/secondlife/viewer

# Conflicts:
#	indra/newview/llappviewer.cpp
master
Ansariel 2025-09-23 10:01:04 +02:00
commit 3717122cb9
6 changed files with 69 additions and 32 deletions

View File

@ -97,7 +97,7 @@ jobs:
uses: actions/checkout@v5
with:
repository: secondlife/build-variables
ref: universal
ref: master
path: .build-variables
- name: Checkout master-message-template

View File

@ -342,14 +342,27 @@ void LLWebRTCImpl::init()
mWorkerThread->PostTask(
[this]()
{
mDeviceModule->EnableBuiltInAEC(false);
updateDevices();
if (mDeviceModule)
{
mDeviceModule->EnableBuiltInAEC(false);
updateDevices();
}
});
}
void LLWebRTCImpl::terminate()
{
mWorkerThread->BlockingCall(
[this]()
{
if (mDeviceModule)
{
mDeviceModule->ForceStopRecording();
mDeviceModule->StopPlayout();
}
});
for (auto &connection : mPeerConnections)
{
connection->terminate();
@ -368,8 +381,6 @@ void LLWebRTCImpl::terminate()
{
if (mDeviceModule)
{
mDeviceModule->StopRecording();
mDeviceModule->StopPlayout();
mDeviceModule->Terminate();
}
mDeviceModule = nullptr;
@ -441,12 +452,13 @@ void LLWebRTCImpl::unsetDevicesObserver(LLWebRTCDevicesObserver *observer)
// must be run in the worker thread.
void LLWebRTCImpl::workerDeployDevices()
{
if (!mDeviceModule)
{
return;
}
int16_t recordingDevice = RECORD_DEVICE_DEFAULT;
#if WEBRTC_WIN
int16_t recording_device_start = 0;
#else
int16_t recording_device_start = 1;
#endif
if (mRecordingDevice != "Default")
{
@ -455,6 +467,12 @@ void LLWebRTCImpl::workerDeployDevices()
if (mRecordingDeviceList[i].mID == mRecordingDevice)
{
recordingDevice = i;
#if !WEBRTC_WIN
// linux and mac devices range from 1 to the end of the list, with the index 0 being the
// 'default' device. Windows has a special 'default' device and other devices are indexed
// from 0
recordingDevice++;
#endif
break;
}
}
@ -479,11 +497,7 @@ void LLWebRTCImpl::workerDeployDevices()
mDeviceModule->InitRecording();
int16_t playoutDevice = PLAYOUT_DEVICE_DEFAULT;
#if WEBRTC_WIN
int16_t playout_device_start = 0;
#else
int16_t playout_device_start = 1;
#endif
if (mPlayoutDevice != "Default")
{
for (int16_t i = playout_device_start; i < mPlayoutDeviceList.size(); i++)
@ -491,6 +505,12 @@ void LLWebRTCImpl::workerDeployDevices()
if (mPlayoutDeviceList[i].mID == mPlayoutDevice)
{
playoutDevice = i;
#if !WEBRTC_WIN
// linux and mac devices range from 1 to the end of the list, with the index 0 being the
// 'default' device. Windows has a special 'default' device and other devices are indexed
// from 0
playoutDevice++;
#endif
break;
}
}
@ -546,25 +566,24 @@ void LLWebRTCImpl::workerDeployDevices()
void LLWebRTCImpl::setCaptureDevice(const std::string &id)
{
if (mRecordingDevice != id)
{
mRecordingDevice = id;
deployDevices();
}
mRecordingDevice = id;
deployDevices();
}
void LLWebRTCImpl::setRenderDevice(const std::string &id)
{
if (mPlayoutDevice != id)
{
mPlayoutDevice = id;
deployDevices();
}
mPlayoutDevice = id;
deployDevices();
}
// updateDevices needs to happen on the worker thread.
void LLWebRTCImpl::updateDevices()
{
if (!mDeviceModule)
{
return;
}
int16_t renderDeviceCount = mDeviceModule->PlayoutDevices();
mPlayoutDeviceList.clear();
@ -609,7 +628,7 @@ void LLWebRTCImpl::updateDevices()
void LLWebRTCImpl::OnDevicesUpdated()
{
deployDevices();
updateDevices();
}
@ -1485,6 +1504,7 @@ void terminate()
if (gWebRTCImpl)
{
gWebRTCImpl->terminate();
delete gWebRTCImpl;
gWebRTCImpl = nullptr;
}
}

View File

@ -75,7 +75,7 @@ public:
LLWebRTCLogSink(LLWebRTCLogCallback* callback) : mCallback(callback) {}
// Destructor: close the log file
~LLWebRTCLogSink() override {}
~LLWebRTCLogSink() override { mCallback = nullptr; }
void OnLogMessage(const std::string& msg, webrtc::LoggingSeverity severity) override
{
@ -239,8 +239,10 @@ public:
return 0;
}
int32_t StopRecording() override {
if (tuning_) return 0; // if we're tuning, disregard the StopRecording we get from disabling the streams
return inner_->StopRecording();
// ignore stop recording as webrtc.lib will send one when streams shut down,
// even if there are other streams in place. Start/Stop recording are entirely
// controlled by the app
return 0;
}
int32_t ForceStartRecording() { return inner_->StartRecording(); }
int32_t ForceStopRecording() { return inner_->StopRecording(); }

View File

@ -3923,7 +3923,7 @@ LLSD LLAppViewer::getViewerInfo() const
//[FIRE-3923 : SJ] Added Drawdistance, bandwidth and LOD to info
info["DRAW_DISTANCE"] = gSavedSettings.getF32("RenderFarClip");
info["BANDWIDTH"] = gSavedSettings.getF32("ThrottleBandwidthKBPS");
info["BANDWIDTH"] = LLViewerThrottle::getMaxBandwidthKbps();
info["LOD"] = gSavedSettings.getF32("RenderVolumeLODFactor");
//[FIRE 3113 : SJ] Added Settingsfile to info
@ -4065,7 +4065,7 @@ LLSD LLAppViewer::getViewerInfo() const
//info["FONT_SIZE_ADJUSTMENT"] = gSavedSettings.getF32("FontScreenDPI");
//info["UI_SCALE"] = gSavedSettings.getF32("UIScaleFactor");
//info["DRAW_DISTANCE"] = gSavedSettings.getF32("RenderFarClip");
//info["NET_BANDWITH"] = gSavedSettings.getF32("ThrottleBandwidthKBPS");
//info["NET_BANDWITH"] = LLViewerThrottle::getMaxBandwidthKbps();
//info["LOD_FACTOR"] = gSavedSettings.getF32("RenderVolumeLODFactor");
//info["RENDER_QUALITY"] = (F32)gSavedSettings.getU32("RenderQualityPerformance");
//info["TEXTURE_MEMORY"] = gGLManager.mVRAM;

View File

@ -305,7 +305,14 @@ void LLVoiceClient::setHidden(bool hidden)
void LLVoiceClient::terminate()
{
if (mSpatialVoiceModule) mSpatialVoiceModule->terminate();
if (LLVivoxVoiceClient::instanceExists())
{
LLWebRTCVoiceClient::getInstance()->terminate();
}
if (LLVivoxVoiceClient::instanceExists())
{
LLVivoxVoiceClient::getInstance()->terminate();
}
mSpatialVoiceModule = NULL;
m_servicePump = NULL;

View File

@ -288,6 +288,8 @@ void LLWebRTCVoiceClient::terminate()
return;
}
LL_INFOS("Voice") << "Terminating WebRTC" << LL_ENDL;
mVoiceEnabled = false;
llwebrtc::terminate();
@ -697,7 +699,10 @@ LLVoiceDeviceList& LLWebRTCVoiceClient::getCaptureDevices()
void LLWebRTCVoiceClient::setCaptureDevice(const std::string& name)
{
mWebRTCDeviceInterface->setCaptureDevice(name);
if (mWebRTCDeviceInterface)
{
mWebRTCDeviceInterface->setCaptureDevice(name);
}
}
void LLWebRTCVoiceClient::setDevicesListUpdated(bool state)
{
@ -784,7 +789,10 @@ LLVoiceDeviceList& LLWebRTCVoiceClient::getRenderDevices()
void LLWebRTCVoiceClient::setRenderDevice(const std::string& name)
{
mWebRTCDeviceInterface->setRenderDevice(name);
if (mWebRTCDeviceInterface)
{
mWebRTCDeviceInterface->setRenderDevice(name);
}
}
void LLWebRTCVoiceClient::tuningStart()