Agora Server Gateway SDK C++ API Reference
|
#include <NGIAgoraLocalUser.h>
The ILocalUser class defines the behavior and state of a local user.
Each RTC connection has its own local user. Apps can get the local user object by calling IRtcConnection::getLocalUser.
Each local user has two user roles: broadcaster (publisher and subscriber) and audience (subscriber only). A publisher publishes audio and video tracks, while audience receive them.
|
inlinevirtual |
|
pure virtual |
Gets the role of the user.
|
pure virtual |
Publishes a local audio track to the channel.
By default, all published audio tracks are mixed.
audioTrack | The local audio track to be published. |
|
pure virtual |
Publishes a local video track to the channel.
videoTrack | The local video track to be published. |
|
pure virtual |
Registers an audio frame observer.
You need to implement the IAudioFrameObserverBase
class in this method, and register the following callbacks according to your scenario:
observer | A pointer to the audio frame observer: IAudioFrameObserverBase. |
|
pure virtual |
Registers a local user observer object.
You need to implement the ILocalUserObserver class in this method. Once registered, the ILocalUserObserver receives events of the ILocalUser object.
observer | The pointer to the ILocalUserObserver object. |
|
pure virtual |
Registers an IVideoEncodedFrameObserver object.
You need to implement the IVideoEncodedFrameObserver
class in this method. Once you successfully register the encoded frame observer, the SDK triggers the OnEncodedVideoFrame callback when it receives the encoded video image.
observer | The pointer to the IVideoEncodedFrameObserver object. |
|
pure virtual |
Registers an IVideoFrameObserver2 object.
You need to implement the IVideoFrameObserver2
class in this method. Once you successfully register the video frame observer, the SDK triggers the onFrame callback when it receives the video image.
observer | The pointer to the IVideoFrameObserver2 object. |
|
pure virtual |
Sends intra-frame request to the host with a specified uid.
After you successfully send the request, the host receives the onIntraRequestReceived callback.
userId | The user ID of the host. |
|
pure virtual |
Configures the audio encoder.
The SDK applies the configurations to all the sending audio tracks.
config | The reference to the audio encoder configurations. |
|
pure virtual |
Sets the audio frame parameters for the onMixedAudioFrame callback.
numberOfChannels | The number of channels of the audio frame in the onMixedAudioFrame callback.
|
sampleRateHz | The sample rate (Hz) of the audio frame in the onMixedAudioFrame callback. You can set it as 8000, 16000, 32000, 44100, or 48000. |
samplesPerCall | Sets the number of samples returned in the onMixedAudioFrame callback. samplesPerCall is usually set as 1024 for RTMP or RTMPS streaming. |
|
pure virtual |
Sets the audio frame parameters for the onPlaybackAudioFrameBeforeMixing callback.
numberOfChannels | The number of channels of the audio frame in the onPlaybackAudioFrameBeforeMixing callback.
|
sampleRateHz | The sample rate (Hz) of the audio frame in the onPlaybackAudioFrameBeforeMixing callback. You can set it as 8000, 16000, 32000, 44100, or 48000. |
|
pure virtual |
Sets the audio frame parameters for the onPlaybackAudioFrame callback.
numberOfChannels | The number of audio channels of the audio frame in the onPlaybackAudioFrame callback.
|
sampleRateHz | The sample rate (Hz) of the audio frame in the onPlaybackAudioFrame callback. You can set it as 8000, 16000, 32000, 44100, or 48000. |
mode | Use mode of the audio frame. See RAW_AUDIO_FRAME_OP_MODE_TYPE. |
samplesPerCall | The number of samples of the audio frame. * |
|
pure virtual |
Sets the audio frame parameters for the onRecordAudioFrame callback.
numberOfChannels | The number of channels of the audio frame in the onRecordAudioFrame callback.
|
sampleRateHz | The sample rate (Hz) of the audio frame in the onRecordAudioFrame callback. You can set it as 8000, 16000, 32000, 44100, or 48000. |
mode | Use mode of the audio frame. See RAW_AUDIO_FRAME_OP_MODE_TYPE. |
samplesPerCall | The number of samples of the audio frame. |
|
pure virtual |
Sets the role of the user.
You can call this method either before or after connecting to an Agora channel:
role
, the connection fails with the onConnectionFailure callback. role | The role of the user. See CLIENT_ROLE_TYPE. |
|
pure virtual |
Subscribes to the audio of all remote users in the channel.
This method also automatically subscribes to the audio of any subsequent user.
|
pure virtual |
Subscribes to the video of all remote users in the channel.
This method also automatically subscribes to the video of any subsequent remote user.
subscriptionOptions | The reference to the video subscription options: VideoSubscriptionOptions. |
|
pure virtual |
Subscribes to the audio of a specified remote user in channel.
userId | The ID of the remote user whose audio you want to subscribe to. |
userId
is invalid.
|
pure virtual |
Subscribes to the video of a specified remote user in the channel.
userId | The ID of the user whose video you want to subscribe to. |
subscriptionOptions | The reference to the video subscription options: VideoSubscriptionOptions. For example, subscribing to encoded video data only or subscribing to low-stream video. |
userId
is invalid.
|
pure virtual |
Stops publishing the local audio track to the channel.
audioTrack | The local audio track that you want to stop publishing. |
|
pure virtual |
Stops publishing the local video track to the channel.
videoTrack | The local video track that you want to stop publishing. |
|
pure virtual |
Releases the audio frame observer.
observer | The pointer to the audio frame observer: IAudioFrameObserverBase. |
|
pure virtual |
Releases the ILocalUserObserver object.
observer | The pointer to the ILocalUserObserver object that you want to release. |
|
pure virtual |
Releases the IVideoEncodedFrameObserver object.
observer | The pointer to the IVideoEncodedFrameObserver object. |
|
pure virtual |
Releases the IVideoFrameObserver2 object.
observer | The pointer to the IVideoFrameObserver2 object. |
|
pure virtual |
Stops subscribing to the audio of all remote users in the channel.
This method automatically stops subscribing to the audio of any subsequent user, unless you explicitly call subscribeAudio or subscribeAllAudio.
|
pure virtual |
Stops subscribing to the video of all remote users in the channel.
This method automatically stops subscribing to the video of any subsequent user, unless you explicitly call subscribeVideo or subscribeAllVideo.
|
pure virtual |
Stops subscribing to the audio of a specified remote user in the channel.
userId | The ID of the user whose audio you want to stop subscribing to. |
userId
is invalid.
|
pure virtual |
Stops subscribing to the video of a specified remote user in the channel.
userId | The ID of the user whose video you want to stop subscribing to. |
userId
is invalid.