Agora Java API Reference for Android
Public Member Functions | List of all members
agora::rtmp::IRtmpUser Class Referenceabstract

#include <NGIAgoraRtmpUser.h>

Public Member Functions

virtual int setAudioStreamConfiguration (const streaming::AudioStreamConfiguration &config)=0
 
virtual int setVideoStreamConfiguration (const streaming::VideoStreamConfiguration &config)=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 (IRtmpUserObserver *observer)=0
 
virtual int unregisteRtmpUserObserver (IRtmpUserObserver *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
 
virtual int snapshot (agora::streaming::ISnapshotCallback *callback)=0
 

Detailed Description

The IRtmpUser 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 Function Documentation

◆ setAudioStreamConfiguration()

virtual int agora::rtmp::IRtmpUser::setAudioStreamConfiguration ( const streaming::AudioStreamConfiguration config)
pure virtual

Configures the RTMP audio stream.

Parameters
configThe reference to the audio stream configurations: AudioStreamConfiguration.
Returns
  • 0: Success.
  • < 0: Failure.

◆ setVideoStreamConfiguration()

virtual int agora::rtmp::IRtmpUser::setVideoStreamConfiguration ( const streaming::VideoStreamConfiguration config)
pure virtual

Configures the RTMP video stream.

Parameters
configThe reference to the video stream configurations: VideoStreamConfiguration.
Returns
  • 0: Success.
  • < 0: Failure.

◆ publishAudio()

virtual int agora::rtmp::IRtmpUser::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::rtmp::IRtmpUser::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.

◆ publishVideo()

virtual int agora::rtmp::IRtmpUser::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::rtmp::IRtmpUser::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::rtmp::IRtmpUser::registerRtmpUserObserver ( IRtmpUserObserver observer)
pure virtual

Registers a RTMP user observer object.

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

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

◆ unregisteRtmpUserObserver()

virtual int agora::rtmp::IRtmpUser::unregisteRtmpUserObserver ( IRtmpUserObserver observer)
pure virtual

Releases the IRtmpUserObserver object previously registered using registerRtmpUserObserver().

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

◆ registerAudioFrameObserver()

virtual int agora::rtmp::IRtmpUser::registerAudioFrameObserver ( media::base::IAudioFrameObserver *  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::rtmp::IRtmpUser::unregisterAudioFrameObserver ( media::base::IAudioFrameObserver *  observer)
pure virtual

Unregisters an audio frame observer object.

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

◆ registerVideoFrameObserver()

virtual int agora::rtmp::IRtmpUser::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::rtmp::IRtmpUser::unregisterVideoFrameObserver ( media::base::IVideoFrameObserver *  observer)
pure virtual

Unregisters a video frame observer object.

Parameters
observerA pointer to the video frame observer: IVideoFrameObserver.

◆ snapshot()

virtual int agora::rtmp::IRtmpUser::snapshot ( agora::streaming::ISnapshotCallback callback)
pure virtual

Registers a ISnapshotCallback object.

Parameters
callbackA pointer to the snapshot callback: ISnapshotCallback. This callback is just only called once
Returns
  • 0: Success.
  • < 0: Failure.