Agora C++ API Reference for All Platforms

Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
agora::rtc::IMediaPlayerSourceEx Class Referenceabstract

Inherits agora::rtc::IMediaPlayerSource.

## Public Member Functions
virtual agora_refptr< rtc::IAudioPcmDataSender > | getAudioPcmDataSender ()=0
virtual agora_refptr< rtc::IVideoFrameSender > | getVideoFrameSender ()=0
virtual void | setRenderLastVideoFrame (bool set_black_frame)=0
virtual bool | showBlackFrameWhenStop ()=0
virtual int64_t | getFirstAudioFramePts ()=0
virtual int64_t | getFirstVideoFramePts ()=0
virtual int | getPlayerOption (const char *key, int64_t &value)=0
virtual int | registerPlayerSourceObserverEx (IMediaPlayerSourceObserver *observer, bool internal)=0
int | registerPlayerSourceObserver (IMediaPlayerSourceObserver *observer) final
virtual void | onPlayerSourceObserverCallback (std::function< void(IMediaPlayerSourceObserver *)> &&task)=0
Public Member Functions inherited from agora::rtc::IMediaPlayerSource
virtual int | getSourceId () const =0
virtual int | open (const char *url, int64_t startPos)=0
virtual int | openWithMediaSource (const media::base::MediaSource &source)=0
virtual int | play ()=0
virtual int | pause ()=0
virtual int | stop ()=0
virtual int | resume ()=0
virtual int | seek (int64_t newPos)=0
virtual int | getDuration (int64_t &duration)=0
virtual int | getPlayPosition (int64_t &pos)=0
virtual int | getStreamCount (int64_t &count)=0
virtual int | getStreamInfo (int64_t index, media::base::PlayerStreamInfo *info)=0
virtual int | setLoopCount (int64_t loopCount)=0
virtual int | setPlaybackSpeed (int speed)=0
virtual int | selectAudioTrack (int64_t index)=0
virtual int | selectMultiAudioTrack (int playoutTrackIndex, int publishTrackIndex)=0
virtual int | setPlayerOption (const char *key, int64_t value)=0
virtual int | setPlayerOption (const char *key, const char *value)=0
virtual int | takeScreenshot (const char *filename)=0
virtual int | selectInternalSubtitle (int64_t index)=0
virtual int | setExternalSubtitle (const char *url)=0
virtual media::base::MEDIA_PLAYER_STATE | getState ()=0
virtual int | unregisterPlayerSourceObserver (IMediaPlayerSourceObserver *observer)=0
virtual int | registerAudioFrameObserver (media::IAudioPcmFrameSink *observer)=0
virtual int | unregisterAudioFrameObserver (media::IAudioPcmFrameSink *observer)=0
virtual int | openWithAgoraCDNSrc (const char *src, int64_t startPos)=0
virtual int | getAgoraCDNLineCount ()=0
virtual int | switchAgoraCDNLineByIndex (int index)=0
virtual int | getCurrentAgoraCDNIndex ()=0
virtual int | enableAutoSwitchAgoraCDN (bool enable)=0
virtual int | renewAgoraCDNSrcToken (const char *token, int64_t ts)=0
virtual int | switchAgoraCDNSrc (const char *src, bool syncPts=false)=0
virtual int | switchSrc (const char *src, bool syncPts)=0
virtual int | preloadSrc (const char *src, int64_t startPos)=0
virtual int | unloadSrc (const char *src)=0
virtual int | playPreloadedSrc (const char *src)=0
Public Member Functions inherited from agora::RefCountInterface
virtual void | AddRef () const =0
virtual RefCountReleaseStatus | Release () const =0
virtual bool | HasOneRef () const =0

## Static Public Member Functions
static agora_refptr< IMediaPlayerSourceEx > | Create (base::IAgoraService *agora_service, media::base::MEDIA_PLAYER_SOURCE_TYPE type=media::base::MEDIA_PLAYER_SOURCE_DEFAULT)

## Protected Member Functions
virtual | ~IMediaPlayerSourceEx ()=default
Protected Member Functions inherited from agora::rtc::IMediaPlayerSource
virtual | ~IMediaPlayerSource ()
Protected Member Functions inherited from agora::RefCountInterface
virtual | ~RefCountInterface ()

## Constructor & Destructor Documentation

## ◆ ~IMediaPlayerSourceEx()

virtual agora::rtc::IMediaPlayerSourceEx::~IMediaPlayerSourceEx | ( |  | ) |
| protected virtual default

## Member Function Documentation

## ◆ Create()

static agora_refptr<IMediaPlayerSourceEx> agora::rtc::IMediaPlayerSourceEx::Create | ( | base::IAgoraService * | agora_service,
|  | media::base::MEDIA_PLAYER_SOURCE_TYPE | type = `media::base::MEDIA_PLAYER_SOURCE_DEFAULT`
| ) |  |
| static

## ◆ getAudioPcmDataSender()

virtual agora_refptr<rtc::IAudioPcmDataSender> agora::rtc::IMediaPlayerSourceEx::getAudioPcmDataSender | ( |  | ) |
| pure virtual

## ◆ getVideoFrameSender()

virtual agora_refptr<rtc::IVideoFrameSender> agora::rtc::IMediaPlayerSourceEx::getVideoFrameSender | ( |  | ) |
| pure virtual

## ◆ setRenderLastVideoFrame()

virtual void agora::rtc::IMediaPlayerSourceEx::setRenderLastVideoFrame | ( | bool | set_black_frame | ) |
| pure virtual

## ◆ showBlackFrameWhenStop()

virtual bool agora::rtc::IMediaPlayerSourceEx::showBlackFrameWhenStop | ( |  | ) |
| pure virtual

## ◆ getFirstAudioFramePts()

virtual int64_t agora::rtc::IMediaPlayerSourceEx::getFirstAudioFramePts | ( |  | ) |
| pure virtual

## ◆ getFirstVideoFramePts()

virtual int64_t agora::rtc::IMediaPlayerSourceEx::getFirstVideoFramePts | ( |  | ) |
| pure virtual

## ◆ getPlayerOption()

virtual int agora::rtc::IMediaPlayerSourceEx::getPlayerOption | ( | const char * | key,
|  | int64_t & | value
| ) |  |
| pure virtual

## ◆ registerPlayerSourceObserverEx()

virtual int agora::rtc::IMediaPlayerSourceEx::registerPlayerSourceObserverEx | ( | IMediaPlayerSourceObserver * | observer,
|  | bool | internal
| ) |  |
| pure virtual

## ◆ registerPlayerSourceObserver()

int agora::rtc::IMediaPlayerSourceEx::registerPlayerSourceObserver | ( | IMediaPlayerSourceObserver * | observer | ) |
| inline final virtual

Registers a media player source observer.

Once the media player source observer is registered, you can use the observer to monitor the state change of the media player.

Parameters

  observer | The pointer to the IMediaPlayerSourceObserver object.

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

Implements agora::rtc::IMediaPlayerSource.

## ◆ onPlayerSourceObserverCallback()

virtual void agora::rtc::IMediaPlayerSourceEx::onPlayerSourceObserverCallback | ( | std::function< void(IMediaPlayerSourceObserver *)> && | task | ) |
| pure virtual