Skip to content

Commit 0e3ba50

Browse files
committed
Revert "Improve switching of webrtc devices"
Wrong approach. Might need to split workerDeployDevices into separate recording and rendering variants. This partiall reverts commit bb26aa3, I left log lines.
1 parent 34dcaaa commit 0e3ba50

File tree

5 files changed

+1
-38
lines changed

5 files changed

+1
-38
lines changed

indra/llwebrtc/llwebrtc.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -582,13 +582,6 @@ void LLWebRTCImpl::setRenderDevice(const std::string &id)
582582
deployDevices();
583583
}
584584

585-
void LLWebRTCImpl::setDevices(const std::string& capture_id, const std::string& render_id)
586-
{
587-
mRecordingDevice = capture_id;
588-
mPlayoutDevice = render_id;
589-
deployDevices();
590-
}
591-
592585
// updateDevices needs to happen on the worker thread.
593586
void LLWebRTCImpl::updateDevices()
594587
{

indra/llwebrtc/llwebrtc.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,6 @@ class LLWebRTCDeviceInterface
150150
// set the capture and render devices using the unique identifier for the device
151151
virtual void setCaptureDevice(const std::string& id) = 0;
152152
virtual void setRenderDevice(const std::string& id) = 0;
153-
virtual void setDevices(const std::string& caprure_id, const std::string& render_id) = 0;
154153

155154
// Device observers for device change callbacks.
156155
virtual void setDevicesObserver(LLWebRTCDevicesObserver *observer) = 0;

indra/llwebrtc/llwebrtc_impl.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,6 @@ class LLWebRTCImpl : public LLWebRTCDeviceInterface, public webrtc::AudioDeviceO
443443

444444
void setCaptureDevice(const std::string& id) override;
445445
void setRenderDevice(const std::string& id) override;
446-
void setDevices(const std::string& caprure_id, const std::string& render_id) override;
447446

448447
void setTuningMode(bool enable) override;
449448
float getTuningAudioLevel() override;

indra/newview/llvoicewebrtc.cpp

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -735,8 +735,6 @@ void LLWebRTCVoiceClient::OnDevicesChangedImpl(const llwebrtc::LLWebRTCVoiceDevi
735735
std::string outputDevice = gSavedSettings.getString("VoiceOutputAudioDevice");
736736

737737
LL_DEBUGS("Voice") << "Setting devices to-input: '" << inputDevice << "' output: '" << outputDevice << "'" << LL_ENDL;
738-
bool update_render = false;
739-
bool update_capture = false;
740738

741739
// only set the render device if the device list has changed.
742740
if (mRenderDevices.size() != render_devices.size() || !std::equal(mRenderDevices.begin(),
@@ -750,7 +748,7 @@ void LLWebRTCVoiceClient::OnDevicesChangedImpl(const llwebrtc::LLWebRTCVoiceDevi
750748
{
751749
addRenderDevice(LLVoiceDevice(device.mDisplayName, device.mID));
752750
}
753-
update_render = true;
751+
setRenderDevice(outputDevice);
754752
}
755753

756754
// only set the capture device if the device list has changed.
@@ -767,22 +765,6 @@ void LLWebRTCVoiceClient::OnDevicesChangedImpl(const llwebrtc::LLWebRTCVoiceDevi
767765

768766
addCaptureDevice(LLVoiceDevice(device.mDisplayName, device.mID));
769767
}
770-
update_capture = true;
771-
}
772-
773-
if (update_render && update_capture)
774-
{
775-
// Do both in one go to avoid multiple deployDevices calls.
776-
// And to avoid situation where workerDeployDevices has an
777-
// obsolete device id
778-
setDevices(inputDevice, outputDevice);
779-
}
780-
else if (update_render)
781-
{
782-
setRenderDevice(outputDevice);
783-
}
784-
else if (update_capture)
785-
{
786768
setCaptureDevice(inputDevice);
787769
}
788770

@@ -816,15 +798,6 @@ void LLWebRTCVoiceClient::setRenderDevice(const std::string& name)
816798
}
817799
}
818800

819-
void LLWebRTCVoiceClient::setDevices(const std::string& capture_name, const std::string& render_name)
820-
{
821-
if (mWebRTCDeviceInterface)
822-
{
823-
LL_DEBUGS("Voice") << "new capture device: " << capture_name << " New render device: " << render_name << LL_ENDL;
824-
mWebRTCDeviceInterface->setDevices(capture_name, render_name);
825-
}
826-
}
827-
828801
void LLWebRTCVoiceClient::tuningStart()
829802
{
830803
if (!mIsInTuningMode)

indra/newview/llvoicewebrtc.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ class LLWebRTCVoiceClient : public LLSingleton<LLWebRTCVoiceClient>,
124124

125125
void setCaptureDevice(const std::string& name) override;
126126
void setRenderDevice(const std::string& name) override;
127-
void setDevices(const std::string& capture_name, const std::string& render_name);
128127

129128
LLVoiceDeviceList& getCaptureDevices() override;
130129
LLVoiceDeviceList& getRenderDevices() override;

0 commit comments

Comments
 (0)