Agora Java API Reference for Android

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
17 enum AUDIO_MIXING_DUAL_MONO_MODE {
18 /* 0: Original mode */
19 AUDIO_MIXING_DUAL_MONO_AUTO = 0,
20 /* 1: Left channel mode */
21 AUDIO_MIXING_DUAL_MONO_L = 1,
22 /* 2: Right channel mode */
23 AUDIO_MIXING_DUAL_MONO_R = 2,
24 /* 3: Mixed channel mode */
25 AUDIO_MIXING_DUAL_MONO_MIX = 3
26 };
27
28
32 class IMediaEngine {
33 public:
46 virtual int registerAudioFrameObserver(IAudioFrameObserver* observer) = 0;
60 virtual int registerVideoFrameObserver(IVideoFrameObserver* observer) = 0;
74 virtual int registerVideoEncodedFrameObserver(IVideoEncodedFrameObserver* observer) = 0;
75
88 virtual int registerFaceInfoObserver(IFaceInfoObserver* observer) = 0;
89
100 virtual int pushAudioFrame(IAudioFrameObserverBase::AudioFrame* frame, rtc::track_id_t trackId = 0) = 0;
101
118 virtual int pullAudioFrame(IAudioFrameObserverBase::AudioFrame* frame) = 0;
119
140 virtual int setExternalVideoSource(
141 bool enabled, bool useTexture, EXTERNAL_VIDEO_SOURCE_TYPE sourceType = VIDEO_FRAME,
142 rtc::SenderOptions encodedVideoOption = rtc::SenderOptions()) = 0;
143
144 #if defined(__ANDROID__)
145
159 virtual int setExternalRemoteEglContext(void* eglContext) = 0;
160 #endif
161
188 virtual int setExternalAudioSource(bool enabled, int sampleRate, int channels, bool localPlayback = false, bool publish = true) __deprecated = 0;
189
205 virtual rtc::track_id_t createCustomAudioTrack(rtc::AUDIO_TRACK_TYPE trackType, const rtc::AudioTrackConfig& config) = 0;
206
216 virtual int destroyCustomAudioTrack(rtc::track_id_t trackId) = 0;
217
245 virtual int setExternalAudioSink(bool enabled, int sampleRate, int channels) = 0;
246
261 virtual int enableCustomAudioLocalPlayback(rtc::track_id_t trackId, bool enabled) = 0;
262
271 virtual int pushVideoFrame(base::ExternalVideoFrame* frame, unsigned int videoTrackId = 0) = 0;
282 virtual int pushEncodedVideoImage(const unsigned char* imageBuffer, size_t length,
283 const agora::rtc::EncodedVideoFrameInfo& videoEncodedFrameInfo,
284 unsigned int videoTrackId = 0) = 0;
288 virtual int addVideoFrameRenderer(IVideoFrameObserver *renderer) = 0;
289
293 virtual int removeVideoFrameRenderer(IVideoFrameObserver *renderer) = 0;
294
295 virtual void release() = 0;
296
297 protected:
298 virtual ~IMediaEngine() {}
299 };
300
301 } // namespace media
302
303 } // namespace agora
agora::rtc::SenderOptions
Definition: AgoraBase.h:1254
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::enableCustomAudioLocalPlayback
virtual int enableCustomAudioLocalPlayback(rtc::track_id_t trackId, bool enabled)=0
agora::media::IFaceInfoObserver
Definition: AgoraMediaBase.h:2067
agora::media::IMediaEngine::pullAudioFrame
virtual int pullAudioFrame(IAudioFrameObserverBase::AudioFrame *frame)=0
agora::media::IMediaEngine::registerVideoFrameObserver
virtual int registerVideoFrameObserver(IVideoFrameObserver *observer)=0
agora::media::IVideoFrameObserver
Definition: AgoraMediaBase.h:1664
agora::media::IMediaEngine::pushAudioFrame
virtual int pushAudioFrame(IAudioFrameObserverBase::AudioFrame *frame, rtc::track_id_t trackId=0)=0
agora::media::IAudioFrameObserverBase::AudioFrame
Definition: AgoraMediaBase.h:1282
agora::media::IAudioFrameObserver
Definition: AgoraMediaBase.h:1549
agora::media::IMediaEngine::registerAudioFrameObserver
virtual int registerAudioFrameObserver(IAudioFrameObserver *observer)=0
agora::media::IMediaEngine::createCustomAudioTrack
virtual rtc::track_id_t createCustomAudioTrack(rtc::AUDIO_TRACK_TYPE trackType, const rtc::AudioTrackConfig &config)=0
agora::media::IMediaEngine::registerFaceInfoObserver
virtual int registerFaceInfoObserver(IFaceInfoObserver *observer)=0
agora::media::IMediaEngine::setExternalAudioSink
virtual int setExternalAudioSink(bool enabled, int sampleRate, int channels)=0
agora::media::IMediaEngine::registerVideoEncodedFrameObserver
virtual int registerVideoEncodedFrameObserver(IVideoEncodedFrameObserver *observer)=0
agora::media::IMediaEngine::destroyCustomAudioTrack
virtual int destroyCustomAudioTrack(rtc::track_id_t trackId)=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
agora::media::IMediaEngine::setExternalAudioSource
virtual int setExternalAudioSource(bool enabled, int sampleRate, int channels, bool localPlayback=false, bool publish=true) __deprecated=0
agora::media::IMediaEngine
Definition: IAgoraMediaEngine.h:32
agora::media::IVideoEncodedFrameObserver
Definition: AgoraMediaBase.h:1642
agora::media::IMediaEngine::removeVideoFrameRenderer
virtual int removeVideoFrameRenderer(IVideoFrameObserver *renderer)=0
agora::media::IMediaEngine::addVideoFrameRenderer
virtual int addVideoFrameRenderer(IVideoFrameObserver *renderer)=0
agora::media::IMediaEngine::pushVideoFrame
virtual int pushVideoFrame(base::ExternalVideoFrame *frame, unsigned int videoTrackId=0)=0