#include <IAgoraMediaEngine.h>
◆ ~IMediaEngine()
virtual agora::media::IMediaEngine::~IMediaEngine |
( |
| ) |
|
|
inlinevirtual |
◆ release()
virtual void agora::media::IMediaEngine::release |
( |
| ) |
|
|
pure virtual |
◆ registerAudioFrameObserver()
virtual int agora::media::IMediaEngine::registerAudioFrameObserver |
( |
IAudioFrameObserver * |
observer | ) |
|
|
pure virtual |
Registers an audio frame observer object.
This method is used to register an audio frame observer object (register a callback). This method is required to register callbacks when the engine is required to provide an onRecordAudioFrame or onPlaybackAudioFrame callback.
- Parameters
-
observer | Audio frame observer object instance. If NULL is passed in, the registration is canceled. |
- Returns
- 0: Success.
- < 0: Failure.
◆ registerVideoFrameObserver()
virtual int agora::media::IMediaEngine::registerVideoFrameObserver |
( |
IVideoFrameObserver * |
observer | ) |
|
|
pure virtual |
Registers a video frame observer object.
You need to implement the IVideoFrameObserver class in this method, and register callbacks according to your scenarios.
After you successfully register the video frame observer, the SDK triggers the registered callbacks each time a video frame is received.
- Parameters
-
observer | Video frame observer object instance. If NULL is passed in, the registration is canceled. |
- Returns
- 0: Success.
- < 0: Failure.
◆ registerVideoRenderFactory()
◆ pushAudioFrame() [1/2]
◆ pushAudioFrame() [2/2]
Pushes the external audio frame.
- Parameters
-
- Returns
- 0: Success.
- < 0: Failure.
◆ pullAudioFrame()
Pulls the remote audio data.
Before calling this method, call the setExternalAudioSink(enabled: true) method to enable and set the external audio sink.
After a successful method call, the app pulls the decoded and mixed audio data for playback.
- Note
- Once you call the pullAudioFrame method successfully, the app will not retrieve any audio data from the onPlaybackAudioFrame callback.
- The difference between the onPlaybackAudioFrame callback and the pullAudioFrame method is as follows:
onPlaybackAudioFrame
: The SDK sends the audio data to the app once every 10 ms. Any delay in processing the audio frames may result in audio jitter.
pullAudioFrame
: The app pulls the remote audio data. After setting the audio data parameters, the SDK adjusts the frame buffer and avoids problems caused by jitter in the external audio playback.
- Parameters
-
frame | Pointers to the audio frame. See: AudioFrame. |
- Returns
- 0: Success.
- < 0: Failure.
◆ setExternalVideoSource()
virtual int agora::media::IMediaEngine::setExternalVideoSource |
( |
bool |
enable, |
|
|
bool |
useTexture |
|
) |
| |
|
pure virtual |
Configures the external video source.
- Parameters
-
enable | Sets whether to use the external video source:
- true: Use the external video source.
- false: (Default) Do not use the external video source.
|
useTexture | Sets whether to use texture as an input:
- true: Use texture as an input.
- false: (Default) Do not use texture as an input.
|
- Returns
- 0: Success.
- < 0: Failure.
◆ pushVideoFrame()
Pushes the video frame using the ExternalVideoFrame and passes the video frame to the Agora SDK.
- Parameters
-
- Note
- In the Communication profile, this method does not support video frames in the Texture format.
- Returns
- 0: Success.
- < 0: Failure.