Agora C++ API Reference for All Platforms

Loading...
Searching...
No Matches
Public Member Functions | List of all members
agora::media::IMediaEngineEx Class Referenceabstract

`#include <media_engine_i.h>`

Inherits agora::media::IMediaEngine.

## Public Member Functions
virtual int | pushVideoFrameEx (const webrtc::VideoFrame &frame, unsigned int video_track_id=0)=0
virtual int | enableDualStreamModeEx (bool enabled, const rtc::SimulcastStreamConfig &streamConfig, const rtc::RtcConnection &connection)=0
virtual int | setExternalVideoConfigEx (const rtc::VideoEncoderConfiguration &config)=0
virtual int | setExternalVideoConfigEx (const rtc::VideoEncoderConfiguration &config, const rtc::RtcConnection &connection)=0
| ~IMediaEngineEx () override=default
virtual int | registerAudioFrameObserver (IAudioFrameObserver *observer)=0
virtual int | registerVideoFrameObserver (IVideoFrameObserver *observer)=0
virtual int | registerVideoEncodedFrameObserver (IVideoEncodedFrameObserver *observer)=0
virtual int | pushEncodedVideoImage (const unsigned char *imageBuffer, size_t length, const agora::rtc::EncodedVideoFrameInfo &videoEncodedFrameInfo, unsigned int videoTrackId=0)=0
Public Member Functions inherited from agora::media::IMediaEngine
virtual int | registerFaceInfoObserver (IFaceInfoObserver *observer)=0
virtual int | pushAudioFrame (IAudioFrameObserverBase::AudioFrame *frame, rtc::track_id_t trackId=0)=0
virtual int | pullAudioFrame (IAudioFrameObserverBase::AudioFrame *frame)=0
virtual int | setExternalVideoSource (bool enabled, bool useTexture, EXTERNAL_VIDEO_SOURCE_TYPE sourceType=VIDEO_FRAME, rtc::SenderOptions encodedVideoOption=rtc::SenderOptions())=0
virtual int | setExternalRemoteEglContext (void *eglContext)=0
virtual int | setExternalAudioSource (bool enabled, int sampleRate, int channels, bool localPlayback=false, bool publish=true) __deprecated=0
virtual rtc::track_id_t | createCustomAudioTrack (rtc::AUDIO_TRACK_TYPE trackType, const rtc::AudioTrackConfig &config)=0
virtual int | destroyCustomAudioTrack (rtc::track_id_t trackId)=0
virtual int | setExternalAudioSink (bool enabled, int sampleRate, int channels)=0
virtual int | enableCustomAudioLocalPlayback (rtc::track_id_t trackId, bool enabled)=0
virtual int | pushVideoFrame (base::ExternalVideoFrame *frame, unsigned int videoTrackId=0)=0
virtual int | addVideoFrameRenderer (IVideoFrameObserver *renderer)=0
virtual int | removeVideoFrameRenderer (IVideoFrameObserver *renderer)=0
virtual void | release ()=0

## Additional Inherited Members
Protected Member Functions inherited from agora::media::IMediaEngine
virtual | ~IMediaEngine ()

## Detailed Description

The IMediaEngineEx class

## Constructor & Destructor Documentation

## ◆ ~IMediaEngineEx()

agora::media::IMediaEngineEx::~IMediaEngineEx | ( |  | ) |
| override default

## Member Function Documentation

## ◆ pushVideoFrameEx()

virtual int agora::media::IMediaEngineEx::pushVideoFrameEx | ( | const webrtc::VideoFrame & | frame,
|  | unsigned int | video_track_id = 0 )
| pure virtual

## ◆ enableDualStreamModeEx()

virtual int agora::media::IMediaEngineEx::enableDualStreamModeEx | ( | bool | enabled,
|  | const rtc::SimulcastStreamConfig & | streamConfig,
|  | const rtc::RtcConnection & | connection )
| pure virtual

## ◆ setExternalVideoConfigEx() [1/2]

virtual int agora::media::IMediaEngineEx::setExternalVideoConfigEx | ( | const rtc::VideoEncoderConfiguration & | config | ) |
| pure virtual

Deprecated by IRtcEngine::setVideoEncoderConfiguration.

## ◆ setExternalVideoConfigEx() [2/2]

virtual int agora::media::IMediaEngineEx::setExternalVideoConfigEx | ( | const rtc::VideoEncoderConfiguration & | config,
|  | const rtc::RtcConnection & | connection )
| pure virtual

## ◆ registerAudioFrameObserver()

virtual int agora::media::IMediaEngine::registerAudioFrameObserver | ( | IAudioFrameObserver * | observer | ) |
| virtual

Registers an audio frame observer object.

Call this method to register an audio frame observer object (register a callback). When you need the SDK to trigger the `onMixedAudioFrame`, `onRecordAudioFrame`, `onPlaybackAudioFrame`, `onPlaybackAudioFrameBeforeMixing` or `onEarMonitoringAudioFrame` callback, you need to use this method to register the callbacks. Call timing: Call this method before joining a channel.

Parameters

  observer | The observer instance. See `IAudioFrameObserver`. Set the value as NULL to release the instance. Agora recommends calling this method after receiving `onLeaveChannel` to release the audio observer object.

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

Implements agora::media::IMediaEngine.

## ◆ registerVideoFrameObserver()

virtual int agora::media::IMediaEngine::registerVideoFrameObserver | ( | IVideoFrameObserver * | observer | ) |
| virtual

Registers a raw video frame observer object.

If you want to observe raw video frames (such as YUV or RGBA format), Agora recommends that you implement one `IVideoFrameObserver` class with this method. When calling this method to register a video observer, you can register callbacks in the `IVideoFrameObserver` class as needed. After you successfully register the video frame observer, the SDK triggers the registered callbacks each time a video frame is received. Applicable scenarios: After registering the raw video observer, you can use the obtained raw video data in various video pre-processing scenarios, such as virtual backgrounds and image enhacement by yourself. Call timing: Call this method before joining a channel.

Note
  When handling the video data returned in the callbacks, pay attention to the changes in the `width` and `height` parameters, which may be adapted under the following circumstances:
  - When network conditions deteriorate, the video resolution decreases incrementally.
  - If the user adjusts the video profile, the resolution of the video returned in the callbacks also changes.

Parameters

  observer | The observer instance. See `IVideoFrameObserver`. To release the instance, set the value as NULL.

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

Implements agora::media::IMediaEngine.

## ◆ registerVideoEncodedFrameObserver()

virtual int agora::media::IMediaEngine::registerVideoEncodedFrameObserver | ( | IVideoEncodedFrameObserver * | observer | ) |
| virtual

Registers a receiver object for the encoded video image.

If you only want to observe encoded video frames (such as H.264 format) without decoding and rendering the video, Agora recommends that you implement one `IVideoEncodedFrameObserver` class through this method.

Note
  Call this method before joining a channel.

Parameters

  observer | The video frame observer object. See `IVideoEncodedFrameObserver`.

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

Implements agora::media::IMediaEngine.

## ◆ pushEncodedVideoImage()

virtual int agora::media::IMediaEngine::pushEncodedVideoImage | ( | const unsigned char * | imageBuffer,
|  | size_t | length,
|  | const agora::rtc::EncodedVideoFrameInfo & | videoEncodedFrameInfo,
|  | unsigned int | videoTrackId = 0 )
| virtual

Pushes the encoded video image to the app.

Parameters

  imageBuffer | A pointer to the video image.
  length | The data length.
  videoEncodedFrameInfo | The reference to the information of the encoded video frame: EncodedVideoFrameInfo.
  videoTrackId | The id of the video track. 0: Success. < 0: Failure.

Implements agora::media::IMediaEngine.