Agora C++ API Reference for All Platforms
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 "api/video/video_frame.h"
10 #include "IAgoraMediaEngine.h"
11 
12 namespace agora {
13 namespace media {
14 namespace base {
16  public:
18  void onFrame(const VideoFrame* frame) final {}
19  bool isExternal() final { return false; }
20  virtual void onFrame(const webrtc::VideoFrame& frame) = 0;
21 };
22 }
23 
28  public:
30 
31  bool onCaptureVideoFrame(VideoFrame& videoFrame) final { return false; }
32  bool onSecondaryCameraCaptureVideoFrame(VideoFrame& videoFrame) final { return false; }
33 
34  bool onScreenCaptureVideoFrame(VideoFrame& videoFrame) final { return false; }
35  bool onSecondaryScreenCaptureVideoFrame(VideoFrame& videoFrame) final { return false; }
36 
37  bool onRenderVideoFrame(const char* channelId, rtc::uid_t remoteUid,
38  VideoFrame& videoFrame) final { return false; }
39  bool onTranscodedVideoFrame(VideoFrame& videoFrame) final { return false; }
40  bool onMediaPlayerVideoFrame(VideoFrame& videoFrame, int mediaPlayerId) final { return false; }
41  bool isExternal() final { return false; }
42 
43  virtual bool onCaptureVideoFrame(webrtc::VideoFrame& videoFrame) = 0;
44  virtual bool onSecondaryCameraCaptureVideoFrame(webrtc::VideoFrame& videoFrame) = 0;
45 
46  virtual bool onScreenCaptureVideoFrame(webrtc::VideoFrame& videoFrame) = 0;
47  virtual bool onSecondaryScreenCaptureVideoFrame(webrtc::VideoFrame& videoFrame) = 0;
48 
49  virtual bool onRenderVideoFrame(const char* channelId, rtc::uid_t remoteUid,
50  const webrtc::VideoFrame& videoFrame) = 0;
51  virtual bool onTranscodedVideoFrame(webrtc::VideoFrame& videoFrame) = 0;
52  virtual bool onMediaPlayerVideoFrame(webrtc::VideoFrame& videoFrame, int mediaPlayerId) = 0;
53 };
54 
58 class IMediaEngineEx : public IMediaEngine {
59  public:
60  virtual int pushVideoFrameEx(const webrtc::VideoFrame& frame) = 0;
61  virtual int pushVideoFrameEx(const webrtc::VideoFrame& frame, const rtc::RtcConnection& connection) = 0;
62 
67  virtual int setExternalVideoConfigEx(const rtc::VideoEncoderConfiguration& config, const rtc::RtcConnection& connection) = 0;
68 
69  protected:
70  ~IMediaEngineEx() override = default;
71 };
72 
73 } // namespace media
74 } // namespace agora
agora::media::base::VideoFrame
Definition: AgoraMediaBase.h:428
agora::media::IVideoFrameObserverEx
Definition: media_engine_i.h:27
agora::media::base::IVideoFrameObserverEx::onFrame
virtual void onFrame(const webrtc::VideoFrame &frame)=0
agora::media::IVideoFrameObserverEx::onCaptureVideoFrame
virtual bool onCaptureVideoFrame(webrtc::VideoFrame &videoFrame)=0
agora::media::base::IVideoFrameObserver
Definition: AgoraMediaBase.h:508
agora::media::IVideoFrameObserver
Definition: AgoraMediaBase.h:767
agora::media::base::IVideoFrameObserverEx
Definition: media_engine_i.h:15
agora::media::IVideoFrameObserverEx::onRenderVideoFrame
virtual bool onRenderVideoFrame(const char *channelId, rtc::uid_t remoteUid, const webrtc::VideoFrame &videoFrame)=0
agora::rtc::VideoEncoderConfiguration
Definition: AgoraBase.h:1797
agora::media::base::IVideoFrameObserverEx::isExternal
bool isExternal() final
Definition: media_engine_i.h:19
agora::media::IMediaEngineEx::setExternalVideoConfigEx
virtual int setExternalVideoConfigEx(const rtc::VideoEncoderConfiguration &config)=0
agora
Definition: AgoraAtomicOps.h:21
agora::media::IVideoFrameObserverEx::onScreenCaptureVideoFrame
virtual bool onScreenCaptureVideoFrame(webrtc::VideoFrame &videoFrame)=0
agora::media::IVideoFrameObserverEx::onRenderVideoFrame
bool onRenderVideoFrame(const char *channelId, rtc::uid_t remoteUid, VideoFrame &videoFrame) final
Definition: media_engine_i.h:37
agora::media::IMediaEngineEx
Definition: media_engine_i.h:58
agora::media::IVideoFrameObserverEx::onMediaPlayerVideoFrame
virtual bool onMediaPlayerVideoFrame(webrtc::VideoFrame &videoFrame, int mediaPlayerId)=0
agora::media::IMediaEngineEx::~IMediaEngineEx
~IMediaEngineEx() override=default
agora::media::IVideoFrameObserverEx::onMediaPlayerVideoFrame
bool onMediaPlayerVideoFrame(VideoFrame &videoFrame, int mediaPlayerId) final
Definition: media_engine_i.h:40
agora::media::IVideoFrameObserverEx::onTranscodedVideoFrame
virtual bool onTranscodedVideoFrame(webrtc::VideoFrame &videoFrame)=0
agora::rtc::RtcConnection
Definition: IAgoraRtcEngineEx.h:36
agora::media::IVideoFrameObserverEx::onCaptureVideoFrame
bool onCaptureVideoFrame(VideoFrame &videoFrame) final
Definition: media_engine_i.h:31
agora::media::IVideoFrameObserverEx::~IVideoFrameObserverEx
virtual ~IVideoFrameObserverEx()
Definition: media_engine_i.h:29
agora::media::IVideoFrameObserverEx::onSecondaryCameraCaptureVideoFrame
bool onSecondaryCameraCaptureVideoFrame(VideoFrame &videoFrame) final
Definition: media_engine_i.h:32
agora::media::IVideoFrameObserverEx::onSecondaryScreenCaptureVideoFrame
bool onSecondaryScreenCaptureVideoFrame(VideoFrame &videoFrame) final
Definition: media_engine_i.h:35
agora::media::IMediaEngineEx::pushVideoFrameEx
virtual int pushVideoFrameEx(const webrtc::VideoFrame &frame, const rtc::RtcConnection &connection)=0
agora::media::IVideoFrameObserverEx::onScreenCaptureVideoFrame
bool onScreenCaptureVideoFrame(VideoFrame &videoFrame) final
Definition: media_engine_i.h:34
agora::media::base::IVideoFrameObserverEx::~IVideoFrameObserverEx
virtual ~IVideoFrameObserverEx()
Definition: media_engine_i.h:17
agora::media::IMediaEngine
Definition: IAgoraMediaEngine.h:30
agora::media::IVideoFrameObserverEx::onSecondaryScreenCaptureVideoFrame
virtual bool onSecondaryScreenCaptureVideoFrame(webrtc::VideoFrame &videoFrame)=0
agora::media::IVideoFrameObserverEx::onTranscodedVideoFrame
bool onTranscodedVideoFrame(VideoFrame &videoFrame) final
Definition: media_engine_i.h:39
agora::media::IMediaEngineEx::setExternalVideoConfigEx
virtual int setExternalVideoConfigEx(const rtc::VideoEncoderConfiguration &config, const rtc::RtcConnection &connection)=0
agora::rtc::uid_t
unsigned int uid_t
Definition: AgoraMediaBase.h:25
agora::media::base::IVideoFrameObserverEx::onFrame
void onFrame(const VideoFrame *frame) final
Definition: media_engine_i.h:18
agora::media::IMediaEngineEx::pushVideoFrameEx
virtual int pushVideoFrameEx(const webrtc::VideoFrame &frame)=0
agora::media::IVideoFrameObserverEx::isExternal
bool isExternal() final
Definition: media_engine_i.h:41
agora::media::IVideoFrameObserverEx::onSecondaryCameraCaptureVideoFrame
virtual bool onSecondaryCameraCaptureVideoFrame(webrtc::VideoFrame &videoFrame)=0