Struct opentok_rs_sys::otc_publisher_callbacks
source · [−]#[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
sourceimpl Clone for otc_publisher_callbacks
impl Clone for otc_publisher_callbacks
sourcefn clone(&self) -> otc_publisher_callbacks
fn clone(&self) -> otc_publisher_callbacks
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for otc_publisher_callbacks
impl Debug for otc_publisher_callbacks
impl Copy for otc_publisher_callbacks
Auto Trait Implementations
impl RefUnwindSafe for otc_publisher_callbacks
impl !Send for otc_publisher_callbacks
impl !Sync for otc_publisher_callbacks
impl Unpin for otc_publisher_callbacks
impl UnwindSafe for otc_publisher_callbacks
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more