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

Unified Diff: webrtc/sdk/objc/Framework/Classes/RTCCameraPreviewView.m

Issue 2859573002: Make RTCCameraPreviewView video rotation optional.
Patch Set: Created 3 years, 8 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 | « no previous file | webrtc/sdk/objc/Framework/Headers/WebRTC/RTCCameraPreviewView.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/sdk/objc/Framework/Classes/RTCCameraPreviewView.m
diff --git a/webrtc/sdk/objc/Framework/Classes/RTCCameraPreviewView.m b/webrtc/sdk/objc/Framework/Classes/RTCCameraPreviewView.m
index 5a60ba3e896ddd0585ab7746c261537faa46a9c6..6ea0e2a727b96c9208e7b7298d52e9adb8cca586 100644
--- a/webrtc/sdk/objc/Framework/Classes/RTCCameraPreviewView.m
+++ b/webrtc/sdk/objc/Framework/Classes/RTCCameraPreviewView.m
@@ -18,11 +18,20 @@
@implementation RTCCameraPreviewView
@synthesize captureSession = _captureSession;
+@synthesize shouldUpdateVideoOrientationOnDeviceRotation =
+ _shouldUpdateVideoOrientationOnDeviceRotation;
+ (Class)layerClass {
return [AVCaptureVideoPreviewLayer class];
}
+- (instancetype)init {
+ if (self = [super init]) {
+ _shouldUpdateVideoOrientationOnDeviceRotation = YES;
+ }
+ return self;
+}
+
- (void)setCaptureSession:(AVCaptureSession *)captureSession {
if (_captureSession == captureSession) {
return;
@@ -39,7 +48,9 @@
[super layoutSubviews];
// Update the video orientation based on the device orientation.
- [self setCorrectVideoOrientation];
+ if (_shouldUpdateVideoOrientationOnDeviceRotation) {
+ [self setCorrectVideoOrientation];
+ }
}
- (void)setCorrectVideoOrientation {
« no previous file with comments | « no previous file | webrtc/sdk/objc/Framework/Headers/WebRTC/RTCCameraPreviewView.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698