Chromium Embedded Framework (CEF)  128.4.2+g5c235a2+chromium-128.0.6613.18
CefAudioHandler Class Referenceabstract

Implement this interface to handle audio events. More...

#include "include/cef_audio_handler.h"

Inheritance diagram for CefAudioHandler:
CefBaseRefCounted

Public Types

typedef cef_channel_layout_t ChannelLayout
 

Public Member Functions

virtual bool GetAudioParameters (CefRefPtr< CefBrowser > browser, CefAudioParameters &params)
 Called on the UI thread to allow configuration of audio stream parameters. More...
 
virtual void OnAudioStreamStarted (CefRefPtr< CefBrowser > browser, const CefAudioParameters &params, int channels)=0
 Called on a browser audio capture thread when the browser starts streaming audio. More...
 
virtual void OnAudioStreamPacket (CefRefPtr< CefBrowser > browser, const float **data, int frames, int64_t pts)=0
 Called on the audio stream thread when a PCM packet is received for the stream. More...
 
virtual void OnAudioStreamStopped (CefRefPtr< CefBrowser > browser)=0
 Called on the UI thread when the stream has stopped. More...
 
virtual void OnAudioStreamError (CefRefPtr< CefBrowser > browser, const CefString &message)=0
 Called on the UI or audio stream thread when an error occurred. More...
 
- Public Member Functions inherited from CefBaseRefCounted
virtual void AddRef () const =0
 Called to increment the reference count for the object. More...
 
virtual bool Release () const =0
 Called to decrement the reference count for the object. More...
 
virtual bool HasOneRef () const =0
 Returns true if the reference count is 1. More...
 
virtual bool HasAtLeastOneRef () const =0
 Returns true if the reference count is at least 1. More...
 

Additional Inherited Members

- Protected Member Functions inherited from CefBaseRefCounted
virtual ~CefBaseRefCounted ()
 

Detailed Description

Implement this interface to handle audio events.

Member Typedef Documentation

◆ ChannelLayout

Member Function Documentation

◆ GetAudioParameters()

virtual bool CefAudioHandler::GetAudioParameters ( CefRefPtr< CefBrowser browser,
CefAudioParameters params 
)
inlinevirtual

Called on the UI thread to allow configuration of audio stream parameters.

Return true to proceed with audio stream capture, or false to cancel it. All members of |params| can optionally be configured here, but they are also pre-filled with some sensible defaults.

◆ OnAudioStreamError()

virtual void CefAudioHandler::OnAudioStreamError ( CefRefPtr< CefBrowser browser,
const CefString message 
)
pure virtual

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.

◆ OnAudioStreamPacket()

virtual void CefAudioHandler::OnAudioStreamPacket ( CefRefPtr< CefBrowser browser,
const float **  data,
int  frames,
int64_t  pts 
)
pure virtual

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.

◆ OnAudioStreamStarted()

virtual void CefAudioHandler::OnAudioStreamStarted ( CefRefPtr< CefBrowser browser,
const CefAudioParameters params,
int  channels 
)
pure virtual

Called on a browser audio capture thread when the browser starts streaming audio.

OnAudioStreamStopped will always be called after OnAudioStreamStarted; both methods 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.

◆ OnAudioStreamStopped()

virtual void CefAudioHandler::OnAudioStreamStopped ( CefRefPtr< CefBrowser browser)
pure virtual

Called on the UI thread when the stream has stopped.

OnAudioSteamStopped will always be called after OnAudioStreamStarted; both methods may be called multiple times for the same stream.


The documentation for this class was generated from the following file: