init
TypeScriptstatic init(object: CMBlockBuffer): CMBlockBufferSwift declarationinit(referencing object: CMBlockBuffer)class · iOS 4.0+ · SDK 27.1
class CMBlockBufferstatic init(object: CMBlockBuffer): CMBlockBufferSwift declarationinit(referencing object: CMBlockBuffer)get startIndex(): numberSwift declarationvar startIndex: Int { get }The position of the first element.
get attachments(): CMAttachmentBearerAttachmentsSwift declarationvar attachments: CMAttachmentBearerAttachments { get set }Access attachments.
set attachments(value: CMAttachmentBearerAttachments)Swift declarationvar attachments: CMAttachmentBearerAttachments { get set }Access attachments.
assureBlockMemory(): voidSwift declarationfunc assureBlockMemory() throwsAssures all memory blocks are allocated. Traverses the possibly complex `CMBlockBuffer`, allocating the memory for any constituent memory blocks that are not yet allocated.
withUnsafeMutableBytes(offset: number, body: ((arg0: ArrayBuffer) => unknown)): unknownSwift declarationfunc withUnsafeMutableBytes<R>(atOffset offset: Int = 0, _ body: (UnsafeMutableRawBufferPointer) throws -> R) throws -> RGains access to the data represented by a `CMBlockBuffer`. Gains access to the data represented by a `CMBlockBuffer`. A mutable buffer pointer into a memory block is given to the closure which corresponds to the offset within the `CMBlockBuffer`. This buffer may be smaller than the number of bytes actually available starting at the offset if the `dataLength` of the `CMBlockBuffer` is covered by multiple memory blocks (a noncontiguous `CMBlockBuffer`). The buffer pointer will remain valid as long as the original `CMBlockBuffer` is referenced - once the `CMBlockBuffer` is released for the last time, any buffer pointers into it will be invalid. - Parameters: - offset: Offset within the buffer's offset range. - body: A closure with an `UnsafeMutableRawBufferPointer` parameter that points to contiguous storage in the block buffer. - Returns: The return value, if any, of the body closure parameter.
get owner(): CMBlockBufferSwift declarationvar owner: CMBlockBuffer { get }`CMBlockBuffer` instance to operate on.
appendBufferDeallocatorFlags(buffer: ArrayBuffer, deallocator: ((arg0: SDKHandle, arg1: number) => void), flags?: CMBlockBuffer_Flags): voidSwift declarationfunc append(buffer: UnsafeMutableRawBufferPointer, deallocator: @escaping CMBlockBuffer.CustomBlockDeallocator, flags: CMBlockBuffer.Flags = []) throwsAdds a memory block, alreay allocated with a custom allocator. Adds a memory block to an existing `CMBlockBuffer`. The `CMBlockBuffer`'s total data length will be increased by the specified `buffer` length. Note that append operations are not thread safe, so care must be taken when appending to `CMBlockBuffer`s that are used by multiple threads. - Parameters: - buffer: Block of memory to hold buffered data. The block will be used and will be deallocated when the new CMBlockBuffer is finalized (i.e. released for the last time). - deallocator: Deallocator to be used for deallocating the buffer. - flags: Feature and control flags.
appendBufferDeallocatorFlags48509(buffer: SDKHandle, deallocator: ((arg0: SDKHandle, arg1: number) => void), flags?: CMBlockBuffer_Flags): voidSwift declarationfunc append(buffer: Slice<UnsafeMutableRawBufferPointer>, deallocator: @escaping CMBlockBuffer.CustomBlockDeallocator, flags: CMBlockBuffer.Flags = []) throwsAdds a sliced memory block, alreay allocated with a custom allocator. Adds a memory block to an existing `CMBlockBuffer`. The `CMBlockBuffer`'s total data length will be increased by the specified `buffer` slice length. Note that append operations are not thread safe, so care must be taken when appending to `CMBlockBuffer`s that are used by multiple threads. - Parameters: - buffer: Slice in a block of memory to hold buffered data. The block will be used and will be deallocated when the new `CMBlockBuffer` is finalized (i.e. released for the last time). The `CMBlockBuffer` will refer to the data in the slice. - deallocator: Deallocator to be used for deallocating the buffer. - flags: Feature and control flags.
appendBufferAllocatorFlags(buffer: ArrayBuffer, allocator?: (_CoreFoundation_CFAllocator) | null, flags?: CMBlockBuffer_Flags): voidSwift declarationfunc append(buffer: UnsafeMutableRawBufferPointer, allocator: CFAllocator? = kCFAllocatorDefault, flags: CMBlockBuffer.Flags = []) throwsAdds a memory block, alreay allocated with a `CFAllocator`. Adds a memory block to an existing `CMBlockBuffer`. The `CMBlockBuffer`'s total data length will be increased by the specified `buffer` length. Note that append operations are not thread safe, so care must be taken when appending to `CMBlockBuffer`s that are used by multiple threads. - Parameters: - buffer: Block of memory to hold buffered data. The block will be used and will be deallocated when the `CMBlockBuffer` is finalized (i.e. released for the last time). - allocator: Allocator to be used for deallocating the `buffer`. Pass `kCFAllocatorNull` if no deallocation is desired. - flags: Feature and control flags.
appendBufferAllocatorFlags16471(buffer: SDKHandle, allocator?: (_CoreFoundation_CFAllocator) | null, flags?: CMBlockBuffer_Flags): voidSwift declarationfunc append(buffer: Slice<UnsafeMutableRawBufferPointer>, allocator: CFAllocator? = kCFAllocatorDefault, flags: CMBlockBuffer.Flags = []) throwsAdds a sliced memory block, alreay allocated with a `CFAllocator`. Adds a memory block to an existing `CMBlockBuffer`. The `CMBlockBuffer`'s total data length will be increased by the specified `buffer` slice length. Note that append operations are not thread safe, so care must be taken when appending to `CMBlockBuffer`s that are used by multiple threads. - Parameters: - buffer: Slice in a block of memory to hold buffered data. The block will be used and will be deallocated when the `CMBlockBuffer` is finalized (i.e. released for the last time). The `CMBlockBuffer` will refer to the data in the `buffer` slice. - allocator: Allocator to be used for deallocating the `buffer`. Pass `kCFAllocatorNull` if no deallocation is desired. - flags: Feature and control flags.
appendLengthAllocatorRangeFlags(length: number, allocator?: (_CoreFoundation_CFAllocator) | null, range?: (SDKHandle) | null, flags?: CMBlockBuffer_Flags): voidSwift declarationfunc append(length: Int, allocator: CFAllocator? = kCFAllocatorDefault, range: Range<Int>? = nil, flags: CMBlockBuffer.Flags = []) throwsAdds a memory block, to allocate with a `CFAllocator`. Adds a memory block to an existing `CMBlockBuffer`. The `CMBlockBuffer`'s total data length will be increased by the specified `range` length. If `.assureMemoryNow` is set in the `flags` parameter, the memory block is allocated immediately using the `allocator`. Note that append operations are not thread safe, so care must be taken when appending to `CMBlockBuffer`s that are used by multiple threads. - Parameters: - length: Overall length of the memory block in bytes. Must not be zero. This is the size to allocate when `assureBlockMemory()` is called. - allocator: Allocator to be used for allocating the memory block. - range: Range within the memory block to which the `CMBlockBuffer` should refer to data. If `nil`, the whole memory block is used. - flags: Feature and control flags.
static get typeID(): numberSwift declarationclass var typeID: CFTypeID { get }The `CFTypeID` corresponding to `CMBlockBuffer`.
get isEmpty(): booleanSwift declarationvar isEmpty: Bool { get }Indicates whether the `CMBlockBuffer` is empty. Indicates whether the `CMBlockBuffer` is empty, i.e., devoid of any memory blocks or `CMBlockBuffer` references. Note that a `CMBlockBuffer` containing a not-yet allocated memory block is not considered empty.
get endIndex(): numberSwift declarationvar endIndex: Int { get }The "past the end" position.
3 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.
CMBlockBuffer.append(length:allocator:deallocator:range:flags:)
callback cannot propagate synchronous failure
CMBlockBuffer.append(bufferReference:flags:)
This declaration needs Swift generic type arguments. (no canonical witness for T)
CMBlockBuffer.propagateAttachments(to:)
This declaration needs Swift generic type arguments. (no canonical witness for T)