Agora C++ API Reference for All Platforms
Public Member Functions | Protected Member Functions | List of all members
agora::rtc::IRtmpStreamingService Class Referenceabstract

Inherits agora::RefCountInterface.

Public Member Functions

virtual int addPublishStreamUrl (const char *url, bool transcodingEnabled)=0
 
virtual int removePublishStreamUrl (const char *url)=0
 
virtual int setLiveTranscoding (const LiveTranscoding &transcoding)=0
 
virtual int registerObserver (IRtmpStreamingObserver *observer)=0
 
virtual int unregisterObserver (IRtmpStreamingObserver *observer)=0
 
- Public Member Functions inherited from agora::RefCountInterface
virtual void AddRef () const =0
 
virtual RefCountReleaseStatus Release () const =0
 
virtual bool HasOneRef () const =0
 

Protected Member Functions

 ~IRtmpStreamingService ()
 
- Protected Member Functions inherited from agora::RefCountInterface
virtual ~RefCountInterface ()
 

Detailed Description

The IRtmpStreamingService class, which enables the live stream service.

Constructor & Destructor Documentation

◆ ~IRtmpStreamingService()

agora::rtc::IRtmpStreamingService::~IRtmpStreamingService ( )
inlineprotected

Member Function Documentation

◆ addPublishStreamUrl()

virtual int agora::rtc::IRtmpStreamingService::addPublishStreamUrl ( const char *  url,
bool  transcodingEnabled 
)
pure virtual

Publishes the local stream to the CDN.

This method triggers the onRtmpStreamingStateChanged callback on the local client to report the state of adding a local stream to the CDN.

Note
  • Ensure that you enable the RTMP Converter service before using this function.
  • This method applies to Live-Broadcast only.
  • Ensure that the user joins a channel before calling this method.
  • This method adds only one stream URL address each time it is called.
Parameters
urlThe CDN streaming URL in the RTMP format. The maximum length of this parameter is 1024 bytes. The URL address must not contain special character, such as Chinese language characters.
transcodingEnabledSets whether transcoding is enabled/disabled. If you set this parameter as true, ensure that you call the setLiveTranscoding method before this method.
  • true: Enable transcoding.
  • false: Disable transcoding.
Returns
  • 0: Success.
  • < 0: Failure.

◆ removePublishStreamUrl()

virtual int agora::rtc::IRtmpStreamingService::removePublishStreamUrl ( const char *  url)
pure virtual

Removes an RTMP stream from the CDN.

This method removes the RTMP URL address added by addPublishStreamUrl from a CDN live stream. The SDK triggers the onRtmpStreamingStated callback on the local client to report the state of removing an RTMP stream from the CDN.

Note
  • Ensure that you enable the RTMP Converter service before using this function.
  • This method applies to Live-Broadcast only.
  • This method removes only one stream URL address each time it is called.
Parameters
urlThe RTMP URL address to be removed. The maximum length of this parameter is 1024 bytes. The URL address must not contain special character, such as Chinese language characters.
Returns
  • 0: Success.
  • < 0: Failure.

◆ setLiveTranscoding()

virtual int agora::rtc::IRtmpStreamingService::setLiveTranscoding ( const LiveTranscoding transcoding)
pure virtual

Sets the video layout and audio settings for CDN live.

The SDK triggers the onTranscodingUpdated callback when the LiveTranscoding class is updated using this method. If you call this method to set LiveTrancoding for the first time, the SDK does not trigger this callback.

Note
  • Ensure that you enable the RTMP Converter service before using this function.
  • This method applies to Live-Broadcast only.
  • Ensure that you call this method before calling addPublishStreamUrl().

◆ registerObserver()

virtual int agora::rtc::IRtmpStreamingService::registerObserver ( IRtmpStreamingObserver observer)
pure virtual

Registers an RTMP streaming observer.

Parameters
observerThe pointer to an RTMP streaming observer. See IRtmpStreamingObserver.
Returns
  • 0: Success.
  • < 0: Failure.

◆ unregisterObserver()

virtual int agora::rtc::IRtmpStreamingService::unregisterObserver ( IRtmpStreamingObserver observer)
pure virtual

Releases the RTMP streaming observer created by registerObserver().

Parameters
observerThe pointer to the RTMP streaming observer that you want to release. See IRtmpStreamingObserver.
Returns
  • 0: Success.
  • < 0: Failure.