init
TypeScriptstatic init(object: CMBufferQueue): CMBufferQueueSwift declarationinit(referencing object: CMBufferQueue)class · iOS 4.0+ · SDK 27.1
class CMBufferQueuestatic init(object: CMBufferQueue): CMBufferQueueSwift declarationinit(referencing object: CMBufferQueue)get bufferCount(): numberSwift declarationvar bufferCount: CMItemCount { get }Gets the number of buffers in the queue.
testTrigger(triggerToken: SDKHandle): booleanSwift declarationfunc testTrigger(_ triggerToken: CMBufferQueue.TriggerToken) -> BoolTests whether the trigger condition is true. Whereas the trigger callback will only be called when the condition goes from `false` to `true`, `testTrigger` always returns the condition's current status. The `triggerToken` must be one that has been installed on this queue. - Parameter triggerToken: Trigger to test.
get isAtEndOfData(): booleanSwift declarationvar isAtEndOfData: Bool { get }Returns whether or not the `CMBufferQueue` has been marked with EOD, and is now empty.
markEndOfData(): voidSwift declarationfunc markEndOfData() throwsMarks the `CMBufferQueue` with EOD. All subsequent enqueues will be rejected until `reset()` is called. Subsequent dequeues will succeed as long as the queue is not empty.
removeTrigger(triggerToken: SDKHandle): voidSwift declarationfunc removeTrigger(_ triggerToken: CMBufferQueue.TriggerToken) throwsRemoves a previously installed trigger. Triggers will automatically be removed when a queue is finalized. However, if more than one module has access to a queue, it may be hard for an individual module to know when the queue is finalized since other modules may retain it. To address this concern, modules should remove their triggers before they themselves are finalized. - Parameter triggerToken: Trigger to remove from the queue
installTrigger(condition: CMBufferQueue_TriggerCondition, body?: (((arg0: SDKHandle) => void)) | null): SDKHandleSwift declarationfunc installTrigger(condition: CMBufferQueue.TriggerCondition, _ body: CMBufferQueueTriggerHandler? = nil) throws -> CMBufferQueue.TriggerTokenInstalls a trigger. The returned trigger token can be passed to `testTrigger` and `removeTrigger`. The returned trigger can be discarded (client doesn't need to test or remove trigger), and the body parameter can be `nil` (client doesn't need callbacks, but rather will explicitly test the trigger). One of these two parameters must be non-`nil`, however, since an untestable trigger that does not perform a callback is meaningless. If the trigger condition is already true, `installTrigger` will call the `body`. - Parameters: - condition: The condition to be tested when evaluating the trigger. - body: Closure to be called when the trigger condition becomes true. Can be `nil`, if client intends only to explicitly test the condition. - Returns: Trigger token which can be used with `testTrigger` and `removeTrigger`. Can be discarded if client has no need to explicitly test or remove the trigger.
get containsEndOfData(): booleanSwift declarationvar containsEndOfData: Bool { get }Returns whether or not the `CMBufferQueue` has been marked with EOD.
dequeueIfDataReady(): (unknown) | nullSwift declarationfunc dequeueIfDataReady() -> CMBuffer?Dequeues a buffer if it is ready. - Returns: The dequeued buffer. Will be `nil` if the queue is empty, or if the buffer to be dequeued is not yet ready.
get minDecodeTimeStamp(): CMTimeSwift declarationvar minDecodeTimeStamp: CMTime { get }Gets the earliest decode timestamp. The search for earliest decode timstamp is performed in this API. If you know your queue is in decode order, `firstDecodeTimeStamp` is a faster alternative. If the `getDecodeTimeStamp` handler is `nil`, `CMTime.invalid` will be returned.
get firstDecodeTimeStamp(): CMTimeSwift declarationvar firstDecodeTimeStamp: CMTime { get }Gets the decode timestamp of the first buffer. This API is is a faster alternative to `minDecodeTimeStamp`, but only gives the same answer if your queue is in decode order. If the `getDecodeTimeStamp` handler is `nil`, `CMTime.invalid` will be returned.
setValidationHandler(body: ((arg0: CMBufferQueue, arg1: unknown) => void)): voidSwift declarationfunc setValidationHandler(_ body: @escaping (CMBufferQueue, CMBuffer) throws -> Void)Sets a function that `enqueue` will call to validate buffers before adding them. `enqueue` will call this closure to validate buffers. Throw an error code if the buffer should be rejected; `enqueue` will throw this error to the caller. If you do not have a more descriptive error code, use `Error.invalidBuffer`. - Parameter body: Closure that will validate each buffer enqueued.
get endPresentationTimeStamp(): CMTimeSwift declarationvar endPresentationTimeStamp: CMTime { get }Gets the greatest end presentation timestamp. This is the maximum end time (PTS + duration) of buffers in the queue. If the `getPresentationTimeStamp` handler is `nil`, `CMTime.invalid` will be returned.
get maxPresentationTimeStamp(): CMTimeSwift declarationvar maxPresentationTimeStamp: CMTime { get }Gets the greatest presentation timestamp. If the `getPresentationTimeStamp` handler is `nil`, `CMTime.invalid` will be returned.
get minPresentationTimeStamp(): CMTimeSwift declarationvar minPresentationTimeStamp: CMTime { get }Gets the earliest presentation timestamp. The search for earliest presentation timstamp is performed in this API. If you know your queue is sorted by presentation time, `firstPresentationTimeStamp` is a faster alternative. If the `getPresentationTimeStamp` handler is `nil`, `CMTime.invalid` will be returned.
get firstPresentationTimeStamp(): CMTimeSwift declarationvar firstPresentationTimeStamp: CMTime { get }Gets the presentation timestamp of the first buffer. This API is is a faster alternative to `minPresentationTimeStamp`, but only works if you know your queue is sorted by presentation timestamp. If the `getPresentationTimeStamp` handler is `nil`, `CMTime.invalid` will be returned.
get head(): (unknown) | nullSwift declarationvar head: CMBuffer? { get }Retrieves the next-to-dequeue buffer but leaves it in the queue. Note that with non-FIFO queues it's not guaranteed that the next dequeue will return this particular buffer (if an intervening enqueue adds a buffer that will dequeue next).
reset(): voidSwift declarationfunc reset() throwsResets the `CMBufferQueue`. Empties the queue, and clears any EOD mark. All buffers in the queue are released. Triggers are not removed, however, and will be called appropriately as the queue duration goes to `.zero`.
reset64918(body: ((arg0: unknown) => void)): voidSwift declarationfunc reset(_ body: (CMBuffer) throws -> ()) throwsCalls a closure for every buffer in the queue, then resets the queue. - Parameter body: Closure to be called for each buffer. The closure should not make other calls to the buffer queue.
static get typeID(): numberSwift declarationclass var typeID: CFTypeID { get }The `CFTypeID` corresponding to `CMBufferQueue`.
get buffers(): CMBufferQueue_BuffersSwift declarationvar buffers: CMBufferQueue.Buffers { get }Accesses buffers in a `CMBufferQueue`.
dequeue(): (unknown) | nullSwift declarationfunc dequeue() -> CMBuffer?Dequeues a buffer. - Returns: The dequeued buffer. Will be `nil` if the queue is empty.
enqueue(buffer: unknown): voidSwift declarationfunc enqueue(_ buffer: CMBuffer) throwsEnqueues a buffer. The `buffer` is retained by the queue, so the client can safely release the buffer if it has no further use for it. If the compare handler is not `nil`, this API performs an insertion sort using that compare operation. If the validation handler is not `nil`, this API calls it; if it throws, the buffer will not be enqueued and this API will rethrow the error. - Parameter buffer: The buffer to enqueue.
get isEmpty(): booleanSwift declarationvar isEmpty: Bool { get }Returns whether or not the `CMBufferQueue` is empty.
get duration(): CMTimeSwift declarationvar duration: CMTime { get }Gets the duration. The duration of the `CMBufferQueue` is the sum of all the individual buffer durations, as reported by the `getDuration` handler. If there are no buffers in the queue, `CMTime.zero` will be returned.
get totalSize(): numberSwift declarationvar totalSize: Int { get }Gets the total size. The total size of the `CMBufferQueue` is the sum of all the individual buffer sizes, as reported by the `getTotalSize` handler. If there are no buffers in the queue, `0` will be returned.
No declarations were skipped in this snapshot.