AudioConverterFillComplexBufferWithPacketDependencies

Function AudioConverterFillComplexBufferWithPacketDependencies 

Source
pub unsafe extern "C-unwind" fn AudioConverterFillComplexBufferWithPacketDependencies(
    in_audio_converter: AudioConverterRef,
    in_input_data_proc: AudioConverterComplexInputDataProc,
    in_input_data_proc_user_data: *mut c_void,
    io_output_data_packet_size: NonNull<u32>,
    out_output_data: NonNull<AudioBufferList>,
    out_packet_descriptions: *mut AudioStreamPacketDescription,
    out_packet_dependencies: NonNull<AudioStreamPacketDependencyDescription>,
) -> i32
Available on crate features AudioConverter and objc2-core-audio-types only.
Expand description

Converts audio data supplied by a callback function, supporting non-interleaved and packetized formats, and also supporting packet dependency descriptions.

For output formats that use packet dependency descriptions, this must be used instead of AudioConverterFillComplexBuffer, which will return an error for such formats.

Parameter inAudioConverter: The audio converter to use for format conversion.

Parameter inInputDataProc: A callback function that supplies audio data to convert. This callback is invoked repeatedly as the converter is ready for new input data.

Parameter inInputDataProcUserData: Custom data for use by your application when receiving a callback invocation.

Parameter ioOutputDataPacketSize: On input, the size of the output buffer (in the outOutputData parameter), expressed in number packets in the audio converter’s output format. On output, the number of packets of converted data that were written to the output buffer.

Parameter outOutputData: The converted output data is written to this buffer. On entry, the buffers’ mDataByteSize fields (which must all be the same) reflect buffer capacity. On exit, mDataByteSize is set to the number of bytes written.

Parameter outPacketDescriptions: If not NULL, and if the audio converter’s output format uses packet descriptions, this must point to a block of memory capable of holding the number of packet descriptions specified in the ioOutputDataPacketSize parameter. (See Audio Format Services Reference for functions that let you determine whether an audio format uses packet descriptions). If not NULL on output and if the audio converter’s output format uses packet descriptions, then this parameter contains an array of packet descriptions.

Parameter outPacketDependencies: Should point to a memory block capable of holding the number of packet dependency description structures specified in the ioOutputDataPacketSize parameter. Must not be NULL. This array will be filled out only by encoders that produce a format which has a non-zero value for kAudioFormatProperty_FormatEmploysDependentPackets.

Returns: A result code.

§Safety

  • in_audio_converter must be a valid pointer.
  • in_input_data_proc must be implemented correctly.
  • in_input_data_proc_user_data must be a valid pointer or null.
  • io_output_data_packet_size must be a valid pointer.
  • out_output_data must be a valid pointer.
  • out_packet_descriptions must be a valid pointer or null.
  • out_packet_dependencies must be a valid pointer.