Skip to content

Commit 68106f4

Browse files
authored
Merge pull request react-native-camera#1523 from fagerbua/ios-288p-video
Support CIF (288p) video quality on iOS
2 parents 574f559 + 1098332 commit 68106f4

File tree

4 files changed

+7
-0
lines changed

4 files changed

+7
-0
lines changed

docs/RNCamera.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,9 @@ The promise will be fulfilled with an object with some of the following properti
386386
- `RNCamera.Constants.VideoQuality.4:3`.
387387
- `ios` Specifies capture settings suitable for VGA quality (640x480 pixel) video output. (Same as RNCamera.Constants.VideoQuality.480p).
388388
- `android` Quality level corresponding to the 480p (720 x 480) resolution but with video frame width set to 640.
389+
- `RNCamera.Constants.VideoQuality.288p`.
390+
- `ios` Specifies capture settings suitable for CIF quality (352x288 pixel) video output.
391+
- `android` Not supported.
389392

390393
If nothing is passed the device's highest camera quality will be used as default.
391394
- `iOS` `codec`. This option specifies the codec of the output video. Setting the codec is only supported on `iOS >= 10`. The possible values are:

ios/RN/RNCameraManager.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ typedef NS_ENUM(NSInteger, RNCameraVideoResolution) {
4444
RNCameraVideo1080p = 1,
4545
RNCameraVideo720p = 2,
4646
RNCameraVideo4x3 = 3,
47+
RNCameraVideo288p = 4,
4748
};
4849

4950
@interface RNCameraManager : RCTViewManager <RCTBridgeModule>

ios/RN/RNCameraManager.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ - (NSDictionary *)constantsToExport
5454
@"720p": @(RNCameraVideo720p),
5555
@"480p": @(RNCameraVideo4x3),
5656
@"4:3": @(RNCameraVideo4x3),
57+
@"288p": @(RNCameraVideo288p),
5758
},
5859
@"VideoCodec": [[self class] validCodecTypes],
5960
@"BarCodeType" : [[self class] validBarCodeTypes],

ios/RN/RNCameraUtils.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ + (NSString *)captureSessionPresetForVideoResolution:(RNCameraVideoResolution)re
8787
return AVCaptureSessionPreset1280x720;
8888
case RNCameraVideo4x3:
8989
return AVCaptureSessionPreset640x480;
90+
case RNCameraVideo288p:
91+
return AVCaptureSessionPreset352x288;
9092
default:
9193
return AVCaptureSessionPresetHigh;
9294
}

0 commit comments

Comments
 (0)