Inherited by agora::media::IMediaEngineEx.
|
virtual int | registerAudioFrameObserver (IAudioFrameObserver *observer)=0 |
|
virtual int | registerVideoFrameObserver (IVideoFrameObserver *observer)=0 |
|
virtual int | registerVideoEncodedImageReceiver (rtc::IVideoEncodedImageReceiver *receiver)=0 |
|
virtual int | pushAudioFrame (MEDIA_SOURCE_TYPE type, IAudioFrameObserver::AudioFrame *frame, bool wrap=false, int sourceId=0)=0 |
|
virtual int | pullAudioFrame (IAudioFrameObserver::AudioFrame *frame)=0 |
|
virtual int | setExternalVideoSource (bool enabled, bool useTexture, bool encodedFrame=false)=0 |
|
virtual int | setExternalAudioSource (bool enabled, int sampleRate, int channels, int sourceNumber, bool localPlayback=false, bool publish=true)=0 |
|
virtual int | pushVideoFrame (base::ExternalVideoFrame *frame)=0 |
|
virtual int | pushVideoFrame (base::ExternalVideoFrame *frame, const rtc::RtcConnection &connection)=0 |
|
virtual int | pushEncodedVideoImage (const uint8_t *imageBuffer, size_t length, const agora::rtc::EncodedVideoFrameInfo &videoEncodedFrameInfo)=0 |
|
virtual int | pushEncodedVideoImage (const uint8_t *imageBuffer, size_t length, const agora::rtc::EncodedVideoFrameInfo &videoEncodedFrameInfo, const rtc::RtcConnection &connection)=0 |
|
virtual void | release ()=0 |
|
◆ ~IMediaEngine()
virtual agora::media::IMediaEngine::~IMediaEngine |
( |
| ) |
|
|
inlineprotectedvirtual |
◆ registerAudioFrameObserver()
virtual int agora::media::IMediaEngine::registerAudioFrameObserver |
( |
IAudioFrameObserver * |
observer | ) |
|
|
pure virtual |
Registers an audio frame observer object.
- Note
- Ensure that you call this method before joinChannel.
- Parameters
-
observer | A pointer to the audio frame observer object: IAudioFrameObserver, nullptr means unregistering observer instead. |
- Returns
- 0: Success.
- < 0: Failure.
◆ registerVideoFrameObserver()
virtual int agora::media::IMediaEngine::registerVideoFrameObserver |
( |
IVideoFrameObserver * |
observer | ) |
|
|
pure virtual |
Registers a video frame observer object.
- Note
- Ensure that you call this method before joining the channel.
- If you register an observer for video raw video data, you cannot register an IVideoEncodedImageReceiver object.
- Parameters
-
- Returns
- 0: Success.
- < 0: Failure.
◆ registerVideoEncodedImageReceiver()
Registers a receiver object for the encoded video image.
- Note
- Ensure that you call this method before joining the channel.
- If you register a receiver for encoded video data, you cannot register an IVideoFrameObserver object.
- Parameters
-
- Returns
- 0: Success.
- < 0: Failure.
◆ pushAudioFrame()
Pushes the external audio data to the app.
- Parameters
-
type | deprecated. |
frame | The audio buffer data. |
wrap | deprecated. |
sourceId | The audio track ID. |
- Returns
- 0: Success.
- < 0: Failure.
◆ pullAudioFrame()
Pulls the remote audio data.
After a successful method call, the app pulls the decoded and mixed audio data for playback.
The difference between this method and the onPlaybackAudioFrame 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 | The pointer to the audio frame: AudioFrame. |
- Returns
- 0: Success.
- < 0: Failure.
◆ setExternalVideoSource()
virtual int agora::media::IMediaEngine::setExternalVideoSource |
( |
bool |
enabled, |
|
|
bool |
useTexture, |
|
|
bool |
encodedFrame = false |
|
) |
| |
|
pure virtual |
Sets the external video source.
Once the external video source is enabled, the SDK prepares to accept the external video frame.
- Parameters
-
enabled | Determines whether to enable the external video source.
- true: Enable the external video source. Once set, the SDK creates the external source and prepares video data from
pushVideoFrame or pushEncodedVideoImage .
- false: Disable the external video source.
|
useTexture | Determines whether to use textured video data.
- true: Use texture, which is not supported now.
- False: Do not use texture.
|
encodedFrame | Determines whether the external video source is encoded.
- true: The external video source is encoded.
- false: The external video source is not encoded.
|
- Returns
- 0: Success.
- < 0: Failure.
◆ setExternalAudioSource()
virtual int agora::media::IMediaEngine::setExternalAudioSource |
( |
bool |
enabled, |
|
|
int |
sampleRate, |
|
|
int |
channels, |
|
|
int |
sourceNumber, |
|
|
bool |
localPlayback = false , |
|
|
bool |
publish = true |
|
) |
| |
|
pure virtual |
Sets the external audio source.
- Note
- Ensure that you call this method before joining the channel.
- Parameters
-
enabled | Determines whether to enable the external audio source:
- true: Enable the external audio source.
- false: (default) Disable the external audio source.
|
sampleRate | The Sample rate (Hz) of the external audio source, which can set be as 8000, 16000, 32000, 44100, or 48000. |
channels | The number of channels of the external audio source, which can be set as 1 or 2:
|
sourceNumber | The number of the external audio sources, should be greater than 0. |
- Returns
- 0: Success.
- < 0: Failure.
◆ pushVideoFrame() [1/2]
Pushes the external video frame to the app.
- Parameters
-
frame | The external video frame: ExternalVideoFrame. |
channelId | The channel name. |
localUid | ID of the local user. |
- Returns
- 0: Success.
- < 0: Failure.
◆ pushVideoFrame() [2/2]
◆ pushEncodedVideoImage() [1/2]
virtual int agora::media::IMediaEngine::pushEncodedVideoImage |
( |
const uint8_t * |
imageBuffer, |
|
|
size_t |
length, |
|
|
const agora::rtc::EncodedVideoFrameInfo & |
videoEncodedFrameInfo |
|
) |
| |
|
pure 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. |
channelId | The channel name. |
localUid | ID of the local user. |
- Returns
- 0: Success.
- < 0: Failure.
◆ pushEncodedVideoImage() [2/2]
◆ release()
virtual void agora::media::IMediaEngine::release |
( |
| ) |
|
|
pure virtual |