pub unsafe extern "C" fn OH_AudioStreamBuilder_SetRendererWriteDataCallbackAdvanced(
builder: *mut OH_AudioStreamBuilder,
callback: OH_AudioRenderer_OnWriteDataCallbackAdvanced,
userData: *mut c_void,
) -> OH_AudioStream_ResultAvailable on crate feature
api-20 only.Expand description
Set the callback of writing data to renderer client.
This function is similar with OH_AudioStreamBuilder_SetRendererWriteDataCallback. Only the last callback set
by OH_AudioStreamBuilder_SetRendererWriteDataCallback or this function will become effective. Different with
OH_AudioStreamBuilder_SetRendererWriteDataCallback, the callback in this function can return audio data of any
length.
§Arguments
-
builder- Builder provided by OH_AudioStreamBuilder_Create() -
callback- Callback to functions that will write audio data to renderer client. -
userData- Pointer to an application data structure that will be passed to the callback functions.
§Returns
- Result code.
[
AUDIOSTREAM_SUCCESS] Success. [AUDIOSTREAM_ERROR_INVALID_PARAM] Parameter is invalid, e.g. builder is nullptr, e.t.c.
Available since API-level: 20