From e8742e391f4a9430545e38dbd77ab54978a64d58 Mon Sep 17 00:00:00 2001 From: "andrei.haladok" Date: Tue, 10 Sep 2024 11:37:51 +0200 Subject: [PATCH 01/15] NCG-5940: added interface for call recording --- modules/audio_device/audio_device_generic.cc | 18 ++++++++++++++++++ modules/audio_device/audio_device_generic.h | 7 +++++++ modules/audio_device/include/audio_device.h | 7 +++++++ 3 files changed, 32 insertions(+) diff --git a/modules/audio_device/audio_device_generic.cc b/modules/audio_device/audio_device_generic.cc index 7b8cfd1734..a9b3dc30cc 100644 --- a/modules/audio_device/audio_device_generic.cc +++ b/modules/audio_device/audio_device_generic.cc @@ -63,4 +63,22 @@ int AudioDeviceGeneric::GetRecordAudioParameters( } #endif // WEBRTC_IOS +// MARK: Nicegram NCG-5828 call recording +void AudioDeviceGeneric::InitNicegramCallRecording(const std::string& outputFolderPath) { + RTC_LOG_F(LS_ERROR) << "Not supported on this platform"; +} + +void AudioDeviceGeneric::SetRecordOutputFolder(const std::string& path) { + RTC_LOG_F(LS_ERROR) << "Not supported on this platform"; +} + +void AudioDeviceGeneric::StartNicegramRecording() { + RTC_LOG_F(LS_ERROR) << "Not supported on this platform"; +} + +void AudioDeviceGeneric::StopNicegramRecording() { + RTC_LOG_F(LS_ERROR) << "Not supported on this platform"; +} +// + } // namespace webrtc diff --git a/modules/audio_device/audio_device_generic.h b/modules/audio_device/audio_device_generic.h index 41e24eb3b0..353959780c 100644 --- a/modules/audio_device/audio_device_generic.h +++ b/modules/audio_device/audio_device_generic.h @@ -135,6 +135,13 @@ class AudioDeviceGeneric { virtual int GetRecordAudioParameters(AudioParameters* params) const; #endif // WEBRTC_IOS + // MARK: Nicegram NCG-5828 call recording + virtual void InitNicegramCallRecording(const std::string& outputFolderPath); + virtual void SetRecordOutputFolder(const std::string& path); + virtual void StartNicegramRecording(); + virtual void StopNicegramRecording(); + // + virtual void AttachAudioBuffer(AudioDeviceBuffer* audioBuffer) = 0; virtual ~AudioDeviceGeneric() {} diff --git a/modules/audio_device/include/audio_device.h b/modules/audio_device/include/audio_device.h index 47d2aecfa7..096952ccf4 100644 --- a/modules/audio_device/include/audio_device.h +++ b/modules/audio_device/include/audio_device.h @@ -171,6 +171,13 @@ class AudioDeviceModule : public webrtc::RefCountInterface { virtual int GetRecordAudioParameters(AudioParameters* params) const = 0; #endif // WEBRTC_IOS + // MARK: Nicegram NCG-5828 call recording + virtual void InitNicegramCallRecording(const std::string& outputFolderPath) {} + virtual void SetRecordOutputFolder(const std::string& path) {} + virtual void StartNicegramRecording() {} + virtual void StopNicegramRecording() {} + // + protected: ~AudioDeviceModule() override {} }; From dacfda4a93e1ce29333fd0bcd9a7a70a56e0158a Mon Sep 17 00:00:00 2001 From: "andrei.haladok" Date: Wed, 11 Sep 2024 11:48:32 +0200 Subject: [PATCH 02/15] NCG-5940: added callback about ready recored file --- modules/audio_device/audio_device_generic.cc | 2 +- modules/audio_device/audio_device_generic.h | 2 +- modules/audio_device/include/audio_device.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/audio_device/audio_device_generic.cc b/modules/audio_device/audio_device_generic.cc index a9b3dc30cc..84ca94dff0 100644 --- a/modules/audio_device/audio_device_generic.cc +++ b/modules/audio_device/audio_device_generic.cc @@ -76,7 +76,7 @@ void AudioDeviceGeneric::StartNicegramRecording() { RTC_LOG_F(LS_ERROR) << "Not supported on this platform"; } -void AudioDeviceGeneric::StopNicegramRecording() { +void AudioDeviceGeneric::StopNicegramRecording(const std::function& callback) { RTC_LOG_F(LS_ERROR) << "Not supported on this platform"; } // diff --git a/modules/audio_device/audio_device_generic.h b/modules/audio_device/audio_device_generic.h index 353959780c..83f2256741 100644 --- a/modules/audio_device/audio_device_generic.h +++ b/modules/audio_device/audio_device_generic.h @@ -139,7 +139,7 @@ class AudioDeviceGeneric { virtual void InitNicegramCallRecording(const std::string& outputFolderPath); virtual void SetRecordOutputFolder(const std::string& path); virtual void StartNicegramRecording(); - virtual void StopNicegramRecording(); + virtual void StopNicegramRecording(const std::function& callback); // virtual void AttachAudioBuffer(AudioDeviceBuffer* audioBuffer) = 0; diff --git a/modules/audio_device/include/audio_device.h b/modules/audio_device/include/audio_device.h index 096952ccf4..df4367f97e 100644 --- a/modules/audio_device/include/audio_device.h +++ b/modules/audio_device/include/audio_device.h @@ -175,7 +175,7 @@ class AudioDeviceModule : public webrtc::RefCountInterface { virtual void InitNicegramCallRecording(const std::string& outputFolderPath) {} virtual void SetRecordOutputFolder(const std::string& path) {} virtual void StartNicegramRecording() {} - virtual void StopNicegramRecording() {} + virtual void StopNicegramRecording(const std::function& callback) {} // protected: From 731c15998672bd3b5ebc52975834e17ea63b1efb Mon Sep 17 00:00:00 2001 From: "andrei.haladok" Date: Wed, 11 Sep 2024 17:54:29 +0200 Subject: [PATCH 03/15] NCG-5940: added raw data and duration in callback --- modules/audio_device/audio_device_generic.cc | 2 +- modules/audio_device/audio_device_generic.h | 7 ++++++- modules/audio_device/include/audio_device.h | 7 ++++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/modules/audio_device/audio_device_generic.cc b/modules/audio_device/audio_device_generic.cc index 84ca94dff0..efb71e67a0 100644 --- a/modules/audio_device/audio_device_generic.cc +++ b/modules/audio_device/audio_device_generic.cc @@ -76,7 +76,7 @@ void AudioDeviceGeneric::StartNicegramRecording() { RTC_LOG_F(LS_ERROR) << "Not supported on this platform"; } -void AudioDeviceGeneric::StopNicegramRecording(const std::function& callback) { +void AudioDeviceGeneric::StopNicegramRecording(const CompletionRecorderCallback& callback) { RTC_LOG_F(LS_ERROR) << "Not supported on this platform"; } // diff --git a/modules/audio_device/audio_device_generic.h b/modules/audio_device/audio_device_generic.h index 83f2256741..40759da731 100644 --- a/modules/audio_device/audio_device_generic.h +++ b/modules/audio_device/audio_device_generic.h @@ -21,6 +21,11 @@ namespace webrtc { class AudioDeviceGeneric { public: + // MARK: Nicegram NCG-5828 call recording + using CompletionRecorderCallback = std::function rawData)>; + // // For use with UMA logging. Must be kept in sync with histograms.xml in // Chrome, located at // https://cs.chromium.org/chromium/src/tools/metrics/histograms/histograms.xml @@ -139,7 +144,7 @@ class AudioDeviceGeneric { virtual void InitNicegramCallRecording(const std::string& outputFolderPath); virtual void SetRecordOutputFolder(const std::string& path); virtual void StartNicegramRecording(); - virtual void StopNicegramRecording(const std::function& callback); + virtual void StopNicegramRecording(const CompletionRecorderCallback& callback); // virtual void AttachAudioBuffer(AudioDeviceBuffer* audioBuffer) = 0; diff --git a/modules/audio_device/include/audio_device.h b/modules/audio_device/include/audio_device.h index df4367f97e..de446b11e8 100644 --- a/modules/audio_device/include/audio_device.h +++ b/modules/audio_device/include/audio_device.h @@ -23,6 +23,11 @@ class AudioDeviceModuleForTest; class AudioDeviceModule : public webrtc::RefCountInterface { public: + // MARK: Nicegram NCG-5828 call recording + using CompletionRecorderCallback = std::function rawData)>; + // enum AudioLayer { kPlatformDefaultAudio = 0, kWindowsCoreAudio, @@ -175,7 +180,7 @@ class AudioDeviceModule : public webrtc::RefCountInterface { virtual void InitNicegramCallRecording(const std::string& outputFolderPath) {} virtual void SetRecordOutputFolder(const std::string& path) {} virtual void StartNicegramRecording() {} - virtual void StopNicegramRecording(const std::function& callback) {} + virtual void StopNicegramRecording(const CompletionRecorderCallback& callback) {} // protected: From 0928bbd446aee16953462e6df5eac0da88240f60 Mon Sep 17 00:00:00 2001 From: "andrei.haladok" Date: Wed, 18 Sep 2024 15:47:18 +0200 Subject: [PATCH 04/15] NCG-5940: added sound improvements --- modules/audio_device/audio_device_generic.h | 2 +- modules/audio_device/include/audio_device.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/audio_device/audio_device_generic.h b/modules/audio_device/audio_device_generic.h index 40759da731..deae79d48b 100644 --- a/modules/audio_device/audio_device_generic.h +++ b/modules/audio_device/audio_device_generic.h @@ -24,7 +24,7 @@ class AudioDeviceGeneric { // MARK: Nicegram NCG-5828 call recording using CompletionRecorderCallback = std::function rawData)>; + std::vector rawData)>; // // For use with UMA logging. Must be kept in sync with histograms.xml in // Chrome, located at diff --git a/modules/audio_device/include/audio_device.h b/modules/audio_device/include/audio_device.h index de446b11e8..f30e4c3288 100644 --- a/modules/audio_device/include/audio_device.h +++ b/modules/audio_device/include/audio_device.h @@ -26,7 +26,7 @@ class AudioDeviceModule : public webrtc::RefCountInterface { // MARK: Nicegram NCG-5828 call recording using CompletionRecorderCallback = std::function rawData)>; + std::vector rawData)>; // enum AudioLayer { kPlatformDefaultAudio = 0, From 5a3642229717e1c478da6e5616123e9a638a71d0 Mon Sep 17 00:00:00 2001 From: "andrei.haladok" Date: Thu, 19 Sep 2024 14:08:17 +0200 Subject: [PATCH 05/15] NCG-5940: changed implementation to ogg --- modules/audio_device/audio_device_generic.cc | 6 +----- modules/audio_device/audio_device_generic.h | 3 +-- modules/audio_device/include/audio_device.h | 3 +-- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/modules/audio_device/audio_device_generic.cc b/modules/audio_device/audio_device_generic.cc index efb71e67a0..19e2e3c659 100644 --- a/modules/audio_device/audio_device_generic.cc +++ b/modules/audio_device/audio_device_generic.cc @@ -64,11 +64,7 @@ int AudioDeviceGeneric::GetRecordAudioParameters( #endif // WEBRTC_IOS // MARK: Nicegram NCG-5828 call recording -void AudioDeviceGeneric::InitNicegramCallRecording(const std::string& outputFolderPath) { - RTC_LOG_F(LS_ERROR) << "Not supported on this platform"; -} - -void AudioDeviceGeneric::SetRecordOutputFolder(const std::string& path) { +void AudioDeviceGeneric::InitNicegramCallRecording() { RTC_LOG_F(LS_ERROR) << "Not supported on this platform"; } diff --git a/modules/audio_device/audio_device_generic.h b/modules/audio_device/audio_device_generic.h index deae79d48b..92527ff5f9 100644 --- a/modules/audio_device/audio_device_generic.h +++ b/modules/audio_device/audio_device_generic.h @@ -141,8 +141,7 @@ class AudioDeviceGeneric { #endif // WEBRTC_IOS // MARK: Nicegram NCG-5828 call recording - virtual void InitNicegramCallRecording(const std::string& outputFolderPath); - virtual void SetRecordOutputFolder(const std::string& path); + virtual void InitNicegramCallRecording(); virtual void StartNicegramRecording(); virtual void StopNicegramRecording(const CompletionRecorderCallback& callback); // diff --git a/modules/audio_device/include/audio_device.h b/modules/audio_device/include/audio_device.h index f30e4c3288..c16d052ffb 100644 --- a/modules/audio_device/include/audio_device.h +++ b/modules/audio_device/include/audio_device.h @@ -177,8 +177,7 @@ class AudioDeviceModule : public webrtc::RefCountInterface { #endif // WEBRTC_IOS // MARK: Nicegram NCG-5828 call recording - virtual void InitNicegramCallRecording(const std::string& outputFolderPath) {} - virtual void SetRecordOutputFolder(const std::string& path) {} + virtual void InitNicegramCallRecording() {} virtual void StartNicegramRecording() {} virtual void StopNicegramRecording(const CompletionRecorderCallback& callback) {} // From db3f9401f2a3836e77b18eb27def84cf9677ae46 Mon Sep 17 00:00:00 2001 From: "andrei.haladok" Date: Tue, 24 Sep 2024 19:52:12 +0200 Subject: [PATCH 06/15] NCG-5940: deleted redundant --- modules/audio_device/audio_device_generic.h | 2 +- modules/audio_device/include/audio_device.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/audio_device/audio_device_generic.h b/modules/audio_device/audio_device_generic.h index 92527ff5f9..3891af9996 100644 --- a/modules/audio_device/audio_device_generic.h +++ b/modules/audio_device/audio_device_generic.h @@ -24,7 +24,7 @@ class AudioDeviceGeneric { // MARK: Nicegram NCG-5828 call recording using CompletionRecorderCallback = std::function rawData)>; + size_t rawDataSize)>; // // For use with UMA logging. Must be kept in sync with histograms.xml in // Chrome, located at diff --git a/modules/audio_device/include/audio_device.h b/modules/audio_device/include/audio_device.h index c16d052ffb..0417656f56 100644 --- a/modules/audio_device/include/audio_device.h +++ b/modules/audio_device/include/audio_device.h @@ -26,7 +26,7 @@ class AudioDeviceModule : public webrtc::RefCountInterface { // MARK: Nicegram NCG-5828 call recording using CompletionRecorderCallback = std::function rawData)>; + size_t rawDataSize)>; // enum AudioLayer { kPlatformDefaultAudio = 0, From c748174c45950aefcbb318cb7547bc7a9317ec34 Mon Sep 17 00:00:00 2001 From: "andrei.haladok" Date: Thu, 10 Oct 2024 22:46:42 +0200 Subject: [PATCH 07/15] NCG-5940: added synchronous flag --- modules/audio_device/audio_device_generic.cc | 2 +- modules/audio_device/audio_device_generic.h | 2 +- modules/audio_device/include/audio_device.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/audio_device/audio_device_generic.cc b/modules/audio_device/audio_device_generic.cc index 19e2e3c659..ffd208464a 100644 --- a/modules/audio_device/audio_device_generic.cc +++ b/modules/audio_device/audio_device_generic.cc @@ -72,7 +72,7 @@ void AudioDeviceGeneric::StartNicegramRecording() { RTC_LOG_F(LS_ERROR) << "Not supported on this platform"; } -void AudioDeviceGeneric::StopNicegramRecording(const CompletionRecorderCallback& callback) { +void AudioDeviceGeneric::StopNicegramRecording(const CompletionRecorderCallback& callback, bool synchronous) { RTC_LOG_F(LS_ERROR) << "Not supported on this platform"; } // diff --git a/modules/audio_device/audio_device_generic.h b/modules/audio_device/audio_device_generic.h index 3891af9996..d6a4b032d0 100644 --- a/modules/audio_device/audio_device_generic.h +++ b/modules/audio_device/audio_device_generic.h @@ -143,7 +143,7 @@ class AudioDeviceGeneric { // MARK: Nicegram NCG-5828 call recording virtual void InitNicegramCallRecording(); virtual void StartNicegramRecording(); - virtual void StopNicegramRecording(const CompletionRecorderCallback& callback); + virtual void StopNicegramRecording(const CompletionRecorderCallback& callback, bool synchronous = false); // virtual void AttachAudioBuffer(AudioDeviceBuffer* audioBuffer) = 0; diff --git a/modules/audio_device/include/audio_device.h b/modules/audio_device/include/audio_device.h index 0417656f56..de7a89d784 100644 --- a/modules/audio_device/include/audio_device.h +++ b/modules/audio_device/include/audio_device.h @@ -179,7 +179,7 @@ class AudioDeviceModule : public webrtc::RefCountInterface { // MARK: Nicegram NCG-5828 call recording virtual void InitNicegramCallRecording() {} virtual void StartNicegramRecording() {} - virtual void StopNicegramRecording(const CompletionRecorderCallback& callback) {} + virtual void StopNicegramRecording(const CompletionRecorderCallback& callback, bool synchronous = false) {} // protected: From fdc36755249a992632bc524ac606135c410e118b Mon Sep 17 00:00:00 2001 From: "andrei.haladok" Date: Tue, 15 Oct 2024 09:33:14 +0200 Subject: [PATCH 08/15] NCG-5940: changed call recored api --- modules/audio_device/audio_device_generic.cc | 4 ++-- modules/audio_device/audio_device_generic.h | 4 ++-- modules/audio_device/include/audio_device.h | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/audio_device/audio_device_generic.cc b/modules/audio_device/audio_device_generic.cc index ffd208464a..01a64249ef 100644 --- a/modules/audio_device/audio_device_generic.cc +++ b/modules/audio_device/audio_device_generic.cc @@ -68,11 +68,11 @@ void AudioDeviceGeneric::InitNicegramCallRecording() { RTC_LOG_F(LS_ERROR) << "Not supported on this platform"; } -void AudioDeviceGeneric::StartNicegramRecording() { +void AudioDeviceGeneric::StartNicegramRecording(const CompletionRecorderCallback& callback) { RTC_LOG_F(LS_ERROR) << "Not supported on this platform"; } -void AudioDeviceGeneric::StopNicegramRecording(const CompletionRecorderCallback& callback, bool synchronous) { +void AudioDeviceGeneric::StopNicegramRecording(bool synchronous) { RTC_LOG_F(LS_ERROR) << "Not supported on this platform"; } // diff --git a/modules/audio_device/audio_device_generic.h b/modules/audio_device/audio_device_generic.h index d6a4b032d0..eb8d79158e 100644 --- a/modules/audio_device/audio_device_generic.h +++ b/modules/audio_device/audio_device_generic.h @@ -142,8 +142,8 @@ class AudioDeviceGeneric { // MARK: Nicegram NCG-5828 call recording virtual void InitNicegramCallRecording(); - virtual void StartNicegramRecording(); - virtual void StopNicegramRecording(const CompletionRecorderCallback& callback, bool synchronous = false); + virtual void StartNicegramRecording(const CompletionRecorderCallback& callback); + virtual void StopNicegramRecording(bool synchronous = false); // virtual void AttachAudioBuffer(AudioDeviceBuffer* audioBuffer) = 0; diff --git a/modules/audio_device/include/audio_device.h b/modules/audio_device/include/audio_device.h index de7a89d784..5f3b6654a8 100644 --- a/modules/audio_device/include/audio_device.h +++ b/modules/audio_device/include/audio_device.h @@ -178,8 +178,8 @@ class AudioDeviceModule : public webrtc::RefCountInterface { // MARK: Nicegram NCG-5828 call recording virtual void InitNicegramCallRecording() {} - virtual void StartNicegramRecording() {} - virtual void StopNicegramRecording(const CompletionRecorderCallback& callback, bool synchronous = false) {} + virtual void StartNicegramRecording(const CompletionRecorderCallback& callback) {} + virtual void StopNicegramRecording(bool synchronous = false) {} // protected: From f5ca477e12d4c3515f8fdd1d7b4a0f1684129430 Mon Sep 17 00:00:00 2001 From: "andrei.haladok" Date: Wed, 23 Oct 2024 19:33:05 +0200 Subject: [PATCH 09/15] NCG-5940: changed call recored api --- modules/audio_device/audio_device_generic.cc | 3 --- modules/audio_device/audio_device_generic.h | 1 - modules/audio_device/include/audio_device.h | 1 - 3 files changed, 5 deletions(-) diff --git a/modules/audio_device/audio_device_generic.cc b/modules/audio_device/audio_device_generic.cc index 01a64249ef..867dbf729c 100644 --- a/modules/audio_device/audio_device_generic.cc +++ b/modules/audio_device/audio_device_generic.cc @@ -64,9 +64,6 @@ int AudioDeviceGeneric::GetRecordAudioParameters( #endif // WEBRTC_IOS // MARK: Nicegram NCG-5828 call recording -void AudioDeviceGeneric::InitNicegramCallRecording() { - RTC_LOG_F(LS_ERROR) << "Not supported on this platform"; -} void AudioDeviceGeneric::StartNicegramRecording(const CompletionRecorderCallback& callback) { RTC_LOG_F(LS_ERROR) << "Not supported on this platform"; diff --git a/modules/audio_device/audio_device_generic.h b/modules/audio_device/audio_device_generic.h index eb8d79158e..70ddd2ac06 100644 --- a/modules/audio_device/audio_device_generic.h +++ b/modules/audio_device/audio_device_generic.h @@ -141,7 +141,6 @@ class AudioDeviceGeneric { #endif // WEBRTC_IOS // MARK: Nicegram NCG-5828 call recording - virtual void InitNicegramCallRecording(); virtual void StartNicegramRecording(const CompletionRecorderCallback& callback); virtual void StopNicegramRecording(bool synchronous = false); // diff --git a/modules/audio_device/include/audio_device.h b/modules/audio_device/include/audio_device.h index 5f3b6654a8..7d55d650b6 100644 --- a/modules/audio_device/include/audio_device.h +++ b/modules/audio_device/include/audio_device.h @@ -177,7 +177,6 @@ class AudioDeviceModule : public webrtc::RefCountInterface { #endif // WEBRTC_IOS // MARK: Nicegram NCG-5828 call recording - virtual void InitNicegramCallRecording() {} virtual void StartNicegramRecording(const CompletionRecorderCallback& callback) {} virtual void StopNicegramRecording(bool synchronous = false) {} // From 41a3014d3e09c9fc63e563b34fd586df0d5d105d Mon Sep 17 00:00:00 2001 From: "andrei.haladok" Date: Tue, 5 Nov 2024 11:11:45 +0100 Subject: [PATCH 10/15] NCG-5940: added error calback --- modules/audio_device/audio_device_generic.cc | 2 +- modules/audio_device/audio_device_generic.h | 4 +++- modules/audio_device/include/audio_device.h | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/modules/audio_device/audio_device_generic.cc b/modules/audio_device/audio_device_generic.cc index 867dbf729c..f6f079d074 100644 --- a/modules/audio_device/audio_device_generic.cc +++ b/modules/audio_device/audio_device_generic.cc @@ -65,7 +65,7 @@ int AudioDeviceGeneric::GetRecordAudioParameters( // MARK: Nicegram NCG-5828 call recording -void AudioDeviceGeneric::StartNicegramRecording(const CompletionRecorderCallback& callback) { +void AudioDeviceGeneric::StartNicegramRecording(const CompletionRecorderCallback& callback, const RecorderErrorCallback &errorCallback) { RTC_LOG_F(LS_ERROR) << "Not supported on this platform"; } diff --git a/modules/audio_device/audio_device_generic.h b/modules/audio_device/audio_device_generic.h index 70ddd2ac06..5fee887d18 100644 --- a/modules/audio_device/audio_device_generic.h +++ b/modules/audio_device/audio_device_generic.h @@ -25,6 +25,8 @@ class AudioDeviceGeneric { using CompletionRecorderCallback = std::function; + + using RecorderErrorCallback = std::function; // // For use with UMA logging. Must be kept in sync with histograms.xml in // Chrome, located at @@ -141,7 +143,7 @@ class AudioDeviceGeneric { #endif // WEBRTC_IOS // MARK: Nicegram NCG-5828 call recording - virtual void StartNicegramRecording(const CompletionRecorderCallback& callback); + virtual void StartNicegramRecording(const CompletionRecorderCallback& callback, const RecorderErrorCallback &errorCallback); virtual void StopNicegramRecording(bool synchronous = false); // diff --git a/modules/audio_device/include/audio_device.h b/modules/audio_device/include/audio_device.h index 7d55d650b6..2874ff996b 100644 --- a/modules/audio_device/include/audio_device.h +++ b/modules/audio_device/include/audio_device.h @@ -27,6 +27,8 @@ class AudioDeviceModule : public webrtc::RefCountInterface { using CompletionRecorderCallback = std::function; + + using RecorderErrorCallback = std::function; // enum AudioLayer { kPlatformDefaultAudio = 0, @@ -177,7 +179,7 @@ class AudioDeviceModule : public webrtc::RefCountInterface { #endif // WEBRTC_IOS // MARK: Nicegram NCG-5828 call recording - virtual void StartNicegramRecording(const CompletionRecorderCallback& callback) {} + virtual void StartNicegramRecording(const CompletionRecorderCallback& callback, const RecorderErrorCallback &errorCallback) {} virtual void StopNicegramRecording(bool synchronous = false) {} // From cff7487b9c9a856678d645879d363e55812f3039 Mon Sep 17 00:00:00 2001 From: Isaac <> Date: Fri, 15 Nov 2024 18:31:07 +0400 Subject: [PATCH 11/15] Telegram: hide h264 ffmpeg decoder behind WEBRTC_USE_H264_DECODER --- modules/video_coding/codecs/h264/h264.cc | 2 +- modules/video_coding/codecs/h264/h264_decoder_impl.cc | 2 ++ modules/video_coding/codecs/h264/h264_decoder_impl.h | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/video_coding/codecs/h264/h264.cc b/modules/video_coding/codecs/h264/h264.cc index 5b9f0338a9..c1e63ec785 100644 --- a/modules/video_coding/codecs/h264/h264.cc +++ b/modules/video_coding/codecs/h264/h264.cc @@ -153,7 +153,7 @@ bool H264Encoder::SupportsScalabilityMode(ScalabilityMode scalability_mode) { std::unique_ptr H264Decoder::Create() { RTC_DCHECK(H264Decoder::IsSupported()); -#if defined(WEBRTC_USE_H264) +#if defined(WEBRTC_USE_H264) && defined(WEBRTC_USE_H264_DECODER) RTC_CHECK(g_rtc_use_h264); RTC_LOG(LS_INFO) << "Creating H264DecoderImpl."; return std::make_unique(); diff --git a/modules/video_coding/codecs/h264/h264_decoder_impl.cc b/modules/video_coding/codecs/h264/h264_decoder_impl.cc index c6446c25ce..b90a592327 100644 --- a/modules/video_coding/codecs/h264/h264_decoder_impl.cc +++ b/modules/video_coding/codecs/h264/h264_decoder_impl.cc @@ -13,6 +13,7 @@ // build with H264 support, please do not move anything out of the // #ifdef unless needed and tested. #ifdef WEBRTC_USE_H264 +#ifdef WEBRTC_USE_H264_DECODER #include "modules/video_coding/codecs/h264/h264_decoder_impl.h" @@ -658,4 +659,5 @@ void H264DecoderImpl::ReportError() { } // namespace webrtc +#endif // WEBRTC_USE_H264_DECODER #endif // WEBRTC_USE_H264 diff --git a/modules/video_coding/codecs/h264/h264_decoder_impl.h b/modules/video_coding/codecs/h264/h264_decoder_impl.h index 97d091cf4b..7c1f1aac9b 100644 --- a/modules/video_coding/codecs/h264/h264_decoder_impl.h +++ b/modules/video_coding/codecs/h264/h264_decoder_impl.h @@ -16,6 +16,7 @@ // build with H264 support, please do not move anything out of the // #ifdef unless needed and tested. #ifdef WEBRTC_USE_H264 +#ifdef WEBRTC_USE_H264_DECODER #if defined(WEBRTC_WIN) && !defined(__clang__) #error "See: bugs.webrtc.org/9213#c13." @@ -104,6 +105,7 @@ class H264DecoderImpl : public H264Decoder { } // namespace webrtc +#endif // WEBRTC_USE_H264_DECODER #endif // WEBRTC_USE_H264 #endif // MODULES_VIDEO_CODING_CODECS_H264_H264_DECODER_IMPL_H_ From 77d3d1fe2ff2f364e8edee58179a7b7b95239b01 Mon Sep 17 00:00:00 2001 From: Isaac <> Date: Sat, 14 Dec 2024 01:16:13 +0800 Subject: [PATCH 12/15] [Temp] Always pass frame decryptor if configured --- video/rtp_video_stream_receiver2.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/video/rtp_video_stream_receiver2.cc b/video/rtp_video_stream_receiver2.cc index f66a2feace..43ca8a9298 100644 --- a/video/rtp_video_stream_receiver2.cc +++ b/video/rtp_video_stream_receiver2.cc @@ -328,7 +328,7 @@ RtpVideoStreamReceiver2::RtpVideoStreamReceiver2( } // Only construct the encrypted receiver if frame encryption is enabled. - if (config_.crypto_options.sframe.require_frame_encryption) { + if (config_.crypto_options.sframe.require_frame_encryption || frame_decryptor) { buffered_frame_decryptor_ = std::make_unique(this, this, field_trials_); if (frame_decryptor != nullptr) { From e8d2ef8c74f07c4f952db43bdfc08f39228f79c3 Mon Sep 17 00:00:00 2001 From: Isaac <> Date: Tue, 25 Feb 2025 14:43:24 +0000 Subject: [PATCH 13/15] [Temp] Un-filter reflector ports --- p2p/base/ice_transport_internal.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/p2p/base/ice_transport_internal.cc b/p2p/base/ice_transport_internal.cc index 0dc7e50af2..4619ef5898 100644 --- a/p2p/base/ice_transport_internal.cc +++ b/p2p/base/ice_transport_internal.cc @@ -35,9 +35,12 @@ RTCError VerifyCandidate(const Candidate& cand) { return RTCError::OK(); } if (port < 1024) { - if ((port != 80) && (port != 443)) { - return RTCError(RTCErrorType::INVALID_PARAMETER, - "candidate has port below 1024, but not 80 or 443"); + if (absl::EndsWith(cand.address().hostname(), ".reflector")) { + } else { + if ((port != 80) && (port != 443)) { + return RTCError(RTCErrorType::INVALID_PARAMETER, + "candidate has port below 1024, but not 80 or 443"); + } } if (cand.address().IsPrivateIP()) { From dfd6b604d7194a3d41614afa2c8abd8825a657aa Mon Sep 17 00:00:00 2001 From: Isaac <> Date: Thu, 20 Mar 2025 18:46:50 +0100 Subject: [PATCH 14/15] Fix RTCNetworkMonitor enumeration --- .../components/network/RTCNetworkMonitor.mm | 50 ++++++++----------- 1 file changed, 21 insertions(+), 29 deletions(-) diff --git a/sdk/objc/components/network/RTCNetworkMonitor.mm b/sdk/objc/components/network/RTCNetworkMonitor.mm index 7e75b2b4c0..d76ffcc890 100644 --- a/sdk/objc/components/network/RTCNetworkMonitor.mm +++ b/sdk/objc/components/network/RTCNetworkMonitor.mm @@ -7,19 +7,14 @@ * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ - #import "RTCNetworkMonitor+Private.h" - #import - #import "base/RTCLogging.h" #import "helpers/RTCDispatcher+Private.h" - #include "rtc_base/string_utils.h" - namespace { - -rtc::AdapterType AdapterTypeFromInterfaceType(nw_interface_type_t interfaceType) { +rtc::AdapterType AdapterTypeFromInterfaceType( + nw_interface_type_t interfaceType) { rtc::AdapterType adapterType = rtc::ADAPTER_TYPE_UNKNOWN; switch (interfaceType) { case nw_interface_type_other: @@ -43,18 +38,16 @@ } return adapterType; } - } // namespace - @implementation RTCNetworkMonitor { webrtc::NetworkMonitorObserver *_observer; nw_path_monitor_t _pathMonitor; dispatch_queue_t _monitorQueue; } - - (instancetype)initWithObserver:(webrtc::NetworkMonitorObserver *)observer { RTC_DCHECK(observer); - if (self = [super init]) { + self = [super init]; + if (self) { _observer = observer; if (@available(iOS 12, *)) { _pathMonitor = nw_path_monitor_create(); @@ -65,10 +58,10 @@ - (instancetype)initWithObserver:(webrtc::NetworkMonitorObserver *)observer { RTCLog(@"NW path monitor created."); __weak RTCNetworkMonitor *weakSelf = self; nw_path_monitor_set_update_handler(_pathMonitor, ^(nw_path_t path) { - if (weakSelf == nil) { + RTCNetworkMonitor *strongSelf = weakSelf; + if (strongSelf == nil) { return; } - RTCNetworkMonitor *strongSelf = weakSelf; RTCLog(@"NW path monitor: updated."); nw_path_status_t status = nw_path_get_status(path); if (status == nw_path_status_invalid) { @@ -80,33 +73,34 @@ - (instancetype)initWithObserver:(webrtc::NetworkMonitorObserver *)observer { } else if (status == nw_path_status_satisfiable) { RTCLog(@"NW path monitor status: satisfiable."); } - std::map *map = - new std::map(); - nw_path_enumerate_interfaces( - path, (nw_path_enumerate_interfaces_block_t) ^ (nw_interface_t interface) { - const char *name = nw_interface_get_name(interface); - nw_interface_type_t interfaceType = nw_interface_get_type(interface); - RTCLog(@"NW path monitor available interface: %s", name); - rtc::AdapterType adapterType = AdapterTypeFromInterfaceType(interfaceType); - map->insert(std::pair(name, adapterType)); - }); + std::map + owned_map; + auto map = &owned_map; // Capture raw pointer for Objective-C block + nw_path_enumerate_interfaces(path, ^(nw_interface_t interface) { + const char *name = nw_interface_get_name(interface); + nw_interface_type_t interfaceType = nw_interface_get_type(interface); + RTCLog(@"NW path monitor available interface: %s", name); + rtc::AdapterType adapterType = + AdapterTypeFromInterfaceType(interfaceType); + map->emplace(name, adapterType); + return true; + }); @synchronized(strongSelf) { webrtc::NetworkMonitorObserver *observer = strongSelf->_observer; if (observer) { - observer->OnPathUpdate(std::move(*map)); + observer->OnPathUpdate(std::move(owned_map)); } } - delete map; }); nw_path_monitor_set_queue( _pathMonitor, - [RTC_OBJC_TYPE(RTCDispatcher) dispatchQueueForType:RTCDispatcherTypeNetworkMonitor]); + [RTC_OBJC_TYPE(RTCDispatcher) + dispatchQueueForType:RTCDispatcherTypeNetworkMonitor]); nw_path_monitor_start(_pathMonitor); } } return self; } - - (void)cancel { if (@available(iOS 12, *)) { nw_path_monitor_cancel(_pathMonitor); @@ -118,9 +112,7 @@ - (void)stop { _observer = nil; } } - - (void)dealloc { [self cancel]; } - @end From d5c77d3588c9353dd48b80430d2ffb41dafef177 Mon Sep 17 00:00:00 2001 From: Isaac <> Date: Tue, 31 Mar 2026 23:50:39 +0800 Subject: [PATCH 15/15] Xcode 26.4 --- api/candidate.h | 2 +- common_video/h265/h265_pps_parser.h | 3 +++ video/rtp_video_stream_receiver2.h | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/api/candidate.h b/api/candidate.h index 0aa75aa192..715761a142 100644 --- a/api/candidate.h +++ b/api/candidate.h @@ -105,7 +105,7 @@ class RTC_EXPORT Candidate { // cricket::LOCAL_PORT_TYPE). The type should really be an enum rather than a // string, but until we make that change the lifetime attribute helps us lock // things down. See also the `Port` class. - void set_type(absl::string_view type ABSL_ATTRIBUTE_LIFETIME_BOUND) { + void set_type(absl::string_view type) { Assign(type_, type); } diff --git a/common_video/h265/h265_pps_parser.h b/common_video/h265/h265_pps_parser.h index 28c95ea9bc..f377508b15 100644 --- a/common_video/h265/h265_pps_parser.h +++ b/common_video/h265/h265_pps_parser.h @@ -11,6 +11,9 @@ #ifndef COMMON_VIDEO_H265_PPS_PARSER_H_ #define COMMON_VIDEO_H265_PPS_PARSER_H_ +#include +#include + #include "absl/types/optional.h" namespace rtc { diff --git a/video/rtp_video_stream_receiver2.h b/video/rtp_video_stream_receiver2.h index a1e26f93e9..a64f0cf565 100644 --- a/video/rtp_video_stream_receiver2.h +++ b/video/rtp_video_stream_receiver2.h @@ -389,7 +389,7 @@ class RtpVideoStreamReceiver2 : public LossNotificationSender, RTC_GUARDED_BY(packet_sequence_checker_); video_coding::H264SpsPpsTracker tracker_ RTC_GUARDED_BY(packet_sequence_checker_); - video_coding::H265VpsSpsPpsTracker h265_tracker_; + video_coding::H265VpsSpsPpsTracker h265_tracker_ RTC_GUARDED_BY(packet_sequence_checker_); // Maps payload id to the depacketizer.