Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(328)

Unified Diff: webrtc/api/objc/RTCOpenGLVideoRenderer.mm

Issue 1824573002: Fix some warnings in ObjC code. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/api/objc/RTCIceCandidate.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/objc/RTCOpenGLVideoRenderer.mm
diff --git a/webrtc/api/objc/RTCOpenGLVideoRenderer.mm b/webrtc/api/objc/RTCOpenGLVideoRenderer.mm
index 56a6431ffa43c09ee947e2662bd2a49c0cba36e4..b4a7c7b13a0de28e8f3dfb2373a59ce4bb07c8c0 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<GLsizei>(frame.width);
+ GLsizei lumaHeight = static_cast<GLsizei>(frame.height);
+ GLsizei chromaWidth = static_cast<GLsizei>(frame.chromaWidth);
+ GLsizei chromaHeight = static_cast<GLsizei>(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<GLenum>(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<GLsizei>(width),
+ static_cast<GLsizei>(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<GLsizei>(width),
+ static_cast<GLsizei>(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
« no previous file with comments | « webrtc/api/objc/RTCIceCandidate.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698