Developer Center
Voice Call
API Reference
Agora C++ API Reference for All Platforms
Agora C++ API Reference for All Platforms
◆ 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.
This method is required to register callbacks when the engine is required to provide an onCaptureVideoFrame or onRenderVideoFrame callback.
- 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 external audio frame for external audio playback.
The application pulls the mixed audio frame from the audio engine for external audio playback. We recommend using pullAudioFrame over onPlaybackAudioFrame.
- Note
- This method overrides the registerAudioFrameObserver method. After calling pullAudioFrame, the application will not retrieve any audio frame from the onPlaybackAudioFrame callback.
Before calling this method:
- Call setExternalAudioSink to inform the audio engine that the application will call pullAudioFrame to pull audio frames from the sink.
- Call setPlaybackAudioFrameParameters to set the parameters of the audio frame to be pulled, including the audio sample rate and number of the audio channel.
Differences between onPlaybackAudioFrame and pullAudioFrame:
- onPlaybackAudioFrame sends audio frames to the application once every 10 ms. Any delay in processing the audio frames may result in audio jitter.
- With pullAudioFrame, the application pulls the audio frame. The SDK specifies the number of audio samples for playback by the
sample
parameter in AudioFrame, adjusts the frame buffer, and allows for a delay in processing the audio frames by the application. This method avoids problems caused by jitter in the external audio playback, such as an unsynchronized audio playback.
- Parameters
-
- 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.