From 2ac2739d06662b5e667290c7e7eebe8fead3aeb8 Mon Sep 17 00:00:00 2001 From: Anders Carlsson Date: Mon, 3 Sep 2018 14:17:03 +0200 Subject: [PATCH] Scaling settings nullability in Obj-C SDK. This method is allowed to return nil but was not annotated as such. Bug: webrtc:8560 Change-Id: If54aa94d6ff83b7bdb87b526244616e2627a8999 Reviewed-on: https://webrtc-review.googlesource.com/97380 Reviewed-by: Peter Hanspers Commit-Queue: Anders Carlsson Cr-Commit-Position: refs/heads/master@{#24568} --- sdk/objc/api/video_codec/RTCWrappedNativeVideoEncoder.mm | 2 +- sdk/objc/base/RTCVideoEncoder.h | 2 +- sdk/objc/components/video_codec/RTCVideoEncoderH264.mm | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sdk/objc/api/video_codec/RTCWrappedNativeVideoEncoder.mm b/sdk/objc/api/video_codec/RTCWrappedNativeVideoEncoder.mm index ebfba2c132..9afd54f55f 100644 --- a/sdk/objc/api/video_codec/RTCWrappedNativeVideoEncoder.mm +++ b/sdk/objc/api/video_codec/RTCWrappedNativeVideoEncoder.mm @@ -63,7 +63,7 @@ return nil; } -- (RTCVideoEncoderQpThresholds *)scalingSettings { +- (nullable RTCVideoEncoderQpThresholds *)scalingSettings { RTC_NOTREACHED(); return nil; } diff --git a/sdk/objc/base/RTCVideoEncoder.h b/sdk/objc/base/RTCVideoEncoder.h index 41e78badea..b566615bd9 100644 --- a/sdk/objc/base/RTCVideoEncoder.h +++ b/sdk/objc/base/RTCVideoEncoder.h @@ -42,7 +42,7 @@ RTC_EXPORT /** Returns QP scaling settings for encoder. The quality scaler adjusts the resolution in order to * keep the QP from the encoded images within the given range. Returning nil from this function * disables quality scaling. */ -- (RTCVideoEncoderQpThresholds *)scalingSettings; +- (nullable RTCVideoEncoderQpThresholds *)scalingSettings; @end diff --git a/sdk/objc/components/video_codec/RTCVideoEncoderH264.mm b/sdk/objc/components/video_codec/RTCVideoEncoderH264.mm index 6cd56debc8..16ad1ff47a 100644 --- a/sdk/objc/components/video_codec/RTCVideoEncoderH264.mm +++ b/sdk/objc/components/video_codec/RTCVideoEncoderH264.mm @@ -753,7 +753,7 @@ CFStringRef ExtractProfile(webrtc::SdpVideoFormat videoFormat) { _bitrateAdjuster->Update(frame.buffer.length); } -- (RTCVideoEncoderQpThresholds *)scalingSettings { +- (nullable RTCVideoEncoderQpThresholds *)scalingSettings { return [[RTCVideoEncoderQpThresholds alloc] initWithThresholdsLow:kLowH264QpThreshold high:kHighH264QpThreshold]; }