1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
/// AVCaptureSystemPressureLevel string constants
///
///
/// The AVCaptureSystemPressureLevel string constants describe varying levels of system pressure that affect capture hardware availability and/or quality.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avcapturesystempressurelevel?language=objc)
// NS_TYPED_ENUM
pub type AVCaptureSystemPressureLevel = NSString;
extern "C" {
/// System pressure level is normal (not pressured).
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avcapturesystempressurelevelnominal?language=objc)
pub static AVCaptureSystemPressureLevelNominal: &'static AVCaptureSystemPressureLevel;
}
extern "C" {
/// System pressure is slightly elevated.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avcapturesystempressurelevelfair?language=objc)
pub static AVCaptureSystemPressureLevelFair: &'static AVCaptureSystemPressureLevel;
}
extern "C" {
/// System pressure is highly elevated. Capture performance may be impacted. Frame rate throttling is advised.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avcapturesystempressurelevelserious?language=objc)
pub static AVCaptureSystemPressureLevelSerious: &'static AVCaptureSystemPressureLevel;
}
extern "C" {
/// System pressure is critically elevated. Capture quality and performance are significantly impacted. Frame rate throttling is highly advised.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avcapturesystempressurelevelcritical?language=objc)
pub static AVCaptureSystemPressureLevelCritical: &'static AVCaptureSystemPressureLevel;
}
extern "C" {
/// System pressure is beyond critical. Capture must immediately stop.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avcapturesystempressurelevelshutdown?language=objc)
pub static AVCaptureSystemPressureLevelShutdown: &'static AVCaptureSystemPressureLevel;
}
/// Constants indicating factors contributing to the current system pressured state.
///
///
/// Indicates that the system is not currently pressured.
///
/// Indicates that the entire system is currently experiencing an elevated thermal level.
///
/// Indicates that the system's peak power requirements exceed the battery's current capacity and may result in a system power off.
///
/// Indicates that the module capturing depth information is operating at an elevated temperature. As system pressure increases, depth quality may become degraded.
///
/// Indicates that the camera module is operating at an elevated temperature.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avcapturesystempressurefactors?language=objc)
// NS_OPTIONS
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct AVCaptureSystemPressureFactors(pub NSUInteger);
bitflags::bitflags! {
impl AVCaptureSystemPressureFactors: NSUInteger {
#[doc(alias = "AVCaptureSystemPressureFactorNone")]
const None = 0;
#[doc(alias = "AVCaptureSystemPressureFactorSystemTemperature")]
const SystemTemperature = 1<<0;
#[doc(alias = "AVCaptureSystemPressureFactorPeakPower")]
const PeakPower = 1<<1;
#[doc(alias = "AVCaptureSystemPressureFactorDepthModuleTemperature")]
const DepthModuleTemperature = 1<<2;
#[doc(alias = "AVCaptureSystemPressureFactorCameraTemperature")]
const CameraTemperature = 1<<3;
}
}
unsafe impl Encode for AVCaptureSystemPressureFactors {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for AVCaptureSystemPressureFactors {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
/// A model object describing a system pressure level and contributing factors to the pressured state.
///
///
/// Beginning in iOS 11.1, AVCaptureDevice can report its current system pressure state. System pressure refers to a state in which capture quality is degraded or capture hardware availability is limited due to factors such as overall system temperature, insufficient battery charge for current peak power requirements, or camera module temperature.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avcapturesystempressurestate?language=objc)
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct AVCaptureSystemPressureState;
);
extern_conformance!(
unsafe impl NSObjectProtocol for AVCaptureSystemPressureState {}
);
impl AVCaptureSystemPressureState {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
/// An enumerated string value characterizing the pressure level to which the system is currently elevated.
#[unsafe(method(level))]
#[unsafe(method_family = none)]
pub unsafe fn level(&self) -> Retained<AVCaptureSystemPressureLevel>;
/// A bitmask of values indicating the factors contributing to the current system pressure level.
#[unsafe(method(factors))]
#[unsafe(method_family = none)]
pub unsafe fn factors(&self) -> AVCaptureSystemPressureFactors;
);
}