Agora C++ API Reference for All Platforms

Loading...
Searching...
No Matches
media_engine_i.h
1//
2// Agora Media SDK
3//
4// Copyright (c) 2015 Agora IO. All rights reserved.
5//
6
7#pragma once
8
9#include "AgoraMediaBase.h"
10#include "main/core/video/base/video_frame/video_frame.h"
11#include "IAgoraMediaEngine.h"
12
13namespace agora {
14
15namespace rtc {
16struct RtcConnection;
17}
18
19namespace media {
20namespace base {
21 class IVideoFrameObserverEx : public IVideoFrameObserver {
22 public:
23 virtual ~IVideoFrameObserverEx() {}
24 void onFrame(const VideoFrame* frame) final {}
25 bool isExternal() final { return false; }
26 virtual void onFrame(const webrtc::VideoFrame& frame) = 0;
27};
28}
29
33 class IVideoFrameObserverEx : public IVideoFrameObserver {
34 public:
35 virtual ~IVideoFrameObserverEx() {}
36
37 bool onCaptureVideoFrame(agora::rtc::VIDEO_SOURCE_TYPE type, VideoFrame& videoFrame) final { return false; }
38 bool onPreEncodeVideoFrame(agora::rtc::VIDEO_SOURCE_TYPE type, VideoFrame& videoFrame) final { return false; }
39
40 bool onRenderVideoFrame(const char* channelId, rtc::uid_t remoteUid,
41 VideoFrame& videoFrame) final { return false; }
42
43 bool onTranscodedVideoFrame(VideoFrame& videoFrame) final { return false; }
44 bool onMediaPlayerVideoFrame(VideoFrame& videoFrame, int mediaPlayerId) final { return false; }
45 bool isExternal() final { return false; }
46
47 virtual bool onCaptureVideoFrame(agora::rtc::VIDEO_SOURCE_TYPE type, webrtc::VideoFrame& videoFrame) { return false; }
48 virtual bool onPreEncodeVideoFrame(agora::rtc::VIDEO_SOURCE_TYPE type, webrtc::VideoFrame& videoFrame) { return false; }
49
50 virtual bool onRenderVideoFrame(const char* channelId, rtc::uid_t remoteUid,
51 webrtc::VideoFrame& videoFrame) { return false; }
52
53 virtual bool onTranscodedVideoFrame(webrtc::VideoFrame& videoFrame) { return false; }
54 virtual bool onMediaPlayerVideoFrame(webrtc::VideoFrame& videoFrame, int mediaPlayerId) { return false; }
55};
56
60 class IMediaEngineEx : public IMediaEngine {
61 public:
62 using IMediaEngine::registerAudioFrameObserver;
63 using IMediaEngine::registerVideoFrameObserver;
64 using IMediaEngine::registerVideoEncodedFrameObserver;
65 using IMediaEngine::pushEncodedVideoImage;
66
67 virtual int pushVideoFrameEx(const webrtc::VideoFrame& frame, unsigned int video_track_id = 0) = 0;
68
69 virtual int enableDualStreamModeEx(bool enabled, const rtc::SimulcastStreamConfig& streamConfig,
70 const rtc::RtcConnection& connection) = 0;
74 virtual int setExternalVideoConfigEx(const rtc::VideoEncoderConfiguration& config) = 0;
75 virtual int setExternalVideoConfigEx(const rtc::VideoEncoderConfiguration& config, const rtc::RtcConnection& connection) = 0;
76
77 ~IMediaEngineEx() override = default;
78};
79
80} // namespace media
81} // namespace agora
agora::media::IMediaEngineEx
Definition media_engine_i.h:60
agora::media::IMediaEngineEx::enableDualStreamModeEx
virtual int enableDualStreamModeEx(bool enabled, const rtc::SimulcastStreamConfig &streamConfig, const rtc::RtcConnection &connection)=0
agora::media::IMediaEngineEx::setExternalVideoConfigEx
virtual int setExternalVideoConfigEx(const rtc::VideoEncoderConfiguration &config, const rtc::RtcConnection &connection)=0
agora::media::IMediaEngineEx::setExternalVideoConfigEx
virtual int setExternalVideoConfigEx(const rtc::VideoEncoderConfiguration &config)=0
agora::media::IMediaEngineEx::~IMediaEngineEx
~IMediaEngineEx() override=default
agora::media::IMediaEngineEx::pushVideoFrameEx
virtual int pushVideoFrameEx(const webrtc::VideoFrame &frame, unsigned int video_track_id=0)=0
agora::media::IMediaEngine
Definition IAgoraMediaEngine.h:44
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::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::IVideoFrameObserverEx
Definition media_engine_i.h:33
agora::media::IVideoFrameObserverEx::onPreEncodeVideoFrame
virtual bool onPreEncodeVideoFrame(agora::rtc::VIDEO_SOURCE_TYPE type, webrtc::VideoFrame &videoFrame)
Definition media_engine_i.h:48
agora::media::IVideoFrameObserverEx::isExternal
bool isExternal() final
Definition media_engine_i.h:45
agora::media::IVideoFrameObserverEx::onTranscodedVideoFrame
virtual bool onTranscodedVideoFrame(webrtc::VideoFrame &videoFrame)
Definition media_engine_i.h:53
agora::media::IVideoFrameObserverEx::onCaptureVideoFrame
virtual bool onCaptureVideoFrame(agora::rtc::VIDEO_SOURCE_TYPE type, webrtc::VideoFrame &videoFrame)
Definition media_engine_i.h:47
agora::media::IVideoFrameObserverEx::onMediaPlayerVideoFrame
bool onMediaPlayerVideoFrame(VideoFrame &videoFrame, int mediaPlayerId) final
Definition media_engine_i.h:44
agora::media::IVideoFrameObserverEx::onTranscodedVideoFrame
bool onTranscodedVideoFrame(VideoFrame &videoFrame) final
Definition media_engine_i.h:43
agora::media::IVideoFrameObserverEx::onCaptureVideoFrame
bool onCaptureVideoFrame(agora::rtc::VIDEO_SOURCE_TYPE type, VideoFrame &videoFrame) final
Occurs each time the SDK receives a video frame captured by local devices.
Definition media_engine_i.h:37
agora::media::IVideoFrameObserverEx::onPreEncodeVideoFrame
bool onPreEncodeVideoFrame(agora::rtc::VIDEO_SOURCE_TYPE type, VideoFrame &videoFrame) final
Occurs each time the SDK receives a video frame before encoding.
Definition media_engine_i.h:38
agora::media::IVideoFrameObserverEx::onRenderVideoFrame
virtual bool onRenderVideoFrame(const char *channelId, rtc::uid_t remoteUid, webrtc::VideoFrame &videoFrame)
Definition media_engine_i.h:50
agora::media::IVideoFrameObserverEx::onMediaPlayerVideoFrame
virtual bool onMediaPlayerVideoFrame(webrtc::VideoFrame &videoFrame, int mediaPlayerId)
Definition media_engine_i.h:54
agora::media::IVideoFrameObserverEx::~IVideoFrameObserverEx
virtual ~IVideoFrameObserverEx()
Definition media_engine_i.h:35
agora::media::IVideoFrameObserverEx::onRenderVideoFrame
bool onRenderVideoFrame(const char *channelId, rtc::uid_t remoteUid, VideoFrame &videoFrame) final
Occurs each time the SDK receives a video frame sent by the remote user.
Definition media_engine_i.h:40
agora::media::IVideoFrameObserver
Definition AgoraMediaBase.h:1951
agora::media::IVideoFrameObserver::VideoFrame
media::base::VideoFrame VideoFrame
Definition AgoraMediaBase.h:1953
agora::media::base::IVideoFrameObserverEx
Definition media_engine_i.h:21
agora::media::base::IVideoFrameObserverEx::isExternal
bool isExternal() final
Definition media_engine_i.h:25
agora::media::base::IVideoFrameObserverEx::onFrame
void onFrame(const VideoFrame *frame) final
Occurs each time the player receives a video frame.
Definition media_engine_i.h:24
agora::media::base::IVideoFrameObserverEx::onFrame
virtual void onFrame(const webrtc::VideoFrame &frame)=0
agora::media::base::IVideoFrameObserverEx::~IVideoFrameObserverEx
virtual ~IVideoFrameObserverEx()
Definition media_engine_i.h:23
agora::media::base::IVideoFrameObserver
Definition AgoraMediaBase.h:1172
agora::media::base
Definition NGIAgoraAudioDeviceManager.h:16
agora::media
Definition content_inspect_i.h:15
agora::rtc
Definition AgoraExtensions.h:5
agora::rtc::uid_t
unsigned int uid_t
Definition AgoraMediaBase.h:28
agora::rtc::VIDEO_SOURCE_TYPE
VIDEO_SOURCE_TYPE
The type of the video source.
Definition AgoraMediaBase.h:67
agora
Definition AgoraAtomicOps.h:21
agora::media::base::VideoFrame
Configurations of the video frame.
Definition AgoraMediaBase.h:1024
agora::rtc::RtcConnection
Contains connection information.
Definition IAgoraRtcEngineEx.h:20
agora::rtc::SimulcastStreamConfig
The configuration of the low-quality video stream.
Definition AgoraBase.h:2230
agora::rtc::VideoEncoderConfiguration
Video encoder configurations.
Definition AgoraBase.h:2057