objc2_core_media_io/generated/
CMIOExtensionStream.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-media")]
7use objc2_core_media::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12/// Constants indicating the direction of the stream.
13///
14/// Indicates that the stream is a source; i.e., provides sample buffers for capture.
15///
16/// Indicates that the stream is a sink; i.e., consumes sample buffers for playback.
17///
18/// See also [Apple's documentation](https://developer.apple.com/documentation/coremediaio/cmioextensionstreamdirection?language=objc)
19// NS_ENUM
20#[repr(transparent)]
21#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
22pub struct CMIOExtensionStreamDirection(pub NSInteger);
23impl CMIOExtensionStreamDirection {
24    #[doc(alias = "CMIOExtensionStreamDirectionSource")]
25    pub const Source: Self = Self(0);
26    #[doc(alias = "CMIOExtensionStreamDirectionSink")]
27    pub const Sink: Self = Self(1);
28}
29
30unsafe impl Encode for CMIOExtensionStreamDirection {
31    const ENCODING: Encoding = NSInteger::ENCODING;
32}
33
34unsafe impl RefEncode for CMIOExtensionStreamDirection {
35    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
36}
37
38/// Constants indicating the clock of the stream.
39///
40/// Indicates that the stream's clock is the host time clock.
41///
42/// Indicates that the stream's clock is the clock from the linked CoreAudio device.
43///
44/// Indicates that the stream's clock is specific to the device hosting the stream; this clock type cannot be set directly by the extension, but instead is set automatically when a  CMIOExtensionStreamCustomClockConfiguration is used when creating a CMIOExtensionStream.
45///
46/// See also [Apple's documentation](https://developer.apple.com/documentation/coremediaio/cmioextensionstreamclocktype?language=objc)
47// NS_ENUM
48#[repr(transparent)]
49#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
50pub struct CMIOExtensionStreamClockType(pub NSInteger);
51impl CMIOExtensionStreamClockType {
52    #[doc(alias = "CMIOExtensionStreamClockTypeHostTime")]
53    pub const HostTime: Self = Self(0);
54    #[doc(alias = "CMIOExtensionStreamClockTypeLinkedCoreAudioDeviceUID")]
55    pub const LinkedCoreAudioDeviceUID: Self = Self(1);
56    #[doc(alias = "CMIOExtensionStreamClockTypeCustom")]
57    pub const Custom: Self = Self(2);
58}
59
60unsafe impl Encode for CMIOExtensionStreamClockType {
61    const ENCODING: Encoding = NSInteger::ENCODING;
62}
63
64unsafe impl RefEncode for CMIOExtensionStreamClockType {
65    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
66}
67
68/// Constants indicating the state of a stream discontinuity.
69///
70/// Indicates that there is no stream discontinuity.
71///
72/// Indicates that there is a stream discontinuity of type unknown.
73///
74/// Indicates that there is a stream discontinuity of type time.
75///
76/// Indicates that there is a stream discontinuity of type dropped sample.
77///
78/// See also [Apple's documentation](https://developer.apple.com/documentation/coremediaio/cmioextensionstreamdiscontinuityflags?language=objc)
79// NS_OPTIONS
80#[repr(transparent)]
81#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
82pub struct CMIOExtensionStreamDiscontinuityFlags(pub u32);
83bitflags::bitflags! {
84    impl CMIOExtensionStreamDiscontinuityFlags: u32 {
85        #[doc(alias = "CMIOExtensionStreamDiscontinuityFlagNone")]
86        const None = 0;
87        #[doc(alias = "CMIOExtensionStreamDiscontinuityFlagUnknown")]
88        const Unknown = 1<<0;
89        #[doc(alias = "CMIOExtensionStreamDiscontinuityFlagTime")]
90        const Time = 1<<1;
91        #[doc(alias = "CMIOExtensionStreamDiscontinuityFlagSampleDropped")]
92        const SampleDropped = 1<<6;
93    }
94}
95
96unsafe impl Encode for CMIOExtensionStreamDiscontinuityFlags {
97    const ENCODING: Encoding = u32::ENCODING;
98}
99
100unsafe impl RefEncode for CMIOExtensionStreamDiscontinuityFlags {
101    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
102}
103
104extern_class!(
105    /// A CMIOExtensionStreamProperties describes a CoreMediaIO extension stream properties.
106    ///
107    /// See also [Apple's documentation](https://developer.apple.com/documentation/coremediaio/cmioextensionstreamproperties?language=objc)
108    #[unsafe(super(NSObject))]
109    #[derive(Debug, PartialEq, Eq, Hash)]
110    pub struct CMIOExtensionStreamProperties;
111);
112
113extern_conformance!(
114    unsafe impl NSObjectProtocol for CMIOExtensionStreamProperties {}
115);
116
117impl CMIOExtensionStreamProperties {
118    extern_methods!(
119        #[unsafe(method(init))]
120        #[unsafe(method_family = init)]
121        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
122
123        #[unsafe(method(new))]
124        #[unsafe(method_family = new)]
125        pub unsafe fn new() -> Retained<Self>;
126
127        #[cfg(feature = "CMIOExtensionProperties")]
128        /// Return a stream properties instance.
129        ///
130        /// Parameter `propertiesDictionary`: The dictionary of properties.
131        ///
132        /// Returns: A CMIOExtensionStreamProperties instance.
133        ///
134        /// # Safety
135        ///
136        /// `properties_dictionary` generic generic should be of the correct type.
137        #[unsafe(method(streamPropertiesWithDictionary:))]
138        #[unsafe(method_family = none)]
139        pub unsafe fn streamPropertiesWithDictionary(
140            properties_dictionary: &NSDictionary<CMIOExtensionProperty, CMIOExtensionPropertyState>,
141        ) -> Retained<Self>;
142
143        #[cfg(feature = "CMIOExtensionProperties")]
144        /// Initialize a stream properties instance.
145        ///
146        /// Parameter `propertiesDictionary`: The dictionary of properties.
147        ///
148        /// Returns: A CMIOExtensionStreamProperties instance.
149        ///
150        /// # Safety
151        ///
152        /// `properties_dictionary` generic generic should be of the correct type.
153        #[unsafe(method(initWithDictionary:))]
154        #[unsafe(method_family = init)]
155        pub unsafe fn initWithDictionary(
156            this: Allocated<Self>,
157            properties_dictionary: &NSDictionary<CMIOExtensionProperty, CMIOExtensionPropertyState>,
158        ) -> Retained<Self>;
159
160        /// The active format index.
161        ///
162        /// The property key is CMIOExtensionPropertyStreamActiveFormatIndex.
163        #[unsafe(method(activeFormatIndex))]
164        #[unsafe(method_family = none)]
165        pub unsafe fn activeFormatIndex(&self) -> Option<Retained<NSNumber>>;
166
167        /// Setter for [`activeFormatIndex`][Self::activeFormatIndex].
168        #[unsafe(method(setActiveFormatIndex:))]
169        #[unsafe(method_family = none)]
170        pub unsafe fn setActiveFormatIndex(&self, active_format_index: Option<&NSNumber>);
171
172        /// The frame duration.
173        ///
174        /// The property key is CMIOExtensionPropertyStreamFrameDuration.
175        /// The dictionary needs to be a dictionary representing a CMTime struct that is consistent with the frame duration specification provided by the current active format.
176        #[unsafe(method(frameDuration))]
177        #[unsafe(method_family = none)]
178        pub unsafe fn frameDuration(&self) -> Option<Retained<NSDictionary>>;
179
180        /// Setter for [`frameDuration`][Self::frameDuration].
181        ///
182        /// # Safety
183        ///
184        /// `frame_duration` generic should be of the correct type.
185        #[unsafe(method(setFrameDuration:))]
186        #[unsafe(method_family = none)]
187        pub unsafe fn setFrameDuration(&self, frame_duration: Option<&NSDictionary>);
188
189        /// The maximum frame duration.
190        ///
191        /// The property key is CMIOExtensionPropertyStreamMaxFrameDuration.
192        /// The dictionary needs to be a dictionary representing a CMTime struct that is consistent with the frame duration specification provided by the current active format.
193        #[unsafe(method(maxFrameDuration))]
194        #[unsafe(method_family = none)]
195        pub unsafe fn maxFrameDuration(&self) -> Option<Retained<NSDictionary>>;
196
197        /// Setter for [`maxFrameDuration`][Self::maxFrameDuration].
198        ///
199        /// # Safety
200        ///
201        /// `max_frame_duration` generic should be of the correct type.
202        #[unsafe(method(setMaxFrameDuration:))]
203        #[unsafe(method_family = none)]
204        pub unsafe fn setMaxFrameDuration(&self, max_frame_duration: Option<&NSDictionary>);
205
206        /// The sink stream property buffer queue size.
207        ///
208        /// The property key is CMIOExtensionPropertyStreamSinkBufferQueueSize.
209        #[unsafe(method(sinkBufferQueueSize))]
210        #[unsafe(method_family = none)]
211        pub unsafe fn sinkBufferQueueSize(&self) -> Option<Retained<NSNumber>>;
212
213        /// Setter for [`sinkBufferQueueSize`][Self::sinkBufferQueueSize].
214        #[unsafe(method(setSinkBufferQueueSize:))]
215        #[unsafe(method_family = none)]
216        pub unsafe fn setSinkBufferQueueSize(&self, sink_buffer_queue_size: Option<&NSNumber>);
217
218        /// The sink stream property for number of buffers required for startup.
219        ///
220        /// The property key is CMIOExtensionPropertyStreamSinkBuffersRequiredForStartup.
221        #[unsafe(method(sinkBuffersRequiredForStartup))]
222        #[unsafe(method_family = none)]
223        pub unsafe fn sinkBuffersRequiredForStartup(&self) -> Option<Retained<NSNumber>>;
224
225        /// Setter for [`sinkBuffersRequiredForStartup`][Self::sinkBuffersRequiredForStartup].
226        #[unsafe(method(setSinkBuffersRequiredForStartup:))]
227        #[unsafe(method_family = none)]
228        pub unsafe fn setSinkBuffersRequiredForStartup(
229            &self,
230            sink_buffers_required_for_startup: Option<&NSNumber>,
231        );
232
233        /// The sink stream property buffer underrun count.
234        ///
235        /// The property key is CMIOExtensionPropertyStreamSinkBufferUnderrunCount.
236        #[unsafe(method(sinkBufferUnderrunCount))]
237        #[unsafe(method_family = none)]
238        pub unsafe fn sinkBufferUnderrunCount(&self) -> Option<Retained<NSNumber>>;
239
240        /// Setter for [`sinkBufferUnderrunCount`][Self::sinkBufferUnderrunCount].
241        #[unsafe(method(setSinkBufferUnderrunCount:))]
242        #[unsafe(method_family = none)]
243        pub unsafe fn setSinkBufferUnderrunCount(
244            &self,
245            sink_buffer_underrun_count: Option<&NSNumber>,
246        );
247
248        /// The sink stream property end of data.
249        ///
250        /// The property key is CMIOExtensionPropertyStreamSinkEndOfData.
251        #[unsafe(method(sinkEndOfData))]
252        #[unsafe(method_family = none)]
253        pub unsafe fn sinkEndOfData(&self) -> Option<Retained<NSNumber>>;
254
255        /// Setter for [`sinkEndOfData`][Self::sinkEndOfData].
256        #[unsafe(method(setSinkEndOfData:))]
257        #[unsafe(method_family = none)]
258        pub unsafe fn setSinkEndOfData(&self, sink_end_of_data: Option<&NSNumber>);
259
260        #[cfg(feature = "CMIOExtensionProperties")]
261        /// Set the property value.
262        ///
263        /// Parameter `propertyState`: The property state.
264        ///
265        /// Parameter `property`: The property key.
266        ///
267        /// Setting nil to propertyState does remove the property.
268        ///
269        /// # Safety
270        ///
271        /// `property_state` generic should be of the correct type.
272        #[unsafe(method(setPropertyState:forProperty:))]
273        #[unsafe(method_family = none)]
274        pub unsafe fn setPropertyState_forProperty(
275            &self,
276            property_state: Option<&CMIOExtensionPropertyState>,
277            property: &CMIOExtensionProperty,
278        );
279
280        #[cfg(feature = "CMIOExtensionProperties")]
281        /// The dictionary of properties.
282        ///
283        /// The dictionary containing all keys and values.
284        #[unsafe(method(propertiesDictionary))]
285        #[unsafe(method_family = none)]
286        pub unsafe fn propertiesDictionary(
287            &self,
288        ) -> Retained<NSDictionary<CMIOExtensionProperty, CMIOExtensionPropertyState>>;
289
290        #[cfg(feature = "CMIOExtensionProperties")]
291        /// Setter for [`propertiesDictionary`][Self::propertiesDictionary].
292        ///
293        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
294        ///
295        /// # Safety
296        ///
297        /// `properties_dictionary` generic generic should be of the correct type.
298        #[unsafe(method(setPropertiesDictionary:))]
299        #[unsafe(method_family = none)]
300        pub unsafe fn setPropertiesDictionary(
301            &self,
302            properties_dictionary: &NSDictionary<CMIOExtensionProperty, CMIOExtensionPropertyState>,
303        );
304    );
305}
306
307extern_protocol!(
308    /// [Apple's documentation](https://developer.apple.com/documentation/coremediaio/cmioextensionstreamsource?language=objc)
309    pub unsafe trait CMIOExtensionStreamSource: NSObjectProtocol {
310        #[cfg(feature = "CMIOExtensionProperties")]
311        /// The supported formats for the stream.
312        ///
313        /// formats should not change during the life cycle of the associated stream.
314        #[unsafe(method(formats))]
315        #[unsafe(method_family = none)]
316        unsafe fn formats(&self) -> Retained<NSArray<CMIOExtensionStreamFormat>>;
317
318        #[cfg(feature = "CMIOExtensionProperties")]
319        /// The set of available properties.
320        ///
321        /// The availableProperties should not change during the life cycle of the associated stream.
322        #[unsafe(method(availableProperties))]
323        #[unsafe(method_family = none)]
324        unsafe fn availableProperties(&self) -> Retained<NSSet<CMIOExtensionProperty>>;
325
326        #[cfg(feature = "CMIOExtensionProperties")]
327        /// Get the state of properties.
328        ///
329        /// Parameter `properties`: The addresses of properties from which to get the state.
330        ///
331        /// Parameter `outError`: An error return on failure.
332        ///
333        /// Returns: A stream properties instance containing the properties states.
334        #[unsafe(method(streamPropertiesForProperties:error:_))]
335        #[unsafe(method_family = none)]
336        unsafe fn streamPropertiesForProperties_error(
337            &self,
338            properties: &NSSet<CMIOExtensionProperty>,
339        ) -> Result<Retained<CMIOExtensionStreamProperties>, Retained<NSError>>;
340
341        /// Set the provider properties.
342        ///
343        /// Parameter `streamProperties`: The stream properties instance containing the properties states.
344        ///
345        /// Parameter `outError`: An error return on failure.
346        ///
347        /// Returns: Return YES on success, NO otherwise.
348        ///
349        /// The property attributes associated with a property state are always nil in setter.
350        /// In case of error, it is highly advisable to pass more detailed information regarding the property or properties that failed in the localizedDescription of the NSError.
351        #[unsafe(method(setStreamProperties:error:_))]
352        #[unsafe(method_family = none)]
353        unsafe fn setStreamProperties_error(
354            &self,
355            stream_properties: &CMIOExtensionStreamProperties,
356        ) -> Result<(), Retained<NSError>>;
357
358        #[cfg(feature = "CMIOExtensionProperties")]
359        /// Accept or reject streaming for a client.
360        ///
361        /// Parameter `client`: The client.
362        ///
363        /// Returns: Return YES to accept streaming to a client, NO otherwise.
364        #[unsafe(method(authorizedToStartStreamForClient:))]
365        #[unsafe(method_family = none)]
366        unsafe fn authorizedToStartStreamForClient(&self, client: &CMIOExtensionClient) -> bool;
367
368        /// Start streaming media.
369        ///
370        /// Parameter `outError`: An error return on failure.
371        ///
372        /// Returns: Return YES on success, NO otherwise.
373        #[unsafe(method(startStreamAndReturnError:_))]
374        #[unsafe(method_family = none)]
375        unsafe fn startStreamAndReturnError(&self) -> Result<(), Retained<NSError>>;
376
377        /// Stop streaming media.
378        ///
379        /// Parameter `outError`: An error return on failure.
380        ///
381        /// Returns: Return YES on success, NO otherwise.
382        #[unsafe(method(stopStreamAndReturnError:_))]
383        #[unsafe(method_family = none)]
384        unsafe fn stopStreamAndReturnError(&self) -> Result<(), Retained<NSError>>;
385    }
386);
387
388extern_class!(
389    /// A CMIOExtensionStream describes a stream of media data.
390    ///
391    /// See also [Apple's documentation](https://developer.apple.com/documentation/coremediaio/cmioextensionstream?language=objc)
392    #[unsafe(super(NSObject))]
393    #[derive(Debug, PartialEq, Eq, Hash)]
394    pub struct CMIOExtensionStream;
395);
396
397extern_conformance!(
398    unsafe impl NSObjectProtocol for CMIOExtensionStream {}
399);
400
401impl CMIOExtensionStream {
402    extern_methods!(
403        #[unsafe(method(init))]
404        #[unsafe(method_family = init)]
405        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
406
407        #[unsafe(method(new))]
408        #[unsafe(method_family = new)]
409        pub unsafe fn new() -> Retained<Self>;
410
411        /// Returns a stream instance.
412        ///
413        /// Parameter `localizedName`: The localized name of the stream.
414        ///
415        /// Parameter `streamID`: The stream identifier.
416        ///
417        /// Parameter `direction`: The stream direction.
418        ///
419        /// Parameter `clockType`: The stream clock type.
420        ///
421        /// Parameter `source`: The stream source.
422        ///
423        /// Returns: A CMIOExtensionStream instance that provides data.
424        ///
425        /// Note that the clockType parameter may not be CMIOExtensionStreamClockTypeCustom; that value is reserved for streams created with a custom clock configuration. For streams that have a custom clock, use streamWithLocalizedName:streamID:direction:customClockConfiguration:source:.
426        #[unsafe(method(streamWithLocalizedName:streamID:direction:clockType:source:))]
427        #[unsafe(method_family = none)]
428        pub unsafe fn streamWithLocalizedName_streamID_direction_clockType_source(
429            localized_name: &NSString,
430            stream_id: &NSUUID,
431            direction: CMIOExtensionStreamDirection,
432            clock_type: CMIOExtensionStreamClockType,
433            source: &ProtocolObject<dyn CMIOExtensionStreamSource>,
434        ) -> Retained<Self>;
435
436        #[cfg(feature = "CMIOExtensionProperties")]
437        /// Returns a stream instance.
438        ///
439        /// Parameter `localizedName`: The localized name of the stream.
440        ///
441        /// Parameter `streamID`: The stream identifier.
442        ///
443        /// Parameter `direction`: The stream direction.
444        ///
445        /// Parameter `customClockConfiguration`: A CMIOExtensionStreamCustomClockConfiguration object that defines the custom clock configuration.
446        ///
447        /// Parameter `source`: The stream source.
448        ///
449        /// Returns: A CMIOExtensionStream instance that provides data.
450        #[unsafe(method(streamWithLocalizedName:streamID:direction:customClockConfiguration:source:))]
451        #[unsafe(method_family = none)]
452        pub unsafe fn streamWithLocalizedName_streamID_direction_customClockConfiguration_source(
453            localized_name: &NSString,
454            stream_id: &NSUUID,
455            direction: CMIOExtensionStreamDirection,
456            custom_clock_configuration: &CMIOExtensionStreamCustomClockConfiguration,
457            source: &ProtocolObject<dyn CMIOExtensionStreamSource>,
458        ) -> Retained<Self>;
459
460        /// Initialize a stream instance.
461        ///
462        /// Parameter `localizedName`: The localized name of the stream.
463        ///
464        /// Parameter `streamID`: The stream identifier.
465        ///
466        /// Parameter `direction`: The stream direction.
467        ///
468        /// Parameter `clockType`: The stream clock type.
469        ///
470        /// Parameter `source`: The stream source.
471        ///
472        /// Returns: A CMIOExtensionStream instance that provides data.
473        ///
474        /// Note that the clockType parameter may not be CMIOExtensionStreamClockTypeCustom; that value is reserved for streams created with a custom clock configuration. For streams that have a custom clock, use streamWithLocalizedName:streamID:direction:customClockConfiguration:source:.
475        #[unsafe(method(initWithLocalizedName:streamID:direction:clockType:source:))]
476        #[unsafe(method_family = init)]
477        pub unsafe fn initWithLocalizedName_streamID_direction_clockType_source(
478            this: Allocated<Self>,
479            localized_name: &NSString,
480            stream_id: &NSUUID,
481            direction: CMIOExtensionStreamDirection,
482            clock_type: CMIOExtensionStreamClockType,
483            source: &ProtocolObject<dyn CMIOExtensionStreamSource>,
484        ) -> Retained<Self>;
485
486        #[cfg(feature = "CMIOExtensionProperties")]
487        /// Initialize a stream instance.
488        ///
489        /// Parameter `localizedName`: The localized name of the stream.
490        ///
491        /// Parameter `streamID`: The stream identifier.
492        ///
493        /// Parameter `direction`: The stream direction.
494        ///
495        /// Parameter `customClockConfiguration`: A CMIOExtensionStreamCustomClockConfiguration object that defines the custom clock configuration.
496        ///
497        /// Parameter `source`: The stream source.
498        ///
499        /// Returns: A CMIOExtensionStream instance that provides data.
500        #[unsafe(method(initWithLocalizedName:streamID:direction:customClockConfiguration:source:))]
501        #[unsafe(method_family = init)]
502        pub unsafe fn initWithLocalizedName_streamID_direction_customClockConfiguration_source(
503            this: Allocated<Self>,
504            localized_name: &NSString,
505            stream_id: &NSUUID,
506            direction: CMIOExtensionStreamDirection,
507            custom_clock_configuration: &CMIOExtensionStreamCustomClockConfiguration,
508            source: &ProtocolObject<dyn CMIOExtensionStreamSource>,
509        ) -> Retained<Self>;
510
511        /// The localized name of the stream.
512        #[unsafe(method(localizedName))]
513        #[unsafe(method_family = none)]
514        pub unsafe fn localizedName(&self) -> Retained<NSString>;
515
516        /// The stream identifier.
517        #[unsafe(method(streamID))]
518        #[unsafe(method_family = none)]
519        pub unsafe fn streamID(&self) -> Retained<NSUUID>;
520
521        /// The stream direction.
522        #[unsafe(method(direction))]
523        #[unsafe(method_family = none)]
524        pub unsafe fn direction(&self) -> CMIOExtensionStreamDirection;
525
526        /// The stream clock type.
527        ///
528        /// If the stream was specified with a custom clock configuration, the returned value will be CMIOExtensionStreamClockTypeCustom.
529        #[unsafe(method(clockType))]
530        #[unsafe(method_family = none)]
531        pub unsafe fn clockType(&self) -> CMIOExtensionStreamClockType;
532
533        #[cfg(feature = "CMIOExtensionProperties")]
534        /// Custom clock configuration.
535        ///
536        /// If the stream was specified using a clockType, the returned value will be nil.
537        #[unsafe(method(customClockConfiguration))]
538        #[unsafe(method_family = none)]
539        pub unsafe fn customClockConfiguration(
540            &self,
541        ) -> Option<Retained<CMIOExtensionStreamCustomClockConfiguration>>;
542
543        /// The stream source.
544        #[unsafe(method(source))]
545        #[unsafe(method_family = none)]
546        pub unsafe fn source(
547            &self,
548        ) -> Option<Retained<ProtocolObject<dyn CMIOExtensionStreamSource>>>;
549
550        #[cfg(feature = "CMIOExtensionProperties")]
551        /// The array of streaming clients.
552        ///
553        /// This property is key-value observable.
554        #[unsafe(method(streamingClients))]
555        #[unsafe(method_family = none)]
556        pub unsafe fn streamingClients(&self) -> Retained<NSArray<CMIOExtensionClient>>;
557
558        #[cfg(feature = "CMIOExtensionProperties")]
559        /// Notify client(s) of stream properties changes.
560        ///
561        /// Parameter `propertyStates`: The dictionary of properties having changed.
562        ///
563        /// # Safety
564        ///
565        /// `property_states` generic generic should be of the correct type.
566        #[unsafe(method(notifyPropertiesChanged:))]
567        #[unsafe(method_family = none)]
568        pub unsafe fn notifyPropertiesChanged(
569            &self,
570            property_states: &NSDictionary<CMIOExtensionProperty, CMIOExtensionPropertyState>,
571        );
572
573        #[cfg(feature = "objc2-core-media")]
574        /// Send media sample to client(s).
575        ///
576        /// Parameter `sampleBuffer`: The sample buffer containing media data.
577        ///
578        /// Parameter `discontinuity`: The discontinuity flag indicating if the sample buffer represents a discontinuity boundary.
579        ///
580        /// Parameter `hostTimeInNanoseconds`: The host time in nanoseconds when the buffer was captured.
581        ///
582        /// The sample will be deliver to clients whose media type authorization status is authorized.
583        /// The sample buffer timestamps should be relative to the clock timebase specified with clockType.
584        /// Attempting to send a sample buffer on a sink stream will throw an exception.
585        #[unsafe(method(sendSampleBuffer:discontinuity:hostTimeInNanoseconds:))]
586        #[unsafe(method_family = none)]
587        pub unsafe fn sendSampleBuffer_discontinuity_hostTimeInNanoseconds(
588            &self,
589            sample_buffer: &CMSampleBuffer,
590            discontinuity: CMIOExtensionStreamDiscontinuityFlags,
591            host_time_in_nanoseconds: u64,
592        );
593
594        #[cfg(all(
595            feature = "CMIOExtensionProperties",
596            feature = "block2",
597            feature = "objc2-core-media"
598        ))]
599        /// Consume a sample buffer from a client.
600        ///
601        /// Parameter `client`: The client.
602        ///
603        /// Parameter `completionHandler`: A block that will be called when the operation is completed.
604        /// If the capture request is successful, the "sampleBuffer" parameter contains a valid CMSampleBuffer, the "sampleBufferSequenceNumber" parameter is the sample buffer sequence number,
605        /// the "discontinuity" parameter is the discontinuity flag, the "hasMoreSampleBuffers" parameter indicates whether or not more sample buffers are available, the "error" parameter is nil.
606        #[unsafe(method(consumeSampleBufferFromClient:completionHandler:))]
607        #[unsafe(method_family = none)]
608        pub unsafe fn consumeSampleBufferFromClient_completionHandler(
609            &self,
610            client: &CMIOExtensionClient,
611            completion_handler: &block2::DynBlock<
612                dyn Fn(
613                    *mut CMSampleBuffer,
614                    u64,
615                    CMIOExtensionStreamDiscontinuityFlags,
616                    Bool,
617                    *mut NSError,
618                ),
619            >,
620        );
621
622        #[cfg(feature = "CMIOExtensionProperties")]
623        /// Notify client(s) when a particular buffer was output.
624        ///
625        /// Parameter `scheduledOutput`: The stream scheduled output.
626        #[unsafe(method(notifyScheduledOutputChanged:))]
627        #[unsafe(method_family = none)]
628        pub unsafe fn notifyScheduledOutputChanged(
629            &self,
630            scheduled_output: &CMIOExtensionScheduledOutput,
631        );
632    );
633}