add rotationOverride for RTCEAGLVideoView
Bug: webrtc:11221 Change-Id: I105b93de21fd2faeaf072c947c08006857c7a654 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/162460 Reviewed-by: Kári Helgason <kthelgason@webrtc.org> Commit-Queue: Kári Helgason <kthelgason@webrtc.org> Cr-Commit-Position: refs/heads/master@{#30117}
This commit is contained in:
@ -35,6 +35,9 @@ NS_EXTENSION_UNAVAILABLE_IOS("Rendering not available in app extensions.")
|
|||||||
- (instancetype)initWithCoder:(NSCoder *)aDecoder
|
- (instancetype)initWithCoder:(NSCoder *)aDecoder
|
||||||
shader:(id<RTCVideoViewShading>)shader NS_DESIGNATED_INITIALIZER;
|
shader:(id<RTCVideoViewShading>)shader NS_DESIGNATED_INITIALIZER;
|
||||||
|
|
||||||
|
/** @abstract Wrapped RTCVideoRotation, or nil.
|
||||||
|
*/
|
||||||
|
@property(nonatomic, nullable) NSValue *rotationOverride;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_END
|
NS_ASSUME_NONNULL_END
|
||||||
|
@ -57,6 +57,7 @@
|
|||||||
@synthesize delegate = _delegate;
|
@synthesize delegate = _delegate;
|
||||||
@synthesize videoFrame = _videoFrame;
|
@synthesize videoFrame = _videoFrame;
|
||||||
@synthesize glkView = _glkView;
|
@synthesize glkView = _glkView;
|
||||||
|
@synthesize rotationOverride = _rotationOverride;
|
||||||
|
|
||||||
- (instancetype)initWithFrame:(CGRect)frame {
|
- (instancetype)initWithFrame:(CGRect)frame {
|
||||||
return [self initWithFrame:frame shader:[[RTCDefaultShader alloc] init]];
|
return [self initWithFrame:frame shader:[[RTCDefaultShader alloc] init]];
|
||||||
@ -185,6 +186,10 @@
|
|||||||
if (!frame || frame.timeStampNs == _lastDrawnFrameTimeStampNs) {
|
if (!frame || frame.timeStampNs == _lastDrawnFrameTimeStampNs) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
RTCVideoRotation rotation = frame.rotation;
|
||||||
|
if(_rotationOverride != nil) {
|
||||||
|
[_rotationOverride getValue: &rotation];
|
||||||
|
}
|
||||||
[self ensureGLContext];
|
[self ensureGLContext];
|
||||||
glClear(GL_COLOR_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT);
|
||||||
if ([frame.buffer isKindOfClass:[RTCCVPixelBuffer class]]) {
|
if ([frame.buffer isKindOfClass:[RTCCVPixelBuffer class]]) {
|
||||||
@ -195,7 +200,7 @@
|
|||||||
[_nv12TextureCache uploadFrameToTextures:frame];
|
[_nv12TextureCache uploadFrameToTextures:frame];
|
||||||
[_shader applyShadingForFrameWithWidth:frame.width
|
[_shader applyShadingForFrameWithWidth:frame.width
|
||||||
height:frame.height
|
height:frame.height
|
||||||
rotation:frame.rotation
|
rotation:rotation
|
||||||
yPlane:_nv12TextureCache.yTexture
|
yPlane:_nv12TextureCache.yTexture
|
||||||
uvPlane:_nv12TextureCache.uvTexture];
|
uvPlane:_nv12TextureCache.uvTexture];
|
||||||
[_nv12TextureCache releaseTextures];
|
[_nv12TextureCache releaseTextures];
|
||||||
@ -209,7 +214,7 @@
|
|||||||
[_i420TextureCache uploadFrameToTextures:frame];
|
[_i420TextureCache uploadFrameToTextures:frame];
|
||||||
[_shader applyShadingForFrameWithWidth:frame.width
|
[_shader applyShadingForFrameWithWidth:frame.width
|
||||||
height:frame.height
|
height:frame.height
|
||||||
rotation:frame.rotation
|
rotation:rotation
|
||||||
yPlane:_i420TextureCache.yTexture
|
yPlane:_i420TextureCache.yTexture
|
||||||
uPlane:_i420TextureCache.uTexture
|
uPlane:_i420TextureCache.uTexture
|
||||||
vPlane:_i420TextureCache.vTexture];
|
vPlane:_i420TextureCache.vTexture];
|
||||||
|
Reference in New Issue
Block a user