diff --git a/webrtc/sdk/objc/Framework/Classes/UI/RTCEAGLVideoView.m b/webrtc/sdk/objc/Framework/Classes/UI/RTCEAGLVideoView.m index 5713bf86e3..851c4b4a9e 100644 --- a/webrtc/sdk/objc/Framework/Classes/UI/RTCEAGLVideoView.m +++ b/webrtc/sdk/objc/Framework/Classes/UI/RTCEAGLVideoView.m @@ -226,9 +226,11 @@ } if (_nv12TextureCache) { [_nv12TextureCache uploadFrameToTextures:frame]; - [_shader applyShadingForFrameWithRotation:frame.rotation - yPlane:_nv12TextureCache.yTexture - uvPlane:_nv12TextureCache.uvTexture]; + [_shader applyShadingForFrameWithWidth:frame.width + height:frame.height + rotation:frame.rotation + yPlane:_nv12TextureCache.yTexture + uvPlane:_nv12TextureCache.uvTexture]; [_nv12TextureCache releaseTextures]; } } else { @@ -236,10 +238,12 @@ _i420TextureCache = [[RTCI420TextureCache alloc] initWithContext:_glContext]; } [_i420TextureCache uploadFrameToTextures:frame]; - [_shader applyShadingForFrameWithRotation:frame.rotation - yPlane:_i420TextureCache.yTexture - uPlane:_i420TextureCache.uTexture - vPlane:_i420TextureCache.vTexture]; + [_shader applyShadingForFrameWithWidth:frame.width + height:frame.height + rotation:frame.rotation + yPlane:_i420TextureCache.yTexture + uPlane:_i420TextureCache.uTexture + vPlane:_i420TextureCache.vTexture]; } } diff --git a/webrtc/sdk/objc/Framework/Classes/UI/RTCNSGLVideoView.m b/webrtc/sdk/objc/Framework/Classes/UI/RTCNSGLVideoView.m index 66145fb506..3b7008728c 100644 --- a/webrtc/sdk/objc/Framework/Classes/UI/RTCNSGLVideoView.m +++ b/webrtc/sdk/objc/Framework/Classes/UI/RTCNSGLVideoView.m @@ -141,10 +141,12 @@ static CVReturn OnDisplayLinkFired(CVDisplayLinkRef displayLink, RTCI420TextureCache *i420TextureCache = self.i420TextureCache; if (i420TextureCache) { [i420TextureCache uploadFrameToTextures:frame]; - [_shader applyShadingForFrameWithRotation:frame.rotation - yPlane:i420TextureCache.yTexture - uPlane:i420TextureCache.uTexture - vPlane:i420TextureCache.vTexture]; + [_shader applyShadingForFrameWithWidth:frame.width + height:frame.height + rotation:frame.rotation + yPlane:i420TextureCache.yTexture + uPlane:i420TextureCache.uTexture + vPlane:i420TextureCache.vTexture]; [context flushBuffer]; _lastDrawnFrame = frame; } diff --git a/webrtc/sdk/objc/Framework/Classes/Video/RTCDefaultShader.mm b/webrtc/sdk/objc/Framework/Classes/Video/RTCDefaultShader.mm index 95a1eda5cd..28df4bd7cf 100644 --- a/webrtc/sdk/objc/Framework/Classes/Video/RTCDefaultShader.mm +++ b/webrtc/sdk/objc/Framework/Classes/Video/RTCDefaultShader.mm @@ -150,10 +150,12 @@ static const char kNV12FragmentShaderSource[] = return YES; } -- (void)applyShadingForFrameWithRotation:(RTCVideoRotation)rotation - yPlane:(GLuint)yPlane - uPlane:(GLuint)uPlane - vPlane:(GLuint)vPlane { +- (void)applyShadingForFrameWithWidth:(int)width + height:(int)height + rotation:(RTCVideoRotation)rotation + yPlane:(GLuint)yPlane + uPlane:(GLuint)uPlane + vPlane:(GLuint)vPlane { if (![self prepareVertexBufferWithRotation:rotation]) { return; } @@ -177,9 +179,11 @@ static const char kNV12FragmentShaderSource[] = glDrawArrays(GL_TRIANGLE_FAN, 0, 4); } -- (void)applyShadingForFrameWithRotation:(RTCVideoRotation)rotation - yPlane:(GLuint)yPlane - uvPlane:(GLuint)uvPlane { +- (void)applyShadingForFrameWithWidth:(int)width + height:(int)height + rotation:(RTCVideoRotation)rotation + yPlane:(GLuint)yPlane + uvPlane:(GLuint)uvPlane { if (![self prepareVertexBufferWithRotation:rotation]) { return; } diff --git a/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCVideoViewShading.h b/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCVideoViewShading.h index 48d4e0670a..6f3ece94a1 100644 --- a/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCVideoViewShading.h +++ b/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCVideoViewShading.h @@ -22,15 +22,19 @@ RTC_EXPORT @protocol RTCVideoViewShading /** Callback for I420 frames. Each plane is given as a texture. */ -- (void)applyShadingForFrameWithRotation:(RTCVideoRotation)rotation - yPlane:(GLuint)yPlane - uPlane:(GLuint)uPlane - vPlane:(GLuint)vPlane; +- (void)applyShadingForFrameWithWidth:(int)width + height:(int)height + rotation:(RTCVideoRotation)rotation + yPlane:(GLuint)yPlane + uPlane:(GLuint)uPlane + vPlane:(GLuint)vPlane; /** Callback for NV12 frames. Each plane is given as a texture. */ -- (void)applyShadingForFrameWithRotation:(RTCVideoRotation)rotation - yPlane:(GLuint)yPlane - uvPlane:(GLuint)uvPlane; +- (void)applyShadingForFrameWithWidth:(int)width + height:(int)height + rotation:(RTCVideoRotation)rotation + yPlane:(GLuint)yPlane + uvPlane:(GLuint)uvPlane; @end