extern static /* OSStatus */ CMBlockBufferError CMBlockBufferCreateWithBufferReference( /* CFAllocatorRef */ IntPtr structureAllocator, /* CMBlockBufferRef */ IntPtr targetBuffer, /* size_t */ nuint offsetToData, /* size_t */ nuint dataLength, CMBlockBufferFlags flags, /* CMBlockBufferRef* */ out IntPtr newBlockBuffer);
public static CMBlockBuffer CreateEmpty (uint subBlockCapacity, CMBlockBufferFlags flags, out CMBlockBufferError error) { IntPtr buffer; error = CMBlockBufferCreateEmpty (IntPtr.Zero, subBlockCapacity, flags, out buffer); if (error != CMBlockBufferError.None) return null; return new CMBlockBuffer (buffer, true); }
extern static /* OSStatus */ CMBlockBufferError CMBlockBufferCreateContiguous( /* CFAllocatorRef */ IntPtr structureAllocator, /* CMBlockBufferRef */ IntPtr sourceBuffer, /* CFAllocatorRef */ IntPtr blockAllocator, /* CMBlockBufferCustomBlockSource */ IntPtr customBlockSource, // Can be null /* size_t */ nuint offsetToData, /* size_t */ nuint dataLength, CMBlockBufferFlags flags, /* CMBlockBufferRef* */ out IntPtr newBlockBuffer);
extern static /* OSStatus */ CMBlockBufferError CMBlockBufferAppendMemoryBlock( /* CMBlockBufferRef */ IntPtr buffer, /* void * */ IntPtr memoryBlock, /* size_t */ nuint blockLength, /* CFAllocatorRef */ IntPtr blockAllocator, /* CMBlockBufferCustomBlockSource */ IntPtr customBlockSource, // can be null /* size_t */ nuint offsetToData, /* size_t */ nuint dataLength, CMBlockBufferFlags flags);
extern static /* OSStatus */ CMBlockBufferError CMBlockBufferCreateWithMemoryBlock( /* CFAllocatorRef */ IntPtr structureAllocator, /* void * */ IntPtr memoryBlock, /* size_t */ nuint blockLength, /* CFAllocatorRef */ IntPtr blockAllocator, /* CMBlockBufferCustomBlockSource* */ IntPtr customBlockSource, // Can be null /* size_t */ nuint offsetToData, /* size_t */ nuint dataLength, CMBlockBufferFlags flags, /* CMBlockBufferRef* */ out IntPtr newBlockBuffer);
public static CMBlockBuffer CreateEmpty(uint subBlockCapacity, CMBlockBufferFlags flags, out CMBlockBufferError error) { IntPtr buffer; error = CMBlockBufferCreateEmpty(IntPtr.Zero, subBlockCapacity, flags, out buffer); if (error != CMBlockBufferError.None) { return(null); } return(new CMBlockBuffer(buffer, true)); }
static extern CMBlockBufferError CMBlockBufferCreateWithMemoryBlock( /* CFAllocatorRef */ IntPtr structureAllocator, /* void * */ IntPtr memoryBlock, /* size_t */ nuint blockLength, /* CFAllocatorRef */ IntPtr blockAllocator, /* CMBlockBufferCustomBlockSource* */ IntPtr customBlockSource, // Can be null /* size_t */ nuint offsetToData, /* size_t */ nuint dataLength, CMBlockBufferFlags flags, /* CMBlockBufferRef* */ out IntPtr newBlockBuffer);
extern static CMBlockBufferError CMBlockBufferCreateEmpty(IntPtr allocator, uint subBlockCapacity, CMBlockBufferFlags flags, out IntPtr output);
public static CMBlockBuffer CreateContiguous(CMBlockBuffer sourceBuffer, CMCustomBlockAllocator customBlockSource, nuint offsetToData, nuint dataLength, CMBlockBufferFlags flags, out CMBlockBufferError error) { if (sourceBuffer == null) throw new ArgumentNullException ("sourceBuffer"); IntPtr buffer; if (customBlockSource == null) error = CMBlockBufferCreateContiguous (IntPtr.Zero, sourceBuffer.handle, IntPtr.Zero, IntPtr.Zero, offsetToData, dataLength, flags, out buffer); else error = CMBlockBufferCreateContiguous (IntPtr.Zero, sourceBuffer.handle, IntPtr.Zero, ref customBlockSource.Cblock, offsetToData, dataLength, flags, out buffer); if (error != CMBlockBufferError.None) return null; var block = new CMBlockBuffer (buffer, true); block.customAllocator = customBlockSource; return block; }
static extern CMBlockBufferError CMBlockBufferCreateWithBufferReference( /* CFAllocatorRef */ IntPtr structureAllocator, /* CMBlockBufferRef */ IntPtr targetBuffer, /* size_t */ nuint offsetToData, /* size_t */ nuint dataLength, CMBlockBufferFlags flags, /* CMBlockBufferRef* */ out IntPtr newBlockBuffer);
public static CMBlockBuffer FromMemoryBlock(byte [] data, nuint offsetToData, CMBlockBufferFlags flags, out CMBlockBufferError error) { if (data == null) { throw new ArgumentNullException(nameof(data)); } var allocator = new CMManagedArrayBlockAllocator(data); return(FromMemoryBlock(IntPtr.Zero, (uint)data.Length, allocator, offsetToData, (uint)data.Length, flags, out error)); }
public static CMBlockBuffer CreateContiguous(CMBlockBuffer sourceBuffer, CMCustomBlockAllocator customBlockSource, nuint offsetToData, nuint dataLength, CMBlockBufferFlags flags, out CMBlockBufferError error) { if (sourceBuffer == null) { throw new ArgumentNullException("sourceBuffer"); } IntPtr buffer; if (customBlockSource == null) { error = CMBlockBufferCreateContiguous(IntPtr.Zero, sourceBuffer.handle, IntPtr.Zero, IntPtr.Zero, offsetToData, dataLength, flags, out buffer); } else { error = CMBlockBufferCreateContiguous(IntPtr.Zero, sourceBuffer.handle, IntPtr.Zero, ref customBlockSource.Cblock, offsetToData, dataLength, flags, out buffer); } if (error != CMBlockBufferError.None) { return(null); } var block = new CMBlockBuffer(buffer, true); block.customAllocator = customBlockSource; return(block); }
public CMBlockBufferError AppendMemoryBlock(byte [] data, nuint offsetToData, CMBlockBufferFlags flags) { if (Handle == IntPtr.Zero) throw new ObjectDisposedException ("BlockBuffer"); if (data == null) throw new ArgumentNullException (nameof (data)); var allocator = new CMManagedArrayBlockAllocator (data); return AppendMemoryBlock (IntPtr.Zero, (uint) data.Length, allocator, offsetToData, (uint) data.Length, flags); }
public CMBlockBufferError AppendMemoryBlock(IntPtr memoryBlock, nuint blockLength, CMCustomBlockAllocator customBlockSource, nuint offsetToData, nuint dataLength, CMBlockBufferFlags flags) { var blockAllocator = memoryBlock == IntPtr.Zero ? NativeHandle.Zero : CFAllocator.Null.Handle; if (customBlockSource is null) { return(CMBlockBufferAppendMemoryBlock(GetCheckedHandle(), memoryBlock, blockLength, blockAllocator, IntPtr.Zero, offsetToData, dataLength, flags)); } else { return(CMBlockBufferAppendMemoryBlock(GetCheckedHandle(), memoryBlock, blockLength, blockAllocator, ref customBlockSource.Cblock, offsetToData, dataLength, flags)); } }
public CMBlockBufferError AppendBuffer(CMBlockBuffer targetBuffer, nuint offsetToData, nuint dataLength, CMBlockBufferFlags flags) { if (Handle == IntPtr.Zero) throw new ObjectDisposedException ("BlockBuffer"); // From docs targetBuffer must not be null unless the PermitEmptyReference flag is set if (!flags.HasFlag (CMBlockBufferFlags.PermitEmptyReference)) { if (targetBuffer == null) throw new ArgumentNullException ("targetBuffer"); } return CMBlockBufferAppendBufferReference (Handle, targetBuffer == null ? IntPtr.Zero : targetBuffer.handle, offsetToData, dataLength, flags); }
public CMBlockBufferError AppendMemoryBlock(IntPtr memoryBlock, nuint blockLength, CMCustomBlockAllocator customBlockSource, nuint offsetToData, nuint dataLength, CMBlockBufferFlags flags) { if (Handle == IntPtr.Zero) throw new ObjectDisposedException ("BlockBuffer"); var blockAllocator = memoryBlock == IntPtr.Zero ? IntPtr.Zero : CFAllocator.Null.Handle; if (customBlockSource == null) return CMBlockBufferAppendMemoryBlock (Handle, memoryBlock, blockLength, blockAllocator, IntPtr.Zero, offsetToData, dataLength, flags); else return CMBlockBufferAppendMemoryBlock (Handle, memoryBlock, blockLength, blockAllocator, ref customBlockSource.Cblock, offsetToData, dataLength, flags); }
public static CMBlockBuffer FromMemoryBlock(byte [] data, nuint offsetToData, CMBlockBufferFlags flags, out CMBlockBufferError error) { if (data == null) throw new ArgumentNullException (nameof (data)); var allocator = new CMManagedArrayBlockAllocator (data); return FromMemoryBlock (IntPtr.Zero, (uint) data.Length, allocator, offsetToData, (uint) data.Length, flags, out error); }
public static CMBlockBuffer FromMemoryBlock(IntPtr memoryBlock, nuint blockLength, CMCustomBlockAllocator customBlockSource, nuint offsetToData, nuint dataLength, CMBlockBufferFlags flags, out CMBlockBufferError error) { var blockAllocator = memoryBlock == IntPtr.Zero ? IntPtr.Zero : CFAllocator.Null.Handle; IntPtr buffer; if (customBlockSource == null) error = CMBlockBufferCreateWithMemoryBlock (IntPtr.Zero, memoryBlock, blockLength, blockAllocator, IntPtr.Zero, offsetToData, dataLength, flags, out buffer); else error = CMBlockBufferCreateWithMemoryBlock (IntPtr.Zero, memoryBlock, blockLength, blockAllocator, ref customBlockSource.Cblock, offsetToData, dataLength, flags, out buffer); if (error != CMBlockBufferError.None) return null; var block = new CMBlockBuffer (buffer, true); block.customAllocator = customBlockSource; return block; }
public static CMBlockBuffer FromBuffer(CMBlockBuffer targetBuffer, nuint offsetToData, nuint dataLength, CMBlockBufferFlags flags, out CMBlockBufferError error) { // From docs targetBuffer must not be null unless the PermitEmptyReference flag is set if (!flags.HasFlag (CMBlockBufferFlags.PermitEmptyReference)) if (targetBuffer == null) throw new ArgumentNullException ("targetBuffer"); IntPtr buffer; error = CMBlockBufferCreateWithBufferReference (IntPtr.Zero, targetBuffer == null ? IntPtr.Zero : targetBuffer.handle, offsetToData, dataLength, flags, out buffer); if (error != CMBlockBufferError.None) return null; return new CMBlockBuffer (buffer, true); }
extern static /* OSStatus */ CMBlockBufferError CMBlockBufferAppendBufferReference( /* CMBlockBufferRef */ IntPtr buffer, /* CMBlockBufferRef */ IntPtr targetBBuf, /* size_t */ nuint offsetToData, /* size_t */ nuint dataLength, CMBlockBufferFlags flags);
public CMBlockBufferError AppendMemoryBlock(IntPtr memoryBlock, nuint blockLength, CMCustomBlockAllocator customBlockSource, nuint offsetToData, nuint dataLength, CMBlockBufferFlags flags) { if (Handle == IntPtr.Zero) { throw new ObjectDisposedException("BlockBuffer"); } var blockAllocator = memoryBlock == IntPtr.Zero ? IntPtr.Zero : CFAllocator.Null.Handle; if (customBlockSource == null) { return(CMBlockBufferAppendMemoryBlock(Handle, memoryBlock, blockLength, blockAllocator, IntPtr.Zero, offsetToData, dataLength, flags)); } else { return(CMBlockBufferAppendMemoryBlock(Handle, memoryBlock, blockLength, blockAllocator, ref customBlockSource.Cblock, offsetToData, dataLength, flags)); } }
public CMBlockBufferError AppendBuffer(CMBlockBuffer targetBuffer, nuint offsetToData, nuint dataLength, CMBlockBufferFlags flags) { if (Handle == IntPtr.Zero) { throw new ObjectDisposedException("BlockBuffer"); } // From docs targetBuffer must not be null unless the PermitEmptyReference flag is set if (!flags.HasFlag(CMBlockBufferFlags.PermitEmptyReference)) { if (targetBuffer == null) { throw new ArgumentNullException("targetBuffer"); } } return(CMBlockBufferAppendBufferReference(Handle, targetBuffer == null ? IntPtr.Zero : targetBuffer.handle, offsetToData, dataLength, flags)); }
extern static /* OSStatus */ CMBlockBufferError CMBlockBufferCreateEmpty(/* CFAllocatorRef */ IntPtr allocator, /* uint32_t */ uint subBlockCapacity, CMBlockBufferFlags flags, /* CMBlockBufferRef* */ out IntPtr output);
public static CMBlockBuffer FromMemoryBlock(IntPtr memoryBlock, nuint blockLength, CMCustomBlockAllocator customBlockSource, nuint offsetToData, nuint dataLength, CMBlockBufferFlags flags, out CMBlockBufferError error) { var blockAllocator = memoryBlock == IntPtr.Zero ? IntPtr.Zero : CFAllocator.Null.Handle; IntPtr buffer; if (customBlockSource == null) { error = CMBlockBufferCreateWithMemoryBlock(IntPtr.Zero, memoryBlock, blockLength, blockAllocator, IntPtr.Zero, offsetToData, dataLength, flags, out buffer); } else { error = CMBlockBufferCreateWithMemoryBlock(IntPtr.Zero, memoryBlock, blockLength, blockAllocator, ref customBlockSource.Cblock, offsetToData, dataLength, flags, out buffer); } if (error != CMBlockBufferError.None) { return(null); } var block = new CMBlockBuffer(buffer, true); block.customAllocator = customBlockSource; return(block); }
public static CMBlockBuffer?FromBuffer(CMBlockBuffer?targetBuffer, nuint offsetToData, nuint dataLength, CMBlockBufferFlags flags, out CMBlockBufferError error) { // From docs targetBuffer must not be null unless the PermitEmptyReference flag is set if (!flags.HasFlag(CMBlockBufferFlags.PermitEmptyReference)) { if (targetBuffer is null) { ObjCRuntime.ThrowHelper.ThrowArgumentNullException(nameof(targetBuffer)); } } IntPtr buffer; error = CMBlockBufferCreateWithBufferReference(IntPtr.Zero, targetBuffer.GetHandle(), offsetToData, dataLength, flags, out buffer); if (error != CMBlockBufferError.None) { return(null); } return(new CMBlockBuffer(buffer, true)); }
public CMBlockBufferError AppendMemoryBlock(byte [] data, nuint offsetToData, CMBlockBufferFlags flags) { if (Handle == IntPtr.Zero) { throw new ObjectDisposedException("BlockBuffer"); } if (data == null) { throw new ArgumentNullException(nameof(data)); } var allocator = new CMManagedArrayBlockAllocator(data); return(AppendMemoryBlock(IntPtr.Zero, (uint)data.Length, allocator, offsetToData, (uint)data.Length, flags)); }
public CMBlockBufferError AppendMemoryBlock(byte [] data, nuint offsetToData, CMBlockBufferFlags flags) { if (data is null) ObjCRuntime.ThrowHelper.ThrowArgumentNullException(nameof(data)); }
static extern CMBlockBufferError CMBlockBufferAppendBufferReference( /* CMBlockBufferRef */ IntPtr buffer, /* CMBlockBufferRef */ IntPtr targetBBuf, /* size_t */ nuint offsetToData, /* size_t */ nuint dataLength, CMBlockBufferFlags flags);
public CMBlockBufferError AppendBuffer(CMBlockBuffer?targetBuffer, nuint offsetToData, nuint dataLength, CMBlockBufferFlags flags) { // From docs targetBuffer must not be null unless the PermitEmptyReference flag is set if (!flags.HasFlag(CMBlockBufferFlags.PermitEmptyReference)) { if (targetBuffer is null) { ObjCRuntime.ThrowHelper.ThrowArgumentNullException(nameof(targetBuffer)); } } return(CMBlockBufferAppendBufferReference(GetCheckedHandle(), targetBuffer.GetHandle(), offsetToData, dataLength, flags)); }
public CMBlockBufferError AppendMemoryBlock(byte [] data, nuint offsetToData, CMBlockBufferFlags flags) { if (Handle == IntPtr.Zero) { throw new ObjectDisposedException("BlockBuffer"); } if (data == null) throw new ArgumentNullException(nameof(data)); }
static extern CMBlockBufferError CMBlockBufferAppendMemoryBlock( /* CMBlockBufferRef */ IntPtr buffer, /* void * */IntPtr memoryBlock, /* size_t */nuint blockLength, /* CFAllocatorRef */IntPtr blockAllocator, /* CMBlockBufferCustomBlockSource */ IntPtr customBlockSource, // can be null /* size_t */nuint offsetToData, /* size_t */nuint dataLength, CMBlockBufferFlags flags);
static extern CMBlockBufferError CMBlockBufferCreateContiguous( /* CFAllocatorRef */ IntPtr structureAllocator, /* CMBlockBufferRef */ IntPtr sourceBuffer, /* CFAllocatorRef */ IntPtr blockAllocator, /* CMBlockBufferCustomBlockSource */ IntPtr customBlockSource, // Can be null /* size_t */ nuint offsetToData, /* size_t */ nuint dataLength, CMBlockBufferFlags flags, /* CMBlockBufferRef* */ out IntPtr newBlockBuffer);
static extern CMBlockBufferError CMBlockBufferCreateEmpty(/* CFAllocatorRef */ IntPtr allocator, /* uint32_t */ uint subBlockCapacity, CMBlockBufferFlags flags, /* CMBlockBufferRef* */ out IntPtr output);
public static CMBlockBuffer FromBuffer(CMBlockBuffer targetBuffer, nuint offsetToData, nuint dataLength, CMBlockBufferFlags flags, out CMBlockBufferError error) { // From docs targetBuffer must not be null unless the PermitEmptyReference flag is set if (!flags.HasFlag(CMBlockBufferFlags.PermitEmptyReference)) { if (targetBuffer == null) { throw new ArgumentNullException("targetBuffer"); } } IntPtr buffer; error = CMBlockBufferCreateWithBufferReference(IntPtr.Zero, targetBuffer == null ? IntPtr.Zero : targetBuffer.handle, offsetToData, dataLength, flags, out buffer); if (error != CMBlockBufferError.None) { return(null); } return(new CMBlockBuffer(buffer, true)); }
extern static CMBlockBufferError CMBlockBufferCreateEmpty (IntPtr allocator, uint subBlockCapacity, CMBlockBufferFlags flags, out IntPtr output);