CMAudioSampleBufferCreateWithPacketDescriptions

Function CMAudioSampleBufferCreateWithPacketDescriptions 

Source
pub unsafe extern "C-unwind" fn CMAudioSampleBufferCreateWithPacketDescriptions(
    allocator: Option<&CFAllocator>,
    data_buffer: Option<&CMBlockBuffer>,
    data_ready: bool,
    make_data_ready_callback: CMSampleBufferMakeDataReadyCallback,
    make_data_ready_refcon: *mut c_void,
    format_description: &CMFormatDescription,
    num_samples: CMItemCount,
    presentation_time_stamp: CMTime,
    packet_descriptions: *const AudioStreamPacketDescription,
    sample_buffer_out: NonNull<*mut CMSampleBuffer>,
) -> i32
Available on crate features CMBase and CMBlockBuffer and CMFormatDescription and CMSampleBuffer and CMTime and objc2-core-audio-types only.
Expand description

Creates an CMSampleBuffer containing audio given packetDescriptions instead of sizing and timing info

Provides an optimization over CMSampleBufferCreate() when the caller already has packetDescriptions for the audio data. This routine will use the packetDescriptions to create the sizing and timing arrays required to make the sample buffer if necessary.

ยงSafety

  • make_data_ready_callback must be implemented correctly.
  • make_data_ready_refcon must be a valid pointer or null.
  • packet_descriptions must be a valid pointer or null.
  • sample_buffer_out must be a valid pointer.