objc2_core_media_io/generated/CMIOExtensionProperties.rs
1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5#[cfg(feature = "objc2-core-media")]
6use objc2_core_media::*;
7use objc2_foundation::*;
8
9use crate::*;
10
11/// CMIOExtensionProperty string constants
12///
13/// The CMIOExtensionProperty string constants indicates a property key.
14///
15/// See also [Apple's documentation](https://developer.apple.com/documentation/coremediaio/cmioextensionproperty?language=objc)
16// NS_TYPED_ENUM
17pub type CMIOExtensionProperty = NSString;
18
19extern "C" {
20 /// The key for the provider property name.
21 ///
22 /// The property state for CMIOExtensionPropertyProviderName is a string with a readonly attribute.
23 ///
24 /// See also [Apple's documentation](https://developer.apple.com/documentation/coremediaio/cmioextensionpropertyprovidername?language=objc)
25 pub static CMIOExtensionPropertyProviderName: &'static CMIOExtensionProperty;
26}
27
28extern "C" {
29 /// The key for the provider property manufacturer.
30 ///
31 /// The property state for CMIOExtensionPropertyProviderManufacturer is a string with a readonly attribute.
32 ///
33 /// See also [Apple's documentation](https://developer.apple.com/documentation/coremediaio/cmioextensionpropertyprovidermanufacturer?language=objc)
34 pub static CMIOExtensionPropertyProviderManufacturer: &'static CMIOExtensionProperty;
35}
36
37extern "C" {
38 /// The key for the device property model.
39 ///
40 /// The property state for CMIOExtensionPropertyDeviceModel is a string with a readonly attribute.
41 ///
42 /// See also [Apple's documentation](https://developer.apple.com/documentation/coremediaio/cmioextensionpropertydevicemodel?language=objc)
43 pub static CMIOExtensionPropertyDeviceModel: &'static CMIOExtensionProperty;
44}
45
46extern "C" {
47 /// The key for the device property IsSuspended, this key indicates if the device is currently suspended.
48 ///
49 /// For example, the user might close the clamshell of the device. While suspended the device still responds
50 /// to all requests just as if it were active, but the stream(s) will not provide any data.
51 /// The property state for CMIOExtensionPropertyDeviceIsSuspended is a number as boolean with a readonly attribute.
52 ///
53 /// See also [Apple's documentation](https://developer.apple.com/documentation/coremediaio/cmioextensionpropertydeviceissuspended?language=objc)
54 pub static CMIOExtensionPropertyDeviceIsSuspended: &'static CMIOExtensionProperty;
55}
56
57extern "C" {
58 /// The key for the device property transport type.
59 ///
60 /// The property state for CMIOExtensionPropertyDeviceTransportType is a number whose value correspond to the audio transport type ( kIOAudioDeviceTransportType... ) defined in
61 /// <IOKit
62 /// /audio/IOAudioTypes.h> and with a readonly attribute.
63 ///
64 /// See also [Apple's documentation](https://developer.apple.com/documentation/coremediaio/cmioextensionpropertydevicetransporttype?language=objc)
65 pub static CMIOExtensionPropertyDeviceTransportType: &'static CMIOExtensionProperty;
66}
67
68extern "C" {
69 /// The key for the device property linked CoreAudio device UID.
70 ///
71 /// The property state for CMIOExtensionPropertyDeviceLinkedCoreAudioDeviceUID is a string with a readonly attribute.
72 ///
73 /// See also [Apple's documentation](https://developer.apple.com/documentation/coremediaio/cmioextensionpropertydevicelinkedcoreaudiodeviceuid?language=objc)
74 pub static CMIOExtensionPropertyDeviceLinkedCoreAudioDeviceUID: &'static CMIOExtensionProperty;
75}
76
77extern "C" {
78 /// The key for the device property that specifies if a device can be the default input device.
79 ///
80 /// The property state for CMIOExtensionPropertyDeviceCanBeDefaultInputDevice is a number representing a boolean value.
81 ///
82 /// See also [Apple's documentation](https://developer.apple.com/documentation/coremediaio/cmioextensionpropertydevicecanbedefaultinputdevice?language=objc)
83 pub static CMIOExtensionPropertyDeviceCanBeDefaultInputDevice: &'static CMIOExtensionProperty;
84}
85
86extern "C" {
87 /// The key for the device property that specifies if a device can be the default output device.
88 ///
89 /// The property state for CMIOExtensionPropertyDeviceCanBeDefaultOutputDevice is a number representing a boolean value.
90 ///
91 /// See also [Apple's documentation](https://developer.apple.com/documentation/coremediaio/cmioextensionpropertydevicecanbedefaultoutputdevice?language=objc)
92 pub static CMIOExtensionPropertyDeviceCanBeDefaultOutputDevice: &'static CMIOExtensionProperty;
93}
94
95extern "C" {
96 /// The key for the readonly device property indicating the number of frames of latency in the CMIOExtensionDevice.
97 ///
98 /// The property state for CMIOExtensionPropertyDeviceLatency is a number containing the number of frames of latency in the CMIOExtensionDevice. Note that input and output latency may differ. Further, the CMIOExtensionDevice's CMIOExtensionStreams may have additional latency so they should be queried as well. If both the device and the stream say they have latency, then the total latency for the stream is the device latency summed with the stream latency. This property translates to the kCMIODevicePropertyLatency property.
99 ///
100 /// See also [Apple's documentation](https://developer.apple.com/documentation/coremediaio/cmioextensionpropertydevicelatency?language=objc)
101 pub static CMIOExtensionPropertyDeviceLatency: &'static CMIOExtensionProperty;
102}
103
104extern "C" {
105 /// The key for the stream property active format index.
106 ///
107 /// The property state for CMIOExtensionPropertyStreamActiveFormatIndex is a number.
108 ///
109 /// See also [Apple's documentation](https://developer.apple.com/documentation/coremediaio/cmioextensionpropertystreamactiveformatindex?language=objc)
110 pub static CMIOExtensionPropertyStreamActiveFormatIndex: &'static CMIOExtensionProperty;
111}
112
113extern "C" {
114 /// The key for the stream property frame duration.
115 ///
116 /// The property state for CMIOExtensionPropertyStreamFrameDuration needs to be a dictionary representing a CMTime struct that is consistent with the frame duration specification provided by the current active format.
117 ///
118 /// See also [Apple's documentation](https://developer.apple.com/documentation/coremediaio/cmioextensionpropertystreamframeduration?language=objc)
119 pub static CMIOExtensionPropertyStreamFrameDuration: &'static CMIOExtensionProperty;
120}
121
122extern "C" {
123 /// The key for the stream property maximum frame duration.
124 ///
125 /// The property state for CMIOExtensionPropertyStreamMaxFrameDuration needs to be a dictionary representing a CMTime struct.
126 ///
127 /// See also [Apple's documentation](https://developer.apple.com/documentation/coremediaio/cmioextensionpropertystreammaxframeduration?language=objc)
128 pub static CMIOExtensionPropertyStreamMaxFrameDuration: &'static CMIOExtensionProperty;
129}
130
131extern "C" {
132 /// The key for the sink stream property buffer queue size.
133 ///
134 /// The property state for CMIOExtensionPropertyStreamSinkBufferQueueSize is a number. This property translates to the kCMIOStreamPropertyOutputBufferQueueSize property.
135 ///
136 /// See also [Apple's documentation](https://developer.apple.com/documentation/coremediaio/cmioextensionpropertystreamsinkbufferqueuesize?language=objc)
137 pub static CMIOExtensionPropertyStreamSinkBufferQueueSize: &'static CMIOExtensionProperty;
138}
139
140extern "C" {
141 /// The key for the sink stream property for number of buffers required for startup.
142 ///
143 /// The property state for CMIOExtensionPropertyStreamSinkBuffersRequiredForStartup is a number. This property translates to the kCMIOStreamPropertyOutputBuffersRequiredForStartup property.
144 ///
145 /// See also [Apple's documentation](https://developer.apple.com/documentation/coremediaio/cmioextensionpropertystreamsinkbuffersrequiredforstartup?language=objc)
146 pub static CMIOExtensionPropertyStreamSinkBuffersRequiredForStartup:
147 &'static CMIOExtensionProperty;
148}
149
150extern "C" {
151 /// The key for the sink stream property buffer underrun count.
152 ///
153 /// A number that is incremented every time a stream's buffers are not being serviced fast enough.
154 /// The property state for CMIOExtensionPropertyStreamSinkBufferUnderrunCount is a number with a readonly attribute. This property translates to the kCMIOStreamPropertyOutputBufferUnderrunCount property.
155 ///
156 /// See also [Apple's documentation](https://developer.apple.com/documentation/coremediaio/cmioextensionpropertystreamsinkbufferunderruncount?language=objc)
157 pub static CMIOExtensionPropertyStreamSinkBufferUnderrunCount: &'static CMIOExtensionProperty;
158}
159
160extern "C" {
161 /// The key for the sink stream property end of data.
162 ///
163 /// The property state for CMIOExtensionPropertyStreamSinkEndOfData is a number, 1 means that the stream has reached the end and a value of 0 means that more data is (or will be) available. This property translates to the kCMIOStreamPropertyEndOfData property.
164 ///
165 /// See also [Apple's documentation](https://developer.apple.com/documentation/coremediaio/cmioextensionpropertystreamsinkendofdata?language=objc)
166 pub static CMIOExtensionPropertyStreamSinkEndOfData: &'static CMIOExtensionProperty;
167}
168
169extern "C" {
170 /// The key for the readonly stream property indicating the number of frames of latency in the CMIOExtensionStream.
171 ///
172 /// The property state for CMIOExtensionPropertyStreamLatency is a number containing the number of frames of latency in the CMIOExtensionStream. Note that the owning CMIOExtensionDevice may have additional latency so it should be queried as well. If both the device and the stream say they have latency, then the total latency for the stream is the device latency summed with the stream latency. This property translates to the kCMIOStreamPropertyLatency property.
173 ///
174 /// See also [Apple's documentation](https://developer.apple.com/documentation/coremediaio/cmioextensionpropertystreamlatency?language=objc)
175 pub static CMIOExtensionPropertyStreamLatency: &'static CMIOExtensionProperty;
176}
177
178extern_class!(
179 /// A CMIOExtensionPropertyAttributes describes attributes of a property's value.
180 ///
181 /// See also [Apple's documentation](https://developer.apple.com/documentation/coremediaio/cmioextensionpropertyattributes?language=objc)
182 #[unsafe(super(NSObject))]
183 #[derive(Debug, PartialEq, Eq, Hash)]
184 pub struct CMIOExtensionPropertyAttributes<ObjectType: ?Sized = AnyObject>;
185);
186
187impl<ObjectType: ?Sized + Message> CMIOExtensionPropertyAttributes<ObjectType> {
188 /// Unchecked conversion of the generic parameter.
189 ///
190 /// # Safety
191 ///
192 /// The generic must be valid to reinterpret as the given type.
193 #[inline]
194 pub unsafe fn cast_unchecked<NewObjectType: ?Sized + Message>(
195 &self,
196 ) -> &CMIOExtensionPropertyAttributes<NewObjectType> {
197 unsafe { &*((self as *const Self).cast()) }
198 }
199}
200
201extern_conformance!(
202 unsafe impl<ObjectType: ?Sized + NSCoding> NSCoding
203 for CMIOExtensionPropertyAttributes<ObjectType>
204 {
205 }
206);
207
208extern_conformance!(
209 unsafe impl<ObjectType: ?Sized> NSCopying for CMIOExtensionPropertyAttributes<ObjectType> {}
210);
211
212unsafe impl<ObjectType: ?Sized + Message> CopyingHelper
213 for CMIOExtensionPropertyAttributes<ObjectType>
214{
215 type Result = Self;
216}
217
218extern_conformance!(
219 unsafe impl<ObjectType: ?Sized> NSObjectProtocol for CMIOExtensionPropertyAttributes<ObjectType> {}
220);
221
222extern_conformance!(
223 unsafe impl<ObjectType: ?Sized + NSSecureCoding> NSSecureCoding
224 for CMIOExtensionPropertyAttributes<ObjectType>
225 {
226 }
227);
228
229impl<ObjectType: Message> CMIOExtensionPropertyAttributes<ObjectType> {
230 extern_methods!(
231 #[unsafe(method(init))]
232 #[unsafe(method_family = init)]
233 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
234
235 #[unsafe(method(new))]
236 #[unsafe(method_family = new)]
237 pub unsafe fn new() -> Retained<Self>;
238
239 /// Returns a property attributes instance.
240 ///
241 /// Parameter `minValue`: The minimum value of the property.
242 ///
243 /// Parameter `maxValue`: The maximum value of the property.
244 ///
245 /// Parameter `validValues`: The array of valid values.
246 ///
247 /// Parameter `readOnly`: A readOnly flag.
248 ///
249 /// Returns: A CMIOExtensionPropertyAttributes instance that describes the attributes of a property.
250 ///
251 /// Property attributes may contain a minValue in which case the property is bounded by a minimum value.
252 /// Property attributes may contain a maxValue in which case the property is bounded by a maximum value.
253 /// Property attributes may contain both minValue and maxValue in which case the property is bounded within a range.
254 /// Property attributes may contain a validValues in which case the property is discrete and can only have a certain set of value.
255 /// If a property does not have a minValue/maxValue/validValues attributes, the property can have any value.
256 #[unsafe(method(propertyAttributesWithMinValue:maxValue:validValues:readOnly:))]
257 #[unsafe(method_family = none)]
258 pub unsafe fn propertyAttributesWithMinValue_maxValue_validValues_readOnly(
259 min_value: Option<&ObjectType>,
260 max_value: Option<&ObjectType>,
261 valid_values: Option<&NSArray<ObjectType>>,
262 read_only: bool,
263 ) -> Retained<Self>;
264
265 /// Initialize a property attributes instance.
266 ///
267 /// Parameter `minValue`: The minimum value of the property.
268 ///
269 /// Parameter `maxValue`: The maximum value of the property.
270 ///
271 /// Parameter `validValues`: The array of valid values.
272 ///
273 /// Parameter `readOnly`: A readOnly flag.
274 ///
275 /// Returns: A CMIOExtensionPropertyAttributes instance that describes the attributes of a property.
276 ///
277 /// Property attributes may contain a minValue in which case the property is bounded by a minimum value.
278 /// Property attributes may contain a maxValue in which case the property is bounded by a maximum value.
279 /// Property attributes may contain both minValue and maxValue in which case the property is bounded within a range.
280 /// Property attributes may contain a validValues in which case the property is discrete and can only have a certain set of value.
281 /// If a property does not have a minValue/maxValue/validValues attributes, the property can have any value.
282 #[unsafe(method(initWithMinValue:maxValue:validValues:readOnly:))]
283 #[unsafe(method_family = init)]
284 pub unsafe fn initWithMinValue_maxValue_validValues_readOnly(
285 this: Allocated<Self>,
286 min_value: Option<&ObjectType>,
287 max_value: Option<&ObjectType>,
288 valid_values: Option<&NSArray<ObjectType>>,
289 read_only: bool,
290 ) -> Retained<Self>;
291
292 /// The class property representing a readOnly property attribute with no minValue/maxValue/validValues.
293 #[unsafe(method(readOnlyPropertyAttribute))]
294 #[unsafe(method_family = none)]
295 pub unsafe fn readOnlyPropertyAttribute() -> Retained<CMIOExtensionPropertyAttributes>;
296
297 /// The minimum value of a property.
298 #[unsafe(method(minValue))]
299 #[unsafe(method_family = none)]
300 pub unsafe fn minValue(&self) -> Option<Retained<ObjectType>>;
301
302 /// The maximum value of a property.
303 #[unsafe(method(maxValue))]
304 #[unsafe(method_family = none)]
305 pub unsafe fn maxValue(&self) -> Option<Retained<ObjectType>>;
306
307 /// An array of valid values.
308 #[unsafe(method(validValues))]
309 #[unsafe(method_family = none)]
310 pub unsafe fn validValues(&self) -> Option<Retained<NSArray<ObjectType>>>;
311
312 /// The readOnly flag attribute.
313 #[unsafe(method(isReadOnly))]
314 #[unsafe(method_family = none)]
315 pub unsafe fn isReadOnly(&self) -> bool;
316 );
317}
318
319extern_class!(
320 /// A CMIOExtensionPropertyState describes a property state.
321 ///
322 /// See also [Apple's documentation](https://developer.apple.com/documentation/coremediaio/cmioextensionpropertystate?language=objc)
323 #[unsafe(super(NSObject))]
324 #[derive(Debug, PartialEq, Eq, Hash)]
325 pub struct CMIOExtensionPropertyState<ObjectType: ?Sized = AnyObject>;
326);
327
328impl<ObjectType: ?Sized + Message> CMIOExtensionPropertyState<ObjectType> {
329 /// Unchecked conversion of the generic parameter.
330 ///
331 /// # Safety
332 ///
333 /// The generic must be valid to reinterpret as the given type.
334 #[inline]
335 pub unsafe fn cast_unchecked<NewObjectType: ?Sized + Message>(
336 &self,
337 ) -> &CMIOExtensionPropertyState<NewObjectType> {
338 unsafe { &*((self as *const Self).cast()) }
339 }
340}
341
342extern_conformance!(
343 unsafe impl<ObjectType: ?Sized + NSCoding> NSCoding for CMIOExtensionPropertyState<ObjectType> {}
344);
345
346extern_conformance!(
347 unsafe impl<ObjectType: ?Sized> NSCopying for CMIOExtensionPropertyState<ObjectType> {}
348);
349
350unsafe impl<ObjectType: ?Sized + Message> CopyingHelper for CMIOExtensionPropertyState<ObjectType> {
351 type Result = Self;
352}
353
354extern_conformance!(
355 unsafe impl<ObjectType: ?Sized> NSObjectProtocol for CMIOExtensionPropertyState<ObjectType> {}
356);
357
358extern_conformance!(
359 unsafe impl<ObjectType: ?Sized + NSSecureCoding> NSSecureCoding
360 for CMIOExtensionPropertyState<ObjectType>
361 {
362 }
363);
364
365impl<ObjectType: Message> CMIOExtensionPropertyState<ObjectType> {
366 extern_methods!(
367 #[unsafe(method(init))]
368 #[unsafe(method_family = init)]
369 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
370
371 #[unsafe(method(new))]
372 #[unsafe(method_family = new)]
373 pub unsafe fn new() -> Retained<Self>;
374
375 /// Returns a property state instance.
376 ///
377 /// Parameter `value`: The value associated with a property state.
378 ///
379 /// Returns: A CMIOExtensionPropertyState instance with a nil attributes.
380 #[unsafe(method(propertyStateWithValue:))]
381 #[unsafe(method_family = none)]
382 pub unsafe fn propertyStateWithValue(value: Option<&ObjectType>) -> Retained<Self>;
383
384 /// Returns a property state instance.
385 ///
386 /// Parameter `value`: The value associated with a property state.
387 ///
388 /// Parameter `attributes`: The property attributes associated with a property state.
389 ///
390 /// Returns: A CMIOExtensionPropertyState instance.
391 ///
392 /// A nil property attributes defaults to a read/write property that doesn't have a minValue/maxValue/validValues.
393 /// The supported value types are NSDictionary/NSArray/NSString/NSData/NSNumber.
394 #[unsafe(method(propertyStateWithValue:attributes:))]
395 #[unsafe(method_family = none)]
396 pub unsafe fn propertyStateWithValue_attributes(
397 value: Option<&ObjectType>,
398 attributes: Option<&CMIOExtensionPropertyAttributes<ObjectType>>,
399 ) -> Retained<Self>;
400
401 /// Initialize a property state instance.
402 ///
403 /// Parameter `value`: The value associated with a property state.
404 ///
405 /// Returns: A CMIOExtensionPropertyState instance.
406 ///
407 /// A nil property attributes defaults to a read/write property that doesn't have a minValue/maxValue/validValues.
408 /// The supported value types are NSDictionary/NSArray/NSString/NSData/NSNumber.
409 #[unsafe(method(initWithValue:))]
410 #[unsafe(method_family = init)]
411 pub unsafe fn initWithValue(
412 this: Allocated<Self>,
413 value: Option<&ObjectType>,
414 ) -> Retained<Self>;
415
416 /// Initialize a property state instance.
417 ///
418 /// Parameter `value`: The value associated with a property state.
419 ///
420 /// Parameter `attributes`: The property attributes associated with a property state.
421 ///
422 /// Returns: A CMIOExtensionPropertyState instance.
423 ///
424 /// A nil property attributes defaults to a read/write property that doesn't have a minValue/maxValue/validValues.
425 /// The supported value types are NSDictionary/NSArray/NSString/NSData/NSNumber.
426 #[unsafe(method(initWithValue:attributes:))]
427 #[unsafe(method_family = init)]
428 pub unsafe fn initWithValue_attributes(
429 this: Allocated<Self>,
430 value: Option<&ObjectType>,
431 attributes: Option<&CMIOExtensionPropertyAttributes<ObjectType>>,
432 ) -> Retained<Self>;
433
434 /// The value of the property.
435 #[unsafe(method(value))]
436 #[unsafe(method_family = none)]
437 pub unsafe fn value(&self) -> Option<Retained<ObjectType>>;
438
439 /// The property attributes of the property.
440 #[unsafe(method(attributes))]
441 #[unsafe(method_family = none)]
442 pub unsafe fn attributes(
443 &self,
444 ) -> Option<Retained<CMIOExtensionPropertyAttributes<ObjectType>>>;
445 );
446}
447
448extern_class!(
449 /// A CMIOExtensionStreamCustomClockProperties describes the parameters used to create a custom clock on the host side (as opposed to the stream using hosttime or a linked Core Audio clock.
450 ///
451 /// See also [Apple's documentation](https://developer.apple.com/documentation/coremediaio/cmioextensionstreamcustomclockconfiguration?language=objc)
452 #[unsafe(super(NSObject))]
453 #[derive(Debug, PartialEq, Eq, Hash)]
454 pub struct CMIOExtensionStreamCustomClockConfiguration;
455);
456
457extern_conformance!(
458 unsafe impl NSCoding for CMIOExtensionStreamCustomClockConfiguration {}
459);
460
461extern_conformance!(
462 unsafe impl NSCopying for CMIOExtensionStreamCustomClockConfiguration {}
463);
464
465unsafe impl CopyingHelper for CMIOExtensionStreamCustomClockConfiguration {
466 type Result = Self;
467}
468
469extern_conformance!(
470 unsafe impl NSObjectProtocol for CMIOExtensionStreamCustomClockConfiguration {}
471);
472
473extern_conformance!(
474 unsafe impl NSSecureCoding for CMIOExtensionStreamCustomClockConfiguration {}
475);
476
477impl CMIOExtensionStreamCustomClockConfiguration {
478 extern_methods!(
479 #[unsafe(method(init))]
480 #[unsafe(method_family = init)]
481 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
482
483 #[unsafe(method(new))]
484 #[unsafe(method_family = new)]
485 pub unsafe fn new() -> Retained<Self>;
486
487 #[cfg(feature = "objc2-core-media")]
488 /// Return a custom clock configuration instance.
489 ///
490 /// Parameter `clockName`: The name of the clock being specified.
491 ///
492 /// Parameter `sourceIdentifier`: An unique identifier that is used to indicate the entity that is driving the clock. This value is used internally to determine if two custom clocks have the same hardware source, and thus determine whether or not they will drift relative to one another. This parameter is used in the following way: if a device supports multiple active streams that are internally clocked by a common source, then instead of sharing one clock between each stream, a clock per stream can be configured with the sourceIdentifier for each clock set to be the same value.
493 ///
494 /// Parameter `getTimeCallMinimumInterval`: If the clock is queried for its current time more often than this interval, an interpolated value will be returned.
495 ///
496 /// Parameter `numberOfEventsForRateSmoothing`: The number of events to use for rate smoothing; must be > 0.
497 ///
498 /// Parameter `numberOfAveragesForRateSmoothing`: The number of averages used for rate smoothing; if 0, the default smoothing algorithm is used.
499 ///
500 /// Returns: A CMIOExtensionStreamCustomClockConfiguration instance.
501 #[unsafe(method(customClockConfigurationWithClockName:sourceIdentifier:getTimeCallMinimumInterval:numberOfEventsForRateSmoothing:numberOfAveragesForRateSmoothing:))]
502 #[unsafe(method_family = none)]
503 pub unsafe fn customClockConfigurationWithClockName_sourceIdentifier_getTimeCallMinimumInterval_numberOfEventsForRateSmoothing_numberOfAveragesForRateSmoothing(
504 clock_name: &NSString,
505 source_identifier: &NSUUID,
506 get_time_call_minimum_interval: CMTime,
507 number_of_events_for_rate_smoothing: u32,
508 number_of_averages_for_rate_smoothing: u32,
509 ) -> Retained<Self>;
510
511 #[cfg(feature = "objc2-core-media")]
512 /// Initialize a custom clock configuration instance.
513 ///
514 /// Parameter `clockName`: The name of the clock being specified.
515 ///
516 /// Parameter `sourceIdentifier`: An unique identifier that is used to indicate the entity that is driving the clock. This value is used internally to determine if two custom clocks have the same hardware source, and thus determine whether or not they will drift relative to one another. This parameter is used in the following way: if a device supports multiple active streams that are internally clocked by a common source, then instead of sharing one clock between each stream, a clock per stream can be configured with the sourceIdentifier for each clock set to be the same value.
517 ///
518 /// Parameter `getTimeCallMinimumInterval`: If the clock is queried for its current time more often than this interval, an interpolated value will be returned.
519 ///
520 /// Parameter `numberOfEventsForRateSmoothing`: The number of events to use for rate smoothing; must be > 0.
521 ///
522 /// Parameter `numberOfAveragesForRateSmoothing`: The number of averages used for rate smoothing; if 0, the default smoothing algorithm is used.
523 ///
524 /// Returns: A CMIOExtensionStreamCustomClockConfiguration instance.
525 #[unsafe(method(initWithClockName:sourceIdentifier:getTimeCallMinimumInterval:numberOfEventsForRateSmoothing:numberOfAveragesForRateSmoothing:))]
526 #[unsafe(method_family = init)]
527 pub unsafe fn initWithClockName_sourceIdentifier_getTimeCallMinimumInterval_numberOfEventsForRateSmoothing_numberOfAveragesForRateSmoothing(
528 this: Allocated<Self>,
529 clock_name: &NSString,
530 source_identifier: &NSUUID,
531 get_time_call_minimum_interval: CMTime,
532 number_of_events_for_rate_smoothing: u32,
533 number_of_averages_for_rate_smoothing: u32,
534 ) -> Retained<Self>;
535
536 /// The name of the clock.
537 #[unsafe(method(clockName))]
538 #[unsafe(method_family = none)]
539 pub unsafe fn clockName(&self) -> Retained<NSString>;
540
541 /// The identifier of the entity driving the clock.
542 ///
543 /// An unique identifier that is used to indicate the entity that is driving the clock. This value is used internally to determine if two custom clocks have the same hardware source, and thus determine whether or not they will drift relative to one another. This parameter is used in the following way: if a device supports multiple active streams that are internally clocked by a common source, then instead of sharing one clock between each stream, a clock per stream can be configured with the sourceIdentifier for each clock set to be the same value.
544 #[unsafe(method(sourceIdentifier))]
545 #[unsafe(method_family = none)]
546 pub unsafe fn sourceIdentifier(&self) -> Retained<NSUUID>;
547
548 #[cfg(feature = "objc2-core-media")]
549 /// If the clock is queried for its current time more often than this interval, an interpolated value will be returned.
550 #[unsafe(method(getTimeCallMinimumInterval))]
551 #[unsafe(method_family = none)]
552 pub unsafe fn getTimeCallMinimumInterval(&self) -> CMTime;
553
554 /// The number of events to use for rate smoothing; will be > 0.
555 #[unsafe(method(numberOfEventsForRateSmoothing))]
556 #[unsafe(method_family = none)]
557 pub unsafe fn numberOfEventsForRateSmoothing(&self) -> u32;
558
559 /// The number of averages used for rate smoothing; 0 indicates that the default smoothing algorithm is used.
560 #[unsafe(method(numberOfAveragesForRateSmoothing))]
561 #[unsafe(method_family = none)]
562 pub unsafe fn numberOfAveragesForRateSmoothing(&self) -> u32;
563 );
564}
565
566extern_class!(
567 /// A CMIOExtensionStreamFormat describes a stream format.
568 ///
569 /// See also [Apple's documentation](https://developer.apple.com/documentation/coremediaio/cmioextensionstreamformat?language=objc)
570 #[unsafe(super(NSObject))]
571 #[derive(Debug, PartialEq, Eq, Hash)]
572 pub struct CMIOExtensionStreamFormat;
573);
574
575extern_conformance!(
576 unsafe impl NSCoding for CMIOExtensionStreamFormat {}
577);
578
579extern_conformance!(
580 unsafe impl NSCopying for CMIOExtensionStreamFormat {}
581);
582
583unsafe impl CopyingHelper for CMIOExtensionStreamFormat {
584 type Result = Self;
585}
586
587extern_conformance!(
588 unsafe impl NSObjectProtocol for CMIOExtensionStreamFormat {}
589);
590
591extern_conformance!(
592 unsafe impl NSSecureCoding for CMIOExtensionStreamFormat {}
593);
594
595impl CMIOExtensionStreamFormat {
596 extern_methods!(
597 #[unsafe(method(init))]
598 #[unsafe(method_family = init)]
599 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
600
601 #[unsafe(method(new))]
602 #[unsafe(method_family = new)]
603 pub unsafe fn new() -> Retained<Self>;
604
605 #[cfg(feature = "objc2-core-media")]
606 /// Returns a stream format instance.
607 ///
608 /// Parameter `formatDescription`: The format description of the samples delivered by the stream.
609 ///
610 /// Parameter `maxFrameDuration`: The maximum frame duration.
611 ///
612 /// Parameter `minFrameDuration`: The minimum frame duration.
613 ///
614 /// Parameter `validFrameDurations`: The list of valid CMTime as dictionaries. If nil the full range between min and max is valid. The CMTime in dictionary format are made with CMTimeCopyAsDictionary.
615 ///
616 /// Returns: A CMIOExtensionStreamFormat instance that describes the stream format.
617 ///
618 /// A frame duration is the reciprocal of a frame rate.
619 /// If a CMIOExtensionStreamFormat's validFrameDurations property is not nil and not empty, the frame duration are discrete and can only have a certain set of value. Current frame duration and maximum frame duration can be changed with the properties CMIOExtensionPropertyStreamFrameDuration and CMIOExtensionPropertyStreamMaxFrameDuration.
620 ///
621 /// # Safety
622 ///
623 /// `valid_frame_durations` generic generic should be of the correct type.
624 #[unsafe(method(streamFormatWithFormatDescription:maxFrameDuration:minFrameDuration:validFrameDurations:))]
625 #[unsafe(method_family = none)]
626 pub unsafe fn streamFormatWithFormatDescription_maxFrameDuration_minFrameDuration_validFrameDurations(
627 format_description: &CMFormatDescription,
628 max_frame_duration: CMTime,
629 min_frame_duration: CMTime,
630 valid_frame_durations: Option<&NSArray<NSDictionary>>,
631 ) -> Retained<Self>;
632
633 #[cfg(feature = "objc2-core-media")]
634 /// Initialize a stream format instance.
635 ///
636 /// Parameter `formatDescription`: The format description of the samples delivered by the stream.
637 ///
638 /// Parameter `maxFrameDuration`: The maximum frame duration.
639 ///
640 /// Parameter `minFrameDuration`: The minimum frame duration.
641 ///
642 /// Parameter `validFrameDurations`: The list of valid CMTime as dictionaries if nil the full range between min and max is valid. The CMTime in dictionary format are made with CMTimeCopyAsDictionary.
643 ///
644 /// Returns: A CMIOExtensionStreamFormat instance that describes the stream format.
645 ///
646 /// A frame duration is the reciprocal of a frame rate.
647 /// If a CMIOExtensionStreamFormat's validFrameDurations property is not nil and not empty, the frame duration are discrete and can only have a certain set of value. Current frame duration and maximum frame duration can be changed with the properties CMIOExtensionPropertyStreamFrameDuration and CMIOExtensionPropertyStreamMaxFrameDuration.
648 ///
649 /// # Safety
650 ///
651 /// `valid_frame_durations` generic generic should be of the correct type.
652 #[unsafe(method(initWithFormatDescription:maxFrameDuration:minFrameDuration:validFrameDurations:))]
653 #[unsafe(method_family = init)]
654 pub unsafe fn initWithFormatDescription_maxFrameDuration_minFrameDuration_validFrameDurations(
655 this: Allocated<Self>,
656 format_description: &CMFormatDescription,
657 max_frame_duration: CMTime,
658 min_frame_duration: CMTime,
659 valid_frame_durations: Option<&NSArray<NSDictionary>>,
660 ) -> Retained<Self>;
661
662 #[cfg(feature = "objc2-core-media")]
663 /// The format description of the samples delivered by the stream.
664 #[unsafe(method(formatDescription))]
665 #[unsafe(method_family = none)]
666 pub unsafe fn formatDescription(&self) -> Retained<CMFormatDescription>;
667
668 #[cfg(feature = "objc2-core-media")]
669 /// The minimum frame duration (AKA maximum frame rate).
670 #[unsafe(method(minFrameDuration))]
671 #[unsafe(method_family = none)]
672 pub unsafe fn minFrameDuration(&self) -> CMTime;
673
674 #[cfg(feature = "objc2-core-media")]
675 /// The maximum frame duration (AKA minimum frame rate).
676 #[unsafe(method(maxFrameDuration))]
677 #[unsafe(method_family = none)]
678 pub unsafe fn maxFrameDuration(&self) -> CMTime;
679
680 /// The valid frame durations as an array of CMTime as dictionaries. The CMTime in dictionary format are made with CMTimeCopyAsDictionary.
681 #[unsafe(method(validFrameDurations))]
682 #[unsafe(method_family = none)]
683 pub unsafe fn validFrameDurations(&self) -> Option<Retained<NSArray<NSDictionary>>>;
684 );
685}
686
687extern_class!(
688 /// [Apple's documentation](https://developer.apple.com/documentation/coremediaio/cmioextensionscheduledoutput?language=objc)
689 #[unsafe(super(NSObject))]
690 #[derive(Debug, PartialEq, Eq, Hash)]
691 pub struct CMIOExtensionScheduledOutput;
692);
693
694extern_conformance!(
695 unsafe impl NSCoding for CMIOExtensionScheduledOutput {}
696);
697
698extern_conformance!(
699 unsafe impl NSCopying for CMIOExtensionScheduledOutput {}
700);
701
702unsafe impl CopyingHelper for CMIOExtensionScheduledOutput {
703 type Result = Self;
704}
705
706extern_conformance!(
707 unsafe impl NSObjectProtocol for CMIOExtensionScheduledOutput {}
708);
709
710extern_conformance!(
711 unsafe impl NSSecureCoding for CMIOExtensionScheduledOutput {}
712);
713
714impl CMIOExtensionScheduledOutput {
715 extern_methods!(
716 #[unsafe(method(init))]
717 #[unsafe(method_family = init)]
718 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
719
720 #[unsafe(method(new))]
721 #[unsafe(method_family = new)]
722 pub unsafe fn new() -> Retained<Self>;
723
724 /// Return a stream scheduled output instance.
725 ///
726 /// Parameter `sequenceNumber`: The buffer sequence number that was output.
727 ///
728 /// Parameter `hostTimeInNanoseconds`: The host time in nanoseconds when the buffer was output.
729 ///
730 /// Returns: A CMIOExtensionScheduledOutput instance that describes the state of the stream.
731 #[unsafe(method(scheduledOutputWithSequenceNumber:hostTimeInNanoseconds:))]
732 #[unsafe(method_family = none)]
733 pub unsafe fn scheduledOutputWithSequenceNumber_hostTimeInNanoseconds(
734 sequence_number: u64,
735 host_time_in_nanoseconds: u64,
736 ) -> Retained<Self>;
737
738 /// Initialize a stream scheduled output instance.
739 ///
740 /// Parameter `sequenceNumber`: The buffer sequence number that was output.
741 ///
742 /// Parameter `hostTimeInNanoseconds`: The host time in nanoseconds when the buffer was output.
743 ///
744 /// Returns: A CMIOExtensionScheduledOutput instance that describes the state of the stream.
745 #[unsafe(method(initWithSequenceNumber:hostTimeInNanoseconds:))]
746 #[unsafe(method_family = init)]
747 pub unsafe fn initWithSequenceNumber_hostTimeInNanoseconds(
748 this: Allocated<Self>,
749 sequence_number: u64,
750 host_time_in_nanoseconds: u64,
751 ) -> Retained<Self>;
752
753 /// The buffer sequence number that was output.
754 #[unsafe(method(sequenceNumber))]
755 #[unsafe(method_family = none)]
756 pub unsafe fn sequenceNumber(&self) -> u64;
757
758 /// The host time in nanoseconds when the buffer was output.
759 #[unsafe(method(hostTimeInNanoseconds))]
760 #[unsafe(method_family = none)]
761 pub unsafe fn hostTimeInNanoseconds(&self) -> u64;
762 );
763}
764
765extern_class!(
766 /// [Apple's documentation](https://developer.apple.com/documentation/coremediaio/cmioextensionclient?language=objc)
767 #[unsafe(super(NSObject))]
768 #[derive(Debug, PartialEq, Eq, Hash)]
769 pub struct CMIOExtensionClient;
770);
771
772extern_conformance!(
773 unsafe impl NSCopying for CMIOExtensionClient {}
774);
775
776unsafe impl CopyingHelper for CMIOExtensionClient {
777 type Result = Self;
778}
779
780extern_conformance!(
781 unsafe impl NSObjectProtocol for CMIOExtensionClient {}
782);
783
784impl CMIOExtensionClient {
785 extern_methods!(
786 #[unsafe(method(init))]
787 #[unsafe(method_family = init)]
788 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
789
790 #[unsafe(method(new))]
791 #[unsafe(method_family = new)]
792 pub unsafe fn new() -> Retained<Self>;
793
794 /// The client unique identifier.
795 #[unsafe(method(clientID))]
796 #[unsafe(method_family = none)]
797 pub unsafe fn clientID(&self) -> Retained<NSUUID>;
798
799 /// The client's signing identifier.
800 #[unsafe(method(signingID))]
801 #[unsafe(method_family = none)]
802 pub unsafe fn signingID(&self) -> Option<Retained<NSString>>;
803
804 #[cfg(feature = "libc")]
805 /// The pid of the client application.
806 #[unsafe(method(pid))]
807 #[unsafe(method_family = none)]
808 pub unsafe fn pid(&self) -> libc::pid_t;
809 );
810}