#[repr(C)]
pub struct otc_publisher_callbacks { pub on_stream_created: Option<unsafe extern "C" fn(publisher: *mut otc_publisher, user_data: *mut c_void, stream: *const otc_stream)>, pub on_stream_destroyed: Option<unsafe extern "C" fn(publisher: *mut otc_publisher, user_data: *mut c_void, stream: *const otc_stream)>, pub on_render_frame: Option<unsafe extern "C" fn(publisher: *mut otc_publisher, user_data: *mut c_void, frame: *const otc_video_frame)>, pub on_audio_level_updated: Option<unsafe extern "C" fn(publisher: *mut otc_publisher, user_data: *mut c_void, audio_level: f32)>, pub on_audio_stats: Option<unsafe extern "C" fn(publisher: *mut otc_publisher, user_data: *mut c_void, audio_stats: *mut otc_publisher_audio_stats, number_of_stats: size_t)>, pub on_video_stats: Option<unsafe extern "C" fn(publisher: *mut otc_publisher, user_data: *mut c_void, video_stats: *mut otc_publisher_video_stats, number_of_stats: size_t)>, pub on_error: Option<unsafe extern "C" fn(publisher: *mut otc_publisher, user_data: *mut c_void, error_string: *const c_char, error_code: otc_publisher_error_code)>, pub user_data: *mut c_void, pub reserved: *mut c_void, }
Expand description

Publisher callback functions.

This structure is a set of function pointers to callback functions that can be called in response to events related to an OpenTok publisher.

All callbacks will not be made on the application or main thread but on an internal thread. The application should return the callback as quickly as possible to avoid blocking the internal thread.

Data passed into a callback function (other than publisher and user_data) will be released after the callback is called. Make a copy of the data if you need to retain it.

Fields

on_stream_created: Option<unsafe extern "C" fn(publisher: *mut otc_publisher, user_data: *mut c_void, stream: *const otc_stream)>

Called when the publisher’s stream is created.

@param publisher A pointer to the publisher. @param user_data A pointer to the user_data you set for the publisher. @param stream A pointer to the stream.

on_stream_destroyed: Option<unsafe extern "C" fn(publisher: *mut otc_publisher, user_data: *mut c_void, stream: *const otc_stream)>

Called when the publisher’s stream is destroyed.

@param publisher A pointer to the publisher. @param user_data A pointer to the user_data you set for the publisher. @param strem A pointer to the stream.

on_render_frame: Option<unsafe extern "C" fn(publisher: *mut otc_publisher, user_data: *mut c_void, frame: *const otc_video_frame)>

Called when there is a new frame ready to be rendered by the publisher.

@param publisher A pointer to the publisher. @param user_data A pointer to the user_data you set for the publisher. @param frame A pointer to the new video frame.

on_audio_level_updated: Option<unsafe extern "C" fn(publisher: *mut otc_publisher, user_data: *mut c_void, audio_level: f32)>

Called periodically to report the audio level of the publisher.

@param publisher A pointer to the publisher. @param user_data A pointer to the user_data you set for the publisher. @param audio_level The audio level value, from 0 to 1.0.

on_audio_stats: Option<unsafe extern "C" fn(publisher: *mut otc_publisher, user_data: *mut c_void, audio_stats: *mut otc_publisher_audio_stats, number_of_stats: size_t)>

Called periodically to report audio statistics for the publisher.

@param publisher A pointer to the publisher. @param user_data A pointer to the user_data you set for the publisher. @param audio_stats An array of publisher audio stats. @param number_of_stats The number of audio stats in the array.

on_video_stats: Option<unsafe extern "C" fn(publisher: *mut otc_publisher, user_data: *mut c_void, video_stats: *mut otc_publisher_video_stats, number_of_stats: size_t)>

Called periodically to report video statistics for the publisher.

@param publisher A pointer to the publisher. @param user_data A pointer to the user_data you set for the publisher. @param video_stats An array of publisher video stats. @param number_of_stats The number of video stats in the array.

on_error: Option<unsafe extern "C" fn(publisher: *mut otc_publisher, user_data: *mut c_void, error_string: *const c_char, error_code: otc_publisher_error_code)>

Called when the publisher fails.

@param publisher A pointer to the publisher. @param user_data A pointer to the user_data you set for the publisher. @param error_string A string containing the error message. @param error_code An error code enum value.

user_data: *mut c_void

A pointer to data you set related to the publisher.

reserved: *mut c_void

A void pointer to a memory area holding reserved resources used for the internal implementation.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.