commit | 7c32c866c07954d29838a56b30a9ab7738012c9d | [log] [tgz] |
---|---|---|
author | Peter Hanspers <peterhanspers@webrtc.org> | Thu Jun 14 14:12:45 2018 +0200 |
committer | Commit Bot <commit-bot@chromium.org> | Thu Jun 14 13:46:06 2018 +0000 |
tree | b919932598c653b422cbd275ba0bce098fb51c01 | |
parent | 724a97d08d35b69d934b1c09fc2e0f4dd4d47f76 [diff] |
Metal view: Update drawable size when rotating. Bug: webrtc:9407 Change-Id: I8d6651eb4cd22c83a2dddbdbd890f34a61002f97 Reviewed-on: https://webrtc-review.googlesource.com/83586 Reviewed-by: Anders Carlsson <andersc@webrtc.org> Commit-Queue: Peter Hanspers <peterhanspers@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23614}
diff --git a/sdk/objc/Framework/Classes/Metal/RTCMTLVideoView.m b/sdk/objc/Framework/Classes/Metal/RTCMTLVideoView.m index 66194db..48e7b9a 100644 --- a/sdk/objc/Framework/Classes/Metal/RTCMTLVideoView.m +++ b/sdk/objc/Framework/Classes/Metal/RTCMTLVideoView.m
@@ -182,6 +182,15 @@ - (void)mtkView:(MTKView *)view drawableSizeWillChange:(CGSize)size { } +#pragma mark - + +- (void)setRotationOverride:(NSValue *)rotationOverride { + _rotationOverride = rotationOverride; + + self.metalView.drawableSize = [self drawableSize]; + [self setNeedsLayout]; +} + - (RTCVideoRotation)frameRotation { if (self.rotationOverride) { RTCVideoRotation rotation;
diff --git a/sdk/objc/Framework/Headers/WebRTC/RTCMTLVideoView.h b/sdk/objc/Framework/Headers/WebRTC/RTCMTLVideoView.h index dcb27de..da1797f 100644 --- a/sdk/objc/Framework/Headers/WebRTC/RTCMTLVideoView.h +++ b/sdk/objc/Framework/Headers/WebRTC/RTCMTLVideoView.h
@@ -44,7 +44,7 @@ /** @abstract Wrapped RTCVideoRotation, or nil. */ -@property(nullable) NSValue* rotationOverride; +@property(nonatomic, nullable) NSValue* rotationOverride; @end