From ea12f4c5e8e5bf87f73d065405db3703a9f839d8 Mon Sep 17 00:00:00 2001 From: sakal Date: Fri, 5 May 2017 00:45:30 -0700 Subject: [PATCH] Make fps NSInteger in startCaptureWithDevice. This is better in line with Obj-C design guidelines. BUG=None Review-Url: https://codereview.webrtc.org/2862493003 Cr-Commit-Position: refs/heads/master@{#18023} --- webrtc/examples/objc/AppRTCMobile/ARDCaptureController.m | 4 ++-- webrtc/sdk/objc/Framework/Classes/RTCCameraVideoCapturer.m | 6 +++--- .../objc/Framework/Headers/WebRTC/RTCCameraVideoCapturer.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/webrtc/examples/objc/AppRTCMobile/ARDCaptureController.m b/webrtc/examples/objc/AppRTCMobile/ARDCaptureController.m index 328c422e5f..da6a37a8ff 100644 --- a/webrtc/examples/objc/AppRTCMobile/ARDCaptureController.m +++ b/webrtc/examples/objc/AppRTCMobile/ARDCaptureController.m @@ -34,7 +34,7 @@ _usingFrontCamera ? AVCaptureDevicePositionFront : AVCaptureDevicePositionBack; AVCaptureDevice *device = [self findDeviceForPosition:position]; AVCaptureDeviceFormat *format = [self selectFormatForDevice:device]; - int fps = [self selectFpsForFormat:format]; + NSInteger fps = [self selectFpsForFormat:format]; [_capturer startCaptureWithDevice:device format:format fps:fps]; } @@ -81,7 +81,7 @@ return selectedFormat; } -- (int)selectFpsForFormat:(AVCaptureDeviceFormat *)format { +- (NSInteger)selectFpsForFormat:(AVCaptureDeviceFormat *)format { Float64 maxFramerate = 0; for (AVFrameRateRange *fpsRange in format.videoSupportedFrameRateRanges) { maxFramerate = fmax(maxFramerate, fpsRange.maxFrameRate); diff --git a/webrtc/sdk/objc/Framework/Classes/RTCCameraVideoCapturer.m b/webrtc/sdk/objc/Framework/Classes/RTCCameraVideoCapturer.m index 9a0b40f081..030329979a 100644 --- a/webrtc/sdk/objc/Framework/Classes/RTCCameraVideoCapturer.m +++ b/webrtc/sdk/objc/Framework/Classes/RTCCameraVideoCapturer.m @@ -115,12 +115,12 @@ static inline BOOL IsMediaSubTypeSupported(FourCharCode mediaSubType) { - (void)startCaptureWithDevice:(AVCaptureDevice *)device format:(AVCaptureDeviceFormat *)format - fps:(int)fps { + fps:(NSInteger)fps { _willBeRunning = true; [RTCDispatcher dispatchAsyncOnType:RTCDispatcherTypeCaptureSession block:^{ - RTCLogInfo("startCaptureWithDevice %@ @ %d fps", format, fps); + RTCLogInfo("startCaptureWithDevice %@ @ %zd fps", format, fps); #if TARGET_OS_IPHONE [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications]; @@ -360,7 +360,7 @@ static inline BOOL IsMediaSubTypeSupported(FourCharCode mediaSubType) { #pragma mark - Private, called inside capture queue -- (void)updateDeviceCaptureFormat:(AVCaptureDeviceFormat *)format fps:(int)fps { +- (void)updateDeviceCaptureFormat:(AVCaptureDeviceFormat *)format fps:(NSInteger)fps { NSAssert([RTCDispatcher isOnQueueForType:RTCDispatcherTypeCaptureSession], @"updateDeviceCaptureFormat must be called on the capture queue."); @try { diff --git a/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCCameraVideoCapturer.h b/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCCameraVideoCapturer.h index 6eb6a9dec3..973452707c 100644 --- a/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCCameraVideoCapturer.h +++ b/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCCameraVideoCapturer.h @@ -31,7 +31,7 @@ RTC_EXPORT // Starts and stops the capture session asynchronously. - (void)startCaptureWithDevice:(AVCaptureDevice *)device format:(AVCaptureDeviceFormat *)format - fps:(int)fps; + fps:(NSInteger)fps; // Stops the capture session asynchronously. - (void)stopCapture;