Agora RTC Objective-C API Reference Refactor

Public Member Functions
IRtmpConnectionObserver Class Referenceabstract

## Public Member Functions
virtual void | onConnected (const RtmpConnectionInfo &connectionInfo)=0
virtual void | onDisconnected (const RtmpConnectionInfo &connectionInfo)=0
virtual void | onReconnecting (const RtmpConnectionInfo &connectionInfo)=0
virtual void | onReconnected (const RtmpConnectionInfo &connectionInfo)=0
virtual void | onConnectionFailure (const RtmpConnectionInfo &connectionInfo, RTMP_CONNECTION_ERROR errCode)=0
virtual void | onTransferStatistics (uint64_t video_width, uint64_t video_height, uint64_t video_bitrate, uint64_t audio_bitrate, uint64_t video_frame_rate, uint64_t push_video_frame_cnt, uint64_t pop_video_frame_cnt)=0

## Detailed Description

The IRtmpConnectionObserver class, which observes the RTMP connection state of the SDK.

## Constructor & Destructor Documentation

## ◆ ~IRtmpConnectionObserver()

virtual ~IRtmpConnectionObserver | ( |  | ) |
| inline virtual

## Member Function Documentation

## ◆ onConnected()

virtual void onConnected | ( | const RtmpConnectionInfo & | connectionInfo | ) |
| pure virtual

Occurs when the connection state between the SDK and the RTMP server changes to STATE_CONNECTED(3).

Parameters

  connectionInfo | The information of the current connection: RtmpConnectionInfo.

## ◆ onDisconnected()

virtual void onDisconnected | ( | const RtmpConnectionInfo & | connectionInfo | ) |
| pure virtual

Occurs when the connection state between the SDK and the RTMP server changes to STATE_DISCONNECTED(1).

Parameters

  connectionInfo | The information of the current connection: RtmpConnectionInfo.

## ◆ onReconnecting()

virtual void onReconnecting | ( | const RtmpConnectionInfo & | connectionInfo | ) |
| pure virtual

Occurs when the connection state between the SDK and RTMP server changes to STATE_RECONNECTING(4).

Parameters

  connectionInfo | The information of the current connection: RtmpConnectionInfo.

## ◆ onReconnected()

virtual void onReconnected | ( | const RtmpConnectionInfo & | connectionInfo | ) |
| pure virtual

Occurs when the connection state between the SDK and RTMP server changes to STATE_RECONNECTED(6).

Parameters

  connectionInfo | The information of the current connection: RtmpConnectionInfo.

## ◆ onConnectionFailure()

virtual void onConnectionFailure | ( | const RtmpConnectionInfo & | connectionInfo,
|  | RTMP_CONNECTION_ERROR | errCode
| ) |  |
| pure virtual

Occurs when the connection state between the SDK and the RTMP server changes to STATE_FAILED(5).

Parameters

  connectionInfo | The connection information: RtmpConnectionInfo.
  errCode | The error code for the connection failure.

## ◆ onTransferStatistics()

virtual void onTransferStatistics | ( | uint64_t | video_width,
|  | uint64_t | video_height,
|  | uint64_t | video_bitrate,
|  | uint64_t | audio_bitrate,
|  | uint64_t | video_frame_rate,
|  | uint64_t | push_video_frame_cnt,
|  | uint64_t | pop_video_frame_cnt
| ) |  |
| pure virtual

Occurs every 1s when the connection transmits data, report the current video bitrate, audio bitrate and video framerate.

Parameters

  video_width | The width of the video frame actually pushed out
  video_height | The height of the video frame actually pushed out
  video_bitrate | The actual bitrate of the video stream being pushed out
  audio_bitrate | The actual bitrate of the audio stream being pushed out
  video_frame_rate | The frame rate of the video stream actually pushed out