7 #pragma once // NOLINT(build/header_guard)
10 #include "IAgoraLog.h"
11 #include "AgoraRefPtr.h"
12 #include "NGIAgoraVideoFrame.h"
13 #include "AgoraMediaBase.h"
16 #if defined(WEBRTC_IOS)
17 #include <coreVideo/CVPixelBuffer.h>
24 uint32_t captured_frame_width;
25 uint32_t captured_frame_height;
26 uint32_t total_captured_frames;
27 uint64_t per_frame_cap_time_ms;
28 uint64_t per_capture_cpu_cycles;
29 bool capture_mouse_cursor;
31 uint32_t real_capture_fps;
32 uint32_t capture_out_fps;
36 : capture_type(-1), captured_frame_width(0), captured_frame_height(0),
37 total_captured_frames(0), per_frame_cap_time_ms(0),
38 per_capture_cpu_cycles(0), capture_mouse_cursor(
true),
39 target_fps(0), real_capture_fps(0),
40 capture_out_fps(0), drop_fps(0) {}
47 virtual int postEvent(
const char* key,
const char* value) = 0;
48 virtual void printLog(commons::LOG_LEVEL level,
const char* format, ...) = 0;
49 virtual void printLog(commons::LOG_LEVEL level,
const char* fromat, va_list) = 0;
51 virtual bool timeToPushVideo() = 0;
54 #if defined(WEBRTC_IOS)
55 virtual int pushVideoFrame(CVPixelBufferRef pixelBuffer, int64_t timestamp_ms, uint32_t rotation) = 0;
57 #if defined(WEBRTC_WIN)
58 virtual void recycleVideoCache() = 0;
69 #if defined (__ANDROID__) || (defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE)
74 : dimensions(640, 360), frameRate(15) {}
87 bool disable_frame_transparent_check;
90 : type(CaptureScreen), screen_rect(), region_offset(), display_id(0), window_id(NULL), disable_frame_transparent_check(
false) { }
101 bool unskip_system_window;
102 #if defined(WEBRTC_MAC)
103 std::vector<std::string> skip_empty_title_apps;
117 virtual int initVideo(
const VideoCaptureConfig& config) = 0;
119 virtual int startVideoCapture(
const VideoCaptureConfig& config) = 0;
120 virtual int stopVideoCapture() = 0;
121 virtual int stopVideoCaptureAsync() = 0;
123 virtual CaptureMode getVideoCaptureMode() = 0;
126 virtual int startAudioCapture(
const AudioCaptureConfig& config) {
127 return -ERR_NOT_SUPPORTED;
129 virtual int stopAudioCapture() {
130 return -ERR_NOT_SUPPORTED;
132 virtual int setAudioVolume(uint32_t volume) {
133 return -ERR_NOT_SUPPORTED;
135 virtual int setFrameRate(
int fps) {
136 return -ERR_NOT_SUPPORTED;
140 return -ERR_NOT_SUPPORTED;
143 return -ERR_NOT_SUPPORTED;
145 virtual int setExcludeWindowList(
void*
const * handles,
int count) {
146 return -ERR_NOT_SUPPORTED;
148 virtual int captureMouseCursor(
bool capture) {
149 return -ERR_NOT_SUPPORTED;
152 return -ERR_NOT_SUPPORTED;
154 virtual int getProfilingStats(ScreenCaptureProfilingStatistics& stats) {
155 return -ERR_NOT_SUPPORTED;
157 virtual int getScreenDimensions(
int& width,
int& height) {
158 return ERR_NOT_SUPPORTED;
160 virtual int setProperty(
const char* key,
const char* json_value) {
161 return -ERR_NOT_SUPPORTED;
163 virtual int setCustomContext(
const char* key,
const void* context) {
164 return -ERR_NOT_SUPPORTED;
166 virtual int getProperty(
const char* key,
char* json_value,
int& length) {
167 return -ERR_NOT_SUPPORTED;
169 virtual int setHighLight(
bool isHighLight,
unsigned int color,
int width) {
170 return -ERR_NOT_SUPPORTED;
172 virtual int setContentType(
int contentType) {
173 return -ERR_NOT_SUPPORTED;
175 virtual void* getCustomContext(
const char* key) {
178 virtual void* getScreenCaptureSources(
const ScreenSourceListOption& option) {
181 virtual void setFrameCopy(
bool frameCopy) {};
182 #if defined(WEBRTC_ANDROID) && !defined(RTC_EXCLUDE_JAVA)
183 virtual void setSmoothCapture(
bool smoothCapture) {};
184 virtual void setResetVitualDisplay(
bool reset) {};
186 #if defined(WEBRTC_ANDROID)
187 virtual int setExternalMediaProjection(
void* mediaProjection) {
188 return -ERR_NOT_SUPPORTED;