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(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)); } }
static extern CMBlockBufferError CMBlockBufferCreateWithMemoryBlock( /* CFAllocatorRef */ IntPtr structureAllocator, /* void * */ IntPtr memoryBlock, /* size_t */ nuint blockLength, /* CFAllocatorRef */ IntPtr blockAllocator, /* CMBlockBufferCustomBlockSource* */ ref CMCustomBlockAllocator.CMBlockBufferCustomBlockSource customBlockSource, /* size_t */ nuint offsetToData, /* size_t */ nuint dataLength, CMBlockBufferFlags flags, /* CMBlockBufferRef* */ out IntPtr newBlockBuffer);
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); }
static extern CMBlockBufferError CMBlockBufferCreateContiguous( /* CFAllocatorRef */ IntPtr structureAllocator, /* CMBlockBufferRef */ IntPtr sourceBuffer, /* CFAllocatorRef */ IntPtr blockAllocator, /* CMBlockBufferCustomBlockSource* */ ref CMCustomBlockAllocator.CMBlockBufferCustomBlockSource customBlockSource, /* size_t */ nuint offsetToData, /* size_t */ nuint dataLength, CMBlockBufferFlags flags, /* CMBlockBufferRef* */ out IntPtr newBlockBuffer);
static extern CMBlockBufferError CMBlockBufferAppendMemoryBlock( /* CMBlockBufferRef */ IntPtr buffer, /* void * */IntPtr memoryBlock, /* size_t */nuint blockLength, /* CFAllocatorRef */IntPtr blockAllocator, /* CMBlockBufferCustomBlockSource */ ref CMCustomBlockAllocator.CMBlockBufferCustomBlockSource customBlockSource, /* 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 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 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; }