public static CMSampleBuffer CreateReady(CMBlockBuffer dataBuffer, CMFormatDescription formatDescription, int samplesCount, CMSampleTimingInfo[] sampleTimingArray, nuint[] sampleSizeArray, out CMSampleBufferError error) { if (dataBuffer == null) { throw new ArgumentNullException("dataBuffer"); } if (samplesCount < 0) { throw new ArgumentOutOfRangeException("samplesCount"); } IntPtr buffer; var fdh = formatDescription == null ? IntPtr.Zero : formatDescription.Handle; var timingCount = sampleTimingArray == null ? 0 : sampleTimingArray.Length; var sizeCount = sampleSizeArray == null ? 0 : sampleSizeArray.Length; error = CMSampleBufferCreateReady(IntPtr.Zero, dataBuffer.handle, fdh, samplesCount, timingCount, sampleTimingArray, sizeCount, sampleSizeArray, out buffer); if (error != CMSampleBufferError.None) { return(null); } return(new CMSampleBuffer(buffer, true)); }
public CMFormatDescription GetFormatDescription() { var desc = default(CMFormatDescription); var descHandle = CMSampleBufferGetFormatDescription(handle); if (descHandle != IntPtr.Zero) { desc = new CMFormatDescription(descHandle, false); } return(desc); }
public static CMSampleBuffer CreateReadyWithImageBuffer(CVImageBuffer imageBuffer, CMFormatDescription formatDescription, CMSampleTimingInfo[] sampleTiming, out CMSampleBufferError error) { if (imageBuffer == null) { throw new ArgumentNullException("imageBuffer"); } if (formatDescription == null) { throw new ArgumentNullException("formatDescription"); } IntPtr buffer; error = CMSampleBufferCreateReadyWithImageBuffer(IntPtr.Zero, imageBuffer.handle, formatDescription.Handle, sampleTiming, out buffer); if (error != CMSampleBufferError.None) return(null); }
public static CMSampleBuffer CreateReadyWithImageBuffer (CVImageBuffer imageBuffer, CMFormatDescription formatDescription, CMSampleTimingInfo[] sampleTiming, out CMSampleBufferError error) { if (imageBuffer == null) throw new ArgumentNullException ("imageBuffer"); if (formatDescription == null) throw new ArgumentNullException ("formatDescription"); IntPtr buffer; error = CMSampleBufferCreateReadyWithImageBuffer (IntPtr.Zero, imageBuffer.handle, formatDescription.Handle, sampleTiming, out buffer); if (error != CMSampleBufferError.None) return null; return new CMSampleBuffer (buffer, true); }
public static CMSampleBuffer CreateReady (CMBlockBuffer dataBuffer, CMFormatDescription formatDescription, int samplesCount, CMSampleTimingInfo[] sampleTimingArray, nuint[] sampleSizeArray, out CMSampleBufferError error) { if (dataBuffer == null) throw new ArgumentNullException ("dataBuffer"); if (samplesCount < 0) throw new ArgumentOutOfRangeException ("samplesCount"); IntPtr buffer; var fdh = formatDescription == null ? IntPtr.Zero : formatDescription.Handle; var timingCount = sampleTimingArray == null ? 0 : sampleTimingArray.Length; var sizeCount = sampleSizeArray == null ? 0 : sampleSizeArray.Length; error = CMSampleBufferCreateReady (IntPtr.Zero, dataBuffer.handle, fdh, samplesCount, timingCount, sampleTimingArray, sizeCount, sampleSizeArray, out buffer); if (error != CMSampleBufferError.None) return null; return new CMSampleBuffer (buffer, true); }
public static CMSampleBuffer CreateReadyWithPacketDescriptions (CMBlockBuffer dataBuffer, CMFormatDescription formatDescription, int samplesCount, CMTime sampleTimestamp, AudioStreamPacketDescription[] packetDescriptions, out CMSampleBufferError error) { if (dataBuffer == null) throw new ArgumentNullException ("dataBuffer"); if (formatDescription == null) throw new ArgumentNullException ("formatDescription"); if (samplesCount <= 0) throw new ArgumentOutOfRangeException ("samplesCount"); IntPtr buffer; error = CMAudioSampleBufferCreateReadyWithPacketDescriptions (IntPtr.Zero, dataBuffer.handle, formatDescription.handle, samplesCount, sampleTimestamp, packetDescriptions, out buffer); if (error != CMSampleBufferError.None) return null; return new CMSampleBuffer (buffer, true); }
public CMFormatDescription GetFormatDescription () { var desc = default(CMFormatDescription); var descHandle = CMSampleBufferGetFormatDescription (handle); if (descHandle != IntPtr.Zero) { desc = new CMFormatDescription (descHandle, false); } return desc; }
public VTStatus CanAcceptFormatDescriptor (CMFormatDescription newDescriptor) { if (Handle == IntPtr.Zero) throw new ObjectDisposedException ("DecompressionSession"); return VTDecompressionSessionCanAcceptFormatDescription (Handle, newDescriptor.Handle); }
public static CMSampleBuffer CreateReadyWithPacketDescriptions(CMBlockBuffer dataBuffer, CMFormatDescription formatDescription, int samplesCount, CMTime sampleTimestamp, AudioStreamPacketDescription[] packetDescriptions, out CMSampleBufferError error) { if (dataBuffer == null) { throw new ArgumentNullException("dataBuffer"); } if (formatDescription == null) { throw new ArgumentNullException("formatDescription"); } if (samplesCount <= 0) { throw new ArgumentOutOfRangeException("samplesCount"); } IntPtr buffer; error = CMAudioSampleBufferCreateReadyWithPacketDescriptions(IntPtr.Zero, dataBuffer.handle, formatDescription.handle, samplesCount, sampleTimestamp, packetDescriptions, out buffer); if (error != CMSampleBufferError.None) { return(null); } return(new CMSampleBuffer(buffer, true)); }