• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2023 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef SCREEN_CAPTURE_SERVICE_SERVER_H
17 #define SCREEN_CAPTURE_SERVICE_SERVER_H
18 
19 #include "screen_capture_server_base.h"
20 #include "ui_extension_ability_connection.h"
21 
22 namespace OHOS {
23 namespace Media {
24 
25 class ScreenCaptureServer : public std::enable_shared_from_this<ScreenCaptureServer>,
26         public IScreenCaptureService, public NoCopyable {
27 public:
28     static std::map<int32_t, std::weak_ptr<ScreenCaptureServer>> serverMap_;
29     static std::map<int32_t, std::pair<int32_t, int32_t>> saUidAppUidMap_;
30     static const int32_t maxSessionId_;
31     static const int32_t maxAppLimit_;
32     static UniqueIDGenerator gIdGenerator_;
33     static std::list<int32_t> startedSessionIDList_;
34     static const int32_t maxSessionPerUid_;
35     static const int32_t maxSCServerDataTypePerUid_;
36     static std::shared_mutex mutexServerMapRWGlobal_;
37     static std::shared_mutex mutexListRWGlobal_;
38     static std::shared_mutex mutexSaAppInfoMapGlobal_;
39     static std::atomic<int32_t> systemScreenRecorderPid_;
40 
41     static std::shared_ptr<IScreenCaptureService> Create();
42     static bool IsSAServiceCalling();
43     static bool CanScreenCaptureInstanceBeCreate(int32_t appUid);
44     static std::shared_ptr<IScreenCaptureService> CreateScreenCaptureNewInstance();
45     static int32_t ReportAVScreenCaptureUserChoice(int32_t sessionId, const std::string &content);
46     static int32_t GetRunningScreenCaptureInstancePid(std::list<int32_t> &pidList);
47     static int32_t GetAVScreenCaptureConfigurableParameters(int32_t sessionId, std::string &resultStr);
48     static void GetChoiceFromJson(Json::Value &root, const std::string &content, std::string key, std::string &value);
49     static void GetValueFromJson(Json::Value &root, const std::string &content, std::string key, bool &value);
50     static void AddScreenCaptureServerMap(int32_t sessionId, std::weak_ptr<ScreenCaptureServer> server);
51     static void RemoveScreenCaptureServerMap(int32_t sessionId);
52     static bool CheckScreenCaptureSessionIdLimit(int32_t curAppUid);
53     static bool CheckSCServerSpecifiedDataTypeNum(int32_t curAppUid, DataType dataType);
54     static void CountScreenCaptureAppNum(std::set<int32_t>& appSet);
55     static bool CheckScreenCaptureAppLimit(int32_t curAppUid);
56     static std::shared_ptr<ScreenCaptureServer> GetScreenCaptureServerById(int32_t id);
57     static std::shared_ptr<ScreenCaptureServer> GetScreenCaptureServerByIdWithLock(int32_t id);
58     static std::list<int32_t> GetStartedScreenCaptureServerPidList();
59     static int32_t CountStartedScreenCaptureServerNumByPid(int32_t pid);
60     static void AddStartedSessionIdList(int32_t value);
61     static void RemoveStartedSessionIdList(int32_t value);
62     static std::list<int32_t> GetAllStartedSessionIdList();
63     static void AddSaAppInfoMap(int32_t saUid, int32_t curAppUid);
64     static void RemoveSaAppInfoMap(int32_t saUid);
65     static bool CheckSaUid(int32_t saUid, int32_t appUid);
66     static bool IsSaUidValid(int32_t saUid, int32_t appUid);
67     static bool CheckPidIsScreenRecorder(int32_t pid);
68     ScreenCaptureServer();
69     ~ScreenCaptureServer();
70 
71     int32_t SetCaptureMode(CaptureMode captureMode) override;
72     int32_t SetDataType(DataType dataType) override;
73     int32_t SetRecorderInfo(RecorderInfo recorderInfo) override;
74     int32_t SetOutputFile(int32_t outputFd) override;
75     int32_t SetAndCheckLimit() override;
76     int32_t SetAndCheckSaLimit(OHOS::AudioStandard::AppInfo &appInfo) override;
77     int32_t InitAudioEncInfo(AudioEncInfo audioEncInfo) override;
78     int32_t InitAudioCap(AudioCaptureInfo audioInfo) override;
79     int32_t InitVideoEncInfo(VideoEncInfo videoEncInfo) override;
80     int32_t InitVideoCap(VideoCaptureInfo videoInfo) override;
81     int32_t StartScreenCapture(bool isPrivacyAuthorityEnabled) override;
82     int32_t StartScreenCaptureWithSurface(sptr<Surface> surface, bool isPrivacyAuthorityEnabled) override;
83     int32_t StopScreenCapture() override;
84     int32_t SetScreenCaptureCallback(const std::shared_ptr<ScreenCaptureCallBack> &callback) override;
85     int32_t AcquireAudioBuffer(std::shared_ptr<AudioBuffer> &audioBuffer, AudioCaptureSourceType type) override;
86     int32_t AcquireVideoBuffer(sptr<OHOS::SurfaceBuffer> &surfaceBuffer, int32_t &fence,
87         int64_t &timestamp, OHOS::Rect &damage) override;
88     int32_t ReleaseAudioBuffer(AudioCaptureSourceType type) override;
89     int32_t ReleaseVideoBuffer() override;
90     int32_t SetMicrophoneEnabled(bool isMicrophone) override;
91     bool GetMicWorkingState();
92     int32_t SetCanvasRotation(bool canvasRotation) override;
93     int32_t ShowCursor(bool showCursor) override;
94     int32_t ResizeCanvas(int32_t width, int32_t height) override;
95     int32_t SkipPrivacyMode(std::vector<uint64_t> &windowIDsVec) override;
96     int32_t SetMaxVideoFrameRate(int32_t frameRate) override;
97     void Release() override;
98     int32_t ExcludeContent(ScreenCaptureContentFilter &contentFilter) override;
99     int32_t SetScreenCaptureStrategy(ScreenCaptureStrategy strategy) override;
100     int32_t UpdateSurface(sptr<Surface> surface) override;
101     int32_t SetCaptureArea(uint64_t displayId, OHOS::Rect area) override;
102 
103     void SetSessionId(int32_t sessionId);
104     void GetAndSetAppVersion();
105     bool CheckAppVersionForUnsupport(DMError result);
106     int32_t OnReceiveUserPrivacyAuthority(bool isAllowed);
107     int32_t StopScreenCaptureByEvent(AVScreenCaptureStateCode stateCode);
108     std::shared_ptr<OHOS::AbilityRuntime::WantAgent::WantAgent> GetWantAgent(const std::string& callingLabel,
109         int32_t sessionId);
110     void SetPublishRequest(const std::shared_ptr<NotificationLocalLiveViewContent>& localLiveViewContent,
111         int32_t notificationId, NotificationRequest& request);
112     void SystemPrivacyProtected(ScreenId& virtualScreenId, bool systemPrivacyProtectionSwitch);
113     void AppPrivacyProtected(ScreenId& virtualScreenId, bool appPrivacyProtectionSwitch);
114 #ifdef SUPPORT_CALL
115     int32_t TelCallStateUpdated(bool isInTelCall);
116     int32_t TelCallAudioStateUpdated(bool isInTelCallAudio);
117 #endif
118     void UpdateMicrophoneEnabled();
119     int32_t ReleaseMicAudioBuffer();
120     int32_t ReleaseInnerAudioBuffer();
121     int32_t GetInnerAudioCaptureBufferSize(size_t &size);
122     int32_t GetMicAudioCaptureBufferSize(size_t &size);
123     int32_t OnVoIPStatusChanged(bool isInVoIPCall);
124     int32_t OnSpeakerAliveStatusChanged(bool speakerAliveStatus);
125     int32_t ShowCursorInner();
126     void OnDMPrivateWindowChange(bool hasPrivate);
127     void SetMissionId(uint64_t missionId);
128     void SetDisplayId(uint64_t displayId);
129     bool IsTelInCallSkipList();
130     int32_t GetAppPid();
131     int32_t GetAppUid();
132     void NotifyStateChange(AVScreenCaptureStateCode stateCode);
133     void NotifyDisplaySelected(uint64_t displayId);
134     void NotifyCaptureContentChanged(AVScreenCaptureContentChangedEvent event, ScreenCaptureRect* area);
135     void NotifyUserSelected(ScreenCaptureUserSelectionInfo selectionInfo);
136     int32_t SetAndCheckAppInfo(OHOS::AudioStandard::AppInfo &appInfo);
137     void SetSCServerSaUid(int32_t saUid);
138     int32_t GetSCServerSaUid();
139     DataType GetSCServerDataType();
140     AVScreenCaptureState GetSCServerCaptureState();
141     bool IsSCRecorderFileWithVideo();
142     std::shared_ptr<AudioCapturerWrapper> GetInnerAudioCapture();
143     std::shared_ptr<AudioCapturerWrapper> GetMicAudioCapture();
144     bool IsStopAcquireAudioBufferFlag();
145     bool IsMicrophoneSwitchTurnOn();
146     bool IsMicrophoneCaptureRunning();
147     bool IsInnerCaptureRunning();
148     void SetInnerAudioCapture(std::shared_ptr<AudioCapturerWrapper> innerAudioCapture);
149     int32_t StopInnerAudioCapture();
150     void SetWindowIdList(uint64_t windowId);
151     std::vector<int32_t> GetWindowIdList();
152     void OnSceneSessionManagerDied(const wptr<IRemoteObject>& remote);
153     void SetDefaultDisplayIdOfWindows();
154     uint64_t GetDefaultDisplayId();
155     void SetCurDisplayId(uint64_t displayId);
156     uint64_t GetCurDisplayId();
157 private:
158     int32_t StartScreenCaptureInner(bool isPrivacyAuthorityEnabled);
159     int32_t RegisterServerCallbacks();
160     int32_t OnStartScreenCapture();
161     bool IsFirstStartPidInstance(int32_t pid);
162     bool FirstPidUpdatePrivacyUsingPermissionState(int32_t pid);
163     void PostStartScreenCapture(bool isSuccess);
164     void PostStartScreenCaptureSuccessAction();
165     int32_t InitRecorderInfo(std::shared_ptr<IRecorderService> &recorder, AudioCaptureInfo audioInfo);
166     int32_t InitRecorderMix();
167     int32_t InitRecorderInner();
168     int32_t InitRecorder();
169     int32_t StartScreenCaptureFile();
170     int32_t StartScreenCaptureStream();
171     int32_t StartAudioCapture();
172     std::string GenerateThreadNameByPrefix(std::string threadName);
173     int32_t StartStreamInnerAudioCapture();
174     int32_t StartStreamMicAudioCapture();
175     int32_t StartFileInnerAudioCapture();
176     int32_t StartFileMicAudioCapture();
177     int32_t StartMicAudioCapture();
178     int32_t StopMicAudioCapture();
179     int32_t StartStreamVideoCapture();
180     int32_t StartStreamHomeVideoCapture();
181     int32_t StopScreenCaptureInner(AVScreenCaptureStateCode stateCode);
182     bool IsLastStartedPidInstance(int32_t pid);
183     bool LastPidUpdatePrivacyUsingPermissionState(int32_t pid);
184     void PostStopScreenCapture(AVScreenCaptureStateCode stateCode);
185     int32_t StopAudioCapture();
186     int32_t StopVideoCapture();
187     int32_t StopScreenCaptureRecorder();
188     int32_t CheckAllParams();
189     int32_t CheckCaptureStreamParams();
190     int32_t CheckCaptureFileParams();
191     int32_t SetCanvasRotationInner();
192     int32_t SkipPrivacyModeInner();
193     int32_t SetScreenScaleMode();
194     void InitAppInfo();
195     void CloseFd();
196     void ReleaseInner();
197     void GetDumpFlag();
198     void GetSystemUIFlag();
199     int32_t SetMicrophoneOn();
200     int32_t SetMicrophoneOff();
201 
202     VirtualScreenOption InitVirtualScreenOption(const std::string &name, sptr<OHOS::Surface> consumer);
203     int32_t GetMissionIds(std::vector<uint64_t> &missionIds);
204     int32_t MakeVirtualScreenMirrorForWindow(sptr<Rosen::Display> defaultDisplay,
205         std::vector<ScreenId> mirrorIds);
206     int32_t MakeVirtualScreenMirrorForHomeScreen(sptr<Rosen::Display> defaultDisplay,
207          std::vector<ScreenId> mirrorIds);
208     int32_t MakeVirtualScreenMirrorForSpecifiedScreen(sptr<Rosen::Display> defaultDisplay,
209         std::vector<ScreenId> mirrorIds);
210     int32_t MakeVirtualScreenMirror();
211     int32_t CreateVirtualScreen(const std::string &name, sptr<OHOS::Surface> consumer);
212     int32_t SetVirtualScreenAutoRotation();
213     int32_t PrepareVirtualScreenMirror();
214     void DestroyVirtualScreen();
215 
216     bool CheckScreenCapturePermission();
217     bool IsUserPrivacyAuthorityNeeded();
218     bool UpdatePrivacyUsingPermissionState(VideoPermissionState state);
219     bool CheckPrivacyWindowSkipPermission();
220     int32_t RequestUserPrivacyAuthority();
221     int32_t StartPrivacyWindow();
222     void SetCaptureConfig(CaptureMode captureMode, int32_t missionId = -1); // -1 invalid
223     ScreenScaleMode GetScreenScaleMode(const AVScreenCaptureFillMode &fillMode);
224     int32_t HandlePopupWindowCase(Json::Value& root, const std::string &content);
225     int32_t HandleStreamDataCase(Json::Value& root, const std::string &content);
226     void PrepareSelectWindow(Json::Value &root);
227 
228 #ifdef PC_STANDARD
229     bool CheckCaptureSpecifiedWindowForSelectWindow();
230     void SendConfigToUIParams(AAFwk::Want& want);
231     bool IsHopper();
232     int32_t MakeVirtualScreenMirrorForWindowForHopper(sptr<Rosen::Display> defaultDisplay,
233         std::vector<ScreenId> mirrorIds);
234     int32_t MakeVirtualScreenMirrorForHomeScreenForHopper(sptr<Rosen::Display> defaultDisplay,
235         std::vector<ScreenId> mirrorIds);
236     int32_t MakeVirtualScreenMirrorForSpecifiedScreenForHopper(sptr<Rosen::Display> defaultDisplay,
237         std::vector<ScreenId> mirrorIds);
238     bool IsPickerPopUp();
239 #endif
240 #ifdef SUPPORT_SCREEN_CAPTURE_WINDOW_NOTIFICATION
241     int32_t TryStartNotification();
242     int32_t TryNotificationOnPostStartScreenCapture();
243 #endif
244     int32_t StartNotification();
245     std::shared_ptr<NotificationLocalLiveViewContent> GetLocalLiveViewContent();
246     void UpdateLiveViewContent();
247     NotificationTime CreateCountTime();
248     std::shared_ptr<PixelMap> GetPixelMap(std::string path);
249     std::shared_ptr<PixelMap> GetPixelMapSvg(std::string path, int32_t width, int32_t height);
250     void ResSchedReportData(int64_t value, std::unordered_map<std::string, std::string> payload);
251     int64_t GetCurrentMillisecond();
252     void SetMetaDataReport();
253     void SetErrorInfo(int32_t errCode, const std::string &errMsg, StopReason stopReason, bool userAgree);
254     int32_t ReStartMicForVoIPStatusSwitch();
255     void RegisterPrivateWindowListener();
256     void RegisterScreenConnectListener();
257     uint64_t GetDisplayIdOfWindows(uint64_t displayId);
258     std::string GetStringByResourceName(const char* name);
259     void RefreshResConfig();
260     void InitResourceManager();
261     void SetSystemScreenRecorderStatus(bool status);
262 #ifdef SUPPORT_CALL
263     int32_t OnTelCallStart();
264     int32_t OnTelCallStop();
265 #endif
266     bool DestroyPopWindow();
267     bool DestroyPrivacySheet();
268     void StopNotStartedScreenCapture(AVScreenCaptureStateCode stateCode);
269     int32_t RegisterWindowLifecycleListener(std::vector<int32_t> windowIdList);
270     int32_t UnRegisterWindowLifecycleListener();
271     int32_t RegisterWindowInfoChangedListener();
272     int32_t UnRegisterWindowInfoChangedListener();
273     int32_t RegisterWindowRelatedListener();
274     int32_t SetCaptureAreaInner(uint64_t displayId, OHOS::Rect area);
275     bool CheckDisplayArea(uint64_t displayId, OHOS::Rect area);
276     void PrepareUserSelectionInfo(ScreenCaptureUserSelectionInfo &selectionInfo);
277     void SetupCapsule(NotificationCapsule& capsule);
278     void RegisterLanguageSwitchListener();
279     void OnReceiveEvent(const EventFwk::CommonEventData &data);
280     void UnRegisterLanguageSwitchListener();
281     int32_t HandleOriginalStreamPrivacy();
282     void PublishStartRecordEvent();
283 private:
284     std::mutex mutex_;
285     std::mutex cbMutex_;
286     std::mutex inCallMutex_;
287     std::shared_ptr<ScreenCaptureObserverCallBack> screenCaptureObserverCb_ = nullptr;
288     std::shared_ptr<ScreenCaptureCallBack> screenCaptureCb_ = nullptr;
289     bool canvasRotation_ = false;
290     bool showCursor_ = true;
291     bool isMicrophoneSwitchTurnOn_ = true;
292     bool isPrivacyAuthorityEnabled_ = false;
293     bool showSensitiveCheckBox_ = false;
294     bool checkBoxSelected_ = false;
295     bool showShareSystemAudioBox_ = false;
296     bool isInnerAudioBoxSelected_ = true;
297     bool appPrivacyProtectionSwitch_ = true;
298     bool systemPrivacyProtectionSwitch_ = true;
299     std::vector<uint64_t> surfaceIdList_ = {};
300     std::vector<uint8_t> surfaceTypeList_ = {};
301     std::atomic<bool> stopAcquireAudioBufferFromAudio_ = false;
302     AVScreenCaptureMixMode recorderFileAudioType_ = AVScreenCaptureMixMode::INVALID_MODE;
303 
304     int32_t sessionId_ = 0;
305     int32_t notificationId_ = 0;
306     std::string callingLabel_;
307     std::string liveViewText_;
308     std::string liveViewSubText_;
309     std::atomic<int32_t> micCount_{0};
310     float density_ = 0.0f;
311     int32_t capsuleVpSize_ = 18;
312     int32_t capsulePxSize_ = 0;
313     int32_t saUid_ = -1;
314     int32_t appVersion_ = -1;
315 
316     /* used for both CAPTURE STREAM and CAPTURE FILE */
317     OHOS::AudioStandard::AppInfo appInfo_;
318     bool isScreenCaptureAuthority_ = false;
319     std::string appName_ = "";
320     AVScreenCaptureConfig captureConfig_;
321     AVScreenCaptureAvType avType_ = AVScreenCaptureAvType::INVALID_TYPE;
322     AVScreenCaptureDataMode dataMode_ = AVScreenCaptureDataMode::BUFFER_MODE;
323     StatisticalEventInfo statisticalEventInfo_;
324     sptr<OHOS::Surface> consumer_ = nullptr;
325     bool isConsumerStart_ = false;
326     bool isDump_ = false;
327     bool isSystemUI2_ = false;
328     ScreenId virtualScreenId_ = SCREEN_ID_INVALID;
329     ScreenId displayScreenId_ = SCREEN_ID_INVALID;
330     std::vector<uint64_t> missionIds_;
331     std::vector<int32_t> windowIdList_ = {};
332     ScreenId curWindowInDisplayId_ = SCREEN_ID_INVALID;
333     ScreenCaptureContentFilter contentFilter_;
334     AVScreenCaptureState captureState_ = AVScreenCaptureState::CREATED;
335     std::shared_ptr<NotificationLocalLiveViewContent> localLiveViewContent_;
336     int64_t startTime_ = 0;
337     sptr<UIExtensionAbilityConnection> connection_ = nullptr;
338     sptr<SCWindowLifecycleListener> windowLifecycleListener_ = nullptr;
339     sptr<SCDeathRecipientListener> lifecycleListenerDeathRecipient_ = nullptr;
340     sptr<SCWindowInfoChangedListener> windowInfoChangedListener_ = nullptr;
341     bool isRegionCapture_ = false;
342     uint64_t regionDisplayId_ = 0;
343     OHOS::Rect regionArea_ = {0, 0, 0, 0};
344 
345     /* used for CAPTURE STREAM */
346     sptr<IBufferConsumerListener> surfaceCb_ = nullptr;
347     sptr<OHOS::Surface> surface_ = nullptr;
348     bool isSurfaceMode_ = false;
349     std::shared_ptr<AudioCapturerWrapper> innerAudioCapture_;
350     std::shared_ptr<AudioCapturerWrapper> micAudioCapture_;
351 
352     /* used for CAPTURE FILE */
353     std::shared_ptr<IRecorderService> recorder_ = nullptr;
354     std::string url_;
355     OutputFormatType fileFormat_ = OutputFormatType::FORMAT_DEFAULT;
356     int32_t outputFd_ = -1;
357     int32_t audioSourceId_ = 0;
358     int32_t videoSourceId_ = 0;
359     std::shared_ptr<AudioDataSource> audioSource_ = nullptr;
360     /* used for DFX events */
361     uint64_t instanceId_ = 0;
362     std::shared_ptr<ScreenRendererAudioStateChangeCallback> captureCallback_;
363     std::vector<uint64_t> skipPrivacyWindowIDsVec_;
364     sptr<DisplayManager::IPrivateWindowListener> displayListener_;
365     bool isCalledBySystemApp_ = false;
366     Global::Resource::ResourceManager *resourceManager_ = nullptr;
367     Global::Resource::ResConfig *resConfig_ = nullptr;
368     OHOS::sptr<Rosen::ScreenManager::IScreenListener> screenConnectListener_ = nullptr;
369     std::shared_ptr<ScreenCaptureSubscriber> subscriber_ = nullptr;
370 #ifdef SUPPORT_CALL
371     std::atomic<bool> isInTelCall_ = false;
372     std::atomic<bool> isInTelCallAudio_ = false;
373 #endif
374     std::atomic<bool> recorderFileWithVideo_{false};
375 private:
376     static int32_t CheckAudioCapParam(const AudioCaptureInfo &audioCapInfo);
377     static int32_t CheckVideoCapParam(const VideoCaptureInfo &videoCapInfo);
378     static int32_t CheckAudioEncParam(const AudioEncInfo &audioEncInfo);
379     static int32_t CheckVideoEncParam(const VideoEncInfo &videoEncInfo);
380     static int32_t CheckAudioCapInfo(AudioCaptureInfo &audioCapInfo);
381     static int32_t CheckVideoCapInfo(VideoCaptureInfo &videoCapInfo);
382     static int32_t CheckAudioEncInfo(AudioEncInfo &audioEncInfo);
383     static int32_t CheckVideoEncInfo(VideoEncInfo &videoEncInfo);
384     static int32_t CheckCaptureMode(CaptureMode captureMode);
385     static int32_t CheckDataType(DataType dataType);
386 
387 private:
388     static constexpr int32_t ROOT_UID = 0;
389     static constexpr int32_t AUDIO_BITRATE_MIN = 8000;
390     static constexpr int32_t AUDIO_BITRATE_MAX = 384000;
391     static constexpr int32_t VIDEO_BITRATE_MIN = 1;
392     static constexpr int32_t VIDEO_BITRATE_MAX = 30000000;
393     static constexpr int32_t VIDEO_FRAME_RATE_MIN = 1;
394     static constexpr int32_t VIDEO_FRAME_RATE_MAX = 60;
395     static constexpr int32_t VIDEO_FRAME_WIDTH_MAX = 10240;
396     static constexpr int32_t VIDEO_FRAME_HEIGHT_MAX = 4320;
397     static constexpr int32_t SESSION_ID_INVALID = -1;
398     static constexpr int32_t AV_SCREEN_CAPTURE_SESSION_UID = 1013;
399     static constexpr const char* NOTIFICATION_SCREEN_RECORDING_TITLE_ID = "notification_screen_recording_title";
400     static constexpr const char* QUOTATION_MARKS_STRING = "\"";
401     static constexpr const char* NOTIFICATION_SCREEN_RECORDING_PRIVACY_ON_ID =
402         "notification_screen_recording_privacy_on";
403     static constexpr const char* NOTIFICATION_SCREEN_RECORDING_PRIVACY_OFF_ID =
404         "notification_screen_recording_privacy_off";
405     static constexpr int64_t MAX_INNER_AUDIO_TIMEOUT_IN_NS = 2000000000; // 2s
406     static constexpr int64_t AUDIO_INTERVAL_IN_NS = 20000000; // 20ms
407     static constexpr int64_t NEG_AUDIO_INTERVAL_IN_NS = -20000000; // 20ms
408     static constexpr int32_t SELECT_TYPE_SCREEN = 0;
409     static constexpr int32_t SELECT_TYPE_WINDOW = 1;
410 };
411 } // namespace Media
412 } // namespace OHOS
413 #endif // SCREEN_CAPTURE_SERVICE_SERVER_H
414