Video SDK v3.7.1 API Reference for All Platforms (C++)
|
Public Member Functions | |
virtual | ~IMediaEngine () |
virtual void | release ()=0 |
virtual int | registerAudioFrameObserver (IAudioFrameObserver *observer)=0 |
virtual int | registerVideoFrameObserver (IVideoFrameObserver *observer)=0 |
virtual int | registerVideoRenderFactory (IExternalVideoRenderFactory *factory) AGORA_DEPRECATED_ATTRIBUTE=0 |
virtual int | pushAudioFrame (MEDIA_SOURCE_TYPE type, IAudioFrameObserver::AudioFrame *frame, bool wrap) AGORA_DEPRECATED_ATTRIBUTE=0 |
virtual int | pushAudioFrame (IAudioFrameObserver::AudioFrame *frame) AGORA_DEPRECATED_ATTRIBUTE=0 |
virtual int | pushAudioFrame (int32_t sourcePos, IAudioFrameObserver::AudioFrame *frame)=0 |
virtual int | setExternalAudioSourceVolume (int32_t sourcePos, int32_t volume)=0 |
virtual int | pullAudioFrame (IAudioFrameObserver::AudioFrame *frame)=0 |
virtual int | setExternalVideoSource (bool enable, bool useTexture)=0 |
virtual int | pushVideoFrame (ExternalVideoFrame *frame)=0 |
virtual int | registerVideoEncodedFrameObserver (IVideoEncodedFrameObserver *observer)=0 |
|
inlinevirtual |
|
pure virtual |
|
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.
observer | Audio frame observer object instance. See IAudioFrameObserver. Set the value as NULL to release the audio observer object. Agora recommends calling registerAudioFrameObserver(NULL) after receiving the onLeaveChannel callback. |
|
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.
width
and height
parameters, which may be adapted under the following circumstances:observer | Video frame observer object instance. If NULL is passed in, the registration is canceled. |
|
pure virtual |
|
pure virtual |
Pushes the external audio frame.
type | Type of audio capture device: MEDIA_SOURCE_TYPE. |
frame | Audio frame pointer: AudioFrame. |
wrap | Whether to use the placeholder. We recommend setting the default value.
|
|
pure virtual |
Pushes the external audio frame.
frame | Pointer to the audio frame: AudioFrame. |
|
pure virtual |
Pushes the external audio frame to a specified position.
According to your needs, you can push the external audio frame to one of three positions: after audio capture, before audio encoding, or before local playback. You can call this method multiple times to push one audio frame to multiple positions or multiple audio frames to different positions. For example, in the KTV scenario, you can push the singing voice to after audio capture, so that the singing voice can be processed by the SDK audio module and you can obtain a high-quality audio experience; you can also push the accompaniment to before audio encoding, so that the accompaniment is not affected by the audio module of the SDK.
sourcePos | The push position of the external audio frame. See AUDIO_EXTERNAL_SOURCE_POSITION. |
frame | The external audio frame. See AudioFrame. The value range of the audio frame length (ms) is [10,60]. |
-2 (ERR_INVALID_ARGUMENT)
: The parameter is invalid.-12 (ERR_TOO_OFTEN)
: The call frequency is too high, causing the internal buffer to overflow. Call this method again after 30-50 ms.
|
pure virtual |
Sets the volume of the external audio frame in the specified position.
You can call this method multiple times to set the volume of external audio frames in different positions. The volume setting takes effect for all external audio frames that are pushed to the specified position.
sourcePos | The push position of the external audio frame. See AUDIO_EXTERNAL_SOURCE_POSITION. |
volume | The volume of the external audio frame. The value range is [0,100]. The default value is 100, which represents the original value. |
-2 (ERR_INVALID_ARGUMENT)
: The parameter is invalid.
|
pure virtual |
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.
onPlaybackAudioFrame
: The SDK sends the audio data to the app through this callback. 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.frame | Pointers to the audio frame. See: AudioFrame. |
|
pure virtual |
Configures the external video source.
enable | Sets whether to use the external video source:
|
useTexture | Sets whether to use texture as an input:
|
|
pure virtual |
Pushes the video frame using the ExternalVideoFrame and passes the video frame to the Agora SDK.
frame | Video frame to be pushed. See ExternalVideoFrame. |
COMMUNICATION
profile, this method does not support video frames in the Texture format.
|
pure virtual |
Registers a local encoded video frame observer.
After you successfully register the local encoded video frame observer, the SDK triggers the callbacks that you have implemented in the IVideoEncodedFrameObserver class each time a video frame is received.
observer | The local encoded video frame observer. See IVideoEncodedFrameObserver. If null is passed, the observer registration is canceled. |