diff --git a/sdk/objc/api/peerconnection/RTCConfiguration.h b/sdk/objc/api/peerconnection/RTCConfiguration.h index f1400813d6..f9e6edfd97 100644 --- a/sdk/objc/api/peerconnection/RTCConfiguration.h +++ b/sdk/objc/api/peerconnection/RTCConfiguration.h @@ -201,6 +201,16 @@ RTC_OBJC_EXPORT */ @property(nonatomic, nullable) RTCCryptoOptions *cryptoOptions; +/** + * Time interval between audio RTCP reports. + */ +@property(nonatomic, assign) int rtcpAudioReportIntervalMs; + +/** + * Time interval between video RTCP reports. + */ +@property(nonatomic, assign) int rtcpVideoReportIntervalMs; + - (instancetype)init; @end diff --git a/sdk/objc/api/peerconnection/RTCConfiguration.mm b/sdk/objc/api/peerconnection/RTCConfiguration.mm index 55bf26f38d..4041f8399f 100644 --- a/sdk/objc/api/peerconnection/RTCConfiguration.mm +++ b/sdk/objc/api/peerconnection/RTCConfiguration.mm @@ -53,6 +53,8 @@ @synthesize useMediaTransport = _useMediaTransport; @synthesize useMediaTransportForDataChannels = _useMediaTransportForDataChannels; @synthesize cryptoOptions = _cryptoOptions; +@synthesize rtcpAudioReportIntervalMs = _rtcpAudioReportIntervalMs; +@synthesize rtcpVideoReportIntervalMs = _rtcpVideoReportIntervalMs; - (instancetype)init { // Copy defaults. @@ -130,6 +132,8 @@ sframeRequireFrameEncryption:config.crypto_options->sframe .require_frame_encryption]; } + _rtcpAudioReportIntervalMs = config.audio_rtcp_report_interval_ms(); + _rtcpVideoReportIntervalMs = config.video_rtcp_report_interval_ms(); } return self; } @@ -261,7 +265,8 @@ _cryptoOptions.sframeRequireFrameEncryption ? true : false; nativeConfig->crypto_options = absl::optional(nativeCryptoOptions); } - + nativeConfig->set_audio_rtcp_report_interval_ms(_rtcpAudioReportIntervalMs); + nativeConfig->set_video_rtcp_report_interval_ms(_rtcpVideoReportIntervalMs); return nativeConfig.release(); } diff --git a/sdk/objc/unittests/RTCConfigurationTest.mm b/sdk/objc/unittests/RTCConfigurationTest.mm index 67a303e550..f31fcfd858 100644 --- a/sdk/objc/unittests/RTCConfigurationTest.mm +++ b/sdk/objc/unittests/RTCConfigurationTest.mm @@ -54,6 +54,8 @@ srtpEnableAes128Sha1_32CryptoCipher:YES srtpEnableEncryptedRtpHeaderExtensions:YES sframeRequireFrameEncryption:YES]; + config.rtcpAudioReportIntervalMs = 2500; + config.rtcpVideoReportIntervalMs = 3750; std::unique_ptr nativeConfig([config createNativeConfiguration]); @@ -86,6 +88,8 @@ EXPECT_EQ(true, nativeConfig->crypto_options->srtp.enable_aes128_sha1_32_crypto_cipher); EXPECT_EQ(true, nativeConfig->crypto_options->srtp.enable_encrypted_rtp_header_extensions); EXPECT_EQ(true, nativeConfig->crypto_options->sframe.require_frame_encryption); + EXPECT_EQ(2500, nativeConfig->audio_rtcp_report_interval_ms()); + EXPECT_EQ(3750, nativeConfig->video_rtcp_report_interval_ms()); } - (void)testNativeConversionToConfiguration { @@ -115,6 +119,8 @@ srtpEnableAes128Sha1_32CryptoCipher:NO srtpEnableEncryptedRtpHeaderExtensions:NO sframeRequireFrameEncryption:NO]; + config.rtcpAudioReportIntervalMs = 1500; + config.rtcpVideoReportIntervalMs = 2150; webrtc::PeerConnectionInterface::RTCConfiguration *nativeConfig = [config createNativeConfiguration]; @@ -150,6 +156,8 @@ newConfig.cryptoOptions.srtpEnableEncryptedRtpHeaderExtensions); EXPECT_EQ(config.cryptoOptions.sframeRequireFrameEncryption, newConfig.cryptoOptions.sframeRequireFrameEncryption); + EXPECT_EQ(config.rtcpAudioReportIntervalMs, newConfig.rtcpAudioReportIntervalMs); + EXPECT_EQ(config.rtcpVideoReportIntervalMs, newConfig.rtcpVideoReportIntervalMs); } - (void)testDefaultValues {