_cef_audio_handler_t

Struct _cef_audio_handler_t 

Source
#[repr(C)]
pub struct _cef_audio_handler_t { pub base: cef_base_ref_counted_t, pub get_audio_parameters: Option<unsafe extern "C" fn(self_: *mut _cef_audio_handler_t, browser: *mut _cef_browser_t, params: *mut cef_audio_parameters_t) -> c_int>, pub on_audio_stream_started: Option<unsafe extern "C" fn(self_: *mut _cef_audio_handler_t, browser: *mut _cef_browser_t, params: *const cef_audio_parameters_t, channels: c_int)>, pub on_audio_stream_packet: Option<unsafe extern "C" fn(self_: *mut _cef_audio_handler_t, browser: *mut _cef_browser_t, data: *mut *const f32, frames: c_int, pts: i64)>, pub on_audio_stream_stopped: Option<unsafe extern "C" fn(self_: *mut _cef_audio_handler_t, browser: *mut _cef_browser_t)>, pub on_audio_stream_error: Option<unsafe extern "C" fn(self_: *mut _cef_audio_handler_t, browser: *mut _cef_browser_t, message: *const cef_string_t)>, }
Expand description

Implement this structure to handle audio events.

NOTE: This struct is allocated client-side.

Fields§

§base: cef_base_ref_counted_t

Base structure.

§get_audio_parameters: Option<unsafe extern "C" fn(self_: *mut _cef_audio_handler_t, browser: *mut _cef_browser_t, params: *mut cef_audio_parameters_t) -> c_int>

Called on the UI thread to allow configuration of audio stream parameters. Return true (1) to proceed with audio stream capture, or false (0) to cancel it. All members of |params| can optionally be configured here, but they are also pre-filled with some sensible defaults.

§on_audio_stream_started: Option<unsafe extern "C" fn(self_: *mut _cef_audio_handler_t, browser: *mut _cef_browser_t, params: *const cef_audio_parameters_t, channels: c_int)>

Called on a browser audio capture thread when the browser starts streaming audio. OnAudioStreamStopped will always be called after OnAudioStreamStarted; both functions may be called multiple times for the same browser. |params| contains the audio parameters like sample rate and channel layout. |channels| is the number of channels.

§on_audio_stream_packet: Option<unsafe extern "C" fn(self_: *mut _cef_audio_handler_t, browser: *mut _cef_browser_t, data: *mut *const f32, frames: c_int, pts: i64)>

Called on the audio stream thread when a PCM packet is received for the stream. |data| is an array representing the raw PCM data as a floating point type, i.e. 4-byte value(s). |frames| is the number of frames in the PCM packet. |pts| is the presentation timestamp (in milliseconds since the Unix Epoch) and represents the time at which the decompressed packet should be presented to the user. Based on |frames| and the |channel_layout| value passed to OnAudioStreamStarted you can calculate the size of the |data| array in bytes.

§on_audio_stream_stopped: Option<unsafe extern "C" fn(self_: *mut _cef_audio_handler_t, browser: *mut _cef_browser_t)>

Called on the UI thread when the stream has stopped. OnAudioSteamStopped will always be called after OnAudioStreamStarted; both functions may be called multiple times for the same stream.

§on_audio_stream_error: Option<unsafe extern "C" fn(self_: *mut _cef_audio_handler_t, browser: *mut _cef_browser_t, message: *const cef_string_t)>

Called on the UI or audio stream thread when an error occurred. During the stream creation phase this callback will be called on the UI thread while in the capturing phase it will be called on the audio stream thread. The stream will be stopped immediately.

Trait Implementations§

Source§

impl Clone for _cef_audio_handler_t

Source§

fn clone(&self) -> _cef_audio_handler_t

Returns a duplicate 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 _cef_audio_handler_t

Source§

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

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

impl Copy for _cef_audio_handler_t

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, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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.