@interface AVCaptureDevice : NSObject
{
@private
AVCaptureDeviceInternal *_internal;
}
+ (NSArray *)devices NS_DEPRECATED_IOS(4_0, 10_0, "Use AVCaptureDeviceDiscoverySession instead.");
+ (NSArray *)devicesWithMediaType:(NSString *)mediaType NS_DEPRECATED_IOS(4_0, 10_0, "Use AVCaptureDeviceDiscoverySession instead.");
+ (AVCaptureDevice *)defaultDeviceWithMediaType:(NSString *)mediaType;
+ (AVCaptureDevice *)deviceWithUniqueID:(NSString *)deviceUniqueID;
@property(nonatomic, readonly) NSString *uniqueID;
@property(nonatomic, readonly) NSString *modelID;
@property(nonatomic, readonly) NSString *localizedName;
@property(nonatomic, readonly) NSString *manufacturer NS_AVAILABLE(10_9, NA);
@property(nonatomic, readonly) int32_t transportType NS_AVAILABLE(10_7, NA);
- (BOOL)hasMediaType:(NSString *)mediaType;
- (BOOL)lockForConfiguration:(NSError **)outError;
- (void)unlockForConfiguration;
- (BOOL)supportsAVCaptureSessionPreset:(NSString *)preset;
@property(nonatomic, readonly, getter=isConnected) BOOL connected;
@property(nonatomic, readonly, getter=isInUseByAnotherApplication) BOOL inUseByAnotherApplication NS_AVAILABLE(10_7, NA);
@property(nonatomic, readonly, getter=isSuspended) BOOL suspended NS_AVAILABLE(10_7, NA);
@property(nonatomic, readonly) NSArray *linkedDevices NS_AVAILABLE(10_7, NA);
@property(nonatomic, readonly) NSArray *formats NS_AVAILABLE(10_7, 7_0);
@property(nonatomic, retain) AVCaptureDeviceFormat *activeFormat NS_AVAILABLE(10_7, 7_0);
@property(nonatomic) CMTime activeVideoMinFrameDuration NS_AVAILABLE(10_7, 7_0);
@property(nonatomic) CMTime activeVideoMaxFrameDuration NS_AVAILABLE(10_9, 7_0);
@property(nonatomic, readonly) NSArray *inputSources NS_AVAILABLE(10_7, NA);
@property(nonatomic, retain) AVCaptureDeviceInputSource *activeInputSource NS_AVAILABLE(10_7, NA);
@end
typedef NS_ENUM(NSInteger, AVCaptureDevicePosition) {
AVCaptureDevicePositionUnspecified = 0,
AVCaptureDevicePositionBack = 1,
AVCaptureDevicePositionFront = 2
}
@interface AVCaptureDevice (AVCaptureDevicePosition)
@property(nonatomic, readonly) AVCaptureDevicePosition position;
@end
typedef NSString *AVCaptureDeviceType NS_STRING_ENUM NS_AVAILABLE_IOS(10_0) __TVOS_PROHIBITED;
AVF_EXPORT AVCaptureDeviceType const AVCaptureDeviceTypeBuiltInMicrophone NS_AVAILABLE_IOS(10_0) __TVOS_PROHIBITED;
AVF_EXPORT AVCaptureDeviceType const AVCaptureDeviceTypeBuiltInWideAngleCamera NS_AVAILABLE_IOS(10_0) __TVOS_PROHIBITED;
AVF_EXPORT AVCaptureDeviceType const AVCaptureDeviceTypeBuiltInTelephotoCamera NS_AVAILABLE_IOS(10_0) __TVOS_PROHIBITED;
AVF_EXPORT AVCaptureDeviceType const AVCaptureDeviceTypeBuiltInDualCamera NS_AVAILABLE_IOS(10_2) __TVOS_PROHIBITED;
AVF_EXPORT AVCaptureDeviceType const AVCaptureDeviceTypeBuiltInDuoCamera NS_DEPRECATED_IOS(10_0, 10_2, "Use AVCaptureDeviceTypeBuiltInDualCamera instead") __TVOS_PROHIBITED;
@interface AVCaptureDevice (AVCaptureDeviceType)
@property(nonatomic, readonly) AVCaptureDeviceType deviceType NS_AVAILABLE_IOS(10_0) __TVOS_PROHIBITED;
+ (AVCaptureDevice *)defaultDeviceWithDeviceType:(AVCaptureDeviceType)deviceType mediaType:(NSString *)mediaType position:(AVCaptureDevicePosition)position NS_AVAILABLE_IOS(10_0) __TVOS_PROHIBITED;
@end
typedef NS_ENUM(NSInteger, AVCaptureFlashMode) {
AVCaptureFlashModeOff = 0,
AVCaptureFlashModeOn = 1,
AVCaptureFlashModeAuto = 2
}
@interface AVCaptureDevice (AVCaptureDeviceFlash)
@property(nonatomic, readonly) BOOL hasFlash;
@property(nonatomic, readonly, getter=isFlashAvailable) BOOL flashAvailable NS_AVAILABLE_IOS(5_0);
@property(nonatomic, readonly, getter=isFlashActive) BOOL flashActive NS_DEPRECATED_IOS(5_0, 10_0, "Use AVCapturePhotoOutput's -isFlashScene instead.");
- (BOOL)isFlashModeSupported:(AVCaptureFlashMode)flashMode NS_DEPRECATED(10_7, NA, 4_0, 10_0, "Use AVCapturePhotoOutput's -supportedFlashModes instead.");
@property(nonatomic) AVCaptureFlashMode flashMode NS_DEPRECATED(10_7, NA, 4_0, 10_0, "Use AVCapturePhotoSettings.flashMode instead.");
@end
typedef NS_ENUM(NSInteger, AVCaptureTorchMode) {
AVCaptureTorchModeOff = 0,
AVCaptureTorchModeOn = 1,
AVCaptureTorchModeAuto = 2,
}
extern const float AVCaptureMaxAvailableTorchLevel;
@interface AVCaptureDevice (AVCaptureDeviceTorch)
@property(nonatomic, readonly) BOOL hasTorch;
@property(nonatomic, readonly, getter=isTorchAvailable) BOOL torchAvailable NS_AVAILABLE_IOS(5_0);
@property(nonatomic, readonly, getter=isTorchActive) BOOL torchActive NS_AVAILABLE_IOS(6_0);
@property(nonatomic, readonly) float torchLevel NS_AVAILABLE_IOS(5_0);
- (BOOL)isTorchModeSupported:(AVCaptureTorchMode)torchMode;
@property(nonatomic) AVCaptureTorchMode torchMode;
- (BOOL)setTorchModeOnWithLevel:(float)torchLevel error:(NSError **)outError NS_AVAILABLE_IOS(6_0);
@end
typedef NS_ENUM(NSInteger, AVCaptureFocusMode) {
AVCaptureFocusModeLocked = 0,
AVCaptureFocusModeAutoFocus = 1,
AVCaptureFocusModeContinuousAutoFocus = 2,
}
typedef NS_ENUM(NSInteger, AVCaptureAutoFocusRangeRestriction) {
AVCaptureAutoFocusRangeRestrictionNone = 0,
AVCaptureAutoFocusRangeRestrictionNear = 1,
AVCaptureAutoFocusRangeRestrictionFar = 2,
}
@interface AVCaptureDevice (AVCaptureDeviceFocus)
- (BOOL)isFocusModeSupported:(AVCaptureFocusMode)focusMode;
@property(nonatomic, readonly, getter=isLockingFocusWithCustomLensPositionSupported) BOOL lockingFocusWithCustomLensPositionSupported NS_AVAILABLE_IOS(10_0);
@property(nonatomic) AVCaptureFocusMode focusMode;
@property(nonatomic, readonly, getter=isFocusPointOfInterestSupported) BOOL focusPointOfInterestSupported;
@property(nonatomic) CGPoint focusPointOfInterest;
@property(nonatomic, readonly, getter=isAdjustingFocus) BOOL adjustingFocus;
@property(nonatomic, readonly, getter=isAutoFocusRangeRestrictionSupported) BOOL autoFocusRangeRestrictionSupported NS_AVAILABLE_IOS(7_0);
@property(nonatomic) AVCaptureAutoFocusRangeRestriction autoFocusRangeRestriction NS_AVAILABLE_IOS(7_0);
@property(nonatomic, readonly, getter=isSmoothAutoFocusSupported) BOOL smoothAutoFocusSupported NS_AVAILABLE_IOS(7_0);
@property(nonatomic, getter=isSmoothAutoFocusEnabled) BOOL smoothAutoFocusEnabled NS_AVAILABLE_IOS(7_0);
@property(nonatomic, readonly) float lensPosition NS_AVAILABLE_IOS(8_0);
AVF_EXPORT const float AVCaptureLensPositionCurrent NS_AVAILABLE_IOS(8_0);
- (void)setFocusModeLockedWithLensPosition:(float)lensPosition completionHandler:(void (^)(CMTime syncTime))handler NS_AVAILABLE_IOS(8_0);
@end
typedef NS_ENUM(NSInteger, AVCaptureExposureMode) {
AVCaptureExposureModeLocked = 0,
AVCaptureExposureModeAutoExpose = 1,
AVCaptureExposureModeContinuousAutoExposure = 2,
AVCaptureExposureModeCustom NS_ENUM_AVAILABLE_IOS(8_0) = 3,
}
@interface AVCaptureDevice (AVCaptureDeviceExposure)
- (BOOL)isExposureModeSupported:(AVCaptureExposureMode)exposureMode;
@property(nonatomic) AVCaptureExposureMode exposureMode;
@property(nonatomic, readonly, getter=isExposurePointOfInterestSupported) BOOL exposurePointOfInterestSupported;
@property(nonatomic) CGPoint exposurePointOfInterest;
@property(nonatomic, readonly, getter=isAdjustingExposure) BOOL adjustingExposure;
@property(nonatomic, readonly) float lensAperture NS_AVAILABLE_IOS(8_0);
@property(nonatomic, readonly) CMTime exposureDuration NS_AVAILABLE_IOS(8_0);
@property(nonatomic, readonly) float ISO NS_AVAILABLE_IOS(8_0);
AVF_EXPORT const CMTime AVCaptureExposureDurationCurrent NS_AVAILABLE_IOS(8_0);
AVF_EXPORT const float AVCaptureISOCurrent NS_AVAILABLE_IOS(8_0);
- (void)setExposureModeCustomWithDuration:(CMTime)duration ISO:(float)ISO completionHandler:(void (^)(CMTime syncTime))handler NS_AVAILABLE_IOS(8_0);
@property(nonatomic, readonly) float exposureTargetOffset NS_AVAILABLE_IOS(8_0);
@property(nonatomic, readonly) float exposureTargetBias NS_AVAILABLE_IOS(8_0);
@property(nonatomic, readonly) float minExposureTargetBias NS_AVAILABLE_IOS(8_0);
@property(nonatomic, readonly) float maxExposureTargetBias NS_AVAILABLE_IOS(8_0);
AVF_EXPORT const float AVCaptureExposureTargetBiasCurrent NS_AVAILABLE_IOS(8_0);
- (void)setExposureTargetBias:(float)bias completionHandler:(void (^)(CMTime syncTime))handler NS_AVAILABLE_IOS(8_0);
@end
typedef NS_ENUM(NSInteger, AVCaptureWhiteBalanceMode) {
AVCaptureWhiteBalanceModeLocked = 0,
AVCaptureWhiteBalanceModeAutoWhiteBalance = 1,
AVCaptureWhiteBalanceModeContinuousAutoWhiteBalance = 2,
} NS_AVAILABLE(10_7, 4_0) __TVOS_PROHIBITED;
/*!
@typedef AVCaptureWhiteBalanceGains
@abstract
Structure containing RGB white balance gain values.
*/
typedef struct {
float redGain;
float greenGain;
float blueGain;
} AVCaptureWhiteBalanceGains NS_AVAILABLE_IOS(8_0) __TVOS_PROHIBITED;
/*!
@typedef AVCaptureWhiteBalanceChromaticityValues
@abstract
Structure containing CIE 1931 xy chromaticity values.
*/
typedef struct {
float x;
float y;
} AVCaptureWhiteBalanceChromaticityValues NS_AVAILABLE_IOS(8_0) __TVOS_PROHIBITED;
/*!
@typedef AVCaptureWhiteBalanceTemperatureAndTintValues
@abstract
Structure containing a white balance color correlated temperature in kelvin, plus a tint value in the range of [-150 - +150].
*/
typedef struct {
float temperature;
float tint;
} AVCaptureWhiteBalanceTemperatureAndTintValues NS_AVAILABLE_IOS(8_0) __TVOS_PROHIBITED;
@interface AVCaptureDevice (AVCaptureDeviceWhiteBalance)
- (BOOL)isWhiteBalanceModeSupported:(AVCaptureWhiteBalanceMode)whiteBalanceMode;
@property(nonatomic, readonly, getter=isLockingWhiteBalanceWithCustomDeviceGainsSupported) BOOL lockingWhiteBalanceWithCustomDeviceGainsSupported NS_AVAILABLE_IOS(10_0);
@property(nonatomic) AVCaptureWhiteBalanceMode whiteBalanceMode;
@property(nonatomic, readonly, getter=isAdjustingWhiteBalance) BOOL adjustingWhiteBalance;
@property(nonatomic, readonly) AVCaptureWhiteBalanceGains deviceWhiteBalanceGains NS_AVAILABLE_IOS(8_0);
@property(nonatomic, readonly) AVCaptureWhiteBalanceGains grayWorldDeviceWhiteBalanceGains NS_AVAILABLE_IOS(8_0);
@property(nonatomic, readonly) float maxWhiteBalanceGain NS_AVAILABLE_IOS(8_0);
AVF_EXPORT const AVCaptureWhiteBalanceGains AVCaptureWhiteBalanceGainsCurrent NS_AVAILABLE_IOS(8_0);
- (void)setWhiteBalanceModeLockedWithDeviceWhiteBalanceGains:(AVCaptureWhiteBalanceGains)whiteBalanceGains completionHandler:(void (^)(CMTime syncTime))handler NS_AVAILABLE_IOS(8_0);
-(AVCaptureWhiteBalanceChromaticityValues)chromaticityValuesForDeviceWhiteBalanceGains:(AVCaptureWhiteBalanceGains)whiteBalanceGains NS_AVAILABLE_IOS(8_0);
- (AVCaptureWhiteBalanceGains)deviceWhiteBalanceGainsForChromaticityValues:(AVCaptureWhiteBalanceChromaticityValues)chromaticityValues NS_AVAILABLE_IOS(8_0);
- (AVCaptureWhiteBalanceTemperatureAndTintValues)temperatureAndTintValuesForDeviceWhiteBalanceGains:(AVCaptureWhiteBalanceGains)whiteBalanceGains NS_AVAILABLE_IOS(8_0);
- (AVCaptureWhiteBalanceGains)deviceWhiteBalanceGainsForTemperatureAndTintValues:(AVCaptureWhiteBalanceTemperatureAndTintValues)tempAndTintValues NS_AVAILABLE_IOS(8_0);
@end
@interface AVCaptureDevice (AVCaptureDeviceSubjectAreaChangeMonitoring)
@property(nonatomic, getter=isSubjectAreaChangeMonitoringEnabled) BOOL subjectAreaChangeMonitoringEnabled NS_AVAILABLE_IOS(5_0);
@end
@interface AVCaptureDevice (AVCaptureDeviceLowLightBoost)
@property(nonatomic, readonly, getter=isLowLightBoostSupported) BOOL lowLightBoostSupported NS_AVAILABLE_IOS(6_0);
@property(nonatomic, readonly, getter=isLowLightBoostEnabled) BOOL lowLightBoostEnabled NS_AVAILABLE_IOS(6_0);
@property(nonatomic) BOOL automaticallyEnablesLowLightBoostWhenAvailable NS_AVAILABLE_IOS(6_0);
@end
@interface AVCaptureDevice (AVCaptureDeviceVideoZoom)
@property(nonatomic) CGFloat videoZoomFactor NS_AVAILABLE_IOS(7_0);
- (void)rampToVideoZoomFactor:(CGFloat)factor withRate:(float)rate NS_AVAILABLE_IOS(7_0);
@property(nonatomic,readonly,getter=isRampingVideoZoom) BOOL rampingVideoZoom NS_AVAILABLE_IOS(7_0);
- (void)cancelVideoZoomRamp NS_AVAILABLE_IOS(7_0);
@end
typedef NS_ENUM(NSInteger, AVAuthorizationStatus) {
AVAuthorizationStatusNotDetermined = 0,
AVAuthorizationStatusRestricted,
AVAuthorizationStatusDenied,
AVAuthorizationStatusAuthorized
} NS_AVAILABLE_IOS(7_0) __TVOS_PROHIBITED;
@interface AVCaptureDevice (AVCaptureDeviceAuthorization)
+ (AVAuthorizationStatus)authorizationStatusForMediaType:(NSString *)mediaType NS_AVAILABLE_IOS(7_0);
+ (void)requestAccessForMediaType:(NSString *)mediaType completionHandler:(void (^)(BOOL granted))handler NS_AVAILABLE_IOS(7_0);
@end
typedef float AVCaptureDeviceTransportControlsSpeed;
typedef NS_ENUM(NSInteger, AVCaptureDeviceTransportControlsPlaybackMode) {
AVCaptureDeviceTransportControlsNotPlayingMode = 0,
AVCaptureDeviceTransportControlsPlayingMode = 1
} NS_AVAILABLE(10_7, NA) __TVOS_PROHIBITED;
@interface AVCaptureDevice (AVCaptureDeviceTransportControls)
@property(nonatomic, readonly) BOOL transportControlsSupported NS_AVAILABLE(10_7, NA);
@property(nonatomic, readonly) AVCaptureDeviceTransportControlsPlaybackMode transportControlsPlaybackMode NS_AVAILABLE(10_7, NA);
@property(nonatomic, readonly) AVCaptureDeviceTransportControlsPlaybackMode transportControlsPlaybackMode NS_AVAILABLE(10_7, NA);
- (void)setTransportControlsPlaybackMode:(AVCaptureDeviceTransportControlsPlaybackMode)mode speed:(AVCaptureDeviceTransportControlsSpeed)speed NS_AVAILABLE(10_7, NA);
@end
@interface AVCaptureDevice (AVCaptureDeviceHighDynamicRangeSupport)
@property(nonatomic) BOOL automaticallyAdjustsVideoHDREnabled NS_AVAILABLE_IOS(8_0);
@property(nonatomic, getter=isVideoHDREnabled) BOOL videoHDREnabled NS_AVAILABLE_IOS(8_0);
@end
typedef NS_ENUM(NSInteger, AVCaptureColorSpace) {
AVCaptureColorSpace_sRGB NS_SWIFT_NAME(sRGB) = 0,
AVCaptureColorSpace_P3_D65 NS_SWIFT_NAME(P3_D65) = 1,
} NS_AVAILABLE_IOS(10_0) __TVOS_PROHIBITED;
@interface AVCaptureDevice (AVCaptureDeviceColorSpaceSupport)
@property(nonatomic) AVCaptureColorSpace activeColorSpace NS_AVAILABLE_IOS(10_0);
@end
@interface AVCaptureDeviceDiscoverySession : NSObject
+ (instancetype)discoverySessionWithDeviceTypes:(NSArray<AVCaptureDeviceType> *)deviceTypes mediaType:(NSString *)mediaType position:(AVCaptureDevicePosition)position;
- (instancetype)init NS_UNAVAILABLE;
@property(nonatomic, readonly) NSArray<AVCaptureDevice *> *devices;
@end
@interface AVFrameRateRange : NSObject
{
@private
AVFrameRateRangeInternal *_internal;
}
@property(readonly) Float64 minFrameRate;
@property(readonly) Float64 maxFrameRate;
@property(readonly) CMTime maxFrameDuration;
@property(readonly) CMTime minFrameDuration;
@end
typedef NS_ENUM(NSInteger, AVCaptureVideoStabilizationMode) {
AVCaptureVideoStabilizationModeOff = 0,
AVCaptureVideoStabilizationModeStandard = 1,
AVCaptureVideoStabilizationModeCinematic = 2,
AVCaptureVideoStabilizationModeAuto = -1,
} NS_AVAILABLE_IOS(8_0) __TVOS_PROHIBITED;
typedef NS_ENUM(NSInteger, AVCaptureAutoFocusSystem) {
AVCaptureAutoFocusSystemNone = 0,
AVCaptureAutoFocusSystemContrastDetection = 1,
AVCaptureAutoFocusSystemPhaseDetection = 2,
} NS_AVAILABLE_IOS(8_0) __TVOS_PROHIBITED;
@interface AVCaptureDeviceFormat : NSObject
{
@private
AVCaptureDeviceFormatInternal *_internal;
}
@property(nonatomic, readonly) NSString *mediaType;
@property(nonatomic, readonly) CMFormatDescriptionRef formatDescription;
@property(nonatomic, readonly) NSArray *videoSupportedFrameRateRanges;
@property(nonatomic, readonly) float videoFieldOfView NS_AVAILABLE_IOS(7_0);
@property(nonatomic, readonly, getter=isVideoBinned) BOOL videoBinned NS_AVAILABLE_IOS(7_0);
- (BOOL)isVideoStabilizationModeSupported:(AVCaptureVideoStabilizationMode)videoStabilizationMode NS_AVAILABLE_IOS(8_0);
@property(nonatomic, readonly, getter=isVideoStabilizationSupported) BOOL videoStabilizationSupported NS_DEPRECATED_IOS(7_0, 8_0, "Use isVideoStabilizationModeSupported: instead.");
@property(nonatomic, readonly) CGFloat videoMaxZoomFactor NS_AVAILABLE_IOS(7_0);
@property(nonatomic, readonly) CGFloat videoZoomFactorUpscaleThreshold NS_AVAILABLE_IOS(7_0);
@property(nonatomic, readonly) CMTime minExposureDuration NS_AVAILABLE_IOS(8_0);
@property(nonatomic, readonly) CMTime maxExposureDuration NS_AVAILABLE_IOS(8_0);
@property(nonatomic, readonly) float minISO NS_AVAILABLE_IOS(8_0);
@property(nonatomic, readonly) float maxISO NS_AVAILABLE_IOS(8_0);
@property(nonatomic, readonly, getter=isVideoHDRSupported) BOOL videoHDRSupported NS_AVAILABLE_IOS(8_0);
@property(nonatomic, readonly) CMVideoDimensions highResolutionStillImageDimensions NS_AVAILABLE_IOS(8_0);
@property(nonatomic, readonly) AVCaptureAutoFocusSystem autoFocusSystem NS_AVAILABLE_IOS(8_0);
@property(nonatomic, readonly) NSArray<NSNumber *> *supportedColorSpaces NS_AVAILABLE_IOS(10_0);
@end
@interface AVCaptureDeviceInputSource : NSObject
{
@private
AVCaptureDeviceInputSourceInternal *_internal;
}
@property(nonatomic, readonly) NSString *inputSourceID;
@property(nonatomic, readonly) NSString *localizedName;
网友评论