Skip to content

Commit

Permalink
fix: Remove enableHighQualityPhotos entirely
Browse files Browse the repository at this point in the history
  • Loading branch information
mrousavy committed Mar 19, 2024
1 parent ca41f2d commit 7110b76
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 31 deletions.
1 change: 0 additions & 1 deletion package/example/src/CameraPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,6 @@ export function CameraPage({ navigation }: Props): React.ReactElement {
video={true}
audio={hasMicrophonePermission}
frameProcessor={frameProcessor}
enableHighQualityPhotos={true}
/>
</TapGestureHandler>
</Reanimated.View>
Expand Down
6 changes: 2 additions & 4 deletions package/ios/CameraView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ public final class CameraView: UIView, CameraSessionDelegate {
// props that require reconfiguring
@objc var cameraId: NSString?
@objc var enableDepthData = false
@objc var enableHighQualityPhotos = false
@objc var enablePortraitEffectsMatteDelivery = false
@objc var enableBufferCompression = false
// use cases
Expand Down Expand Up @@ -179,10 +178,9 @@ public final class CameraView: UIView, CameraSessionDelegate {

// Photo
if photo {
config.photo = .enabled(config: CameraConfiguration.Photo(enableHighQualityPhotos: enableHighQualityPhotos,
config.photo = .enabled(config: CameraConfiguration.Photo(qualityBalance: getPhotoQualityBalance(),
enableDepthData: enableDepthData,
enablePortraitEffectsMatte: enablePortraitEffectsMatteDelivery,
qualityBalance: getPhotoQualityBalance()))
enablePortraitEffectsMatte: enablePortraitEffectsMatteDelivery))
} else {
config.photo = .disabled
}
Expand Down
1 change: 0 additions & 1 deletion package/ios/CameraViewManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ @interface RCT_EXTERN_REMAP_MODULE (CameraView, CameraViewManager, RCTViewManage
RCT_EXPORT_VIEW_PROPERTY(isActive, BOOL);
RCT_EXPORT_VIEW_PROPERTY(cameraId, NSString);
RCT_EXPORT_VIEW_PROPERTY(enableDepthData, BOOL);
RCT_EXPORT_VIEW_PROPERTY(enableHighQualityPhotos, BOOL);
RCT_EXPORT_VIEW_PROPERTY(enablePortraitEffectsMatteDelivery, BOOL);
RCT_EXPORT_VIEW_PROPERTY(enableBufferCompression, BOOL);
// use cases
Expand Down
3 changes: 1 addition & 2 deletions package/ios/Core/CameraConfiguration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,9 @@ class CameraConfiguration {
A Photo Output configuration
*/
struct Photo: Equatable {
var enableHighQualityPhotos = false
var qualityBalance = QualityBalance.balanced
var enableDepthData = false
var enablePortraitEffectsMatte = false
var qualityBalance = QualityBalance.balanced
}

/**
Expand Down
5 changes: 0 additions & 5 deletions package/ios/Core/CameraSession+Configuration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,6 @@ extension CameraSession {
let qualityPrioritization = AVCapturePhotoOutput.QualityPrioritization(fromQualityBalance: photo.qualityBalance)
photoOutput.maxPhotoQualityPrioritization = qualityPrioritization
}
if photo.enableHighQualityPhotos {
// This is deprecated in favor of `maxPhotoDimensions`, but maxPhotoDimensions is by default
// already set to the highest resolution possible (i think?), so we don't need to set that again.
photoOutput.isHighResolutionCaptureEnabled = true
}
// TODO: Enable isResponsiveCaptureEnabled? (iOS 17+)
// TODO: Enable isFastCapturePrioritizationEnabled? (iOS 17+)
if photo.enableDepthData {
Expand Down
6 changes: 0 additions & 6 deletions package/ios/Core/CameraSession+Photo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,6 @@ extension CameraSession {
// Create photo settings
let photoSettings = AVCapturePhotoSettings()

// high resolution capture
if photo.enableHighQualityPhotos {
// TODO: On iOS 16+ this will be removed in favor of maxPhotoDimensions.
photoSettings.isHighResolutionPhotoEnabled = photoOutput.isHighResolutionCaptureEnabled
}

// depth data
photoSettings.isDepthDataDeliveryEnabled = photoOutput.isDepthDataDeliveryEnabled
if #available(iOS 12.0, *) {
Expand Down
12 changes: 0 additions & 12 deletions package/src/CameraProps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,18 +265,6 @@ export interface CameraProps extends ViewProps {
* @default false
*/
enablePortraitEffectsMatteDelivery?: boolean
/**
* Indicates whether the Camera should prepare the photo pipeline to provide maximum quality photos.
*
* This enables:
* * High Resolution Capture ([`isHighResolutionCaptureEnabled`](https://developer.apple.com/documentation/avfoundation/avcapturephotooutput/1648721-ishighresolutioncaptureenabled))
* * Virtual Device fusion for greater detail ([`isVirtualDeviceConstituentPhotoDeliveryEnabled`](https://developer.apple.com/documentation/avfoundation/avcapturephotooutput/3192189-isvirtualdeviceconstituentphotod))
* * Dual Device fusion for greater detail ([`isDualCameraDualPhotoDeliveryEnabled`](https://developer.apple.com/documentation/avfoundation/avcapturephotosettings/2873917-isdualcameradualphotodeliveryena))
*
* @platform iOS
* @default false
*/
enableHighQualityPhotos?: boolean
/**
* If `true`, show a debug view to display the FPS of the Video Pipeline (Frame Processor).
* This is useful for debugging your Frame Processor's speed.
Expand Down

0 comments on commit 7110b76

Please sign in to comment.