From f05af9e0fc38702bbbf395860dc13426744f39b1 Mon Sep 17 00:00:00 2001 From: Taylor Brandstetter Date: Thu, 19 Mar 2020 17:14:27 -0700 Subject: [PATCH] Revert "Remove bitratePriority from the Obj-C RTCRtpEncodingParameters wrapper." MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 86e0ea5711cfef95960ffcc8b6d918c67576e5c9. Reason for revert: The reasons for removing bitratePriority are unclear. Aside from the fact that you can't yet use it for the relative bitrate of simulcast streams, only the relative bitrate of entire tracks, it's working as intended. It differs from the standard, but only in that it's more flexible; the web standard only allows values of 0.5, 1.0, 2.0, and 4.0 while for the native API we allow any ratio. Original change's description: > Remove bitratePriority from the Obj-C RTCRtpEncodingParameters wrapper. > > This was added in CL 135122, but the bitratePriority parameter is not > standard and not implemented in a way users would expect. So it should > actually not be exposed in the Obj-C SDK. > > Bug: webrtc:10438 > Change-Id: I801ce940a32701d2703e951ef2b601c606aa2111 > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/135287 > Reviewed-by: Kári Helgason > Commit-Queue: Anders Carlsson > Cr-Commit-Position: refs/heads/master@{#27861} TBR=andersc@webrtc.org,kthelgason@webrtc.org # Not skipping CQ checks because original CL landed > 1 day ago. Bug: webrtc:10438 Change-Id: Ibc16b6054a1583de43a868d98683ea114bd89435 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/171140 Reviewed-by: Taylor Reviewed-by: Kári Helgason Commit-Queue: Kári Helgason Cr-Commit-Position: refs/heads/master@{#30863} --- sdk/objc/api/peerconnection/RTCRtpEncodingParameters.h | 3 +++ sdk/objc/api/peerconnection/RTCRtpEncodingParameters.mm | 3 +++ 2 files changed, 6 insertions(+) diff --git a/sdk/objc/api/peerconnection/RTCRtpEncodingParameters.h b/sdk/objc/api/peerconnection/RTCRtpEncodingParameters.h index bd4fe8e1ee..1bbb88dba3 100644 --- a/sdk/objc/api/peerconnection/RTCRtpEncodingParameters.h +++ b/sdk/objc/api/peerconnection/RTCRtpEncodingParameters.h @@ -59,6 +59,9 @@ RTC_OBJC_EXPORT /** The SSRC being used by this encoding. */ @property(nonatomic, readonly, nullable) NSNumber *ssrc; +/** The relative bitrate priority. */ +@property(nonatomic, assign) double bitratePriority; + /** The relative DiffServ Code Point priority. */ @property(nonatomic, assign) RTCPriority networkPriority; diff --git a/sdk/objc/api/peerconnection/RTCRtpEncodingParameters.mm b/sdk/objc/api/peerconnection/RTCRtpEncodingParameters.mm index 6fef212245..4468fb37d6 100644 --- a/sdk/objc/api/peerconnection/RTCRtpEncodingParameters.mm +++ b/sdk/objc/api/peerconnection/RTCRtpEncodingParameters.mm @@ -22,6 +22,7 @@ @synthesize numTemporalLayers = _numTemporalLayers; @synthesize scaleResolutionDownBy = _scaleResolutionDownBy; @synthesize ssrc = _ssrc; +@synthesize bitratePriority = _bitratePriority; @synthesize networkPriority = _networkPriority; - (instancetype)init { @@ -56,6 +57,7 @@ if (nativeParameters.ssrc) { _ssrc = [NSNumber numberWithUnsignedLong:*nativeParameters.ssrc]; } + _bitratePriority = nativeParameters.bitrate_priority; _networkPriority = [RTCRtpEncodingParameters priorityFromNativePriority:nativeParameters.network_priority]; } @@ -87,6 +89,7 @@ if (_ssrc != nil) { parameters.ssrc = absl::optional(_ssrc.unsignedLongValue); } + parameters.bitrate_priority = _bitratePriority; parameters.network_priority = [RTCRtpEncodingParameters nativePriorityFromPriority:_networkPriority]; return parameters;