/** * @throws OSStatusException * @since Available in iOS 8.0 and later. */ @WeaklyLinked public static CMSampleBuffer createAudioSampleBuffer(CMBlockBuffer dataBuffer, CMFormatDescription formatDescription, @MachineSizedSInt long numSamples, @ByVal CMTime sbufPTS, AudioStreamPacketDescription[] packetDescriptions) throws OSStatusException { long refconId = CMSampleBuffer.refconId.getAndIncrement(); AudioStreamPacketDescription packetDescriptionPtr = Struct.allocate(AudioStreamPacketDescription.class, (int)numSamples); packetDescriptionPtr.update(packetDescriptions); CMSampleBufferPtr ptr = new CMSampleBufferPtr(); OSStatus status = createAudioSampleBuffer0(null, dataBuffer, formatDescription, numSamples, sbufPTS, packetDescriptionPtr, ptr); if (OSStatusException.throwIfNecessary(status)) { CMSampleBuffer buffer = ptr.get(); buffer.localRefconId = refconId; return buffer; } return null; }
/** * @throws OSStatusException * @since Available in iOS 4.0 and later. */ @WeaklyLinked public static CMSampleBuffer createAudioSampleBuffer(CMBlockBuffer dataBuffer, boolean dataReady, MakeDataReadyCallback callback, CMFormatDescription formatDescription, @MachineSizedSInt long numSamples, @ByVal CMTime sbufPTS, AudioStreamPacketDescription[] packetDescriptions) throws OSStatusException { long refconId = CMSampleBuffer.refconId.getAndIncrement(); AudioStreamPacketDescription packetDescriptionPtr = Struct.allocate(AudioStreamPacketDescription.class, (int)numSamples); packetDescriptionPtr.update(packetDescriptions); CMSampleBufferPtr ptr = new CMSampleBufferPtr(); OSStatus status = createAudioSampleBuffer0(null, dataBuffer, dataReady, new FunctionPtr(cbMakeDataReady), refconId, formatDescription, numSamples, sbufPTS, packetDescriptionPtr, ptr); if (OSStatusException.throwIfNecessary(status)) { CMSampleBuffer buffer = ptr.get(); buffer.localRefconId = refconId; synchronized (makeDataReadyCallbacks) { makeDataReadyCallbacks.put(refconId, callback); } return buffer; } return null; } /**
/** * @throws OSStatusException * @since Available in iOS 8.0 and later. */ @WeaklyLinked public static CMSampleBuffer createAudioSampleBuffer(CMBlockBuffer dataBuffer, CMFormatDescription formatDescription, @MachineSizedSInt long numSamples, @ByVal CMTime sbufPTS, AudioStreamPacketDescription[] packetDescriptions) throws OSStatusException { long refconId = CMSampleBuffer.refconId.getAndIncrement(); AudioStreamPacketDescription packetDescriptionPtr = Struct.allocate(AudioStreamPacketDescription.class, (int)numSamples); packetDescriptionPtr.update(packetDescriptions); CMSampleBufferPtr ptr = new CMSampleBufferPtr(); OSStatus status = createAudioSampleBuffer0(null, dataBuffer, formatDescription, numSamples, sbufPTS, packetDescriptionPtr, ptr); if (OSStatusException.throwIfNecessary(status)) { CMSampleBuffer buffer = ptr.get(); buffer.localRefconId = refconId; return buffer; } return null; }
/** * @throws OSStatusException * @since Available in iOS 8.0 and later. */ @WeaklyLinked public static CMSampleBuffer createAudioSampleBuffer(CMBlockBuffer dataBuffer, CMFormatDescription formatDescription, @MachineSizedSInt long numSamples, @ByVal CMTime sbufPTS, AudioStreamPacketDescription[] packetDescriptions) throws OSStatusException { long refconId = CMSampleBuffer.refconId.getAndIncrement(); AudioStreamPacketDescription packetDescriptionPtr = Struct.allocate(AudioStreamPacketDescription.class, (int)numSamples); packetDescriptionPtr.update(packetDescriptions); CMSampleBufferPtr ptr = new CMSampleBufferPtr(); OSStatus status = createAudioSampleBuffer0(null, dataBuffer, formatDescription, numSamples, sbufPTS, packetDescriptionPtr, ptr); if (OSStatusException.throwIfNecessary(status)) { CMSampleBuffer buffer = ptr.get(); buffer.localRefconId = refconId; return buffer; } return null; }
/** * @throws OSStatusException * @since Available in iOS 4.0 and later. */ @WeaklyLinked public static CMSampleBuffer createAudioSampleBuffer(CMBlockBuffer dataBuffer, boolean dataReady, MakeDataReadyCallback callback, CMFormatDescription formatDescription, @MachineSizedSInt long numSamples, @ByVal CMTime sbufPTS, AudioStreamPacketDescription[] packetDescriptions) throws OSStatusException { long refconId = CMSampleBuffer.refconId.getAndIncrement(); AudioStreamPacketDescription packetDescriptionPtr = Struct.allocate(AudioStreamPacketDescription.class, (int)numSamples); packetDescriptionPtr.update(packetDescriptions); CMSampleBufferPtr ptr = new CMSampleBufferPtr(); OSStatus status = createAudioSampleBuffer0(null, dataBuffer, dataReady, new FunctionPtr(cbMakeDataReady), refconId, formatDescription, numSamples, sbufPTS, packetDescriptionPtr, ptr); if (OSStatusException.throwIfNecessary(status)) { CMSampleBuffer buffer = ptr.get(); buffer.localRefconId = refconId; synchronized (makeDataReadyCallbacks) { makeDataReadyCallbacks.put(refconId, callback); } return buffer; } return null; } /**
/** * @throws OSStatusException * @since Available in iOS 4.0 and later. */ @WeaklyLinked public static CMSampleBuffer createAudioSampleBuffer(CMBlockBuffer dataBuffer, boolean dataReady, MakeDataReadyCallback callback, CMFormatDescription formatDescription, @MachineSizedSInt long numSamples, @ByVal CMTime sbufPTS, AudioStreamPacketDescription[] packetDescriptions) throws OSStatusException { long refconId = CMSampleBuffer.refconId.getAndIncrement(); AudioStreamPacketDescription packetDescriptionPtr = Struct.allocate(AudioStreamPacketDescription.class, (int)numSamples); packetDescriptionPtr.update(packetDescriptions); CMSampleBufferPtr ptr = new CMSampleBufferPtr(); OSStatus status = createAudioSampleBuffer0(null, dataBuffer, dataReady, new FunctionPtr(cbMakeDataReady), refconId, formatDescription, numSamples, sbufPTS, packetDescriptionPtr, ptr); if (OSStatusException.throwIfNecessary(status)) { CMSampleBuffer buffer = ptr.get(); buffer.localRefconId = refconId; synchronized (makeDataReadyCallbacks) { makeDataReadyCallbacks.put(refconId, callback); } return buffer; } return null; } /**