Project import generated by Copybara.
GitOrigin-RevId: f72a0f86c2c2acdb1920973c718a9e26ed3ec4b6
This commit is contained in:
@@ -34,6 +34,9 @@
|
||||
/// Whether to rotate video buffers with device rotation.
|
||||
@property(nonatomic) BOOL autoRotateBuffers;
|
||||
|
||||
/// Whether to mirror the video or not.
|
||||
@property(nonatomic) BOOL videoMirrored;
|
||||
|
||||
/// The camera intrinsic matrix.
|
||||
@property(nonatomic, readonly) matrix_float3x3 cameraIntrinsicMatrix;
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
BOOL _setupDone;
|
||||
BOOL _useDepth;
|
||||
BOOL _useCustomOrientation;
|
||||
BOOL _videoMirrored;
|
||||
}
|
||||
|
||||
- (instancetype)init {
|
||||
@@ -123,6 +124,22 @@
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setVideoMirrored:(BOOL)videoMirrored {
|
||||
if (videoMirrored == _videoMirrored) {
|
||||
return;
|
||||
}
|
||||
|
||||
BOOL wasRunning = [self isRunning];
|
||||
if (wasRunning) {
|
||||
[self stop];
|
||||
}
|
||||
_videoMirrored = videoMirrored;
|
||||
_setupDone = NO;
|
||||
if (wasRunning) {
|
||||
[self start];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setAutoRotateBuffers:(BOOL)autoRotateBuffers {
|
||||
if (autoRotateBuffers == _autoRotateBuffers) {
|
||||
return; // State has not changed.
|
||||
@@ -252,6 +269,11 @@
|
||||
}
|
||||
}
|
||||
|
||||
if (_videoMirrored) {
|
||||
AVCaptureConnection* connection = [_videoDataOutput connectionWithMediaType:AVMediaTypeVideo];
|
||||
connection.videoMirrored = _videoMirrored;
|
||||
}
|
||||
|
||||
_setupDone = YES;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user