objc2_core_media_io/generated/CMIOSampleBuffer.rs
1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4#[cfg(feature = "objc2-core-foundation")]
5use objc2_core_foundation::*;
6#[cfg(feature = "objc2-core-media")]
7use objc2_core_media::*;
8#[cfg(feature = "objc2-core-video")]
9use objc2_core_video::*;
10
11use crate::*;
12
13/// [Apple's documentation](https://developer.apple.com/documentation/coremediaio/kcmioinvalidsequencenumber?language=objc)
14pub const kCMIOInvalidSequenceNumber: c_uint = !(0);
15/// [Apple's documentation](https://developer.apple.com/documentation/coremediaio/kcmiosamplebuffernodiscontinuities?language=objc)
16pub const kCMIOSampleBufferNoDiscontinuities: c_uint = 0;
17/// [Apple's documentation](https://developer.apple.com/documentation/coremediaio/kcmiosamplebufferdiscontinuityflag_unknowndiscontinuity?language=objc)
18pub const kCMIOSampleBufferDiscontinuityFlag_UnknownDiscontinuity: c_uint = 1 << 0;
19/// [Apple's documentation](https://developer.apple.com/documentation/coremediaio/kcmiosamplebufferdiscontinuityflag_timecodediscontinuity?language=objc)
20pub const kCMIOSampleBufferDiscontinuityFlag_TimecodeDiscontinuity: c_uint = 1 << 1;
21/// [Apple's documentation](https://developer.apple.com/documentation/coremediaio/kcmiosamplebufferdiscontinuityflag_packeterror?language=objc)
22pub const kCMIOSampleBufferDiscontinuityFlag_PacketError: c_uint = 1 << 2;
23/// [Apple's documentation](https://developer.apple.com/documentation/coremediaio/kcmiosamplebufferdiscontinuityflag_streamdiscontinuity?language=objc)
24pub const kCMIOSampleBufferDiscontinuityFlag_StreamDiscontinuity: c_uint = 1 << 3;
25/// [Apple's documentation](https://developer.apple.com/documentation/coremediaio/kcmiosamplebufferdiscontinuityflag_malformeddata?language=objc)
26pub const kCMIOSampleBufferDiscontinuityFlag_MalformedData: c_uint = 1 << 4;
27/// [Apple's documentation](https://developer.apple.com/documentation/coremediaio/kcmiosamplebufferdiscontinuityflag_datawasflushed?language=objc)
28pub const kCMIOSampleBufferDiscontinuityFlag_DataWasFlushed: c_uint = 1 << 5;
29/// [Apple's documentation](https://developer.apple.com/documentation/coremediaio/kcmiosamplebufferdiscontinuityflag_datawasdropped?language=objc)
30pub const kCMIOSampleBufferDiscontinuityFlag_DataWasDropped: c_uint = 1 << 6;
31/// [Apple's documentation](https://developer.apple.com/documentation/coremediaio/kcmiosamplebufferdiscontinuityflag_bufferoverrun?language=objc)
32pub const kCMIOSampleBufferDiscontinuityFlag_BufferOverrun: c_uint = 1 << 7;
33/// [Apple's documentation](https://developer.apple.com/documentation/coremediaio/kcmiosamplebufferdiscontinuityflag_discontinuityindts?language=objc)
34pub const kCMIOSampleBufferDiscontinuityFlag_DiscontinuityInDTS: c_uint = 1 << 8;
35/// [Apple's documentation](https://developer.apple.com/documentation/coremediaio/kcmiosamplebufferdiscontinuityflag_relatedtodiscontinuity?language=objc)
36pub const kCMIOSampleBufferDiscontinuityFlag_RelatedToDiscontinuity: c_uint = 1 << 9;
37/// (as in another picture in the same MPEG-2
38/// GOP) exhibits a discontinuity.
39///
40/// See also [Apple's documentation](https://developer.apple.com/documentation/coremediaio/kcmiosamplebufferdiscontinuityflag_clientsyncdiscontinuity?language=objc)
41pub const kCMIOSampleBufferDiscontinuityFlag_ClientSyncDiscontinuity: c_uint = 1 << 10;
42/// as a way of syncronizing the graph to
43/// a known state.
44///
45/// See also [Apple's documentation](https://developer.apple.com/documentation/coremediaio/kcmiosamplebufferdiscontinuityflag_trickplay?language=objc)
46pub const kCMIOSampleBufferDiscontinuityFlag_TrickPlay: c_uint = 1 << 11;
47/// [Apple's documentation](https://developer.apple.com/documentation/coremediaio/kcmiosamplebufferdiscontinuityflag_nodatamarker?language=objc)
48pub const kCMIOSampleBufferDiscontinuityFlag_NoDataMarker: c_uint = 1 << 12;
49/// the graph if the source has no data (for example
50/// an HDV camera running on empty tape).
51///
52/// See also [Apple's documentation](https://developer.apple.com/documentation/coremediaio/kcmiosamplebufferdiscontinuityflag_dataformatchanged?language=objc)
53pub const kCMIOSampleBufferDiscontinuityFlag_DataFormatChanged: c_uint = 1 << 13;
54/// [Apple's documentation](https://developer.apple.com/documentation/coremediaio/kcmiosamplebufferdiscontinuityflag_timingreferencejumped?language=objc)
55pub const kCMIOSampleBufferDiscontinuityFlag_TimingReferenceJumped: c_uint = 1 << 14;
56/// [Apple's documentation](https://developer.apple.com/documentation/coremediaio/kcmiosamplebufferdiscontinuityflag_durationwasextended?language=objc)
57pub const kCMIOSampleBufferDiscontinuityFlag_DurationWasExtended: c_uint = 1 << 15;
58/// by increasing the duration of known good media; this is a "soft"
59/// discontinuity, much like kCMIOSampleBufferDiscontinuityFlag_TimecodeDiscontinuity,
60/// meaning that the stream isn't necessarily broken, but clients might want to force
61/// capture of all media.
62///
63/// See also [Apple's documentation](https://developer.apple.com/documentation/coremediaio/kcmiosamplebufferdiscontinuityflag_sleepwakecycle?language=objc)
64pub const kCMIOSampleBufferDiscontinuityFlag_SleepWakeCycle: c_uint = 1 << 16;
65/// [Apple's documentation](https://developer.apple.com/documentation/coremediaio/kcmiosamplebufferdiscontinuityflag_codecsettingschanged?language=objc)
66pub const kCMIOSampleBufferDiscontinuityFlag_CodecSettingsChanged: c_uint = 1 << 17;
67
68/// [Apple's documentation](https://developer.apple.com/documentation/coremediaio/kcmiosamplebuffernodataevent_unknown?language=objc)
69pub const kCMIOSampleBufferNoDataEvent_Unknown: c_uint = 0;
70/// [Apple's documentation](https://developer.apple.com/documentation/coremediaio/kcmiosamplebuffernodataevent_nomedia?language=objc)
71pub const kCMIOSampleBufferNoDataEvent_NoMedia: c_uint = 1;
72/// [Apple's documentation](https://developer.apple.com/documentation/coremediaio/kcmiosamplebuffernodataevent_devicedidnotsync?language=objc)
73pub const kCMIOSampleBufferNoDataEvent_DeviceDidNotSync: c_uint = 2;
74/// [Apple's documentation](https://developer.apple.com/documentation/coremediaio/kcmiosamplebuffernodataevent_deviceinwrongmode?language=objc)
75pub const kCMIOSampleBufferNoDataEvent_DeviceInWrongMode: c_uint = 3;
76/// [Apple's documentation](https://developer.apple.com/documentation/coremediaio/kcmiosamplebuffernodataevent_processingerror?language=objc)
77pub const kCMIOSampleBufferNoDataEvent_ProcessingError: c_uint = 4;
78/// [Apple's documentation](https://developer.apple.com/documentation/coremediaio/kcmiosamplebuffernodataevent_sleepwakecycle?language=objc)
79pub const kCMIOSampleBufferNoDataEvent_SleepWakeCycle: c_uint = 5;
80
81extern "C" {
82 /// A CFNumber of kCFNumberSInt32Type. The discontinuity flags
83 /// are used to denote that the given buffer represents a
84 /// discontinuity in a stream of buffers. Its various values
85 /// are defined in CMIOTypes.h.
86 ///
87 /// See also [Apple's documentation](https://developer.apple.com/documentation/coremediaio/kcmiosamplebufferattachmentkey_discontinuityflags?language=objc)
88 #[cfg(feature = "objc2-core-foundation")]
89 pub static kCMIOSampleBufferAttachmentKey_DiscontinuityFlags: Option<&'static CFString>;
90}
91
92extern "C" {
93 /// A CFNumber of kCFNumberSInt64Type. Provides a number that
94 /// increments monotonically for every buffer of a given stream;
95 /// it can be inquired upon and used to detect gaps in the
96 /// stream (for example, a buffer was dropped somewhere will
97 /// reveil itself by a gap in the sequence of sequence numbers).
98 ///
99 /// See also [Apple's documentation](https://developer.apple.com/documentation/coremediaio/kcmiosamplebufferattachmentkey_sequencenumber?language=objc)
100 #[cfg(feature = "objc2-core-foundation")]
101 pub static kCMIOSampleBufferAttachmentKey_SequenceNumber: Option<&'static CFString>;
102}
103
104extern "C" {
105 /// An AVS::HDV1PackData structure, as defined by AVC Video Services.
106 /// Attached to video MPEG-2 video buffers that came from a transmit
107 /// stream that had HDV-1 Pack data.
108 ///
109 /// See also [Apple's documentation](https://developer.apple.com/documentation/coremediaio/kcmiosamplebufferattachmentkey_hdv1_packdata?language=objc)
110 #[cfg(feature = "objc2-core-foundation")]
111 pub static kCMIOSampleBufferAttachmentKey_HDV1_PackData: Option<&'static CFString>;
112}
113
114extern "C" {
115 /// An AVS::HDV2VideoFramePack structure, as defined by AVC Video
116 /// Services. Attached to video MPEG-2 video buffers that came from
117 /// a transmit stream that had HDV-2 VAUX data.
118 ///
119 /// See also [Apple's documentation](https://developer.apple.com/documentation/coremediaio/kcmiosamplebufferattachmentkey_hdv2_vaux?language=objc)
120 #[cfg(feature = "objc2-core-foundation")]
121 pub static kCMIOSampleBufferAttachmentKey_HDV2_VAUX: Option<&'static CFString>;
122}
123
124extern "C" {
125 /// A CFData that contains a CoreAudio AudioTimeStamp structure, as
126 /// defined CoreAudioTypes.h. Attached to buffers provided by
127 /// CoreAudio devices.
128 ///
129 /// See also [Apple's documentation](https://developer.apple.com/documentation/coremediaio/kcmiosamplebufferattachmentkey_caaudiotimestamp?language=objc)
130 #[cfg(feature = "objc2-core-foundation")]
131 pub static kCMIOSampleBufferAttachmentKey_CAAudioTimeStamp: Option<&'static CFString>;
132}
133
134extern "C" {
135 /// A CFData that contains CoreAudio SMPTETime structure, as defined
136 /// CoreAudioTypes.h. Attached to buffers that have an associated
137 /// SMPTE time.
138 ///
139 /// See also [Apple's documentation](https://developer.apple.com/documentation/coremediaio/kcmiosamplebufferattachmentkey_smptetime?language=objc)
140 #[cfg(feature = "objc2-core-foundation")]
141 pub static kCMIOSampleBufferAttachmentKey_SMPTETime: Option<&'static CFString>;
142}
143
144extern "C" {
145 /// A CFNumber of kCFNumberSInt32Type. Attached to buffers that are
146 /// associated with a SMPTE timecode that increments at a rate that
147 /// is not the rate represented by the buffer. For example, a buffer
148 /// might contain 24P video that is associated with a 30FPS SMPTE
149 /// timecode; as the SMPTE timecodes are viewed as a stream, there
150 /// will be gaps. This attachment allows for an annotation to the
151 /// buffer that will not include gaps. Buffer clients interested in
152 /// looking for gaps in the SMPTE timecode can inquire about this
153 /// property, and if it exists, check to see that it increments
154 /// monotonically.
155 ///
156 /// See also [Apple's documentation](https://developer.apple.com/documentation/coremediaio/kcmiosamplebufferattachmentkey_nativesmpteframecount?language=objc)
157 #[cfg(feature = "objc2-core-foundation")]
158 pub static kCMIOSampleBufferAttachmentKey_NativeSMPTEFrameCount: Option<&'static CFString>;
159}
160
161extern "C" {
162 /// A CFNumber of kCFNumberSInt32Type. Attached to buffers containing
163 /// an MPEG-2 transmit stream that was contains multiplexed video frames.
164 /// It specifies how many video frames are represented by the buffer.
165 ///
166 /// See also [Apple's documentation](https://developer.apple.com/documentation/coremediaio/kcmiosamplebufferattachmentkey_numberofvideoframesinbuffer?language=objc)
167 #[cfg(feature = "objc2-core-foundation")]
168 pub static kCMIOSampleBufferAttachmentKey_NumberOfVideoFramesInBuffer:
169 Option<&'static CFString>;
170}
171
172extern "C" {
173 /// A CFNumber of kCFNumberSInt32Type. Attached to buffers containing
174 /// an MPEG-2 video I-Frame that is being multiplexed with audio for
175 /// output. It specifies how many frames are contained in the GOP
176 /// that is started by the I-Frame.
177 ///
178 /// See also [Apple's documentation](https://developer.apple.com/documentation/coremediaio/kcmiosamplebufferattachmentkey_numberofvideoframesingop?language=objc)
179 #[cfg(feature = "objc2-core-foundation")]
180 pub static kCMIOSampleBufferAttachmentKey_NumberOfVideoFramesInGOP: Option<&'static CFString>;
181}
182
183extern "C" {
184 /// A CFDictionary that is a serialized CMTime. Attached to buffers
185 /// of multiplexed data, and indicates a presentation timestamp for
186 /// the muxed data that is based on the source data. Typically used
187 /// to drive the clock abstraction for an output device in order to
188 /// provide a preview of the source data.
189 ///
190 /// See also [Apple's documentation](https://developer.apple.com/documentation/coremediaio/kcmiosamplebufferattachmentkey_muxedsourcepresentationtimestamp?language=objc)
191 #[cfg(feature = "objc2-core-foundation")]
192 pub static kCMIOSampleBufferAttachmentKey_MuxedSourcePresentationTimeStamp:
193 Option<&'static CFString>;
194}
195
196extern "C" {
197 /// A CFNumber of kCFNumberSInt64Type. Attached to buffers that are
198 /// associated with a realtime source or destination that is related
199 /// to the CPU's hosttime in nanoseconds.
200 ///
201 /// See also [Apple's documentation](https://developer.apple.com/documentation/coremediaio/kcmiosamplebufferattachmentkey_hosttime?language=objc)
202 #[cfg(feature = "objc2-core-foundation")]
203 pub static kCMIOSampleBufferAttachmentKey_HostTime: Option<&'static CFString>;
204}
205
206extern "C" {
207 /// A CFBoolean. Attached to buffers (and having the value
208 /// kCFBooleanTrue) if the contents of that buffer is identical
209 /// to the previous buffer in its stream.
210 ///
211 /// See also [Apple's documentation](https://developer.apple.com/documentation/coremediaio/kcmiosamplebufferattachmentkey_repeatedbuffercontents?language=objc)
212 #[cfg(feature = "objc2-core-foundation")]
213 pub static kCMIOSampleBufferAttachmentKey_RepeatedBufferContents: Option<&'static CFString>;
214}
215
216extern "C" {
217 /// A CMFormatDescription. Audio buffers traveling through a
218 /// CMIO graph may be converted, mixed, or otherwise transformed.
219 /// Downstream units may still desire to know the source format
220 /// from which an audio buffer was derived. Units dealing with
221 /// audio data should propagate this attachment if it is present.
222 ///
223 /// See also [Apple's documentation](https://developer.apple.com/documentation/coremediaio/kcmiosamplebufferattachmentkey_sourceaudioformatdescription?language=objc)
224 #[cfg(feature = "objc2-core-foundation")]
225 pub static kCMIOSampleBufferAttachmentKey_SourceAudioFormatDescription:
226 Option<&'static CFString>;
227}
228
229extern "C" {
230 /// A CMIOPulldownCadenceInfo. Video buffers may come from a source
231 /// that has been pulled down (for example, 24p buffers recorded at
232 /// 30p). These buffers can use this attachment to specify where
233 /// this buffer falls in the cadence.
234 ///
235 /// See also [Apple's documentation](https://developer.apple.com/documentation/coremediaio/kcmiosamplebufferattachmentkey_pulldowncadenceinfo?language=objc)
236 #[cfg(feature = "objc2-core-foundation")]
237 pub static kCMIOSampleBufferAttachmentKey_PulldownCadenceInfo: Option<&'static CFString>;
238}
239
240extern "C" {
241 /// A CMSampleBuffer. Video buffers with associated closed caption
242 /// data may attach the data as a CMSampleBuffer. This technique
243 /// is used by the CMIO VDIG input unit if closed caption data
244 /// is available for the current video frame.
245 ///
246 /// See also [Apple's documentation](https://developer.apple.com/documentation/coremediaio/kcmiosamplebufferattachmentkey_closedcaptionsamplebuffer?language=objc)
247 #[cfg(feature = "objc2-core-foundation")]
248 pub static kCMIOSampleBufferAttachmentKey_ClosedCaptionSampleBuffer: Option<&'static CFString>;
249}
250
251extern "C" {
252 /// A CF obect. Attached to buffers output from units that
253 /// support kCMIOUnitProperty_ClientSequenceID.
254 ///
255 /// See also [Apple's documentation](https://developer.apple.com/documentation/coremediaio/kcmiosamplebufferattachmentkey_clientsequenceid?language=objc)
256 #[cfg(feature = "objc2-core-foundation")]
257 pub static kCMIOSampleBufferAttachmentKey_ClientSequenceID: Option<&'static CFString>;
258}
259
260extern "C" {
261 /// A CFDictionary. Screen capture buffers will have this
262 /// attachment so that clients can have some information
263 /// as to the approximate state of the mouse and keyboard
264 /// modifiers when the screen was captured. The following
265 /// keys will be present in the buffer:
266 ///
267 /// kCMIOSampleBufferAttachment_MouseAndKeyboardModifiersKey_CursorPositionX
268 /// kCMIOSampleBufferAttachment_MouseAndKeyboardModifiersKey_CursorPositionY
269 /// kCMIOSampleBufferAttachment_MouseAndKeyboardModifiersKey_MouseButtonState
270 /// kCMIOSampleBufferAttachment_MouseAndKeyboardModifiersKey_CursorIsVisible
271 /// kCMIOSampleBufferAttachment_MouseAndKeyboardModifiersKey_CursorFrameRect
272 /// kCMIOSampleBufferAttachment_MouseAndKeyboardModifiersKey_CursorReference
273 /// kCMIOSampleBufferAttachment_MouseAndKeyboardModifiersKey_CursorScale
274 /// kCMIOSampleBufferAttachment_MouseAndKeyboardModifiersKey_KeyboardModifiers
275 /// kCMIOSampleBufferAttachment_MouseAndKeyboardModifiersKey_KeyboardModifiersEvent
276 ///
277 /// See also [Apple's documentation](https://developer.apple.com/documentation/coremediaio/kcmiosamplebufferattachmentkey_mouseandkeyboardmodifiers?language=objc)
278 #[cfg(feature = "objc2-core-foundation")]
279 pub static kCMIOSampleBufferAttachmentKey_MouseAndKeyboardModifiers: Option<&'static CFString>;
280}
281
282extern "C" {
283 /// Used to look up a CFNumber from the CFDictionary specified by
284 /// kCMIOSampleBufferAttachmentKey_MouseAndKeyboardModifiers. It specifies
285 /// the approximate X coordinate of the cursor hotspot when the screen was
286 /// captured (in the cursor’s flipped coordinate system, origin is the top left of the display and not relative to the capture area).
287 ///
288 /// See also [Apple's documentation](https://developer.apple.com/documentation/coremediaio/kcmiosamplebufferattachment_mouseandkeyboardmodifierskey_cursorpositionx?language=objc)
289 #[cfg(feature = "objc2-core-foundation")]
290 pub static kCMIOSampleBufferAttachment_MouseAndKeyboardModifiersKey_CursorPositionX:
291 Option<&'static CFString>;
292}
293
294extern "C" {
295 /// Used to look up a CFNumber from the CFDictionary specified by
296 /// kCMIOSampleBufferAttachmentKey_MouseAndKeyboardModifiers. It specifies
297 /// the approximate Y coordinate of the cursor hotspot when the screen was
298 /// captured (in the cursor’s flipped coordinate system, origin is the top left of the display and not relative to the capture area).
299 ///
300 /// See also [Apple's documentation](https://developer.apple.com/documentation/coremediaio/kcmiosamplebufferattachment_mouseandkeyboardmodifierskey_cursorpositiony?language=objc)
301 #[cfg(feature = "objc2-core-foundation")]
302 pub static kCMIOSampleBufferAttachment_MouseAndKeyboardModifiersKey_CursorPositionY:
303 Option<&'static CFString>;
304}
305
306extern "C" {
307 /// Used to look up a CFNumber from the CFDictionary specified by
308 /// kCMIOSampleBufferAttachmentKey_MouseAndKeyboardModifiers. It specifies
309 /// the approximate state of the mouse buttons when the screen was
310 /// captured.
311 ///
312 /// See also [Apple's documentation](https://developer.apple.com/documentation/coremediaio/kcmiosamplebufferattachment_mouseandkeyboardmodifierskey_mousebuttonstate?language=objc)
313 #[cfg(feature = "objc2-core-foundation")]
314 pub static kCMIOSampleBufferAttachment_MouseAndKeyboardModifiersKey_MouseButtonState:
315 Option<&'static CFString>;
316}
317
318extern "C" {
319 /// Used to look up a CFBoolean from the CFDictionary specified by
320 /// kCMIOSampleBufferAttachmentKey_MouseAndKeyboardModifiers. It specifies
321 /// the visibility of the mouse cursor when the screen was
322 /// captured.
323 ///
324 /// See also [Apple's documentation](https://developer.apple.com/documentation/coremediaio/kcmiosamplebufferattachment_mouseandkeyboardmodifierskey_cursorisvisible?language=objc)
325 #[cfg(feature = "objc2-core-foundation")]
326 pub static kCMIOSampleBufferAttachment_MouseAndKeyboardModifiersKey_CursorIsVisible:
327 Option<&'static CFString>;
328}
329
330extern "C" {
331 /// Used to look up a CFDictionary representation of a CGRect from the CFDictionary specified by
332 /// kCMIOSampleBufferAttachmentKey_MouseAndKeyboardModifiers. It specifies
333 /// the frame CGRect as dictionary of the cursor when the screen was captured relative to the capture area.
334 /// The origin is at the lower left of the capture area.
335 ///
336 /// See also [Apple's documentation](https://developer.apple.com/documentation/coremediaio/kcmiosamplebufferattachment_mouseandkeyboardmodifierskey_cursorframerect?language=objc)
337 #[cfg(feature = "objc2-core-foundation")]
338 pub static kCMIOSampleBufferAttachment_MouseAndKeyboardModifiersKey_CursorFrameRect:
339 Option<&'static CFString>;
340}
341
342extern "C" {
343 /// Used to look up a NSCursor reference from the CFDictionary specified by
344 /// kCMIOSampleBufferAttachmentKey_MouseAndKeyboardModifiers. It specifies
345 /// the NSCursor when the screen was captured.
346 ///
347 /// See also [Apple's documentation](https://developer.apple.com/documentation/coremediaio/kcmiosamplebufferattachment_mouseandkeyboardmodifierskey_cursorreference?language=objc)
348 #[cfg(feature = "objc2-core-foundation")]
349 pub static kCMIOSampleBufferAttachment_MouseAndKeyboardModifiersKey_CursorReference:
350 Option<&'static CFString>;
351}
352
353extern "C" {
354 /// Used to look up the cursor seed value from the CFDictionary specified by
355 /// kCMIOSampleBufferAttachmentKey_MouseAndKeyboardModifiers. It specifies
356 /// the CFNumber of the seed value for the cursor referenced by
357 /// kCMIOSampleBufferAttachment_MouseAndKeyboardModifiersKey_CursorReference;
358 /// changes in this number reflect that the cursor has changed.
359 ///
360 /// See also [Apple's documentation](https://developer.apple.com/documentation/coremediaio/kcmiosamplebufferattachment_mouseandkeyboardmodifierskey_cursorseed?language=objc)
361 #[cfg(feature = "objc2-core-foundation")]
362 pub static kCMIOSampleBufferAttachment_MouseAndKeyboardModifiersKey_CursorSeed:
363 Option<&'static CFString>;
364}
365
366extern "C" {
367 /// Used to look up a CFNumber from the CFDictionary specified by
368 /// kCMIOSampleBufferAttachmentKey_MouseAndKeyboardModifiers. It specifies
369 /// the cursor scaling when the screen was captured.
370 ///
371 /// See also [Apple's documentation](https://developer.apple.com/documentation/coremediaio/kcmiosamplebufferattachment_mouseandkeyboardmodifierskey_cursorscale?language=objc)
372 #[cfg(feature = "objc2-core-foundation")]
373 pub static kCMIOSampleBufferAttachment_MouseAndKeyboardModifiersKey_CursorScale:
374 Option<&'static CFString>;
375}
376
377extern "C" {
378 /// Used to look up a CFBoolean from the CFDictionary specified by
379 /// kCMIOSampleBufferAttachmentKey_MouseAndKeyboardModifiers. It specifies
380 /// if the cursor is being drawn at the display level when the screen was
381 /// captured (if TRUE, the CursorFrameRect may not represent accurately the frame CGRect of the cursor image being drawn).
382 ///
383 /// See also [Apple's documentation](https://developer.apple.com/documentation/coremediaio/kcmiosamplebufferattachment_mouseandkeyboardmodifierskey_cursorisdrawninframebuffer?language=objc)
384 #[cfg(feature = "objc2-core-foundation")]
385 pub static kCMIOSampleBufferAttachment_MouseAndKeyboardModifiersKey_CursorIsDrawnInFramebuffer:
386 Option<&'static CFString>;
387}
388
389extern "C" {
390 /// Used to look up a CFNumber from the CFDictionary specified by
391 /// kCMIOSampleBufferAttachmentKey_MouseAndKeyboardModifiers. It specifies
392 /// the approximate state of the keyboard modifiers when the screen was
393 /// captured.
394 ///
395 /// See also [Apple's documentation](https://developer.apple.com/documentation/coremediaio/kcmiosamplebufferattachment_mouseandkeyboardmodifierskey_keyboardmodifiers?language=objc)
396 #[cfg(feature = "objc2-core-foundation")]
397 pub static kCMIOSampleBufferAttachment_MouseAndKeyboardModifiersKey_KeyboardModifiers:
398 Option<&'static CFString>;
399}
400
401extern "C" {
402 /// Used to look up a CFNumber from the CFDictionary specified by
403 /// kCMIOSampleBufferAttachmentKey_MouseAndKeyboardModifiers. It specifies
404 /// the approximate state of the keyboard modifiers when the screen was
405 /// captured as define in NSEvent.
406 ///
407 /// See also [Apple's documentation](https://developer.apple.com/documentation/coremediaio/kcmiosamplebufferattachment_mouseandkeyboardmodifierskey_keyboardmodifiersevent?language=objc)
408 #[cfg(feature = "objc2-core-foundation")]
409 pub static kCMIOSampleBufferAttachment_MouseAndKeyboardModifiersKey_KeyboardModifiersEvent:
410 Option<&'static CFString>;
411}
412
413extern "C" {
414 /// A CFBoolean indicating that the underlying pixel buffer has been overlaid by a static image.
415 /// If this attachement exists it will contain the value kCFBooleanTrue indicating a static image overlay. Otherwise the pixel buffer has not been overlaid.
416 ///
417 /// See also [Apple's documentation](https://developer.apple.com/documentation/coremediaio/kcmiosamplebufferattachmentkey_pixelbufferoverlaidbystaticimage?language=objc)
418 #[cfg(feature = "objc2-core-foundation")]
419 pub static kCMIOSampleBufferAttachmentKey_PixelBufferOverlaidByStaticImage:
420 Option<&'static CFString>;
421}
422
423extern "C" {
424 /// A CFNumber of kCFNumberSInt32Type. Attached to buffers representing
425 /// that a device has stopped returning data. The value of this attachment
426 /// is the same as for the discontinuity flags.
427 ///
428 /// See also [Apple's documentation](https://developer.apple.com/documentation/coremediaio/kcmiosamplebufferattachmentkey_nodatamarker?language=objc)
429 #[cfg(feature = "objc2-core-foundation")]
430 pub static kCMIOSampleBufferAttachmentKey_NoDataMarker: Option<&'static CFString>;
431}
432
433extern "C" {
434 /// A CVPixelBufferRef, as defined by CoreVideo.
435 /// Attached to block buffers that wrap a Core Video Pixel Buffer.
436 ///
437 /// See also [Apple's documentation](https://developer.apple.com/documentation/coremediaio/kcmioblockbufferattachmentkey_cvpixelbufferreference?language=objc)
438 #[cfg(feature = "objc2-core-foundation")]
439 pub static kCMIOBlockBufferAttachmentKey_CVPixelBufferReference: Option<&'static CFString>;
440}
441
442extern "C-unwind" {
443 /// Creates a CoreMedia Sample Buffer that can be used in a CMIO Graph.
444 ///
445 /// While CoreMedia Sample Buffers are used in CMIO Graphs, the breadth
446 /// of their flexibility is not supported. For example, CoreMedia Sample
447 /// Buffers may represent more than one frame of video data; CMIO
448 /// Graphs support only one frame of video per buffer.
449 ///
450 /// All parameters are copied; on return, the caller can release them,
451 /// free them, reuse them or whatever. On return, the caller owns the returned CMSampleBuffer, and
452 /// must release it when done with it.
453 ///
454 /// Example of usage for in-display-order video frames:
455 /// <ul>
456 /// dataBuffer: contains 1 Motion JPEG frame
457 /// <br>
458 /// dataFormatDescription: describes Motion JPEG video
459 /// <br>
460 /// numSamples: 1
461 /// <br>
462 /// numSampleTimingEntries: 1
463 /// <br>
464 /// sampleTimingArray: {duration = 3003/90000, presentationTimeStamp = 0/90000, decodeTimeStamp = invalid }
465 /// <br>
466 /// numSampleSizeEntries = 1
467 /// <br>
468 /// sampleSizeArray: {size of the video frame}
469 /// </ul>
470 /// Example of usage for out-of-display-order video frames:
471 /// <ul>
472 /// dataBuffer: contains 1 HDV frame
473 /// <br>
474 /// dataFormatDescription: describes H.264 video
475 /// <br>
476 /// numSamples: 1
477 /// <br>
478 /// numSampleTimingEntries: 1
479 /// <br>
480 /// sampleTimingArray: {duration = 3003/90000, presentationTimeStamp = 9009/90000, decodeTimeStamp = 3003/90000}
481 /// <br>
482 /// numSampleSizeEntries = 1
483 /// <br>
484 /// sampleSizeArray: {size of the video frame}
485 /// </ul>
486 /// Example of usage for compressed audio:
487 /// <ul>
488 /// dataBuffer: contains 24 compressed AAC packets
489 /// <br>
490 /// dataFormatDescription: describes 44.1kHz AAC audio
491 /// <br>
492 /// numSamples: 24
493 /// <br>
494 /// numSampleTimingEntries: 1
495 /// <br>
496 /// sampleTimingArray: {duration = 1024/44100, presentationTimeStamp = 0/44100, decodeTimeStamp = invalid }
497 /// <br>
498 /// numSampleSizeEntries: 24
499 /// <br>
500 /// sampleSizeArray:
501 /// <ul>
502 /// {191, 183, 208, 213, 202, 206, 209, 206, 204, 192, 202, 277,
503 /// <br>
504 /// 282, 240, 209, 194, 193, 197, 196, 198, 168, 199, 171, 194}
505 /// </ul>
506 /// </ul>
507 /// Example of usage for compressed audio:
508 /// <ul>
509 /// dataBuffer: contains 1 HDV audio packet
510 /// <br>
511 /// dataFormatDescription: describes 48kHz MPEG-1 Layer II audio
512 /// <br>
513 /// numSamples: 1
514 /// <br>
515 /// numSampleTimingEntries: 1
516 /// <br>
517 /// sampleTimingArray: {duration = 2160/90000, presentationTimeStamp = 0/90000, decodeTimeStamp = invalid }
518 /// <br>
519 /// numSampleSizeEntries = 1
520 /// <br>
521 /// sampleSizeArray: {1152}
522 /// </ul>
523 /// Example of usage for uncompressed interleaved audio:
524 /// <ul>
525 /// dataBuffer: contains 24000 uncompressed interleaved stereo frames, each containing 2 Float32s =
526 /// <ul>
527 /// {{L,R},
528 /// <br>
529 /// {L,R},
530 /// <br>
531 /// {L,R}, ...}
532 /// </ul>
533 /// <br>
534 /// dataFormatDescription: describes two-channel 48kHz Float32 interleaved audio
535 /// <br>
536 /// numSamples: 24000
537 /// <br>
538 /// numSampleTimingEntries: 1
539 /// <br>
540 /// sampleTimingArray: {duration = 1/48000, presentationTimeStamp = 0/90000, decodeTimeStamp = invalid }
541 /// <br>
542 /// numSampleSizeEntries: 1
543 /// <br>
544 /// sampleSizeArray: {8}
545 /// </ul>
546 /// Example of usage for uncompressed non-interleaved audio:
547 /// <ul>
548 /// dataBuffer: contains 24000 uncompressed interleaved stereo frames, each containing 2 (non-contiguous) Float32s =
549 /// <ul>
550 /// {{L,L,L,L,L,...},
551 /// <br>
552 /// {R,R,R,R,R,...}}
553 /// </ul>
554 /// <br>
555 /// dataFormatDescription: describes two-channel 48kHz Float32 non-interleaved audio
556 /// <br>
557 /// numSamples: 24000
558 /// <br>
559 /// numSampleTimingEntries: 1
560 /// <br>
561 /// sampleTimingArray: {duration = 1/48000, presentationTimeStamp = 0/90000, decodeTimeStamp = invalid }
562 /// <br>
563 /// numSampleSizeEntries: 0
564 /// <br>
565 /// sampleSizeArray: NULL (because the samples are not contiguous)
566 /// </ul>
567 ///
568 ///
569 /// Returns: Returns paramErr if there is an error in parameters, memFullErr if memory
570 /// could not be allocated, and noErr for success. In addition, errors
571 /// returned by CMSampleBufferCreate() will be passed back.
572 ///
573 /// # Safety
574 ///
575 /// - `allocator` might not allow `None`.
576 /// - `data_buffer` might not allow `None`.
577 /// - `format_description` might not allow `None`.
578 /// - `sample_timing_array` must be a valid pointer.
579 /// - `sample_size_array` must be a valid pointer.
580 /// - `s_buf_out` must be a valid pointer.
581 #[cfg(all(feature = "objc2-core-foundation", feature = "objc2-core-media"))]
582 pub fn CMIOSampleBufferCreate(
583 allocator: Option<&CFAllocator>,
584 data_buffer: Option<&CMBlockBuffer>,
585 format_description: Option<&CMFormatDescription>,
586 num_samples: u32,
587 num_sample_timing_entries: u32,
588 sample_timing_array: *const CMSampleTimingInfo,
589 num_sample_size_entries: u32,
590 sample_size_array: *const usize,
591 sequence_number: u64,
592 discontinuity_flags: u32,
593 s_buf_out: *mut *mut CMSampleBuffer,
594 ) -> OSStatus;
595}
596
597extern "C-unwind" {
598 /// Creates a CMSampleBuffer that can be used in a CMIO Graph, that contains a CVImageBuffer
599 /// instead of a CMBlockBuffer.
600 ///
601 /// This routine is a specialized version of CMIOSampleBufferCreate.
602 /// See the description of that routine for background information.
603 ///
604 /// Unlike a CMBlockBuffer which can reference many samples, a CVImageBuffer is defined to
605 /// reference only one sample; therefore this routine has fewer parameters then
606 /// CMIOSampleBufferCreate.
607 ///
608 /// Sample timing information, which is a vector for CMIOSampleBufferCreate,
609 /// consists of only one value for this routine.
610 ///
611 /// The concept of sample size does not apply to CVImageBuffers. As such, CMSampleBufferGetSampleSizeArray
612 /// will return kCMSampleBufferError_BufferHasNoSampleSizes, and CMSampleBufferGetSampleSize
613 /// will return 0.
614 ///
615 /// Because CVImageBuffers hold visual data, the format description provided is a
616 /// CMVideoFormatDescription. The format description must be consistent with formatting
617 /// information attached to the CVImageBuffer. The width, height, and codecType must match
618 /// (for CVPixelBuffers the codec type is given by CVPixelBufferGetPixelFormatType(pixelBuffer);
619 /// for other CVImageBuffers, the codecType must be 0). The format description extensions must
620 /// match the image buffer attachments for all the keys in the list returned by
621 /// CMVideoFormatDescriptionGetExtensionKeysCommonWithImageBuffers (if absent in either they
622 /// must be absent in both).
623 ///
624 /// # Safety
625 ///
626 /// - `allocator` might not allow `None`.
627 /// - `image_buffer` might not allow `None`.
628 /// - `format_description` might not allow `None`.
629 /// - `sample_timing` must be a valid pointer.
630 /// - `s_buf_out` must be a valid pointer.
631 #[cfg(all(
632 feature = "objc2-core-foundation",
633 feature = "objc2-core-media",
634 feature = "objc2-core-video"
635 ))]
636 pub fn CMIOSampleBufferCreateForImageBuffer(
637 allocator: Option<&CFAllocator>,
638 image_buffer: Option<&CVImageBuffer>,
639 format_description: Option<&CMVideoFormatDescription>,
640 sample_timing: *const CMSampleTimingInfo,
641 sequence_number: u64,
642 discontinuity_flags: u32,
643 s_buf_out: *mut *mut CMSampleBuffer,
644 ) -> OSStatus;
645}
646
647extern "C-unwind" {
648 /// Creates a CMSampleBuffer with no data and one buffer-level special marker attachment that
649 /// denotes that no data is available from the device.
650 ///
651 /// It is often important for elements of a CMIO graph to know that a device has stopped
652 /// sending data. A special buffer can be placed in the stream of buffers processed by the
653 /// Graph so that Units will synchronously get notified that the device has stopped sending
654 /// data.
655 ///
656 ///
657 /// Returns: Returns paramErr if there is an error in parameters, memFullErr if memory
658 /// could not be allocated, and noErr for success.
659 ///
660 /// # Safety
661 ///
662 /// - `allocator` might not allow `None`.
663 /// - `format_description` might not allow `None`.
664 /// - `s_buf_out` must be a valid pointer.
665 #[cfg(all(feature = "objc2-core-foundation", feature = "objc2-core-media"))]
666 pub fn CMIOSampleBufferCreateNoDataMarker(
667 allocator: Option<&CFAllocator>,
668 no_data_event: u32,
669 format_description: Option<&CMFormatDescription>,
670 sequence_number: u64,
671 discontinuity_flags: u32,
672 s_buf_out: *mut *mut CMSampleBuffer,
673 ) -> OSStatus;
674}
675
676extern "C-unwind" {
677 /// Sets the sequence number for a CoreMedia Sample Buffer that is being used in a CMIO Graph.
678 ///
679 /// Sequence numbers are a required attachment to CoreMedia Sample Buffers being used in a
680 /// CMIO Graph. They allow a unit to know the position of a buffer in a sequence of
681 /// buffers, and to look for gaps where data may have been lost. Normally, the sequence
682 /// number starts at 0 and increases by one for each subsequent buffer. As the buffer
683 /// flows through a CMIO Graph, a Unit may have reason to reassign the sequence number
684 /// to a new value. NOTE: in order to prevent memory corruption and other errors,
685 /// this function should only be called if the caller is sure that it has the sole
686 /// reference to the buffer; if this cannot be guarenteed, then the caller should
687 /// first create a copy of the buffer using CMSampleBufferCreateCopy().
688 ///
689 /// # Safety
690 ///
691 /// - `allocator` might not allow `None`.
692 /// - `sbuf` might not allow `None`.
693 #[cfg(all(feature = "objc2-core-foundation", feature = "objc2-core-media"))]
694 pub fn CMIOSampleBufferSetSequenceNumber(
695 allocator: Option<&CFAllocator>,
696 sbuf: Option<&CMSampleBuffer>,
697 sequence_number: u64,
698 );
699}
700
701extern "C-unwind" {
702 /// Returns the sequence number for a CoreMedia Sample Buffer that is being used in a CMIO Graph.
703 ///
704 /// Sequence numbers are a required attachment to CoreMedia Sample Buffers being used in a CMIO Graph.
705 ///
706 ///
707 /// Returns: Returns kCMIOInvalidSequenceNumber if there is an error in parameters, or if no sequence number
708 /// was attached to the buffer.
709 ///
710 /// # Safety
711 ///
712 /// `sbuf` might not allow `None`.
713 #[cfg(feature = "objc2-core-media")]
714 pub fn CMIOSampleBufferGetSequenceNumber(sbuf: Option<&CMSampleBuffer>) -> u64;
715}
716
717extern "C-unwind" {
718 /// Sets the discontinuity flags for a CoreMedia Sample Buffer that is being used in a CMIO Graph.
719 ///
720 /// Discontinuity flags are a required attachment to CoreMedia Sample Buffers being used in a
721 /// CMIO Graph. As the buffer flows through a CMIO Graph, a Unit may detect a discontinuity
722 /// and flag the buffer as having such. NOTE: in order to prevent memory corruption and other
723 /// errors, this function should only be called if the caller is sure that it has the sole
724 /// reference to the buffer; if this cannot be guarenteed, then the caller should first create
725 /// a copy of the buffer using CMSampleBufferCreateCopy().
726 ///
727 /// # Safety
728 ///
729 /// - `allocator` might not allow `None`.
730 /// - `sbuf` might not allow `None`.
731 #[cfg(all(feature = "objc2-core-foundation", feature = "objc2-core-media"))]
732 pub fn CMIOSampleBufferSetDiscontinuityFlags(
733 allocator: Option<&CFAllocator>,
734 sbuf: Option<&CMSampleBuffer>,
735 discontinuity_flags: u32,
736 );
737}
738
739extern "C-unwind" {
740 /// Returns the discontinuity flags for a CoreMedia Sample Buffer that is being used in a CMIO Graph.
741 ///
742 /// Discontinuity flags are a required attachment to CoreMedia Sample Buffers being used in a
743 /// CMIO Graph.
744 ///
745 ///
746 /// Returns: Returns kCMIOSampleBufferDiscontinuityFlag_UnknownDiscontinuity if an error occurs.
747 ///
748 /// # Safety
749 ///
750 /// `sbuf` might not allow `None`.
751 #[cfg(feature = "objc2-core-media")]
752 pub fn CMIOSampleBufferGetDiscontinuityFlags(sbuf: Option<&CMSampleBuffer>) -> u32;
753}
754
755extern "C-unwind" {
756 /// Copies all optional attachments.
757 ///
758 /// This convenience function copies all non-required attachment
759 /// values (i.e., the sequence number and discontinuity flags will not be
760 /// copied).
761 ///
762 ///
763 /// Returns: Returns paramErr if there is an error in parameters, and noErr for success.
764 ///
765 /// # Safety
766 ///
767 /// - `source_s_buf` might not allow `None`.
768 /// - `dest_s_buf` might not allow `None`.
769 #[cfg(feature = "objc2-core-media")]
770 pub fn CMIOSampleBufferCopyNonRequiredAttachments(
771 source_s_buf: Option<&CMSampleBuffer>,
772 dest_s_buf: Option<&CMSampleBuffer>,
773 attachment_mode: CMAttachmentMode,
774 ) -> OSStatus;
775}
776
777extern "C-unwind" {
778 /// Copies sample attachments from the CMSampleBufferGetSampleAttachmentsArray()
779 /// CFArrayRef from the source CMSampleBuffer to the destination
780 /// CMSampleBuffer.
781 ///
782 /// This convenience function copies all sample attachments from the
783 /// source buffer's sample attachments array to the destination buffer's.
784 /// If the source CMSampleBuffer has no sample attachments, nothing
785 /// happens.
786 ///
787 ///
788 /// Returns: Returns paramErr if there is an error in parameters, and noErr for success.
789 ///
790 /// # Safety
791 ///
792 /// - `source_s_buf` might not allow `None`.
793 /// - `dest_s_buf` might not allow `None`.
794 #[cfg(feature = "objc2-core-media")]
795 pub fn CMIOSampleBufferCopySampleAttachments(
796 source_s_buf: Option<&CMSampleBuffer>,
797 dest_s_buf: Option<&CMSampleBuffer>,
798 ) -> OSStatus;
799}