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