From 3c7694137a0e868e172fa38dac092f09c591f0a1 Mon Sep 17 00:00:00 2001 From: Rasmus Brandt Date: Thu, 27 Sep 2018 09:53:11 +0200 Subject: [PATCH] iOS: Add maxFramerate to RtpEncodingParameters. iOS counterpart of https://webrtc-review.googlesource.com/c/src/+/91440. Bug: webrtc:9597 Change-Id: Iba426dc3b8acec3c90996ffa012d5dfc833c16f5 Reviewed-on: https://webrtc-review.googlesource.com/102260 Reviewed-by: Anders Carlsson Commit-Queue: Rasmus Brandt Cr-Commit-Position: refs/heads/master@{#24857} --- sdk/objc/api/peerconnection/RTCRtpEncodingParameters.h | 7 +++++-- sdk/objc/api/peerconnection/RTCRtpEncodingParameters.mm | 7 +++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/sdk/objc/api/peerconnection/RTCRtpEncodingParameters.h b/sdk/objc/api/peerconnection/RTCRtpEncodingParameters.h index 0634791b39..0ac8ad94ac 100644 --- a/sdk/objc/api/peerconnection/RTCRtpEncodingParameters.h +++ b/sdk/objc/api/peerconnection/RTCRtpEncodingParameters.h @@ -27,11 +27,14 @@ RTC_OBJC_EXPORT /** The minimum bitrate to use for the encoding, or nil if there is no * limit. - * - * Not implemented. */ @property(nonatomic, copy, nullable) NSNumber *minBitrateBps; +/** The maximum framerate to use for the encoding, or nil if there is no + * limit. + */ +@property(nonatomic, copy, nullable) NSNumber *maxFramerate; + /** The SSRC being used by this encoding. */ @property(nonatomic, readonly, nullable) NSNumber *ssrc; diff --git a/sdk/objc/api/peerconnection/RTCRtpEncodingParameters.mm b/sdk/objc/api/peerconnection/RTCRtpEncodingParameters.mm index 299e318bdc..3246371c23 100644 --- a/sdk/objc/api/peerconnection/RTCRtpEncodingParameters.mm +++ b/sdk/objc/api/peerconnection/RTCRtpEncodingParameters.mm @@ -15,6 +15,7 @@ @synthesize isActive = _isActive; @synthesize maxBitrateBps = _maxBitrateBps; @synthesize minBitrateBps = _minBitrateBps; +@synthesize maxFramerate = _maxFramerate; @synthesize ssrc = _ssrc; - (instancetype)init { @@ -33,6 +34,9 @@ _minBitrateBps = [NSNumber numberWithInt:*nativeParameters.min_bitrate_bps]; } + if (nativeParameters.max_framerate) { + _maxFramerate = [NSNumber numberWithInt:*nativeParameters.max_framerate]; + } if (nativeParameters.ssrc) { _ssrc = [NSNumber numberWithUnsignedLong:*nativeParameters.ssrc]; } @@ -49,6 +53,9 @@ if (_minBitrateBps != nil) { parameters.min_bitrate_bps = absl::optional(_minBitrateBps.intValue); } + if (_maxFramerate != nil) { + parameters.max_framerate = absl::optional(_maxFramerate.intValue); + } if (_ssrc != nil) { parameters.ssrc = absl::optional(_ssrc.unsignedLongValue); }