Agora Server Gateway SDK C++ API Reference
Public Types | Public Member Functions | List of all members
agora::rtc::IRtmpLocalUser Class Referenceabstract

#include <NGIAgoraRtmpLocalUser.h>

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 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::base::IAudioFrameObserver *observer)=0
 
virtual void unregisterAudioFrameObserver (media::base::IAudioFrameObserver *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 local user for the media push.

Each RTMP connection has its own user. You can get the pointer of the local user object through getRtmpLocalUser.

Member Enumeration Documentation

◆ VideoBitrateAdjustType

The adjustment type of the video encoding bitrate.

Enumerator
None 

0: Do not adjust the video encoding bitrate.

Increasing 

1: Increase the video encoding bitrate. Each time you use this enum, the video encoding bitrate increases by 50 kbps.

Decreasing 

2: Decrease the video encoding bitrate. Each time you use this enum, the video encoding bitrate decreases by 100 kbps.

Constructor & Destructor Documentation

◆ ~IRtmpLocalUser()

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

Member Function Documentation

◆ adjustRecordingSignalVolume()

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

Adjusts the audio recording signal volume of the media push.

Parameters
volumeThe volume. The value range is [0,100], where the following applies:
  • 0: Mute.
  • 100: (Default) The original volume.
Returns
  • 0: Success.
  • < 0: Failure.

◆ adjustVideoBitrate()

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

Adjusts the video encoding bitrate of the media push.

The adjustment effect is cumulative when you call this method multiple times. For example, assuming the current video encoding bitrate is 200 kbps, adjustments are applied as follows:

  1. Call this method, and set type to Increasing. The video encoding bitrate increases by 50 kbps, and the current video encoding bitrate becomes 250 kbps.
  2. Call this method again, and set the type to Decreasing. The video encoding bitrate decreases by 100 kbps, and the current video encoding bitrate becomes 150 kbps.
Parameters
typeThe adjustment type of the video encoding bitrate. See VideoBitrateAdjustType.

◆ getRecordingSignalVolume()

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

Gets the audio recording signal volume of the media push.

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

◆ publishAudio()

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

Pushes a local audio stream to the CDN.

Parameters
audioTrackThe local audio track. See ILocalAudioTrack.
Returns
  • 0: Success.
  • < 0: Failure.

◆ publishVideo()

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

Pushes a local video stream to the CDN.

Parameters
videoTrackThe local video track. See ILocalVideoTrack.
Returns
  • 0: Success.
  • < 0: Failure.

◆ registerAudioFrameObserver()

virtual int agora::rtc::IRtmpLocalUser::registerAudioFrameObserver ( media::base::IAudioFrameObserver *  observer)
pure virtual

Registers an audio frame observer.

Parameters
observerA pointer to an IAudioFrameObserver object.
Returns
  • 0: Success.
  • < 0: Failure.

◆ registerRtmpUserObserver()

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

Registers a user observer of the media push.

After successful registration, you can receive related callbacks in the IRtmpLocalUserObserver class.

Parameters
observerA pointer to an IRtmpLocalUserObserver object. You need to implement the IRtmpLocalUserObserver class in this method.
Returns
  • 0: Success.
  • < 0: Failure.

◆ registerVideoFrameObserver()

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

Registers a video frame observer.

Parameters
observerA pointer to an IVideoFrameObserver object.
Returns
  • 0: Success.
  • < 0: Failure.

◆ setAudioEnabled()

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

Enables or disables the local audio in the media push.

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

◆ setAudioStreamConfiguration()

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

Sets the audio encoding properties of the media push.

Parameters
configThe audio encoding configuration of the media push. See RtmpStreamingAudioConfiguration.
Returns
  • 0: Success.
  • < 0: Failure.

◆ setVideoEnabled()

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

Enables or disables the local video in the media push.

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

◆ setVideoStreamConfiguration()

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

Sets the video encoding properties of the media push.

Parameters
configThe video encoding configuration of the media push. See RtmpStreamingVideoConfiguration.
Returns
  • 0: Success.
  • < 0: Failure.

◆ unpublishAudio()

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

Stops pushing a local audio stream to the CDN.

Parameters
audioTrackThe local audio track. See ILocalAudioTrack.
Returns
  • 0: Success.
  • < 0: Failure.

◆ unpublishVideo()

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

Stops pushing a local video stream to the CDN.

Parameters
videoTrackThe local video track. See ILocalVideoTrack.
Returns
  • 0: Success.
  • < 0: Failure.

◆ unregisterAudioFrameObserver()

virtual void agora::rtc::IRtmpLocalUser::unregisterAudioFrameObserver ( media::base::IAudioFrameObserver *  observer)
pure virtual

Releases the registered audio frame observer.

Parameters
observerA pointer to an IAudioFrameObserver object.

◆ unregisteRtmpUserObserver()

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

Releases the registered user observer of the media push.

After successfully releasing the IRtmpLocalUserObserver observer, you can no longer receive any callback in the IRtmpLocalUserObserver class.

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

◆ unregisterVideoFrameObserver()

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

Releases the registered video frame observer.

Parameters
observerA pointer to an IVideoFrameObserver object.

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