From fc462b2b0f7ee153626d162bd97a05110f0804b7 Mon Sep 17 00:00:00 2001 From: Roxie Linden Date: Sun, 10 Mar 2024 00:11:43 -0800 Subject: Remove trailing spaces. Other code cleanup. --- indra/llwebrtc/llwebrtc.cpp | 50 +++++++++++++++++++++--------------------- indra/llwebrtc/llwebrtc.h | 4 ++-- indra/llwebrtc/llwebrtc_impl.h | 22 +++++++++---------- 3 files changed, 38 insertions(+), 38 deletions(-) (limited to 'indra/llwebrtc') diff --git a/indra/llwebrtc/llwebrtc.cpp b/indra/llwebrtc/llwebrtc.cpp index dc5fd9657e..875f233e65 100644 --- a/indra/llwebrtc/llwebrtc.cpp +++ b/indra/llwebrtc/llwebrtc.cpp @@ -85,15 +85,15 @@ void LLAudioDeviceObserver::OnRenderData(const void *audio_samples, } LLCustomProcessor::LLCustomProcessor() : - mSampleRateHz(0), + mSampleRateHz(0), mNumChannels(0), mMicrophoneEnergy(0.0) -{ +{ memset(mSumVector, 0, sizeof(mSumVector)); } void LLCustomProcessor::Initialize(int sample_rate_hz, int num_channels) -{ +{ mSampleRateHz = sample_rate_hz; mNumChannels = num_channels; memset(mSumVector, 0, sizeof(mSumVector)); @@ -187,7 +187,7 @@ void LLWebRTCImpl::init() { // Initialize the audio devices on the Worker Thread mTuningDeviceModule = webrtc::CreateAudioDeviceWithDataObserver( - webrtc::AudioDeviceModule::AudioLayer::kPlatformDefaultAudio, + webrtc::AudioDeviceModule::AudioLayer::kPlatformDefaultAudio, mTaskQueueFactory.get(), std::unique_ptr(mTuningAudioDeviceObserver)); @@ -198,7 +198,7 @@ void LLWebRTCImpl::init() mTuningDeviceModule->SetAudioDeviceSink(this); updateDevices(); }); - + mWorkerThread->BlockingCall( [this]() { @@ -426,7 +426,7 @@ void LLWebRTCImpl::setRenderDevice(const std::string &id) { mTuningDeviceModule->StopPlayout(); } - + mTuningDeviceModule->SetPlayoutDevice(tuningPlayoutDevice); mTuningDeviceModule->InitSpeaker(); mTuningDeviceModule->InitPlayout(); @@ -456,7 +456,7 @@ void LLWebRTCImpl::setRenderDevice(const std::string &id) mPeerDeviceModule->InitSpeaker(); mPeerDeviceModule->InitPlayout(); mPeerDeviceModule->StartPlayout(); - + } }); } @@ -466,7 +466,7 @@ void LLWebRTCImpl::updateDevices() { int16_t renderDeviceCount = mTuningDeviceModule->PlayoutDevices(); int16_t currentRenderDeviceIndex = mTuningDeviceModule->GetPlayoutDevice(); - + LLWebRTCVoiceDeviceList renderDeviceList; for (int16_t index = 0; index < renderDeviceCount; index++) { @@ -475,7 +475,7 @@ void LLWebRTCImpl::updateDevices() mTuningDeviceModule->PlayoutDeviceName(index, name, guid); renderDeviceList.emplace_back(name, guid, index == currentRenderDeviceIndex); } - + int16_t captureDeviceCount = mTuningDeviceModule->RecordingDevices(); int16_t currentCaptureDeviceIndex = mTuningDeviceModule->GetRecordingDevice(); @@ -533,7 +533,7 @@ LLWebRTCPeerConnectionInterface *LLWebRTCImpl::newPeerConnection() { rtc::scoped_refptr peerConnection = rtc::scoped_refptr(new rtc::RefCountedObject()); peerConnection->init(this); - + mPeerConnections.emplace_back(peerConnection); peerConnection->enableSenderTracks(!mMute); return peerConnection.get(); @@ -703,7 +703,7 @@ bool LLWebRTCPeerConnectionImpl::initializeConnection() webrtc::PeerConnectionInterface::RTCOfferAnswerOptions offerOptions; mPeerConnection->CreateOffer(this, offerOptions); }); - + return true; } @@ -759,7 +759,7 @@ void LLWebRTCPeerConnectionImpl::enableReceiverTracks(bool enable) void LLWebRTCPeerConnectionImpl::AnswerAvailable(const std::string &sdp) { RTC_LOG(LS_INFO) << __FUNCTION__ << " Remote SDP: " << sdp; - + mWebRTCImpl->PostSignalingTask( [this, sdp]() { @@ -768,7 +768,7 @@ void LLWebRTCPeerConnectionImpl::AnswerAvailable(const std::string &sdp) RTC_LOG(LS_INFO) << __FUNCTION__ << " " << mPeerConnection->peer_connection_state(); mPeerConnection->SetRemoteDescription(webrtc::CreateSessionDescription(webrtc::SdpType::kAnswer, sdp), rtc::scoped_refptr(this)); - } + } }); } @@ -801,8 +801,8 @@ void LLWebRTCPeerConnectionImpl::setMute(bool mute) } void LLWebRTCPeerConnectionImpl::resetMute() -{ - setMute(mMute); +{ + setMute(mMute); } void LLWebRTCPeerConnectionImpl::setReceiveVolume(float volume) @@ -893,7 +893,7 @@ void LLWebRTCPeerConnectionImpl::OnIceGatheringChange(webrtc::PeerConnectionInte webrtc_new_state = LLWebRTCSignalingObserver::EIceGatheringState::ICE_GATHERING_NEW; return; } - + if (mAnswerReceived) { for (auto &observer : mSignalingObserverList) @@ -907,7 +907,7 @@ void LLWebRTCPeerConnectionImpl::OnIceGatheringChange(webrtc::PeerConnectionInte void LLWebRTCPeerConnectionImpl::OnConnectionChange(webrtc::PeerConnectionInterface::PeerConnectionState new_state) { RTC_LOG(LS_ERROR) << __FUNCTION__ << " Peer Connection State Change " << new_state; - + switch (new_state) { case webrtc::PeerConnectionInterface::PeerConnectionState::kConnected: @@ -929,7 +929,7 @@ void LLWebRTCPeerConnectionImpl::OnConnectionChange(webrtc::PeerConnectionInterf { observer->OnRenegotiationNeeded(); } - + break; } default: @@ -944,7 +944,7 @@ void LLWebRTCPeerConnectionImpl::OnConnectionChange(webrtc::PeerConnectionInterf static std::string iceCandidateToTrickleString(const webrtc::IceCandidateInterface *candidate) { std::ostringstream candidate_stream; - + candidate_stream << candidate->candidate().foundation() << " " << std::to_string(candidate->candidate().component()) << " " << @@ -952,7 +952,7 @@ static std::string iceCandidateToTrickleString(const webrtc::IceCandidateInterfa std::to_string(candidate->candidate().priority()) << " " << candidate->candidate().address().ipaddr().ToString() << " " << candidate->candidate().address().PortAsString() << " typ "; - + if (candidate->candidate().type() == cricket::LOCAL_PORT_TYPE) { candidate_stream << "host"; @@ -982,7 +982,7 @@ static std::string iceCandidateToTrickleString(const webrtc::IceCandidateInterfa { candidate_stream << " tcptype " << candidate->candidate().tcptype(); } - + return candidate_stream.str(); } @@ -990,7 +990,7 @@ static std::string iceCandidateToTrickleString(const webrtc::IceCandidateInterfa void LLWebRTCPeerConnectionImpl::OnIceCandidate(const webrtc::IceCandidateInterface *candidate) { RTC_LOG(LS_INFO) << __FUNCTION__ << " " << candidate->sdp_mline_index(); - + if (!candidate) { RTC_LOG(LS_ERROR) << __FUNCTION__ << " No Ice Candidate Given"; @@ -1067,7 +1067,7 @@ void LLWebRTCPeerConnectionImpl::OnSuccess(webrtc::SessionDescriptionInterface * } void LLWebRTCPeerConnectionImpl::OnFailure(webrtc::RTCError error) -{ +{ RTC_LOG(LS_ERROR) << ToString(error.type()) << ": " << error.message(); } @@ -1100,7 +1100,7 @@ void LLWebRTCPeerConnectionImpl::OnSetRemoteDescriptionComplete(webrtc::RTCError } mCachedIceCandidates.clear(); OnIceGatheringChange(mPeerConnection->ice_gathering_state()); - + } // @@ -1164,7 +1164,7 @@ void LLWebRTCPeerConnectionImpl::sendData(const std::string& data, bool binary) } void LLWebRTCPeerConnectionImpl::setDataObserver(LLWebRTCDataObserver* observer) -{ +{ mDataObserverList.emplace_back(observer); } diff --git a/indra/llwebrtc/llwebrtc.h b/indra/llwebrtc/llwebrtc.h index 789bde452e..43b48e79ab 100644 --- a/indra/llwebrtc/llwebrtc.h +++ b/indra/llwebrtc/llwebrtc.h @@ -30,7 +30,7 @@ * overall threading model than the viewer. * The native webrtc library is also compiled with clang, and has memory management * functions that conflict namespace-wise with those in the viewer. - * + * * Due to these differences, code from the viewer cannot be pulled in to this * dynamic library, so it remains very simple. */ @@ -56,7 +56,7 @@ namespace llwebrtc { -// LLWebRTCVoiceDevice is a simple representation of the +// LLWebRTCVoiceDevice is a simple representation of the // components of a device, used to communicate this // information to the viewer. diff --git a/indra/llwebrtc/llwebrtc_impl.h b/indra/llwebrtc/llwebrtc_impl.h index c2d0a4413e..16afec061e 100644 --- a/indra/llwebrtc/llwebrtc_impl.h +++ b/indra/llwebrtc/llwebrtc_impl.h @@ -153,12 +153,12 @@ class LLWebRTCImpl : public LLWebRTCDeviceInterface, public webrtc::AudioDeviceS void setTuningMode(bool enable) override; float getTuningAudioLevel() override; float getPeerConnectionAudioLevel() override; - + // // AudioDeviceSink // void OnDevicesUpdated() override; - + // // Helpers // @@ -171,7 +171,7 @@ class LLWebRTCImpl : public LLWebRTCDeviceInterface, public webrtc::AudioDeviceS { mWorkerThread->PostTask(std::move(task), location); } - + void PostSignalingTask(absl::AnyInvocable task, const webrtc::Location& location = webrtc::Location::Current()) { @@ -189,7 +189,7 @@ class LLWebRTCImpl : public LLWebRTCDeviceInterface, public webrtc::AudioDeviceS { mWorkerThread->BlockingCall(std::move(functor), location); } - + void SignalingBlockingCall(rtc::FunctionView functor, const webrtc::Location& location = webrtc::Location::Current()) { @@ -205,7 +205,7 @@ class LLWebRTCImpl : public LLWebRTCDeviceInterface, public webrtc::AudioDeviceS // Allows the LLWebRTCPeerConnectionImpl class to retrieve the // native webrtc PeerConnectionFactory. rtc::scoped_refptr getPeerConnectionFactory() - { + { return mPeerConnectionFactory; } @@ -242,7 +242,7 @@ class LLWebRTCImpl : public LLWebRTCDeviceInterface, public webrtc::AudioDeviceS LLAudioDeviceObserver * mTuningAudioDeviceObserver; LLCustomProcessor * mPeerCustomProcessor; - + // peer connections std::vector> mPeerConnections; }; @@ -270,7 +270,7 @@ class LLWebRTCPeerConnectionImpl : public LLWebRTCPeerConnectionInterface, virtual void AddRef() const override = 0; virtual rtc::RefCountReleaseStatus Release() const override = 0; - + // // LLWebRTCPeerConnection // @@ -326,20 +326,20 @@ class LLWebRTCPeerConnectionImpl : public LLWebRTCPeerConnectionInterface, // SetLocalDescriptionObserverInterface implementation. // void OnSetLocalDescriptionComplete(webrtc::RTCError error) override; - + // // DataChannelObserver implementation. // void OnStateChange() override; void OnMessage(const webrtc::DataBuffer& buffer) override; - + // Helpers void resetMute(); void enableSenderTracks(bool enable); void enableReceiverTracks(bool enable); protected: - + LLWebRTCImpl * mWebRTCImpl; rtc::scoped_refptr mPeerConnectionFactory; @@ -358,7 +358,7 @@ class LLWebRTCPeerConnectionImpl : public LLWebRTCPeerConnectionInterface, std::vector mDataObserverList; rtc::scoped_refptr mDataChannel; }; - + } #endif // LLWEBRTC_IMPL_H -- cgit v1.2.3