Agora C++ API Reference for All Platforms
Loading...
Searching...
No Matches
screen_capture_i.h
1//
2// Agora Media SDK
3//
4// Created by Sting Feng in 2015-05.
5// Copyright (c) 2015 Agora IO. All rights reserved.
6//
7#pragma once
8
9#include "AgoraRefPtr.h"
10#include "NGIAgoraExtensionScreenSource.h"
11#include "NGIAgoraScreenCapturer.h"
12#include "main/core/video/base/video_frame/video_content_type.h"
13#include "main/core/video/base/video_frame/video_frame.h"
14#include "main/core/video/base/video_source_interface.h"
15#include "modules/desktop_capture/desktop_capturer.h"
16
17namespace agora {
18namespace rtc {
19
21class AudioPcmDataSinkInterface;
23
25public:
30 public:
31 virtual ~IScreenCapturerEx() {}
32 virtual int StartCapture() = 0;
33 virtual int StopCapture() = 0;
35 std::weak_ptr<::rtc::VideoSinkInterface<webrtc::VideoFrame>> dataCallback) = 0;
36 virtual int CaptureMouseCursor(bool capture) = 0;
37 virtual int GetScreenDimensions(VideoDimensions& dimension) = 0;
38 virtual int SetOutputDimensions(VideoDimensions dimension) {return 0;};
39 virtual int SetContentType(agora::VideoContentSubType type) {return 0;};
40 virtual void GetContentType(agora::VideoContentType& type, agora::VideoContentSubType& subtype) {};
41 virtual bool FocusOnSelectedSource() = 0;
42 virtual void SetHighLight(bool isHighLight, unsigned int color, int width) {}
43 virtual void SetVideoQoEPusher(std::weak_ptr<agora::rtc::VideoStatsEventsPusher> pusher) = 0;
44
45#if defined (WEBRTC_MAC)
46 virtual bool isAudioCaptureSupported() = 0;
47 virtual int startAudioCapture() = 0;
48 virtual int stopAudioCapture() = 0;
49 virtual void addPcmDataSink(AudioPcmDataSinkInterface* sink) = 0;
50 virtual void removePcmDataSink(AudioPcmDataSinkInterface* sink) = 0;
51#endif
52
53#if defined(_WIN32) || (defined(__APPLE__) && !TARGET_OS_IPHONE && TARGET_OS_MAC) || (defined(__linux__) && !defined(__ANDROID__) && !defined(__OHOS__))
54 virtual int initWithDisplayIdLLApiInternal(int64_t displayId, const rtc::ScreenCaptureConfiguration& config) = 0;
55#endif
56
57#if defined(_WIN32) || (defined(__linux__) && !defined(__ANDROID__) && !defined (__OHOS__))
58 virtual int initWithScreenRectLLApiInternal(const rtc::Rectangle& screenRect, const rtc::Rectangle& regionRect) = 0;
59#endif
63 virtual int setFrameRateLLApiInternal(int rate) = 0;
64#if defined(__ANDROID__)
65 virtual int initWithMediaProjectionPermissionResultDataLLApiInternal(void* data, const VideoDimensions& dimensions) = 0;
66#endif
67#if defined(_WIN32)
69 virtual void SetCaptureSource(bool allow_magnification_api, bool allow_directx_capturer) {}
70 virtual void GetCaptureSource(bool& allow_magnification_api, bool& allow_directx_capturer) {}
71 virtual void SetAllowUseWGC(bool allow_use_wgc) {}
72 virtual void GetAllowUseWGC(bool& allow_use_wgc) {}
73 virtual void SetCaptureToTexture(bool capture_to_texture) {}
74 virtual void GetCaptureToTexture(bool& capture_to_texture) {}
75#endif // _WIN32
76
77#if defined(_WIN32) || (defined(WEBRTC_MAC) && !defined(WEBRTC_IOS))
78 virtual void ForcedUsingScreenCapture(bool using_screen_capture) {}
79
80 virtual void SetExcludeWindowList(const std::vector<void *>& window_list) = 0;
81 virtual webrtc::DesktopCapturer::SourceId GetSourceId() = 0;
82 virtual int GetCaptureType() = 0;
83#endif // _WIN32 || (WEBRTC_MAC&&!WEBRTC_IOS)
90 // Enumerates screen capture sources (sync if |ares| invalid, async otherwise); result is written
91 // into |*source_list|. Returns the sync-stage error code.
93 const std::shared_ptr<IScreenCaptureSourceList*>& /*source_list*/,
94 aosl_ref_t /*ares*/ = AOSL_REF_INVALID) {
95 return -ERR_NOT_SUPPORTED;
96 }
97 virtual void deinit() {};
98 virtual void attachStatsSpace(uint64_t stats_space) {}
99};
100
102public:
104 (void) state;
105 }
106protected:
108};
109
110#if defined(__ANDROID__) || (defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE) || defined(__OHOS__)
111class AudioPcmDataSinkInterface;
113 public:
114 virtual int startVideoCapture() = 0;
115 virtual int stopVideoCapture() = 0;
116 virtual int startAudioCapture() = 0;
117 virtual int stopAudioCapture() = 0;
118 virtual void addPcmDataSink(AudioPcmDataSinkInterface* sink) = 0;
119 virtual void removePcmDataSink(AudioPcmDataSinkInterface* sink) = 0;
120 virtual void deinit() {};
121 virtual void attachStatsSpace(uint64_t stats_space) {}
122 virtual void SetVideoQoEPusher(std::weak_ptr<agora::rtc::VideoStatsEventsPusher> pusher) = 0;
124 virtual int updateScreenCaptureRegionLLApiInternal(const rtc::Rectangle& regionRect) = 0;
125 virtual int setFrameRateLLApiInternal(int fps) = 0;
126 virtual int setAudioRecordConfigLLApiInternal(int channels, int sampleRate) = 0;
127 virtual int setAudioVolumeLLApiInternal(uint32_t volume) = 0;
128};
129#endif
130
131} // namespace rtc
132} // namespace agora
Definition screen_capture_i.h:101
virtual void onScreenCaptureStateChanged(IScreenCapturerEx::SCREEN_CAPTURER_STATE state)
Definition screen_capture_i.h:103
virtual ~IScreenCaptureObserver()
Definition screen_capture_i.h:107
Definition IAgoraRtcEngine.h:1162
Definition NGIAgoraScreenCapturer.h:146
Definition screen_capture_i.h:112
virtual int setAudioVolumeLLApiInternal(uint32_t volume)=0
virtual int stopVideoCapture()=0
virtual int startVideoCapture()=0
virtual int setAudioRecordConfigLLApiInternal(int channels, int sampleRate)=0
virtual void attachStatsSpace(uint64_t stats_space)
Definition screen_capture_i.h:121
virtual int stopAudioCapture()=0
virtual void addPcmDataSink(AudioPcmDataSinkInterface *sink)=0
virtual int setFrameRateLLApiInternal(int fps)=0
virtual void removePcmDataSink(AudioPcmDataSinkInterface *sink)=0
virtual int startAudioCapture()=0
virtual void deinit()
Definition screen_capture_i.h:120
virtual int updateScreenCaptureRegionLLApiInternal(const rtc::Rectangle &regionRect)=0
virtual int setScreenCaptureDimensionsLLApiInternal(const VideoDimensions &dimensions)=0
virtual void SetVideoQoEPusher(std::weak_ptr< agora::rtc::VideoStatsEventsPusher > pusher)=0
Definition screen_capture_i.h:24
virtual int unregisterScreenCaptureObserver(IScreenCaptureObserver *observer)
Definition screen_capture_i.h:87
virtual int initWithScreenRectLLApiInternal(const rtc::Rectangle &screenRect, const rtc::Rectangle &regionRect)=0
virtual int initWithWindowIdLLApiInternal(view_t windowId, const rtc::ScreenCaptureConfiguration &config)=0
virtual void GetContentType(agora::VideoContentType &type, agora::VideoContentSubType &subtype)
Definition screen_capture_i.h:40
virtual int InitUsingLastRegionSetting()
Definition screen_capture_i.h:68
virtual int setFrameRateLLApiInternal(int rate)=0
virtual int startAudioCapture()=0
virtual void SetAllowUseWGC(bool allow_use_wgc)
Definition screen_capture_i.h:71
virtual void GetCaptureToTexture(bool &capture_to_texture)
Definition screen_capture_i.h:74
virtual void SetVideoQoEPusher(std::weak_ptr< agora::rtc::VideoStatsEventsPusher > pusher)=0
virtual int CaptureMouseCursor(bool capture)=0
virtual int SetContentType(agora::VideoContentSubType type)
Definition screen_capture_i.h:39
virtual int initWithDisplayIdLLApiInternal(int64_t displayId, const rtc::ScreenCaptureConfiguration &config)=0
virtual ~IScreenCapturerEx()
Definition screen_capture_i.h:31
virtual void SetCaptureToTexture(bool capture_to_texture)
Definition screen_capture_i.h:73
SCREEN_CAPTURER_STATE
Definition screen_capture_i.h:26
@ SCREEN_CAPTURER_STARTED
Definition screen_capture_i.h:27
@ SCREEN_CAPTURER_STOPPED
Definition screen_capture_i.h:28
virtual void addPcmDataSink(AudioPcmDataSinkInterface *sink)=0
virtual int updateScreenCaptureRegionLLApiInternal(const rtc::Rectangle &rect)=0
virtual void ForcedUsingScreenCapture(bool using_screen_capture)
Definition screen_capture_i.h:78
virtual void GetAllowUseWGC(bool &allow_use_wgc)
Definition screen_capture_i.h:72
virtual int initWithMediaProjectionPermissionResultDataLLApiInternal(void *data, const VideoDimensions &dimensions)=0
virtual void SetHighLight(bool isHighLight, unsigned int color, int width)
Definition screen_capture_i.h:42
virtual int stopAudioCapture()=0
virtual int registerScreenCaptureObserver(IScreenCaptureObserver *observer)
Definition screen_capture_i.h:84
virtual bool FocusOnSelectedSource()=0
virtual void removePcmDataSink(AudioPcmDataSinkInterface *sink)=0
virtual int setScreenOrientationLLApiInternal(VIDEO_ORIENTATION orientation)=0
virtual bool isAudioCaptureSupported()=0
virtual int GetScreenDimensions(VideoDimensions &dimension)=0
virtual int getScreenCaptureSources(const IScreenCaptureSource::ScreenSourceListOption &, const std::shared_ptr< IScreenCaptureSourceList * > &, aosl_ref_t=AOSL_REF_INVALID)
Definition screen_capture_i.h:92
virtual webrtc::DesktopCapturer::SourceId GetSourceId()=0
virtual void deinit()
Definition screen_capture_i.h:97
virtual void SetExcludeWindowList(const std::vector< void * > &window_list)=0
virtual void GetCaptureSource(bool &allow_magnification_api, bool &allow_directx_capturer)
Definition screen_capture_i.h:70
virtual void SetCaptureSource(bool allow_magnification_api, bool allow_directx_capturer)
Definition screen_capture_i.h:69
virtual int SetOutputDimensions(VideoDimensions dimension)
Definition screen_capture_i.h:38
virtual void RegisterCaptureDataCallback(std::weak_ptr<::rtc::VideoSinkInterface< webrtc::VideoFrame > > dataCallback)=0
virtual void attachStatsSpace(uint64_t stats_space)
Definition screen_capture_i.h:98
virtual int GetCaptureType()=0
Definition NGIAgoraScreenCapturer.h:19
Definition video_node_i.h:32
Definition AgoraExtensions.h:5
VIDEO_ORIENTATION
The clockwise rotation of the video.
Definition AgoraBase.h:1086
Definition AgoraAtomicOps.h:21
void * view_t
Definition AgoraBase.h:935
@ ERR_NOT_SUPPORTED
Definition AgoraBase.h:507
Definition NGIAgoraExtensionScreenSource.h:115
The location of the target area relative to the screen or window. If you do not set this parameter,...
Definition AgoraBase.h:2429
The configuration of the captured screen.
Definition IAgoraRtcEngine.h:993
The video dimension.
Definition AgoraBase.h:1252