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

Unified Diff: webrtc/sdk/objc/Framework/Classes/PeerConnection/RTCCameraVideoCapturer.m

Issue 2988783002: Removed file RTCCameraVideoCapturer.mm that isn't needed (Closed)
Patch Set: Added changes from review of 2964703002 after commit. Created 3 years, 5 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 | « webrtc/sdk/BUILD.gn ('k') | webrtc/sdk/objc/Framework/Classes/PeerConnection/RTCCameraVideoCapturer.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/sdk/objc/Framework/Classes/PeerConnection/RTCCameraVideoCapturer.m
diff --git a/webrtc/sdk/objc/Framework/Classes/PeerConnection/RTCCameraVideoCapturer.m b/webrtc/sdk/objc/Framework/Classes/PeerConnection/RTCCameraVideoCapturer.m
index 2d1aedd11027101f5e60af9f664f8f40f1e4b2dd..bb1c035834560f3b800a7ddb1ec827709aa35ac7 100644
--- a/webrtc/sdk/objc/Framework/Classes/PeerConnection/RTCCameraVideoCapturer.m
+++ b/webrtc/sdk/objc/Framework/Classes/PeerConnection/RTCCameraVideoCapturer.m
@@ -18,7 +18,7 @@
#import "WebRTC/UIDevice+RTCDevice.h"
#endif
-#import "AVCaptureSession+Device.h"
+#import "AVCaptureSession+DevicePosition.h"
#import "RTCDispatcher+Private.h"
const int64_t kNanosecondsPerSecond = 1000000000;
@@ -198,16 +198,17 @@ static inline BOOL IsMediaSubTypeSupported(FourCharCode mediaSubType) {
#if TARGET_OS_IPHONE
// Default to portrait orientation on iPhone.
RTCVideoRotation rotation = RTCVideoRotation_90;
- // Check here, which camera this frame is from, to avoid any race conditions.
- AVCaptureDeviceInput *deviceInput =
- (AVCaptureDeviceInput *)((AVCaptureInputPort *)connection.inputPorts.firstObject).input;
- BOOL usingFrontCamera = deviceInput.device.position == AVCaptureDevicePositionFront;
- // Check the image's EXIF for the actual camera the image came as the image could have been
+ BOOL usingFrontCamera = NO;
+ // Check the image's EXIF for the camera the image came from as the image could have been
// delayed as we set alwaysDiscardsLateVideoFrames to NO.
AVCaptureDevicePosition cameraPosition =
[AVCaptureSession devicePositionForSampleBuffer:sampleBuffer];
if (cameraPosition != AVCaptureDevicePositionUnspecified) {
- usingFrontCamera = cameraPosition == AVCaptureDevicePositionFront;
+ usingFrontCamera = AVCaptureDevicePositionFront == cameraPosition;
+ } else {
+ AVCaptureDeviceInput *deviceInput =
+ (AVCaptureDeviceInput *)((AVCaptureInputPort *)connection.inputPorts.firstObject).input;
+ usingFrontCamera = AVCaptureDevicePositionFront == deviceInput.device.position;
}
switch (_orientation) {
case UIDeviceOrientationPortrait:
« no previous file with comments | « webrtc/sdk/BUILD.gn ('k') | webrtc/sdk/objc/Framework/Classes/PeerConnection/RTCCameraVideoCapturer.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698