Agora C++ API Reference for All Platforms
Public Types | Public Member Functions | List of all members
agora::rtc::IRtmpLocalUser Class Referenceabstract

Public Types

enum  VideoBitrateAdjustType { None = 0, Increasing = 1, Decreasing = 2 }
 

Public Member Functions

virtual ~IRtmpLocalUser ()
 
virtual int setAudioStreamConfiguration (const RtmpStreamingAudioConfiguration &config)=0
 
virtual int setVideoStreamConfiguration (const RtmpStreamingVideoConfiguration &config)=0
 
virtual int adjustRecordingSignalVolume (int volume)=0
 
virtual int getRecordingSignalVolume (int32_t *volume)=0
 
virtual int setAudioEnabled (bool enabled)=0
 
virtual void adjustVideoBitrate (VideoBitrateAdjustType type)=0
 
virtual int setVideoEnabled (bool enabled)=0
 
virtual int publishAudio (agora_refptr< rtc::ILocalAudioTrack > audioTrack)=0
 
virtual int unpublishAudio (agora_refptr< rtc::ILocalAudioTrack > audioTrack)=0
 
virtual int publishMediaPlayerAudio (agora_refptr< rtc::ILocalAudioTrack > audioTrack, int32_t playerId=0)=0
 
virtual int unpublishMediaPlayerAudio (agora_refptr< rtc::ILocalAudioTrack > audioTrack, int32_t playerId=0)=0
 
virtual int publishVideo (agora_refptr< rtc::ILocalVideoTrack > videoTrack)=0
 
virtual int unpublishVideo (agora_refptr< rtc::ILocalVideoTrack > videoTrack)=0
 
virtual int registerRtmpUserObserver (IRtmpLocalUserObserver *observer, void(*safeDeleter)(IRtmpLocalUserObserver *)=NULL)=0
 
virtual int unregisteRtmpUserObserver (IRtmpLocalUserObserver *observer)=0
 
virtual int registerAudioFrameObserver (media::IAudioPcmFrameSink *observer)=0
 
virtual void unregisterAudioFrameObserver (media::IAudioPcmFrameSink *observer)=0
 
virtual int registerVideoFrameObserver (media::base::IVideoFrameObserver *observer)=0
 
virtual void unregisterVideoFrameObserver (media::base::IVideoFrameObserver *observer)=0
 

Detailed Description

The IRtmpLocalUser class defines the behavior and state of the RTMP user.

Once connected, a RTMP connection has its own user. Apps can get the user object using IRtmpConnection::getUser.

Member Enumeration Documentation

◆ VideoBitrateAdjustType

Enumerator
None 
Increasing 
Decreasing 

Constructor & Destructor Documentation

◆ ~IRtmpLocalUser()

virtual agora::rtc::IRtmpLocalUser::~IRtmpLocalUser ( )
inlinevirtual

Member Function Documentation

◆ setAudioStreamConfiguration()

virtual int agora::rtc::IRtmpLocalUser::setAudioStreamConfiguration ( const RtmpStreamingAudioConfiguration config)
pure virtual

Set the parameters of the audio encoder when pushing the stream

Parameters
configAudio encoder parameters
Returns
  • 0: Success.
  • < 0: Failure.

◆ setVideoStreamConfiguration()

virtual int agora::rtc::IRtmpLocalUser::setVideoStreamConfiguration ( const RtmpStreamingVideoConfiguration config)
pure virtual

Set the parameters of the video encoder when pushing the stream

Parameters
configVideo encoder parameters
Returns
  • 0: Success.
  • < 0: Failure.

◆ adjustRecordingSignalVolume()

virtual int agora::rtc::IRtmpLocalUser::adjustRecordingSignalVolume ( int  volume)
pure virtual

Adjusts the audio volume for publishing.

Parameters
volumeThe volume for publishing. The value ranges between 0 and 100 (default).
Returns
  • 0: Success.
  • < 0: Failure.

◆ getRecordingSignalVolume()

virtual int agora::rtc::IRtmpLocalUser::getRecordingSignalVolume ( int32_t *  volume)
pure virtual

Gets the current volume for publishing.

Parameters
volumeA pointer to the publishing volume.
Returns
  • 0: Success.
  • < 0: Failure.

◆ setAudioEnabled()

virtual int agora::rtc::IRtmpLocalUser::setAudioEnabled ( bool  enabled)
pure virtual

Set whether to enable local audio

Parameters
enabledWhether to enable local audio:
  • true: Enable local audio.
  • false: Disable local audio.
Returns
  • 0: Success.
  • < 0: Failure.

◆ adjustVideoBitrate()

virtual void agora::rtc::IRtmpLocalUser::adjustVideoBitrate ( VideoBitrateAdjustType  type)
pure virtual

Dynamically adjust the bit rate parameters of the video encoder in the push stream

Note
: When increasing the bit rate, each call increases by 50kbps; When you lower the bit rate, you reduce it by 100kbps per call
Parameters
typeThe type of adjustment mode for the bit-rate parameter of the video encoder in the push stream:
  • Increasing: Increase the video encoding bitrate.
  • Decreasing: Reduce video encoding bitrate
Returns
  • 0: Success.
  • < 0: Failure.

◆ setVideoEnabled()

virtual int agora::rtc::IRtmpLocalUser::setVideoEnabled ( bool  enabled)
pure virtual

Set whether to enable local video

Parameters
enabledWhether to enable local video:
  • true: Enable local video.
  • false: Disable local video.
Returns
  • 0: Success.
  • < 0: Failure.

◆ publishAudio()

virtual int agora::rtc::IRtmpLocalUser::publishAudio ( agora_refptr< rtc::ILocalAudioTrack audioTrack)
pure virtual

Publishes a local audio track to the RTMP connection.

Parameters
audioTrackThe local audio track to be published: ILocalAudioTrack.
Returns
  • 0: Success.
  • < 0: Failure.

◆ unpublishAudio()

virtual int agora::rtc::IRtmpLocalUser::unpublishAudio ( agora_refptr< rtc::ILocalAudioTrack audioTrack)
pure virtual

Stops publishing the local audio track to the RTMP connection.

Parameters
audioTrackThe local audio track that you want to stop publishing: ILocalAudioTrack.
Returns
  • 0: Success.
  • < 0: Failure.

◆ publishMediaPlayerAudio()

virtual int agora::rtc::IRtmpLocalUser::publishMediaPlayerAudio ( agora_refptr< rtc::ILocalAudioTrack audioTrack,
int32_t  playerId = 0 
)
pure virtual

Publishes a media player local audio track to the RTMP connection.

Parameters
audioTrackThe local audio track to be published: ILocalAudioTrack.
playerIdThe player source ID.
Returns
  • 0: Success.
  • < 0: Failure.

◆ unpublishMediaPlayerAudio()

virtual int agora::rtc::IRtmpLocalUser::unpublishMediaPlayerAudio ( agora_refptr< rtc::ILocalAudioTrack audioTrack,
int32_t  playerId = 0 
)
pure virtual

Stops publishing the media player local audio track to the RTMP connection.

Parameters
audioTrackThe local audio track that you want to stop publishing: ILocalAudioTrack.
playerIdThe player source ID.
Returns
  • 0: Success.
  • < 0: Failure.

◆ publishVideo()

virtual int agora::rtc::IRtmpLocalUser::publishVideo ( agora_refptr< rtc::ILocalVideoTrack videoTrack)
pure virtual

Publishes a local video track to the RTMP connection.

Parameters
videoTrackThe local video track to be published: ILocalVideoTrack.
Returns
  • 0: Success.
  • < 0: Failure.

◆ unpublishVideo()

virtual int agora::rtc::IRtmpLocalUser::unpublishVideo ( agora_refptr< rtc::ILocalVideoTrack videoTrack)
pure virtual

Stops publishing the local video track to the RTMP connection.

Parameters
videoTrackThe local video track that you want to stop publishing: ILocalVideoTrack.
  • 0: Success.
  • < 0: Failure.

◆ registerRtmpUserObserver()

virtual int agora::rtc::IRtmpLocalUser::registerRtmpUserObserver ( IRtmpLocalUserObserver observer,
void(*)(IRtmpLocalUserObserver *)  safeDeleter = NULL 
)
pure virtual

Registers a RTMP user observer object.

You need to implement the IRtmpLocalUserObserver class in this method. Once registered, the IRtmpLocalUserObserver receives events sent by the IRtmpLocalUser object.

Parameters
observerThe pointer to the IRtmpLocalUserObserver object.
Returns
  • 0: Success.
  • < 0: Failure.

◆ unregisteRtmpUserObserver()

virtual int agora::rtc::IRtmpLocalUser::unregisteRtmpUserObserver ( IRtmpLocalUserObserver observer)
pure virtual

Releases the IRtmpLocalUserObserver object previously registered using registerRtmpUserObserver().

Parameters
observerThe pointer to the IRtmpLocalUserObserver object that you want to release.
Returns
  • 0: Success.
  • < 0: Failure.

◆ registerAudioFrameObserver()

virtual int agora::rtc::IRtmpLocalUser::registerAudioFrameObserver ( media::IAudioPcmFrameSink observer)
pure virtual

Registers an audio frame observer object.

Parameters
observerA pointer to the audio frame observer object: IAudioFrameObserver.
Returns
  • 0: Success.
  • < 0: Failure.

◆ unregisterAudioFrameObserver()

virtual void agora::rtc::IRtmpLocalUser::unregisterAudioFrameObserver ( media::IAudioPcmFrameSink observer)
pure virtual

Unregisters an audio frame observer object.

Parameters
observerA pointer to the audio frame observer object: IAudioFrameObserver.

◆ registerVideoFrameObserver()

virtual int agora::rtc::IRtmpLocalUser::registerVideoFrameObserver ( media::base::IVideoFrameObserver observer)
pure virtual

Registers a video frame observer object.

Parameters
observerA pointer to the video frame observer: IVideoFrameObserver.
Returns
  • 0: Success.
  • < 0: Failure.

◆ unregisterVideoFrameObserver()

virtual void agora::rtc::IRtmpLocalUser::unregisterVideoFrameObserver ( media::base::IVideoFrameObserver observer)
pure virtual

Unregisters a video frame observer object.

Parameters
observerA pointer to the video frame observer: IVideoFrameObserver.