Add scaleResolutionDownBy to RTCRtpEncodingParameters in ObjC SDK.

Bug: webrtc:10069
Change-Id: I3b34d689569b6a462b771969e383f5d9d7c8047e
Reviewed-on: https://webrtc-review.googlesource.com/c/121404
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Commit-Queue: Mirta Dvornicic <mirtad@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26531}
This commit is contained in:
Mirta Dvornicic
2019-02-04 14:27:49 +01:00
committed by Commit Bot
parent 30abc36444
commit 817aec8eca
2 changed files with 14 additions and 0 deletions

View File

@ -40,6 +40,11 @@ RTC_OBJC_EXPORT
*/
@property(nonatomic, copy, nullable) NSNumber *numTemporalLayers;
/** Scale the width and height down by this factor for video. If nil,
* implementation default scaling factor will be used.
*/
@property(nonatomic, copy, nullable) NSNumber *scaleResolutionDownBy;
/** The SSRC being used by this encoding. */
@property(nonatomic, readonly, nullable) NSNumber *ssrc;

View File

@ -17,6 +17,7 @@
@synthesize minBitrateBps = _minBitrateBps;
@synthesize maxFramerate = _maxFramerate;
@synthesize numTemporalLayers = _numTemporalLayers;
@synthesize scaleResolutionDownBy = _scaleResolutionDownBy;
@synthesize ssrc = _ssrc;
- (instancetype)init {
@ -41,6 +42,10 @@
if (nativeParameters.num_temporal_layers) {
_numTemporalLayers = [NSNumber numberWithInt:*nativeParameters.num_temporal_layers];
}
if (nativeParameters.scale_resolution_down_by) {
_scaleResolutionDownBy =
[NSNumber numberWithDouble:*nativeParameters.scale_resolution_down_by];
}
if (nativeParameters.ssrc) {
_ssrc = [NSNumber numberWithUnsignedLong:*nativeParameters.ssrc];
}
@ -63,6 +68,10 @@
if (_numTemporalLayers != nil) {
parameters.num_temporal_layers = absl::optional<int>(_numTemporalLayers.intValue);
}
if (_scaleResolutionDownBy != nil) {
parameters.scale_resolution_down_by =
absl::optional<double>(_scaleResolutionDownBy.doubleValue);
}
if (_ssrc != nil) {
parameters.ssrc = absl::optional<uint32_t>(_ssrc.unsignedLongValue);
}