diff options
author | Brad Linden <brad@lindenlab.com> | 2024-08-01 15:42:22 -0700 |
---|---|---|
committer | Brad Linden <brad@lindenlab.com> | 2024-08-01 15:42:22 -0700 |
commit | 0ff2bd1a405e4b7f3af5f815d02124017f23d468 (patch) | |
tree | 465b18c3087cf437a9d8ee124ddab4c7cb2dc633 /indra/llwebrtc/llwebrtc_impl.h | |
parent | f9377566b9d1f2aba6aa10bfee0f9a67221debff (diff) | |
parent | 002be0f24321164a74ef2a88c656b7cb0968c7d3 (diff) |
Merge remote-tracking branch 'origin/release/2024.06-atlasaurus' into develop
Diffstat (limited to 'indra/llwebrtc/llwebrtc_impl.h')
-rw-r--r-- | indra/llwebrtc/llwebrtc_impl.h | 57 |
1 files changed, 55 insertions, 2 deletions
diff --git a/indra/llwebrtc/llwebrtc_impl.h b/indra/llwebrtc/llwebrtc_impl.h index c1acd77275..9504e6573b 100644 --- a/indra/llwebrtc/llwebrtc_impl.h +++ b/indra/llwebrtc/llwebrtc_impl.h @@ -69,6 +69,54 @@ namespace llwebrtc class LLWebRTCPeerConnectionImpl; +class LLWebRTCLogSink : public rtc::LogSink { +public: + LLWebRTCLogSink(LLWebRTCLogCallback* callback) : + mCallback(callback) + { + } + + // Destructor: close the log file + ~LLWebRTCLogSink() override + { + } + + void OnLogMessage(const std::string& msg, + rtc::LoggingSeverity severity) override + { + if (mCallback) + { + switch(severity) + { + case rtc::LS_VERBOSE: + mCallback->LogMessage(LLWebRTCLogCallback::LOG_LEVEL_VERBOSE, msg); + break; + case rtc::LS_INFO: + mCallback->LogMessage(LLWebRTCLogCallback::LOG_LEVEL_VERBOSE, msg); + break; + case rtc::LS_WARNING: + mCallback->LogMessage(LLWebRTCLogCallback::LOG_LEVEL_VERBOSE, msg); + break; + case rtc::LS_ERROR: + mCallback->LogMessage(LLWebRTCLogCallback::LOG_LEVEL_VERBOSE, msg); + break; + default: + break; + } + } + } + + void OnLogMessage(const std::string& message) override + { + if (mCallback) + { + mCallback->LogMessage(LLWebRTCLogCallback::LOG_LEVEL_VERBOSE, message); + } + } + +private: + LLWebRTCLogCallback* mCallback; +}; // Implements a class allowing capture of audio data // to determine audio level of the microphone. @@ -139,8 +187,11 @@ class LLCustomProcessor : public webrtc::CustomProcessing class LLWebRTCImpl : public LLWebRTCDeviceInterface, public webrtc::AudioDeviceSink { public: - LLWebRTCImpl(); - ~LLWebRTCImpl() {} + LLWebRTCImpl(LLWebRTCLogCallback* logCallback); + ~LLWebRTCImpl() + { + delete mLogSink; + } void init(); void terminate(); @@ -228,6 +279,8 @@ class LLWebRTCImpl : public LLWebRTCDeviceInterface, public webrtc::AudioDeviceS void setRecording(bool recording); protected: + LLWebRTCLogSink* mLogSink; + // The native webrtc threads std::unique_ptr<rtc::Thread> mNetworkThread; std::unique_ptr<rtc::Thread> mWorkerThread; |