pub unsafe extern "C-unwind" fn AudioCodecProduceOutputPackets(
in_codec: AudioCodec,
out_output_data: NonNull<c_void>,
io_output_data_byte_size: NonNull<u32>,
io_number_packets: NonNull<u32>,
out_packet_description: *mut AudioStreamPacketDescription,
out_status: NonNull<u32>,
) -> i32AudioCodec and AudioComponent and objc2-core-audio-types only.Expand description
Produce as many output packets as requested and the amount of input data allows for. The outStatus argument returns information about the codec’s status to allow for proper data management. See the constants above for the possible values that can be returned.
The outPacketDescription argument is an array of AudioStreamPacketDescription structs that describes the packet layout returned in outOutputData. This argument is optional. Pass NULL if this information is not to be returned. Note that this information is only provided when the output format isn’t linear PCM.
Note that decoders will always only produce linear PCM data in multiples of the number frames in a packet of the encoded format (as returned by kAudioCodecPropertyPacketFrameSize). Encoders will consume this many frames of linear PCM data to produce a packet of their format.
Parameter inCodec: The AudioCodec instance
Parameter outOutputData: Pointer to the output data buffer
Parameter ioOutputDataByteSize: A pointer to the size
Parameter ioNumberPackets: number of input/output packets
Returns: The OSStatus value
§Safety
in_codecmust be a valid pointer.out_output_datamust be a valid pointer.io_output_data_byte_sizemust be a valid pointer.io_number_packetsmust be a valid pointer.out_packet_descriptionmust be a valid pointer or null.out_statusmust be a valid pointer.