Google Talk for Developers

ChannelManager Class

Creates and destroys a VoiceChannel object, and provides access to the MediaEngine object. PhoneSessionClient calls this object to get a list of codecs when it prepares a session request or responds to a connection request. Call uses this object to create and destroy VoiceChannels when Session objects are created and destroyed, and stores a map of Session/VoiceChannel pairs. The methods shown are not thread-safe, and can be called on any thread.

One instance of ChannelManager is instantiated for the whole application; it is created by PhoneSessionClient.

Syntax

class ChannelManager : public MessageHandler 

Methods

The following public methods are exposed by ChannelManager.

Name Description
ChannelManager(Thread *worker_thread)

Constructor. Creates the MediaEngine subclass.

  • worker_thread (required) A thread that is used to handle multithreaded operations, such as DestroyVoiceChannel_w and SetAudioOptions_w.
~ChannelManager Destructor. Destroys the voice channel.
VoiceChannel* CreateVoiceChannel(Session *session) Called by Call to create a new VoiceChannel (and helper MediaChannel) when it creates a Session object. Calls CreateVoiceChannel_w on the worker thread passed in to the constructor .
void DestroyVoiceChannel(VoiceChannel *voice_channel) Deletes local references to the VoiceChannel objects and their MediaChannel objects. Calls DestroyVoiceChannel_w on a different thread.
MediaEngine* media_engine() Returns a handle to the MediaEngine object created and used by ChannelManager.
void SetAudioOptions(bool auto_gain_control, int wave_in_device, int wave_out_device)

Called by PhoneSessionClient to set various audio options for the chat. Calls SetAudioOptions_w on a different thread to perform this action.

  • auto_gain_control   Whether or not the engine should attempt to normalize the volume.
  • wave_in_device   Pointer to an audio capture device.
  • wave_out_device   Pointer to an audio rendering device.
Thread* worker_thread() The thread passed in to the constructor, used to handle the multithreaded methods. This should be the worker thread used by the application.

Structs

Name Description
cricket::ChannelManager::AudioOptions

Describes the audio options that the media engine uses. It has the following members:

  • auto_gain_control   Whether or not the engine should attempt to normalize the volume.
  • wave_in_device   Pointer to an audio capture device.
  • wave_out_device   Pointer to an audio rendering device.

Attributes: public

Declaration file: talk/session/phone/channelmanager.h

Authentication required

You need to be signed in with Google+ to do that.

Signing you in...

Google Developers needs your permission to do that.