opentok_rs_sys

Struct 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§

Source§

impl Clone for otc_publisher_callbacks

Source§

fn clone(&self) -> otc_publisher_callbacks

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for otc_publisher_callbacks

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Copy for otc_publisher_callbacks

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.