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

Unified Diff: webrtc/sdk/objc/Framework/Classes/avfoundationvideocapturer.mm

Issue 2206773002: Use 352x288 for iPhone 4S. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 4 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/sdk/objc/Framework/Classes/avfoundationvideocapturer.mm
diff --git a/webrtc/sdk/objc/Framework/Classes/avfoundationvideocapturer.mm b/webrtc/sdk/objc/Framework/Classes/avfoundationvideocapturer.mm
index 51003cad4113dc5a01c3aa4dff07a872303b6381..a9cf89f8d42294053d174ba860ebd0e4766fb29a 100644
--- a/webrtc/sdk/objc/Framework/Classes/avfoundationvideocapturer.mm
+++ b/webrtc/sdk/objc/Framework/Classes/avfoundationvideocapturer.mm
@@ -29,6 +29,7 @@
// TODO(tkchin): support other formats.
static NSString *const kDefaultPreset = AVCaptureSessionPreset640x480;
+static NSString *const kIPhone4SPreset = AVCaptureSessionPreset352x288;
static cricket::VideoFormat const kDefaultFormat =
cricket::VideoFormat(640,
480,
@@ -36,8 +37,8 @@ static cricket::VideoFormat const kDefaultFormat =
cricket::FOURCC_NV12);
// iPhone4S is too slow to handle 30fps.
static cricket::VideoFormat const kIPhone4SFormat =
- cricket::VideoFormat(640,
- 480,
+ cricket::VideoFormat(352,
+ 288,
cricket::VideoFormat::FpsToInterval(15),
cricket::FOURCC_NV12);
@@ -360,11 +361,17 @@ static cricket::VideoFormat const kIPhone4SFormat =
captureSession.usesApplicationAudioSession = NO;
}
#endif
- if (![captureSession canSetSessionPreset:kDefaultPreset]) {
+ NSString *preset = kDefaultPreset;
+#if TARGET_OS_IPHONE
+ if ([UIDevice deviceType] == RTCDeviceTypeIPhone4S) {
+ preset = kIPhone4SPreset;
+ }
+#endif
+ if (![captureSession canSetSessionPreset:preset]) {
RTCLogError(@"Session preset unsupported.");
return NO;
}
- captureSession.sessionPreset = kDefaultPreset;
+ captureSession.sessionPreset = preset;
// Add the output.
AVCaptureVideoDataOutput *videoDataOutput = [self videoDataOutput];
@@ -570,7 +577,7 @@ struct AVFoundationFrame {
AVFoundationVideoCapturer::AVFoundationVideoCapturer()
: _capturer(nil), _startThread(nullptr) {
- // Set our supported formats. This matches kDefaultPreset.
+ // Set our supported formats. This matches preset.
std::vector<cricket::VideoFormat> supported_formats;
#if TARGET_OS_IPHONE
if ([UIDevice deviceType] == RTCDeviceTypeIPhone4S) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698