Agora C++ API Reference for All Platforms

Loading...
Searching...
No Matches
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, aosl_ref_t ares=AOSL_REF_INVALID)=0
virtual int | setVideoStreamConfiguration (const RtmpStreamingVideoConfiguration &config, aosl_ref_t ares=AOSL_REF_INVALID)=0
virtual int | adjustRecordingSignalVolume (int volume, aosl_ref_t ares=AOSL_REF_INVALID)=0
virtual int | getRecordingSignalVolume (int32_t *volume)=0
virtual int | adjustVideoBitrate (VideoBitrateAdjustType type, aosl_ref_t ares=AOSL_REF_INVALID)=0
virtual int | setVideoEnabled (bool enabled, aosl_ref_t ares=AOSL_REF_INVALID)=0
virtual int | publishAudio (agora_refptr< rtc::ILocalAudioTrack > audioTrack, aosl_ref_t ares=AOSL_REF_INVALID)=0
virtual int | unpublishAudio (agora_refptr< rtc::ILocalAudioTrack > audioTrack, aosl_ref_t ares=AOSL_REF_INVALID)=0
virtual int | publishVideo (agora_refptr< rtc::ILocalVideoTrack > videoTrack, aosl_ref_t ares=AOSL_REF_INVALID)=0
virtual int | unpublishVideo (agora_refptr< rtc::ILocalVideoTrack > videoTrack, aosl_ref_t ares=AOSL_REF_INVALID)=0
virtual int | registerRtmpUserObserver (IRtmpLocalUserObserver *observer, void(*safeDeleter)(IRtmpLocalUserObserver *)=NULL, aosl_ref_t ares=AOSL_REF_INVALID)=0
virtual int | unregisterRtmpUserObserver (IRtmpLocalUserObserver *observer)=0
virtual int | registerAudioFrameObserver (media::IAudioPcmFrameSink *observer, aosl_ref_t ares=AOSL_REF_INVALID)=0
virtual void | unregisterAudioFrameObserver (media::IAudioPcmFrameSink *observer)=0
virtual int | registerVideoFrameObserver (media::base::IVideoFrameObserver *observer, aosl_ref_t ares=AOSL_REF_INVALID)=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

enum agora::rtc::IRtmpLocalUser::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,
|  | aosl_ref_t | ares = AOSL_REF_INVALID )
| pure virtual

Set the parameters of the audio encoder when pushing the stream

Parameters

  config | Audio encoder parameters

Returns
  - 0: Success.
  - < 0: Failure.

## ◆ setVideoStreamConfiguration()

virtual int agora::rtc::IRtmpLocalUser::setVideoStreamConfiguration | ( | const RtmpStreamingVideoConfiguration & | config,
|  | aosl_ref_t | ares = AOSL_REF_INVALID )
| pure virtual

Set the parameters of the video encoder when pushing the stream

Parameters

  config | Video encoder parameters

Returns
  - 0: Success.
  - < 0: Failure.

## ◆ adjustRecordingSignalVolume()

virtual int agora::rtc::IRtmpLocalUser::adjustRecordingSignalVolume | ( | int | volume,
|  | aosl_ref_t | ares = AOSL_REF_INVALID )
| pure virtual

Adjusts the audio volume for publishing.

Parameters

  volume | The 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

  volume | A pointer to the publishing volume.

Returns
  - 0: Success.
  - < 0: Failure.

## ◆ adjustVideoBitrate()

virtual int agora::rtc::IRtmpLocalUser::adjustVideoBitrate | ( | VideoBitrateAdjustType | type,
|  | aosl_ref_t | ares = AOSL_REF_INVALID )
| 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

  type | The 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,
|  | aosl_ref_t | ares = AOSL_REF_INVALID )
| pure virtual

Set whether to enable local video

Parameters

  enabled | Whether 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,
|  | aosl_ref_t | ares = AOSL_REF_INVALID )
| pure virtual

Publishes a local audio track to the RTMP connection.

Parameters

  audioTrack | The local audio track to be published: ILocalAudioTrack.

Returns
  - 0: Success.
  - < 0: Failure.

## ◆ unpublishAudio()

virtual int agora::rtc::IRtmpLocalUser::unpublishAudio | ( | agora_refptr< rtc::ILocalAudioTrack > | audioTrack,
|  | aosl_ref_t | ares = AOSL_REF_INVALID )
| pure virtual

Stops publishing the local audio track to the RTMP connection.

Parameters

  audioTrack | The local audio track that you want to stop publishing: ILocalAudioTrack.

Returns
  - 0: Success.
  - < 0: Failure.

## ◆ publishVideo()

virtual int agora::rtc::IRtmpLocalUser::publishVideo | ( | agora_refptr< rtc::ILocalVideoTrack > | videoTrack,
|  | aosl_ref_t | ares = AOSL_REF_INVALID )
| pure virtual

Publishes a local video track to the RTMP connection.

Parameters

  videoTrack | The local video track to be published: ILocalVideoTrack.

Returns
  - 0: Success.
  - < 0: Failure.

## ◆ unpublishVideo()

virtual int agora::rtc::IRtmpLocalUser::unpublishVideo | ( | agora_refptr< rtc::ILocalVideoTrack > | videoTrack,
|  | aosl_ref_t | ares = AOSL_REF_INVALID )
| pure virtual

Stops publishing the local video track to the RTMP connection.

Parameters

  videoTrack | The local video track that you want to stop publishing: ILocalVideoTrack. 0: Success. < 0: Failure.

## ◆ registerRtmpUserObserver()

virtual int agora::rtc::IRtmpLocalUser::registerRtmpUserObserver | ( | IRtmpLocalUserObserver * | observer,
|  | void(* | safeDeleter )(IRtmpLocalUserObserver *) = NULL,
|  | aosl_ref_t | ares = AOSL_REF_INVALID )
| 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

  observer | The pointer to the IRtmpLocalUserObserver object.

Returns
  - 0: Success.
  - < 0: Failure.

## ◆ unregisterRtmpUserObserver()

virtual int agora::rtc::IRtmpLocalUser::unregisterRtmpUserObserver | ( | IRtmpLocalUserObserver * | observer | ) |
| pure virtual

Releases the IRtmpLocalUserObserver object previously registered using registerRtmpUserObserver().

Parameters

  observer | The 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,
|  | aosl_ref_t | ares = AOSL_REF_INVALID )
| pure virtual

Registers an audio frame observer object.

Parameters

  observer | A 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

  observer | A pointer to the audio frame observer object: IAudioFrameObserver.

## ◆ registerVideoFrameObserver()

virtual int agora::rtc::IRtmpLocalUser::registerVideoFrameObserver | ( | media::base::IVideoFrameObserver * | observer,
|  | aosl_ref_t | ares = AOSL_REF_INVALID )
| pure virtual

Registers a video frame observer object.

Parameters

  observer | A 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

  observer | A pointer to the video frame observer: IVideoFrameObserver.