Agora RTC Objective-C API Reference Refactor

Public Member Functions
IRtmpLocalUser Class Referenceabstract

## Public Member Functions
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 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 | unregisterRtmpUserObserver (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

enum VideoBitrateAdjustType

Enumerator
None |
Increasing |
Decreasing |

## Constructor & Destructor Documentation

## ◆ ~IRtmpLocalUser()

virtual ~IRtmpLocalUser | ( |  | ) |
| inlinevirtual

## Member Function Documentation

## ◆ setAudioStreamConfiguration()

virtual int setAudioStreamConfiguration | ( | const RtmpStreamingAudioConfiguration & | config | ) |
| 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 setVideoStreamConfiguration | ( | const RtmpStreamingVideoConfiguration & | config | ) |
| 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 adjustRecordingSignalVolume | ( | int | volume | ) |
| 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 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 void 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

  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 setVideoEnabled | ( | bool | enabled | ) |
| 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 publishAudio | ( | agora_refptr< rtc::ILocalAudioTrack > | audioTrack | ) |
| 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 unpublishAudio | ( | agora_refptr< rtc::ILocalAudioTrack > | audioTrack | ) |
| 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 publishVideo | ( | agora_refptr< rtc::ILocalVideoTrack > | videoTrack | ) |
| 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 unpublishVideo | ( | agora_refptr< rtc::ILocalVideoTrack > | videoTrack | ) |
| 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 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

  observer | The pointer to the IRtmpLocalUserObserver object.

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

## ◆ unregisterRtmpUserObserver()

virtual int 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 registerAudioFrameObserver | ( | media::IAudioPcmFrameSink * | observer | ) |
| 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 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 registerVideoFrameObserver | ( | media::base::IVideoFrameObserver * | observer | ) |
| 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 unregisterVideoFrameObserver | ( | media::base::IVideoFrameObserver * | observer | ) |
| pure virtual

Unregisters a video frame observer object.

Parameters

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