diff --git a/webrtc/api/objc/RTCDataChannel.h b/webrtc/api/objc/RTCDataChannel.h index 8ab4b34be7..43f5767702 100644 --- a/webrtc/api/objc/RTCDataChannel.h +++ b/webrtc/api/objc/RTCDataChannel.h @@ -46,7 +46,7 @@ NS_ASSUME_NONNULL_BEGIN /** The data channel's |bufferedAmount| changed. */ - (void)dataChannel:(RTCDataChannel *)dataChannel - didChangeBufferedAmount:(NSUInteger)amount; + didChangeBufferedAmount:(uint64_t)amount; @end diff --git a/webrtc/api/objc/RTCDataChannel.mm b/webrtc/api/objc/RTCDataChannel.mm index 98599058ee..4be3a227be 100644 --- a/webrtc/api/objc/RTCDataChannel.mm +++ b/webrtc/api/objc/RTCDataChannel.mm @@ -34,8 +34,8 @@ class DataChannelDelegateAdapter : public DataChannelObserver { void OnBufferedAmountChange(uint64_t previousAmount) override { id delegate = channel_.delegate; - if ([delegate - respondsToSelector:@selector(channel:didChangeBufferedAmount:)]) { + SEL sel = @selector(dataChannel:didChangeBufferedAmount:); + if ([delegate respondsToSelector:sel]) { [delegate dataChannel:channel_ didChangeBufferedAmount:previousAmount]; } } diff --git a/webrtc/api/objc/RTCIceCandidate.h b/webrtc/api/objc/RTCIceCandidate.h index 41ea69e991..e521ae04f6 100644 --- a/webrtc/api/objc/RTCIceCandidate.h +++ b/webrtc/api/objc/RTCIceCandidate.h @@ -24,7 +24,7 @@ NS_ASSUME_NONNULL_BEGIN * The index (starting at zero) of the media description this candidate is * associated with in the SDP. */ -@property(nonatomic, readonly) NSInteger sdpMLineIndex; +@property(nonatomic, readonly) int sdpMLineIndex; /** The SDP string for this candidate. */ @property(nonatomic, readonly) NSString *sdp; @@ -35,7 +35,7 @@ NS_ASSUME_NONNULL_BEGIN * Initialize an RTCIceCandidate from SDP. */ - (instancetype)initWithSdp:(NSString *)sdp - sdpMLineIndex:(NSInteger)sdpMLineIndex + sdpMLineIndex:(int)sdpMLineIndex sdpMid:(nullable NSString *)sdpMid NS_DESIGNATED_INITIALIZER; diff --git a/webrtc/api/objc/RTCIceCandidate.mm b/webrtc/api/objc/RTCIceCandidate.mm index b0b8abc8ca..ecc128f8b2 100644 --- a/webrtc/api/objc/RTCIceCandidate.mm +++ b/webrtc/api/objc/RTCIceCandidate.mm @@ -21,7 +21,7 @@ @synthesize sdp = _sdp; - (instancetype)initWithSdp:(NSString *)sdp - sdpMLineIndex:(NSInteger)sdpMLineIndex + sdpMLineIndex:(int)sdpMLineIndex sdpMid:(NSString *)sdpMid { NSParameterAssert(sdp.length); if (self = [super init]) { @@ -33,9 +33,9 @@ } - (NSString *)description { - return [NSString stringWithFormat:@"RTCIceCandidate:\n%@\n%ld\n%@", + return [NSString stringWithFormat:@"RTCIceCandidate:\n%@\n%d\n%@", _sdpMid, - (long)_sdpMLineIndex, + _sdpMLineIndex, _sdp]; } diff --git a/webrtc/api/objc/RTCOpenGLVideoRenderer.mm b/webrtc/api/objc/RTCOpenGLVideoRenderer.mm index 56a6431ffa..b4a7c7b13a 100644 --- a/webrtc/api/objc/RTCOpenGLVideoRenderer.mm +++ b/webrtc/api/objc/RTCOpenGLVideoRenderer.mm @@ -148,7 +148,7 @@ static const GLsizei kNumTextures = 3 * kNumTextureSets; NSOpenGLContext *_context; #endif BOOL _isInitialized; - NSUInteger _currentTextureSet; + GLint _currentTextureSet; // Handles for OpenGL constructs. GLuint _textures[kNumTextures]; GLuint _program; @@ -313,10 +313,10 @@ static const GLsizei kNumTextures = 3 * kNumTextureSets; frame.chromaHeight == _lastDrawnFrame.chromaHeight) { return YES; } - GLsizei lumaWidth = frame.width; - GLsizei lumaHeight = frame.height; - GLsizei chromaWidth = frame.chromaWidth; - GLsizei chromaHeight = frame.chromaHeight; + GLsizei lumaWidth = static_cast(frame.width); + GLsizei lumaHeight = static_cast(frame.height); + GLsizei chromaWidth = static_cast(frame.chromaWidth); + GLsizei chromaHeight = static_cast(frame.chromaHeight); for (GLint i = 0; i < kNumTextureSets; i++) { glActiveTexture(GL_TEXTURE0 + i * 3); glTexImage2D(GL_TEXTURE_2D, @@ -361,11 +361,11 @@ static const GLsizei kNumTextures = 3 * kNumTextureSets; - (void)uploadPlane:(const uint8_t *)plane sampler:(GLint)sampler - offset:(NSUInteger)offset + offset:(GLint)offset width:(size_t)width height:(size_t)height stride:(int32_t)stride { - glActiveTexture(GL_TEXTURE0 + offset); + glActiveTexture(static_cast(GL_TEXTURE0 + offset)); // When setting texture sampler uniforms, the texture index is used not // the texture handle. glUniform1i(sampler, offset); @@ -382,8 +382,8 @@ static const GLsizei kNumTextures = 3 * kNumTextureSets; glTexImage2D(GL_TEXTURE_2D, 0, RTC_PIXEL_FORMAT, - width, - height, + static_cast(width), + static_cast(height), 0, RTC_PIXEL_FORMAT, GL_UNSIGNED_BYTE, @@ -403,8 +403,8 @@ static const GLsizei kNumTextures = 3 * kNumTextureSets; glTexImage2D(GL_TEXTURE_2D, 0, RTC_PIXEL_FORMAT, - width, - height, + static_cast(width), + static_cast(height), 0, RTC_PIXEL_FORMAT, GL_UNSIGNED_BYTE, @@ -412,7 +412,7 @@ static const GLsizei kNumTextures = 3 * kNumTextureSets; } - (BOOL)updateTextureDataForFrame:(RTCVideoFrame *)frame { - NSUInteger textureOffset = _currentTextureSet * 3; + GLint textureOffset = _currentTextureSet * 3; NSAssert(textureOffset + 3 <= kNumTextures, @"invalid offset"); [self uploadPlane:frame.yPlane