#[repr(C, packed(4))]pub struct CMBufferCallbacks {
pub version: u32,
pub refcon: *mut c_void,
pub getDecodeTimeStamp: CMBufferGetTimeCallback,
pub getPresentationTimeStamp: CMBufferGetTimeCallback,
pub getDuration: CMBufferGetTimeCallback,
pub isDataReady: CMBufferGetBooleanCallback,
pub compare: CMBufferCompareCallback,
pub dataBecameReadyNotification: *const CFString,
pub getSize: CMBufferGetSizeCallback,
}CMBufferQueue and CMTime only.Expand description
Callbacks provided to CMBufferQueueCreate, for use by the queue in interrogating the buffers that it will see.
With the exception of isDataReady, all these callbacks must always return the same result for the same arguments. A buffer’s duration, timestamps, or position relative to other buffers must not appear to change while it is in the queue. Once isDataReady has returned true for a given CMBuffer, it must always return true for that CMBuffer. Durations must always be positive.
See also Apple’s documentation
Fields§
§version: u32Must be 0 or 1.
refcon: *mut c_voidClient refcon to be passed to all callbacks (can be NULL, if the callbacks don’t require it).
getDecodeTimeStamp: CMBufferGetTimeCallbackThis callback is called from CMBufferQueueGetFirstDecodeTimeStamp (once), and from CMBufferQueueGetMinDecodeTimeStamp (multiple times). It should return the decode timestamp of the buffer. If there are multiple samples in the buffer, this callback should return the minimum decode timestamp in the buffer. Can be NULL (CMBufferQueueGetFirstDecodeTimeStamp and CMBufferQueueGetMinDecodeTimeStamp will return kCMTimeInvalid).
getPresentationTimeStamp: CMBufferGetTimeCallbackThis callback is called from CMBufferQueueGetFirstPresentationTimeStamp (once) and from CMBufferQueueGetMinPresentationTimeStamp (multiple times). It should return the presentation timestamp of the buffer. If there are multiple samples in the buffer, this callback should return the minimum presentation timestamp in the buffer. Can be NULL (CMBufferQueueGetFirstPresentationTimeStamp and CMBufferQueueGetMinPresentationTimeStamp will return kCMTimeInvalid).
getDuration: CMBufferGetTimeCallbackThis callback is called (once) during enqueue and dequeue operations to update the total duration of the queue. Must not be NULL.
isDataReady: CMBufferGetBooleanCallbackThis callback is called from CMBufferQueueDequeueIfDataReadyAndRetain, to ask if the buffer that is about to be dequeued is ready. Can be NULL (data will be assumed to be ready).
compare: CMBufferCompareCallbackThis callback is called (multiple times) from CMBufferQueueEnqueue, to perform an insertion sort. Can be NULL (queue will be FIFO).
dataBecameReadyNotification: *const CFStringIf triggers of type kCMBufferQueueTrigger_WhenDataBecomesReady are installed, the queue will listen for this notification on the head buffer. Can be NULL (then the queue won’t listen for it).
getSize: CMBufferGetSizeCallbackThis callback is called (once) during enqueue and dequeue operation to update the total size of the queue. Can be NULL. Ignored if version < 1.
Trait Implementations§
Source§impl Clone for CMBufferCallbacks
impl Clone for CMBufferCallbacks
Source§fn clone(&self) -> CMBufferCallbacks
fn clone(&self) -> CMBufferCallbacks
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CMBufferCallbacks
impl Debug for CMBufferCallbacks
Source§impl Encode for CMBufferCallbacks
Available on crate feature objc2 only.
impl Encode for CMBufferCallbacks
objc2 only.Source§impl PartialEq for CMBufferCallbacks
impl PartialEq for CMBufferCallbacks
Source§impl RefEncode for CMBufferCallbacks
Available on crate feature objc2 only.
impl RefEncode for CMBufferCallbacks
objc2 only.