Agora C++ API Reference for All Platforms

Loading...
Searching...
No Matches
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
13namespace agora {
14namespace 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__))
39 virtual int initWithDisplayId(int64_t displayId, const Rectangle& regionRect) = 0;
40#endif
41
42#if defined(_WIN32) || (defined(__linux__) && !defined(__ANDROID__) && !defined(__OHOS__))
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__)
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__)
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::RefCountInterface
Definition AgoraRefPtr.h:31
agora::rtc::IScreenCapturer2
Definition NGIAgoraScreenCapturer.h:146
agora::rtc::IScreenCapturer2::setAudioRecordConfig
virtual int setAudioRecordConfig(int channels, int sampleRate, aosl_ref_t ares=AOSL_REF_INVALID)=0
agora::rtc::IScreenCapturer2::updateScreenCaptureRegion
virtual int updateScreenCaptureRegion(const Rectangle &regionRect, aosl_ref_t ares=AOSL_REF_INVALID)=0
agora::rtc::IScreenCapturer2::setAudioVolume
virtual int setAudioVolume(uint32_t volume, 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::IScreenCapturer2::setFrameRate
virtual int setFrameRate(int rate, aosl_ref_t ares=AOSL_REF_INVALID)=0
agora::rtc::IScreenCapturer2::setExternalMediaProjection
virtual int setExternalMediaProjection(void *mediaProjection)=0
agora::rtc::IScreenCapturer2::~IScreenCapturer2
virtual ~IScreenCapturer2()
Definition NGIAgoraScreenCapturer.h:218
agora::rtc::IScreenCapturer
Definition NGIAgoraScreenCapturer.h:19
agora::rtc::IScreenCapturer::updateScreenCaptureRegion
virtual int updateScreenCaptureRegion(const Rectangle &regionRect, aosl_ref_t ares=AOSL_REF_INVALID)=0
agora::rtc::IScreenCapturer::setFrameRate
virtual int setFrameRate(int rate, aosl_ref_t ares=AOSL_REF_INVALID)=0
agora::rtc::IScreenCapturer::initWithScreenRect
virtual int initWithScreenRect(const Rectangle &screenRect, const Rectangle &regionRect)=0
agora::rtc::IScreenCapturer::initWithMediaProjectionPermissionResultData
virtual int initWithMediaProjectionPermissionResultData(void *data, const VideoDimensions &dimensions)=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::initWithDisplayId
virtual int initWithDisplayId(int64_t displayId, const Rectangle &regionRect)=0
agora::rtc::IScreenCapturer::setContentHint
virtual int setContentHint(VIDEO_CONTENT_HINT contentHint, aosl_ref_t ares=AOSL_REF_INVALID)=0
agora::rtc::IScreenCapturer::~IScreenCapturer
~IScreenCapturer()
Definition NGIAgoraScreenCapturer.h:142
agora::rtc
Definition AgoraExtensions.h:5
agora::rtc::VIDEO_CONTENT_HINT
VIDEO_CONTENT_HINT
The content hint for screen sharing.
Definition AgoraBase.h:3209
agora::rtc::VIDEO_ORIENTATION
VIDEO_ORIENTATION
The clockwise rotation of the video.
Definition AgoraBase.h:1001
agora
Definition AgoraAtomicOps.h:21
agora::view_t
void * view_t
Definition AgoraBase.h:850
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::VideoDimensions
The video dimension.
Definition AgoraBase.h:1166