pjmedia_aud_play_cb typedef

pjmedia_aud_play_cb = Pointer<NativeFunction<pj_status_t Function(Pointer<Void> user_data, Pointer<pjmedia_frame> frame)>>

This callback is called by player stream when it needs additional data to be played by the device. Application must fill in the whole of output buffer with audio samples.

The frame argument contains the following values:

  • timestamp Playback timestamp, in samples.
  • buf Buffer to be filled out by application.
  • size The size requested in bytes, which will be equal to the size of one whole packet.

@param user_data User data associated with the stream. @param frame Audio frame, which buffer is to be filled in by the application.

@return Returning non-PJ_SUCCESS will cause the audio stream to stop

Implementation

typedef pjmedia_aud_play_cb = ffi.Pointer<
    ffi.NativeFunction<
        pj_status_t Function(ffi.Pointer<ffi.Void> user_data,
            ffi.Pointer<pjmedia_frame> frame)>>;