From 3eb84f0bf9c682b673a04ed7fbd763faca66659e Mon Sep 17 00:00:00 2001 From: philipel Date: Mon, 11 Nov 2019 12:57:44 +0100 Subject: [PATCH] Add allowCodecSwitching flag to RTCConfiguration.mm MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: webrtc:10795 Change-Id: I4d645b077bc459b05ef16641defdbd240dbd1550 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/159481 Commit-Queue: Philip Eliasson Reviewed-by: Kári Helgason Cr-Commit-Position: refs/heads/master@{#29753} --- sdk/objc/api/peerconnection/RTCConfiguration.h | 6 ++++++ sdk/objc/api/peerconnection/RTCConfiguration.mm | 3 +++ 2 files changed, 9 insertions(+) diff --git a/sdk/objc/api/peerconnection/RTCConfiguration.h b/sdk/objc/api/peerconnection/RTCConfiguration.h index 2c32311d9e..13a51b961f 100644 --- a/sdk/objc/api/peerconnection/RTCConfiguration.h +++ b/sdk/objc/api/peerconnection/RTCConfiguration.h @@ -194,6 +194,12 @@ RTC_OBJC_EXPORT */ @property(nonatomic, assign) BOOL activeResetSrtpParams; +/** If the remote side support mid-stream codec switches then allow encoder + * switching to be performed. + */ + +@property(nonatomic, assign) BOOL allowCodecSwitching; + /** * If MediaTransportFactory is provided in PeerConnectionFactory, this flag informs PeerConnection * that it should use the MediaTransportInterface. diff --git a/sdk/objc/api/peerconnection/RTCConfiguration.mm b/sdk/objc/api/peerconnection/RTCConfiguration.mm index c2ff8bf17a..7503a0a01f 100644 --- a/sdk/objc/api/peerconnection/RTCConfiguration.mm +++ b/sdk/objc/api/peerconnection/RTCConfiguration.mm @@ -52,6 +52,7 @@ @synthesize sdpSemantics = _sdpSemantics; @synthesize turnCustomizer = _turnCustomizer; @synthesize activeResetSrtpParams = _activeResetSrtpParams; +@synthesize allowCodecSwitching = _allowCodecSwitching; @synthesize useMediaTransport = _useMediaTransport; @synthesize useMediaTransportForDataChannels = _useMediaTransportForDataChannels; @synthesize cryptoOptions = _cryptoOptions; @@ -138,6 +139,7 @@ } _rtcpAudioReportIntervalMs = config.audio_rtcp_report_interval_ms(); _rtcpVideoReportIntervalMs = config.video_rtcp_report_interval_ms(); + _allowCodecSwitching = config.allow_codec_switching.value_or(false); } return self; } @@ -274,6 +276,7 @@ } nativeConfig->set_audio_rtcp_report_interval_ms(_rtcpAudioReportIntervalMs); nativeConfig->set_video_rtcp_report_interval_ms(_rtcpVideoReportIntervalMs); + nativeConfig->allow_codec_switching = _allowCodecSwitching; return nativeConfig.release(); }