1use core_foundation::{
2 base::TCFType,
3 string::{CFString, CFStringRef},
4};
5use libc::c_int;
6
7pub const kVTUnlimitedFrameDelayCount: c_int = -1;
8
9extern "C" {
10 pub static kVTCompressionPropertyKey_NumberOfPendingFrames: CFStringRef;
11 pub static kVTCompressionPropertyKey_PixelBufferPoolIsShared: CFStringRef;
12 pub static kVTCompressionPropertyKey_VideoEncoderPixelBufferAttributes: CFStringRef;
13 pub static kVTCompressionPropertyKey_MaxKeyFrameInterval: CFStringRef;
14 pub static kVTCompressionPropertyKey_MaxKeyFrameIntervalDuration: CFStringRef;
15 pub static kVTCompressionPropertyKey_AllowTemporalCompression: CFStringRef;
16 pub static kVTCompressionPropertyKey_AllowFrameReordering: CFStringRef;
17 pub static kVTCompressionPropertyKey_AverageBitRate: CFStringRef;
18 pub static kVTCompressionPropertyKey_DataRateLimits: CFStringRef;
19 pub static kVTCompressionPropertyKey_Quality: CFStringRef;
20 pub static kVTCompressionPropertyKey_MoreFramesBeforeStart: CFStringRef;
21 pub static kVTCompressionPropertyKey_MoreFramesAfterEnd: CFStringRef;
22 pub static kVTCompressionPropertyKey_ProfileLevel: CFStringRef;
23 pub static kVTProfileLevel_HEVC_Main_AutoLevel: CFStringRef;
24 pub static kVTProfileLevel_HEVC_Main10_AutoLevel: CFStringRef;
25 pub static kVTProfileLevel_HEVC_Main42210_AutoLevel: CFStringRef;
26 pub static kVTProfileLevel_H264_Baseline_1_3: CFStringRef;
27 pub static kVTProfileLevel_H264_Baseline_3_0: CFStringRef;
28 pub static kVTProfileLevel_H264_Baseline_3_1: CFStringRef;
29 pub static kVTProfileLevel_H264_Baseline_3_2: CFStringRef;
30 pub static kVTProfileLevel_H264_Baseline_4_0: CFStringRef;
31 pub static kVTProfileLevel_H264_Baseline_4_1: CFStringRef;
32 pub static kVTProfileLevel_H264_Baseline_4_2: CFStringRef;
33 pub static kVTProfileLevel_H264_Baseline_5_0: CFStringRef;
34 pub static kVTProfileLevel_H264_Baseline_5_1: CFStringRef;
35 pub static kVTProfileLevel_H264_Baseline_5_2: CFStringRef;
36 pub static kVTProfileLevel_H264_Baseline_AutoLevel: CFStringRef;
37 pub static kVTProfileLevel_H264_Main_3_0: CFStringRef;
38 pub static kVTProfileLevel_H264_Main_3_1: CFStringRef;
39 pub static kVTProfileLevel_H264_Main_3_2: CFStringRef;
40 pub static kVTProfileLevel_H264_Main_4_0: CFStringRef;
41 pub static kVTProfileLevel_H264_Main_4_1: CFStringRef;
42 pub static kVTProfileLevel_H264_Main_4_2: CFStringRef;
43 pub static kVTProfileLevel_H264_Main_5_0: CFStringRef;
44 pub static kVTProfileLevel_H264_Main_5_1: CFStringRef;
45 pub static kVTProfileLevel_H264_Main_5_2: CFStringRef;
46 pub static kVTProfileLevel_H264_Main_AutoLevel: CFStringRef;
47 pub static kVTProfileLevel_H264_Extended_5_0: CFStringRef;
48 pub static kVTProfileLevel_H264_Extended_AutoLevel: CFStringRef;
49 pub static kVTProfileLevel_H264_High_3_0: CFStringRef;
50 pub static kVTProfileLevel_H264_High_3_1: CFStringRef;
51 pub static kVTProfileLevel_H264_High_3_2: CFStringRef;
52 pub static kVTProfileLevel_H264_High_4_0: CFStringRef;
53 pub static kVTProfileLevel_H264_High_4_1: CFStringRef;
54 pub static kVTProfileLevel_H264_High_4_2: CFStringRef;
55 pub static kVTProfileLevel_H264_High_5_0: CFStringRef;
56 pub static kVTProfileLevel_H264_High_5_1: CFStringRef;
57 pub static kVTProfileLevel_H264_High_5_2: CFStringRef;
58 pub static kVTProfileLevel_H264_High_AutoLevel: CFStringRef;
59 pub static kVTProfileLevel_H264_ConstrainedHigh_AutoLevel: CFStringRef;
60 pub static kVTProfileLevel_MP4V_Simple_L0: CFStringRef;
61 pub static kVTProfileLevel_MP4V_Simple_L1: CFStringRef;
62 pub static kVTProfileLevel_MP4V_Simple_L2: CFStringRef;
63 pub static kVTProfileLevel_MP4V_Simple_L3: CFStringRef;
64 pub static kVTProfileLevel_MP4V_Main_L2: CFStringRef;
65 pub static kVTProfileLevel_MP4V_Main_L3: CFStringRef;
66 pub static kVTProfileLevel_MP4V_Main_L4: CFStringRef;
67 pub static kVTProfileLevel_MP4V_AdvancedSimple_L0: CFStringRef;
68 pub static kVTProfileLevel_MP4V_AdvancedSimple_L1: CFStringRef;
69 pub static kVTProfileLevel_MP4V_AdvancedSimple_L2: CFStringRef;
70 pub static kVTProfileLevel_MP4V_AdvancedSimple_L3: CFStringRef;
71 pub static kVTProfileLevel_MP4V_AdvancedSimple_L4: CFStringRef;
72 pub static kVTProfileLevel_H263_Profile0_Level10: CFStringRef;
73 pub static kVTProfileLevel_H263_Profile0_Level45: CFStringRef;
74 pub static kVTProfileLevel_H263_Profile3_Level45: CFStringRef;
75 pub static kVTCompressionPropertyKey_OutputBitDepth: CFStringRef;
76 pub static kVTCompressionPropertyKey_HDRMetadataInsertionMode: CFStringRef;
77 pub static kVTHDRMetadataInsertionMode_None: CFStringRef;
78 pub static kVTHDRMetadataInsertionMode_Auto: CFStringRef;
79 pub static kVTHDRMetadataInsertionMode_RequestSDRRangePreservation: CFStringRef;
80 pub static kVTCompressionPropertyKey_H264EntropyMode: CFStringRef;
81 pub static kVTH264EntropyMode_CAVLC: CFStringRef;
82 pub static kVTH264EntropyMode_CABAC: CFStringRef;
83 pub static kVTCompressionPropertyKey_Depth: CFStringRef;
84 pub static kVTCompressionPropertyKey_PreserveAlphaChannel: CFStringRef;
85 pub static kVTCompressionPropertyKey_MaxFrameDelayCount: CFStringRef;
86 pub static kVTCompressionPropertyKey_MaxH264SliceBytes: CFStringRef;
87 pub static kVTCompressionPropertyKey_RealTime: CFStringRef;
88 pub static kVTCompressionPropertyKey_MaximizePowerEfficiency: CFStringRef;
89 pub static kVTCompressionPropertyKey_SourceFrameCount: CFStringRef;
90 pub static kVTCompressionPropertyKey_ExpectedFrameRate: CFStringRef;
91 pub static kVTCompressionPropertyKey_MaximumRealTimeFrameRate: CFStringRef;
92 pub static kVTCompressionPropertyKey_BaseLayerFrameRateFraction: CFStringRef;
93 pub static kVTCompressionPropertyKey_BaseLayerBitRateFraction: CFStringRef;
94 pub static kVTCompressionPropertyKey_ExpectedDuration: CFStringRef;
95 pub static kVTCompressionPropertyKey_BaseLayerFrameRate: CFStringRef;
96 pub static kVTCompressionPropertyKey_ReferenceBufferCount: CFStringRef;
97 pub static kVTCompressionPropertyKey_CalculateMeanSquaredError: CFStringRef;
98 pub static kVTSampleAttachmentKey_QualityMetrics: CFStringRef;
99 pub static kVTSampleAttachmentQualityMetricsKey_LumaMeanSquaredError: CFStringRef;
100 pub static kVTSampleAttachmentQualityMetricsKey_ChromaBlueMeanSquaredError: CFStringRef;
101 pub static kVTSampleAttachmentQualityMetricsKey_ChromaRedMeanSquaredError: CFStringRef;
102 pub static kVTVideoEncoderSpecification_EnableHardwareAcceleratedVideoEncoder: CFStringRef;
103 pub static kVTVideoEncoderSpecification_RequireHardwareAcceleratedVideoEncoder: CFStringRef;
104 pub static kVTCompressionPropertyKey_UsingHardwareAcceleratedVideoEncoder: CFStringRef;
105 pub static kVTVideoEncoderSpecification_RequiredEncoderGPURegistryID: CFStringRef;
106 pub static kVTVideoEncoderSpecification_PreferredEncoderGPURegistryID: CFStringRef;
107 pub static kVTCompressionPropertyKey_UsingGPURegistryID: CFStringRef;
108 pub static kVTCompressionPropertyKey_SupportsBaseFrameQP: CFStringRef;
109 pub static kVTEncodeFrameOptionKey_ForceKeyFrame: CFStringRef;
110 pub static kVTEncodeFrameOptionKey_BaseFrameQP: CFStringRef;
111 pub static kVTCompressionPropertyKey_CleanAperture: CFStringRef;
112 pub static kVTCompressionPropertyKey_PixelAspectRatio: CFStringRef;
113 pub static kVTCompressionPropertyKey_FieldCount: CFStringRef;
114 pub static kVTCompressionPropertyKey_FieldDetail: CFStringRef;
115 pub static kVTCompressionPropertyKey_AspectRatio16x9: CFStringRef;
116 pub static kVTCompressionPropertyKey_ProgressiveScan: CFStringRef;
117 pub static kVTCompressionPropertyKey_ColorPrimaries: CFStringRef;
118 pub static kVTCompressionPropertyKey_TransferFunction: CFStringRef;
119 pub static kVTCompressionPropertyKey_YCbCrMatrix: CFStringRef;
120 pub static kVTCompressionPropertyKey_ICCProfile: CFStringRef;
121 pub static kVTCompressionPropertyKey_MasteringDisplayColorVolume: CFStringRef;
122 pub static kVTCompressionPropertyKey_ContentLightLevelInfo: CFStringRef;
123 pub static kVTCompressionPropertyKey_GammaLevel: CFStringRef;
124 pub static kVTCompressionPropertyKey_PixelTransferProperties: CFStringRef;
125 pub static kVTCompressionPropertyKey_MultiPassStorage: CFStringRef;
126 pub static kVTCompressionPropertyKey_EncoderID: CFStringRef;
127 pub static kVTCompressionPropertyKey_PreserveDynamicHDRMetadata: CFStringRef;
128 pub static kVTVideoEncoderSpecification_EnableLowLatencyRateControl: CFStringRef;
129 pub static kVTCompressionPropertyKey_MaxAllowedFrameQP: CFStringRef;
130 pub static kVTCompressionPropertyKey_MinAllowedFrameQP: CFStringRef;
131}
132
133#[derive(Clone, Copy, Debug, Eq, PartialEq)]
134pub enum CompressionPropertyKey {
135 NumberOfPendingFrames,
136 PixelBufferPoolIsShared,
137 VideoEncoderPixelBufferAttributes,
138 MaxKeyFrameInterval,
139 MaxKeyFrameIntervalDuration,
140 AllowTemporalCompression,
141 AllowFrameReordering,
142 AverageBitRate,
143 DataRateLimits,
144 Quality,
145 MoreFramesBeforeStart,
146 MoreFramesAfterEnd,
147 ProfileLevel,
148 OutputBitDepth,
149 HDRMetadataInsertionMode,
150 H264EntropyMode,
151 Depth,
152 PreserveAlphaChannel,
153 MaxFrameDelayCount,
154 MaxH264SliceBytes,
155 RealTime,
156 MaximizePowerEfficiency,
157 SourceFrameCount,
158 ExpectedFrameRate,
159 MaximumRealTimeFrameRate,
160 BaseLayerFrameRateFraction,
161 BaseLayerBitRateFraction,
162 ExpectedDuration,
163 BaseLayerFrameRate,
164 ReferenceBufferCount,
165 CalculateMeanSquaredError,
166 UsingHardwareAcceleratedVideoEncoder,
167 UsingGPURegistryID,
168 SupportsBaseFrameQP,
169 CleanAperture,
170 PixelAspectRatio,
171 FieldCount,
172 FieldDetail,
173 AspectRatio16x9,
174 ProgressiveScan,
175 ColorPrimaries,
176 TransferFunction,
177 YCbCrMatrix,
178 ICCProfile,
179 MasteringDisplayColorVolume,
180 ContentLightLevelInfo,
181 GammaLevel,
182 PixelTransferProperties,
183 MultiPassStorage,
184 EncoderID,
185 PreserveDynamicHDRMetadata,
186 MaxAllowedFrameQP,
187 MinAllowedFrameQP,
188}
189
190impl From<CompressionPropertyKey> for CFStringRef {
191 fn from(key: CompressionPropertyKey) -> Self {
192 unsafe {
193 match key {
194 CompressionPropertyKey::NumberOfPendingFrames => kVTCompressionPropertyKey_NumberOfPendingFrames,
195 CompressionPropertyKey::PixelBufferPoolIsShared => kVTCompressionPropertyKey_PixelBufferPoolIsShared,
196 CompressionPropertyKey::VideoEncoderPixelBufferAttributes => kVTCompressionPropertyKey_VideoEncoderPixelBufferAttributes,
197 CompressionPropertyKey::MaxKeyFrameInterval => kVTCompressionPropertyKey_MaxKeyFrameInterval,
198 CompressionPropertyKey::MaxKeyFrameIntervalDuration => kVTCompressionPropertyKey_MaxKeyFrameIntervalDuration,
199 CompressionPropertyKey::AllowTemporalCompression => kVTCompressionPropertyKey_AllowTemporalCompression,
200 CompressionPropertyKey::AllowFrameReordering => kVTCompressionPropertyKey_AllowFrameReordering,
201 CompressionPropertyKey::AverageBitRate => kVTCompressionPropertyKey_AverageBitRate,
202 CompressionPropertyKey::DataRateLimits => kVTCompressionPropertyKey_DataRateLimits,
203 CompressionPropertyKey::Quality => kVTCompressionPropertyKey_Quality,
204 CompressionPropertyKey::MoreFramesBeforeStart => kVTCompressionPropertyKey_MoreFramesBeforeStart,
205 CompressionPropertyKey::MoreFramesAfterEnd => kVTCompressionPropertyKey_MoreFramesAfterEnd,
206 CompressionPropertyKey::ProfileLevel => kVTCompressionPropertyKey_ProfileLevel,
207 CompressionPropertyKey::OutputBitDepth => kVTCompressionPropertyKey_OutputBitDepth,
208 CompressionPropertyKey::HDRMetadataInsertionMode => kVTCompressionPropertyKey_HDRMetadataInsertionMode,
209 CompressionPropertyKey::H264EntropyMode => kVTCompressionPropertyKey_H264EntropyMode,
210 CompressionPropertyKey::Depth => kVTCompressionPropertyKey_Depth,
211 CompressionPropertyKey::PreserveAlphaChannel => kVTCompressionPropertyKey_PreserveAlphaChannel,
212 CompressionPropertyKey::MaxFrameDelayCount => kVTCompressionPropertyKey_MaxFrameDelayCount,
213 CompressionPropertyKey::MaxH264SliceBytes => kVTCompressionPropertyKey_MaxH264SliceBytes,
214 CompressionPropertyKey::RealTime => kVTCompressionPropertyKey_RealTime,
215 CompressionPropertyKey::MaximizePowerEfficiency => kVTCompressionPropertyKey_MaximizePowerEfficiency,
216 CompressionPropertyKey::SourceFrameCount => kVTCompressionPropertyKey_SourceFrameCount,
217 CompressionPropertyKey::ExpectedFrameRate => kVTCompressionPropertyKey_ExpectedFrameRate,
218 CompressionPropertyKey::MaximumRealTimeFrameRate => kVTCompressionPropertyKey_MaximumRealTimeFrameRate,
219 CompressionPropertyKey::BaseLayerFrameRateFraction => kVTCompressionPropertyKey_BaseLayerFrameRateFraction,
220 CompressionPropertyKey::BaseLayerBitRateFraction => kVTCompressionPropertyKey_BaseLayerBitRateFraction,
221 CompressionPropertyKey::ExpectedDuration => kVTCompressionPropertyKey_ExpectedDuration,
222 CompressionPropertyKey::BaseLayerFrameRate => kVTCompressionPropertyKey_BaseLayerFrameRate,
223 CompressionPropertyKey::ReferenceBufferCount => kVTCompressionPropertyKey_ReferenceBufferCount,
224 CompressionPropertyKey::CalculateMeanSquaredError => kVTCompressionPropertyKey_CalculateMeanSquaredError,
225 CompressionPropertyKey::UsingHardwareAcceleratedVideoEncoder => kVTCompressionPropertyKey_UsingHardwareAcceleratedVideoEncoder,
226 CompressionPropertyKey::UsingGPURegistryID => kVTCompressionPropertyKey_UsingGPURegistryID,
227 CompressionPropertyKey::SupportsBaseFrameQP => kVTCompressionPropertyKey_SupportsBaseFrameQP,
228 CompressionPropertyKey::CleanAperture => kVTCompressionPropertyKey_CleanAperture,
229 CompressionPropertyKey::PixelAspectRatio => kVTCompressionPropertyKey_PixelAspectRatio,
230 CompressionPropertyKey::FieldCount => kVTCompressionPropertyKey_FieldCount,
231 CompressionPropertyKey::FieldDetail => kVTCompressionPropertyKey_FieldDetail,
232 CompressionPropertyKey::AspectRatio16x9 => kVTCompressionPropertyKey_AspectRatio16x9,
233 CompressionPropertyKey::ProgressiveScan => kVTCompressionPropertyKey_ProgressiveScan,
234 CompressionPropertyKey::ColorPrimaries => kVTCompressionPropertyKey_ColorPrimaries,
235 CompressionPropertyKey::TransferFunction => kVTCompressionPropertyKey_TransferFunction,
236 CompressionPropertyKey::YCbCrMatrix => kVTCompressionPropertyKey_YCbCrMatrix,
237 CompressionPropertyKey::ICCProfile => kVTCompressionPropertyKey_ICCProfile,
238 CompressionPropertyKey::MasteringDisplayColorVolume => kVTCompressionPropertyKey_MasteringDisplayColorVolume,
239 CompressionPropertyKey::ContentLightLevelInfo => kVTCompressionPropertyKey_ContentLightLevelInfo,
240 CompressionPropertyKey::GammaLevel => kVTCompressionPropertyKey_GammaLevel,
241 CompressionPropertyKey::PixelTransferProperties => kVTCompressionPropertyKey_PixelTransferProperties,
242 CompressionPropertyKey::MultiPassStorage => kVTCompressionPropertyKey_MultiPassStorage,
243 CompressionPropertyKey::EncoderID => kVTCompressionPropertyKey_EncoderID,
244 CompressionPropertyKey::PreserveDynamicHDRMetadata => kVTCompressionPropertyKey_PreserveDynamicHDRMetadata,
245 CompressionPropertyKey::MaxAllowedFrameQP => kVTCompressionPropertyKey_MaxAllowedFrameQP,
246 CompressionPropertyKey::MinAllowedFrameQP => kVTCompressionPropertyKey_MinAllowedFrameQP,
247 }
248 }
249 }
250}
251
252impl From<CompressionPropertyKey> for CFString {
253 fn from(key: CompressionPropertyKey) -> Self {
254 unsafe { CFString::wrap_under_get_rule(CFStringRef::from(key)) }
255 }
256}
257
258#[derive(Clone, Copy, Debug, Eq, PartialEq)]
259pub enum ProfileLevel {
260 HEVCMainAutoLevel,
261 HEVCMain10AutoLevel,
262 HEVCMain42210AutoLevel,
263 H264Baseline13,
264 H264Baseline30,
265 H264Baseline31,
266 H264Baseline32,
267 H264Baseline40,
268 H264Baseline41,
269 H264Baseline42,
270 H264Baseline50,
271 H264Baseline51,
272 H264Baseline52,
273 H264BaselineAutoLevel,
274 H264Main30,
275 H264Main31,
276 H264Main32,
277 H264Main40,
278 H264Main41,
279 H264Main42,
280 H264Main50,
281 H264Main51,
282 H264Main52,
283 H264MainAutoLevel,
284 H264Extended50,
285 H264ExtendedAutoLevel,
286 H264High30,
287 H264High31,
288 H264High32,
289 H264High40,
290 H264High41,
291 H264High42,
292 H264High50,
293 H264High51,
294 H264High52,
295 H264HighAutoLevel,
296 H264ConstrainedHighAutoLevel,
297 MP4VSimpleL0,
298 MP4VSimpleL1,
299 MP4VSimpleL2,
300 MP4VSimpleL3,
301 MP4VMainL2,
302 MP4VMainL3,
303 MP4VMainL4,
304 MP4VAdvancedSimpleL0,
305 MP4VAdvancedSimpleL1,
306 MP4VAdvancedSimpleL2,
307 MP4VAdvancedSimpleL3,
308 MP4VAdvancedSimpleL4,
309 H263Profile0Level10,
310 H263Profile0Level45,
311 H263Profile3Level45,
312}
313
314impl From<ProfileLevel> for CFStringRef {
315 fn from(level: ProfileLevel) -> Self {
316 unsafe {
317 match level {
318 ProfileLevel::HEVCMainAutoLevel => kVTProfileLevel_HEVC_Main_AutoLevel,
319 ProfileLevel::HEVCMain10AutoLevel => kVTProfileLevel_HEVC_Main10_AutoLevel,
320 ProfileLevel::HEVCMain42210AutoLevel => kVTProfileLevel_HEVC_Main42210_AutoLevel,
321 ProfileLevel::H264Baseline13 => kVTProfileLevel_H264_Baseline_1_3,
322 ProfileLevel::H264Baseline30 => kVTProfileLevel_H264_Baseline_3_0,
323 ProfileLevel::H264Baseline31 => kVTProfileLevel_H264_Baseline_3_1,
324 ProfileLevel::H264Baseline32 => kVTProfileLevel_H264_Baseline_3_2,
325 ProfileLevel::H264Baseline40 => kVTProfileLevel_H264_Baseline_4_0,
326 ProfileLevel::H264Baseline41 => kVTProfileLevel_H264_Baseline_4_1,
327 ProfileLevel::H264Baseline42 => kVTProfileLevel_H264_Baseline_4_2,
328 ProfileLevel::H264Baseline50 => kVTProfileLevel_H264_Baseline_5_0,
329 ProfileLevel::H264Baseline51 => kVTProfileLevel_H264_Baseline_5_1,
330 ProfileLevel::H264Baseline52 => kVTProfileLevel_H264_Baseline_5_2,
331 ProfileLevel::H264BaselineAutoLevel => kVTProfileLevel_H264_Baseline_AutoLevel,
332 ProfileLevel::H264Main30 => kVTProfileLevel_H264_Main_3_0,
333 ProfileLevel::H264Main31 => kVTProfileLevel_H264_Main_3_1,
334 ProfileLevel::H264Main32 => kVTProfileLevel_H264_Main_3_2,
335 ProfileLevel::H264Main40 => kVTProfileLevel_H264_Main_4_0,
336 ProfileLevel::H264Main41 => kVTProfileLevel_H264_Main_4_1,
337 ProfileLevel::H264Main42 => kVTProfileLevel_H264_Main_4_2,
338 ProfileLevel::H264Main50 => kVTProfileLevel_H264_Main_5_0,
339 ProfileLevel::H264Main51 => kVTProfileLevel_H264_Main_5_1,
340 ProfileLevel::H264Main52 => kVTProfileLevel_H264_Main_5_2,
341 ProfileLevel::H264MainAutoLevel => kVTProfileLevel_H264_Main_AutoLevel,
342 ProfileLevel::H264Extended50 => kVTProfileLevel_H264_Extended_5_0,
343 ProfileLevel::H264ExtendedAutoLevel => kVTProfileLevel_H264_Extended_AutoLevel,
344 ProfileLevel::H264High30 => kVTProfileLevel_H264_High_3_0,
345 ProfileLevel::H264High31 => kVTProfileLevel_H264_High_3_1,
346 ProfileLevel::H264High32 => kVTProfileLevel_H264_High_3_2,
347 ProfileLevel::H264High40 => kVTProfileLevel_H264_High_4_0,
348 ProfileLevel::H264High41 => kVTProfileLevel_H264_High_4_1,
349 ProfileLevel::H264High42 => kVTProfileLevel_H264_High_4_2,
350 ProfileLevel::H264High50 => kVTProfileLevel_H264_High_5_0,
351 ProfileLevel::H264High51 => kVTProfileLevel_H264_High_5_1,
352 ProfileLevel::H264High52 => kVTProfileLevel_H264_High_5_2,
353 ProfileLevel::H264HighAutoLevel => kVTProfileLevel_H264_High_AutoLevel,
354 ProfileLevel::H264ConstrainedHighAutoLevel => kVTProfileLevel_H264_ConstrainedHigh_AutoLevel,
355 ProfileLevel::MP4VSimpleL0 => kVTProfileLevel_MP4V_Simple_L0,
356 ProfileLevel::MP4VSimpleL1 => kVTProfileLevel_MP4V_Simple_L1,
357 ProfileLevel::MP4VSimpleL2 => kVTProfileLevel_MP4V_Simple_L2,
358 ProfileLevel::MP4VSimpleL3 => kVTProfileLevel_MP4V_Simple_L3,
359 ProfileLevel::MP4VMainL2 => kVTProfileLevel_MP4V_Main_L2,
360 ProfileLevel::MP4VMainL3 => kVTProfileLevel_MP4V_Main_L3,
361 ProfileLevel::MP4VMainL4 => kVTProfileLevel_MP4V_Main_L4,
362 ProfileLevel::MP4VAdvancedSimpleL0 => kVTProfileLevel_MP4V_AdvancedSimple_L0,
363 ProfileLevel::MP4VAdvancedSimpleL1 => kVTProfileLevel_MP4V_AdvancedSimple_L1,
364 ProfileLevel::MP4VAdvancedSimpleL2 => kVTProfileLevel_MP4V_AdvancedSimple_L2,
365 ProfileLevel::MP4VAdvancedSimpleL3 => kVTProfileLevel_MP4V_AdvancedSimple_L3,
366 ProfileLevel::MP4VAdvancedSimpleL4 => kVTProfileLevel_MP4V_AdvancedSimple_L4,
367 ProfileLevel::H263Profile0Level10 => kVTProfileLevel_H263_Profile0_Level10,
368 ProfileLevel::H263Profile0Level45 => kVTProfileLevel_H263_Profile0_Level45,
369 ProfileLevel::H263Profile3Level45 => kVTProfileLevel_H263_Profile3_Level45,
370 }
371 }
372 }
373}
374
375impl From<ProfileLevel> for CFString {
376 fn from(level: ProfileLevel) -> Self {
377 unsafe { CFString::wrap_under_get_rule(CFStringRef::from(level)) }
378 }
379}
380
381#[derive(Clone, Copy, Debug, Eq, PartialEq)]
382pub enum HDRMetadataInsertionMode {
383 None,
384 Auto,
385 RequestSDRRangePreservation,
386}
387
388impl From<HDRMetadataInsertionMode> for CFStringRef {
389 fn from(mode: HDRMetadataInsertionMode) -> Self {
390 unsafe {
391 match mode {
392 HDRMetadataInsertionMode::None => kVTHDRMetadataInsertionMode_None,
393 HDRMetadataInsertionMode::Auto => kVTHDRMetadataInsertionMode_Auto,
394 HDRMetadataInsertionMode::RequestSDRRangePreservation => kVTHDRMetadataInsertionMode_RequestSDRRangePreservation,
395 }
396 }
397 }
398}
399
400impl From<HDRMetadataInsertionMode> for CFString {
401 fn from(mode: HDRMetadataInsertionMode) -> Self {
402 unsafe { CFString::wrap_under_get_rule(CFStringRef::from(mode)) }
403 }
404}
405
406#[derive(Clone, Copy, Debug, Eq, PartialEq)]
407pub enum H264EntropyMode {
408 CAVLC,
409 CABAC,
410}
411
412impl From<H264EntropyMode> for CFStringRef {
413 fn from(mode: H264EntropyMode) -> Self {
414 unsafe {
415 match mode {
416 H264EntropyMode::CAVLC => kVTH264EntropyMode_CAVLC,
417 H264EntropyMode::CABAC => kVTH264EntropyMode_CABAC,
418 }
419 }
420 }
421}
422
423impl From<H264EntropyMode> for CFString {
424 fn from(mode: H264EntropyMode) -> Self {
425 unsafe { CFString::wrap_under_get_rule(CFStringRef::from(mode)) }
426 }
427}
428
429#[derive(Clone, Copy, Debug, Eq, PartialEq)]
430pub enum VideoEncoderSpecification {
431 EnableHardwareAcceleratedVideoEncoder,
432 RequireHardwareAcceleratedVideoEncoder,
433 RequiredEncoderGPURegistryID,
434 PreferredEncoderGPURegistryID,
435 EnableLowLatencyRateControl,
436}
437
438impl From<VideoEncoderSpecification> for CFStringRef {
439 fn from(spec: VideoEncoderSpecification) -> Self {
440 unsafe {
441 match spec {
442 VideoEncoderSpecification::EnableHardwareAcceleratedVideoEncoder => {
443 kVTVideoEncoderSpecification_EnableHardwareAcceleratedVideoEncoder
444 }
445 VideoEncoderSpecification::RequireHardwareAcceleratedVideoEncoder => {
446 kVTVideoEncoderSpecification_RequireHardwareAcceleratedVideoEncoder
447 }
448 VideoEncoderSpecification::RequiredEncoderGPURegistryID => kVTVideoEncoderSpecification_RequiredEncoderGPURegistryID,
449 VideoEncoderSpecification::PreferredEncoderGPURegistryID => kVTVideoEncoderSpecification_PreferredEncoderGPURegistryID,
450 VideoEncoderSpecification::EnableLowLatencyRateControl => kVTVideoEncoderSpecification_EnableLowLatencyRateControl,
451 }
452 }
453 }
454}
455
456impl From<VideoEncoderSpecification> for CFString {
457 fn from(spec: VideoEncoderSpecification) -> Self {
458 unsafe { CFString::wrap_under_get_rule(CFStringRef::from(spec)) }
459 }
460}
461
462#[derive(Clone, Copy, Debug, Eq, PartialEq)]
463pub enum SampleAttachmentKey {
464 QualityMetrics,
465}
466
467#[derive(Clone, Copy, Debug, Eq, PartialEq)]
468pub enum SampleAttachmentQualityMetricsKey {
469 LumaMeanSquaredError,
470 ChromaBlueMeanSquaredError,
471 ChromaRedMeanSquaredError,
472}
473
474impl From<SampleAttachmentKey> for CFStringRef {
475 fn from(key: SampleAttachmentKey) -> Self {
476 unsafe {
477 match key {
478 SampleAttachmentKey::QualityMetrics => kVTSampleAttachmentKey_QualityMetrics,
479 }
480 }
481 }
482}
483
484impl From<SampleAttachmentKey> for CFString {
485 fn from(key: SampleAttachmentKey) -> Self {
486 unsafe { CFString::wrap_under_get_rule(CFStringRef::from(key)) }
487 }
488}
489
490impl From<SampleAttachmentQualityMetricsKey> for CFStringRef {
491 fn from(key: SampleAttachmentQualityMetricsKey) -> Self {
492 unsafe {
493 match key {
494 SampleAttachmentQualityMetricsKey::LumaMeanSquaredError => kVTSampleAttachmentQualityMetricsKey_LumaMeanSquaredError,
495 SampleAttachmentQualityMetricsKey::ChromaBlueMeanSquaredError => kVTSampleAttachmentQualityMetricsKey_ChromaBlueMeanSquaredError,
496 SampleAttachmentQualityMetricsKey::ChromaRedMeanSquaredError => kVTSampleAttachmentQualityMetricsKey_ChromaRedMeanSquaredError,
497 }
498 }
499 }
500}
501
502impl From<SampleAttachmentQualityMetricsKey> for CFString {
503 fn from(key: SampleAttachmentQualityMetricsKey) -> Self {
504 unsafe { CFString::wrap_under_get_rule(CFStringRef::from(key)) }
505 }
506}
507
508#[derive(Clone, Copy, Debug, Eq, PartialEq)]
509pub enum EncodeFrameOptionKey {
510 ForceKeyFrame,
511 BaseFrameQP,
512}
513
514impl From<EncodeFrameOptionKey> for CFStringRef {
515 fn from(key: EncodeFrameOptionKey) -> Self {
516 unsafe {
517 match key {
518 EncodeFrameOptionKey::ForceKeyFrame => kVTEncodeFrameOptionKey_ForceKeyFrame,
519 EncodeFrameOptionKey::BaseFrameQP => kVTEncodeFrameOptionKey_BaseFrameQP,
520 }
521 }
522 }
523}
524
525impl From<EncodeFrameOptionKey> for CFString {
526 fn from(key: EncodeFrameOptionKey) -> Self {
527 unsafe { CFString::wrap_under_get_rule(CFStringRef::from(key)) }
528 }
529}