Agora RTC Objective-C API Reference Refactor

NGIAgoraScreenCapturer.h
Go to the documentation of this file.
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) || (defined(__linux__) && !defined(__ANDROID__) && !defined(__OHOS__))
22
39 virtual int initWithDisplayId(int64_t displayId, const Rectangle& regionRect) = 0;
40 #endif
41
42 #if defined(_WIN32) || (defined(__linux__) && !defined(__ANDROID__) && !defined(__OHOS__))
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) || defined (__OHOS__)
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::IScreenCapturer::setScreenOrientation
virtual int setScreenOrientation(VIDEO_ORIENTATION orientation, aosl_ref_t ares=AOSL_REF_INVALID)=0
AgoraBase.h
agora::rtc::IScreenCapturer::updateScreenCaptureRegion
virtual int updateScreenCaptureRegion(const Rectangle &regionRect, aosl_ref_t ares=AOSL_REF_INVALID)=0
agora::rtc::Rectangle
The location of the target area relative to the screen or window. If you do not set this parameter,...
Definition: AgoraBase.h:2342
agora::rtc::IScreenCapturer::setFrameRate
virtual int setFrameRate(int rate, aosl_ref_t ares=AOSL_REF_INVALID)=0
agora::view_t
void * view_t
Definition: AgoraBase.h:850
agora::rtc::IScreenCapturer::initWithWindowId
virtual int initWithWindowId(view_t windowId, const Rectangle &regionRect)=0
agora::rtc::VIDEO_CONTENT_HINT
VIDEO_CONTENT_HINT
The content hint for screen sharing.
Definition: AgoraBase.h:3210
agora::rtc::IScreenCapturer::~IScreenCapturer
~IScreenCapturer()
Definition: NGIAgoraScreenCapturer.h:142
agora
Definition: AgoraAtomicOps.h:21
agora::rtc::IScreenCapturer
Definition: NGIAgoraScreenCapturer.h:19
agora::rtc::VIDEO_ORIENTATION
VIDEO_ORIENTATION
The clockwise rotation of the video.
Definition: AgoraBase.h:1001
AgoraRefPtr.h
agora::rtc::IScreenCapturer::setContentHint
virtual int setContentHint(VIDEO_CONTENT_HINT contentHint, aosl_ref_t ares=AOSL_REF_INVALID)=0
agora::RefCountInterface
Definition: AgoraRefPtr.h:31
agora::rtc::VideoDimensions
The video dimension.
Definition: AgoraBase.h:1166