Agora C++ API Reference for All Platforms

Loading...
Searching...
No Matches
IAgoraMediaEngine.h
1//
2// Agora Media SDK
3//
4// Copyright (c) 2015 Agora IO. All rights reserved.
5//
6#pragma once
7
8#include "AgoraBase.h"
9#include "AgoraMediaBase.h"
10#include "AgoraRefPtr.h"
11
12 namespace agora {
13 namespace media {
14
18 enum AUDIO_MIXING_DUAL_MONO_MODE {
22 AUDIO_MIXING_DUAL_MONO_AUTO = 0,
27 AUDIO_MIXING_DUAL_MONO_L = 1,
32 AUDIO_MIXING_DUAL_MONO_R = 2,
37 AUDIO_MIXING_DUAL_MONO_MIX = 3
38};
39
40
44 class IMediaEngine {
45 public:
64 virtual int registerAudioFrameObserver(IAudioFrameObserver* observer) = 0;
93 virtual int registerVideoFrameObserver(IVideoFrameObserver* observer) = 0;
110 virtual int registerVideoEncodedFrameObserver(IVideoEncodedFrameObserver* observer) = 0;
111
138 virtual int registerFaceInfoObserver(IFaceInfoObserver* observer) = 0;
139
160 virtual int pushAudioFrame(IAudioFrameObserverBase::AudioFrame* frame, rtc::track_id_t trackId = 0) = 0;
161
193 virtual int pullAudioFrame(IAudioFrameObserverBase::AudioFrame* frame) = 0;
194
221 virtual int setExternalVideoSource(
222 bool enabled, bool useTexture, EXTERNAL_VIDEO_SOURCE_TYPE sourceType = VIDEO_FRAME,
223 rtc::SenderOptions encodedVideoOption = rtc::SenderOptions()) = 0;
224
225#if defined(__ANDROID__)
245 virtual int setExternalRemoteEglContext(void* eglContext) = 0;
246#endif
247
275 virtual int setExternalAudioSource(bool enabled, int sampleRate, int channels, bool localPlayback = false, bool publish = true) __deprecated = 0;
276
304 virtual rtc::track_id_t createCustomAudioTrack(rtc::AUDIO_TRACK_TYPE trackType, const rtc::AudioTrackConfig& config) = 0;
305
315 virtual int destroyCustomAudioTrack(rtc::track_id_t trackId) = 0;
316
343 virtual int setExternalAudioSink(bool enabled, int sampleRate, int channels) = 0;
344
359 virtual int enableCustomAudioLocalPlayback(rtc::track_id_t trackId, bool enabled) = 0;
360
401 virtual int pushVideoFrame(base::ExternalVideoFrame* frame, unsigned int videoTrackId = 0) = 0;
412 virtual int pushEncodedVideoImage(const unsigned char* imageBuffer, size_t length,
413 const agora::rtc::EncodedVideoFrameInfo& videoEncodedFrameInfo,
414 unsigned int videoTrackId = 0) = 0;
418 virtual int addVideoFrameRenderer(IVideoFrameObserver *renderer) = 0;
419
423 virtual int removeVideoFrameRenderer(IVideoFrameObserver *renderer) = 0;
424
425 virtual void release() = 0;
426
427 protected:
428 virtual ~IMediaEngine() {}
429};
430
431} // namespace media
432
433} // namespace agora
agora::media::IAudioFrameObserver
Definition AgoraMediaBase.h:1815
agora::media::IFaceInfoObserver
Definition AgoraMediaBase.h:2452
agora::media::IMediaEngine
Definition IAgoraMediaEngine.h:44
agora::media::IMediaEngine::destroyCustomAudioTrack
virtual int destroyCustomAudioTrack(rtc::track_id_t trackId)=0
Destroys the specified audio track.
agora::media::IMediaEngine::addVideoFrameRenderer
virtual int addVideoFrameRenderer(IVideoFrameObserver *renderer)=0
agora::media::IMediaEngine::setExternalVideoSource
virtual int setExternalVideoSource(bool enabled, bool useTexture, EXTERNAL_VIDEO_SOURCE_TYPE sourceType=VIDEO_FRAME, rtc::SenderOptions encodedVideoOption=rtc::SenderOptions())=0
Configures the external video source.
agora::media::IMediaEngine::registerFaceInfoObserver
virtual int registerFaceInfoObserver(IFaceInfoObserver *observer)=0
Registers or unregisters a facial information observer.
agora::media::IMediaEngine::removeVideoFrameRenderer
virtual int removeVideoFrameRenderer(IVideoFrameObserver *renderer)=0
agora::media::IMediaEngine::pushVideoFrame
virtual int pushVideoFrame(base::ExternalVideoFrame *frame, unsigned int videoTrackId=0)=0
Pushes the external raw video frame to the SDK through video tracks.
agora::media::IMediaEngine::registerVideoEncodedFrameObserver
virtual int registerVideoEncodedFrameObserver(IVideoEncodedFrameObserver *observer)=0
Registers a receiver object for the encoded video image.
agora::media::IMediaEngine::registerVideoFrameObserver
virtual int registerVideoFrameObserver(IVideoFrameObserver *observer)=0
Registers a raw video frame observer object.
agora::media::IMediaEngine::setExternalAudioSink
virtual int setExternalAudioSink(bool enabled, int sampleRate, int channels)=0
Sets the external audio sink.
agora::media::IMediaEngine::pushAudioFrame
virtual int pushAudioFrame(IAudioFrameObserverBase::AudioFrame *frame, rtc::track_id_t trackId=0)=0
Pushes the external audio frame.
agora::media::IMediaEngine::setExternalAudioSource
virtual int setExternalAudioSource(bool enabled, int sampleRate, int channels, bool localPlayback=false, bool publish=true) __deprecated=0
Sets the external audio source parameters.
agora::media::IMediaEngine::pullAudioFrame
virtual int pullAudioFrame(IAudioFrameObserverBase::AudioFrame *frame)=0
Pulls the remote audio data.
agora::media::IMediaEngine::setExternalRemoteEglContext
virtual int setExternalRemoteEglContext(void *eglContext)=0
Sets the EGL context for rendering remote video streams.
agora::media::IMediaEngine::createCustomAudioTrack
virtual rtc::track_id_t createCustomAudioTrack(rtc::AUDIO_TRACK_TYPE trackType, const rtc::AudioTrackConfig &config)=0
Creates a custom audio track.
agora::media::IMediaEngine::pushEncodedVideoImage
virtual int pushEncodedVideoImage(const unsigned char *imageBuffer, size_t length, const agora::rtc::EncodedVideoFrameInfo &videoEncodedFrameInfo, unsigned int videoTrackId=0)=0
agora::media::IMediaEngine::registerAudioFrameObserver
virtual int registerAudioFrameObserver(IAudioFrameObserver *observer)=0
Registers an audio frame observer object.
agora::media::IMediaEngine::enableCustomAudioLocalPlayback
virtual int enableCustomAudioLocalPlayback(rtc::track_id_t trackId, bool enabled)=0
agora::media::IMediaEngine::release
virtual void release()=0
agora::media::IVideoEncodedFrameObserver
Definition AgoraMediaBase.h:1920
agora::media::IVideoFrameObserver
Definition AgoraMediaBase.h:1951
agora::media::base
Definition NGIAgoraAudioDeviceManager.h:16
agora::media
Definition content_inspect_i.h:15
agora::media::__deprecated
@ __deprecated
Definition AgoraMediaBase.h:1292
agora::media::EXTERNAL_VIDEO_SOURCE_TYPE
EXTERNAL_VIDEO_SOURCE_TYPE
The external video frame encoding type.
Definition AgoraMediaBase.h:2262
agora::media::VIDEO_FRAME
@ VIDEO_FRAME
Definition AgoraMediaBase.h:2266
agora::media::AUDIO_MIXING_DUAL_MONO_MODE
AUDIO_MIXING_DUAL_MONO_MODE
The channel mode.
Definition IAgoraMediaEngine.h:18
agora::media::AUDIO_MIXING_DUAL_MONO_AUTO
@ AUDIO_MIXING_DUAL_MONO_AUTO
Definition IAgoraMediaEngine.h:22
agora::media::AUDIO_MIXING_DUAL_MONO_MIX
@ AUDIO_MIXING_DUAL_MONO_MIX
Definition IAgoraMediaEngine.h:37
agora::media::AUDIO_MIXING_DUAL_MONO_L
@ AUDIO_MIXING_DUAL_MONO_L
Definition IAgoraMediaEngine.h:27
agora::media::AUDIO_MIXING_DUAL_MONO_R
@ AUDIO_MIXING_DUAL_MONO_R
Definition IAgoraMediaEngine.h:32
agora::rtc::track_id_t
unsigned int track_id_t
Definition AgoraMediaBase.h:29
agora
Definition AgoraAtomicOps.h:21
rtc
Definition video_node_i.h:28
agora::media::IAudioFrameObserverBase::AudioFrame
Raw audio data.
Definition AgoraMediaBase.h:1429
agora::rtc::SenderOptions
Definition AgoraBase.h:1342