Agora C++ API Reference for All Platforms

NGIAgoraScreenCapturer.h
1 //
2 // Agora SDK
3 //
4 // Copyright (c) 2019 Agora.io. All rights reserved.
5 //
6
7 #pragma once // NOLINT(build/header_guard)
8
9 #include "AgoraBase.h"
10 #include "AgoraRefPtr.h"
11 #include <api/cpp/aosl_ares_class.h>
12
13 namespace agora {
14 namespace rtc {
15
19 class IScreenCapturer : public RefCountInterface {
20 public:
21 #if defined (_WIN32) || (defined(__APPLE__) && TARGET_OS_MAC && !TARGET_OS_IPHONE)
22
39 virtual int initWithDisplayId(int64_t displayId, const Rectangle& regionRect) = 0;
40 #endif
41
42 #if defined(_WIN32) || (defined(__linux__) && !defined(__ANDROID__))
43
60 virtual int initWithScreenRect(const Rectangle& screenRect,
61 const Rectangle& regionRect) = 0;
62 #endif // TARGET_OS_MAC && !TARGET_OS_IPHONE
63
81 virtual int initWithWindowId(view_t windowId, const Rectangle& regionRect) = 0;
82
94 virtual int setContentHint(VIDEO_CONTENT_HINT contentHint, aosl_ref_t ares = AOSL_REF_INVALID) = 0;
95
106 virtual int updateScreenCaptureRegion(const Rectangle& regionRect, aosl_ref_t ares = AOSL_REF_INVALID) = 0;
107
112 virtual int setScreenOrientation(VIDEO_ORIENTATION orientation, aosl_ref_t ares = AOSL_REF_INVALID) = 0;
113
118 virtual int setFrameRate(int rate, aosl_ref_t ares = AOSL_REF_INVALID) = 0;
119
120 #if defined(__ANDROID__)
121
137 virtual int initWithMediaProjectionPermissionResultData(void* data,
138 const VideoDimensions& dimensions) = 0;
139 #endif // __ANDROID__
140
141 protected:
142 ~IScreenCapturer() {}
143 };
144
145 #if defined(__ANDROID__) || (defined(__APPLE__) && TARGET_OS_IPHONE)
146 class IScreenCapturer2 : public RefCountInterface {
147 public:
158 virtual int setScreenCaptureDimensions(const VideoDimensions& dimensions, aosl_ref_t ares = AOSL_REF_INVALID) = 0;
159
170 virtual int updateScreenCaptureRegion(const Rectangle& regionRect, aosl_ref_t ares = AOSL_REF_INVALID) = 0;
171
176 virtual int setFrameRate(int rate, aosl_ref_t ares = AOSL_REF_INVALID) = 0;
177
186 virtual int setAudioRecordConfig(int channels, int sampleRate, aosl_ref_t ares = AOSL_REF_INVALID) = 0;
187
195 virtual int setAudioVolume(uint32_t volume, aosl_ref_t ares = AOSL_REF_INVALID) = 0;
196
197 #if defined(__ANDROID__)
198
214 virtual int setExternalMediaProjection(void* mediaProjection) = 0;
215 #endif
216
217 protected:
218 virtual ~IScreenCapturer2() {}
219 };
220 #endif
221
222 } // namespace rtc
223 } // namespace agora
agora::rtc::IScreenCapturer2::updateScreenCaptureRegion
virtual int updateScreenCaptureRegion(const Rectangle &regionRect, aosl_ref_t ares=AOSL_REF_INVALID)=0
agora::rtc::IScreenCapturer2::setExternalMediaProjection
virtual int setExternalMediaProjection(void *mediaProjection)=0
agora::rtc::IScreenCapturer::updateScreenCaptureRegion
virtual int updateScreenCaptureRegion(const Rectangle &regionRect, aosl_ref_t ares=AOSL_REF_INVALID)=0
agora::rtc::IScreenCapturer::setScreenOrientation
virtual int setScreenOrientation(VIDEO_ORIENTATION orientation, aosl_ref_t ares=AOSL_REF_INVALID)=0
agora::rtc::IScreenCapturer::initWithWindowId
virtual int initWithWindowId(view_t windowId, const Rectangle &regionRect)=0
agora::rtc::IScreenCapturer::~IScreenCapturer
~IScreenCapturer()
Definition: NGIAgoraScreenCapturer.h:142
agora::rtc::Rectangle
Definition: AgoraBase.h:2224
agora::view_t
void * view_t
Definition: AgoraBase.h:818
agora::rtc::IScreenCapturer2::setAudioRecordConfig
virtual int setAudioRecordConfig(int channels, int sampleRate, aosl_ref_t ares=AOSL_REF_INVALID)=0
agora::rtc::IScreenCapturer2::setFrameRate
virtual int setFrameRate(int rate, aosl_ref_t ares=AOSL_REF_INVALID)=0
agora::rtc::IScreenCapturer::setContentHint
virtual int setContentHint(VIDEO_CONTENT_HINT contentHint, aosl_ref_t ares=AOSL_REF_INVALID)=0
agora
Definition: AgoraAtomicOps.h:21
agora::rtc::IScreenCapturer::setFrameRate
virtual int setFrameRate(int rate, aosl_ref_t ares=AOSL_REF_INVALID)=0
agora::rtc::IScreenCapturer2::setScreenCaptureDimensions
virtual int setScreenCaptureDimensions(const VideoDimensions &dimensions, aosl_ref_t ares=AOSL_REF_INVALID)=0
agora::rtc::IScreenCapturer
Definition: NGIAgoraScreenCapturer.h:19
agora::rtc::VIDEO_ORIENTATION
VIDEO_ORIENTATION
Definition: AgoraBase.h:951
agora::rtc::IScreenCapturer2::setAudioVolume
virtual int setAudioVolume(uint32_t volume, aosl_ref_t ares=AOSL_REF_INVALID)=0
agora::rtc::IScreenCapturer::initWithScreenRect
virtual int initWithScreenRect(const Rectangle &screenRect, const Rectangle &regionRect)=0
agora::rtc::IScreenCapturer2
Definition: NGIAgoraScreenCapturer.h:146
agora::rtc::IScreenCapturer2::~IScreenCapturer2
virtual ~IScreenCapturer2()
Definition: NGIAgoraScreenCapturer.h:218
agora::RefCountInterface
Definition: AgoraRefPtr.h:31
agora::rtc::VideoDimensions
Definition: AgoraBase.h:1103
agora::rtc::VIDEO_CONTENT_HINT
VIDEO_CONTENT_HINT
Definition: AgoraBase.h:2770
agora::rtc::IScreenCapturer::initWithMediaProjectionPermissionResultData
virtual int initWithMediaProjectionPermissionResultData(void *data, const VideoDimensions &dimensions)=0
agora::rtc::IScreenCapturer::initWithDisplayId
virtual int initWithDisplayId(int64_t displayId, const Rectangle &regionRect)=0
rtc
Definition: video_node_i.h:28