From 6e31942157296d3cf73beffbec40233a1d31303d Mon Sep 17 00:00:00 2001 From: shiwei75 Date: Thu, 28 Aug 2025 12:00:39 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B1=8F=E5=B9=95=E5=BD=95=E5=88=B6=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E8=AE=BE=E7=BD=AE=E9=AB=98=E4=BA=AE=E5=BD=95=E5=88=B6?= =?UTF-8?q?=E5=8C=BA=E5=9F=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: shiwei75 --- .../screencapture/native_avscreen_capture.cpp | 14 ++++++++++ .../screen_capture/screen_capture_impl.cpp | 8 ++++++ .../screen_capture/screen_capture_impl.h | 1 + interfaces/inner_api/native/screen_capture.h | 14 ++++++++++ interfaces/kits/c/native_avscreen_capture.h | 13 +++++++++ .../kits/c/native_avscreen_capture_base.h | 27 +++++++++++++++++++ services/include/i_screen_capture_service.h | 1 + .../client/screen_capture_client.cpp | 7 +++++ .../client/screen_capture_client.h | 1 + .../ipc/i_standard_screen_capture_service.h | 2 ++ .../ipc/screen_capture_service_proxy.cpp | 19 +++++++++++++ .../ipc/screen_capture_service_proxy.h | 1 + .../ipc/screen_capture_service_stub.cpp | 21 +++++++++++++++ .../ipc/screen_capture_service_stub.h | 1 + .../server/screen_capture_server.cpp | 26 +++++++++++++++++- .../server/screen_capture_server.h | 1 + 16 files changed, 156 insertions(+), 1 deletion(-) diff --git a/frameworks/native/capi/screencapture/native_avscreen_capture.cpp b/frameworks/native/capi/screencapture/native_avscreen_capture.cpp index 9b955f712..044c3461c 100644 --- a/frameworks/native/capi/screencapture/native_avscreen_capture.cpp +++ b/frameworks/native/capi/screencapture/native_avscreen_capture.cpp @@ -1218,6 +1218,20 @@ OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_ReleaseCaptureStrategy(OH_AVScree return AV_SCREEN_CAPTURE_ERR_OK; } +OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_SetCaptureAreaHighlight(struct OH_AVScreenCapture *capture, + OH_AVScreenCaptureHighLightConfig config) +{ + CHECK_AND_RETURN_RET_LOG(capture != nullptr, AV_SCREEN_CAPTURE_ERR_INVALID_VAL, "input capture is nullptr"); + + struct ScreenCaptureObject *screenCaptureObj = reinterpret_cast(capture); + CHECK_AND_RETURN_RET_LOG(screenCaptureObj->screenCapture_ != nullptr, + AV_SCREEN_CAPTURE_ERR_INVALID_VAL, "screenCapture is nullptr"); + + int32_t ret = screenCaptureObj->screenCapture_->SetCaptureAreaHighlight(config); + CHECK_AND_RETURN_RET_LOG(ret == MSERR_OK, AV_SCREEN_CAPTURE_ERR_INVALID_STATE, "SetCaptureAreaHighlight failed"); + return AV_SCREEN_CAPTURE_ERR_OK; +} + OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_SetCaptureStrategy(struct OH_AVScreenCapture *capture, OH_AVScreenCapture_CaptureStrategy *strategy) { diff --git a/frameworks/native/screen_capture/screen_capture_impl.cpp b/frameworks/native/screen_capture/screen_capture_impl.cpp index a677462b0..327cc5298 100644 --- a/frameworks/native/screen_capture/screen_capture_impl.cpp +++ b/frameworks/native/screen_capture/screen_capture_impl.cpp @@ -430,6 +430,14 @@ int32_t ScreenCaptureImpl::ReleaseVideoBuffer() return screenCaptureService_->ReleaseVideoBuffer(); } +int32_t ScreenCaptureImpl::SetCaptureAreaHighlight(AVScreenCaptureHighLightConfig config) +{ + MEDIA_LOGD("ScreenCaptureImpl:0x%{public}06" PRIXPTR " SetCaptureAreaHighlight in", FAKE_POINTER(this)); + CHECK_AND_RETURN_RET_LOG(screenCaptureService_ != nullptr, MSERR_NO_MEMORY, + "screen capture service does not exist."); + return screenCaptureService_->SetCaptureAreaHighlight(config); +} + int32_t ScreenCaptureImpl::SetScreenCaptureStrategy(ScreenCaptureStrategy strategy) { MEDIA_LOGD("ScreenCaptureImpl:0x%{public}06" PRIXPTR " SetScreenCaptureStrategy in", FAKE_POINTER(this)); diff --git a/frameworks/native/screen_capture/screen_capture_impl.h b/frameworks/native/screen_capture/screen_capture_impl.h index f134492cb..9b5deaa64 100644 --- a/frameworks/native/screen_capture/screen_capture_impl.h +++ b/frameworks/native/screen_capture/screen_capture_impl.h @@ -52,6 +52,7 @@ public: int32_t SetScreenCaptureCallback(const std::shared_ptr &callback) override; int32_t ExcludeContent(ScreenCaptureContentFilter &contentFilter) override; int32_t SetPrivacyAuthorityEnabled() override; + int32_t SetCaptureAreaHighlight(AVScreenCaptureHighLightConfig config) override; int32_t SetScreenCaptureStrategy(ScreenCaptureStrategy strategy) override; int32_t UpdateSurface(sptr surface) override; int32_t SetCaptureArea(uint64_t displayId, OHOS::Rect area) override; diff --git a/interfaces/inner_api/native/screen_capture.h b/interfaces/inner_api/native/screen_capture.h index 539f25a6c..a5d92ad14 100644 --- a/interfaces/inner_api/native/screen_capture.h +++ b/interfaces/inner_api/native/screen_capture.h @@ -160,6 +160,12 @@ enum class AVScreenCapturePickerPopUp : int32_t { SCREEN_CAPTURE_PICKER_POPUP_ENABLE = 1, }; +enum class ScreenCaptureHighLightMode : int32_t { + OH_HIGHLIGHT_MODE_CLOSED = 0, + OH_HIGHLIGHT_MODE_CORNER_WRAP = 1, + OH_HIGHLIGHT_MODE_RECTANGLE_WRAP = 2, +}; + struct ScreenCaptureContentFilter { std::set filteredAudioContents; std::vector windowIDsVec; @@ -195,6 +201,12 @@ struct ScreenCaptureStrategy { AVScreenCaptureFillMode fillMode = AVScreenCaptureFillMode::PRESERVE_ASPECT_RATIO; }; +struct AVScreenCaptureHighLightConfig { + uint32_t lineThickness; + uint32_t lineColor; + ScreenCaptureHighLightMode mode = ScreenCaptureHighLightMode::OH_HIGHLIGHT_MODE_CLOSED; +}; + struct VideoCaptureInfo { uint64_t displayId = 0; std::list taskIDs; @@ -228,6 +240,7 @@ struct AVScreenCaptureConfig { VideoInfo videoInfo; RecorderInfo recorderInfo; ScreenCaptureStrategy strategy; + AVScreenCaptureHighLightConfig config; }; struct AudioBuffer { @@ -334,6 +347,7 @@ public: virtual int32_t SetScreenCaptureCallback(const std::shared_ptr &callback) = 0; virtual int32_t ExcludeContent(ScreenCaptureContentFilter &contentFilter) = 0; virtual int32_t SetPrivacyAuthorityEnabled() = 0; + virtual int32_t SetCaptureAreaHighlight(AVScreenCaptureHighLightConfig config) = 0; virtual int32_t SetScreenCaptureStrategy(ScreenCaptureStrategy strategy) = 0; virtual int32_t UpdateSurface(sptr surface) = 0; virtual int32_t SetCaptureArea(uint64_t displayId, Rect area) = 0; diff --git a/interfaces/kits/c/native_avscreen_capture.h b/interfaces/kits/c/native_avscreen_capture.h index 0de2e42a5..d81476cad 100644 --- a/interfaces/kits/c/native_avscreen_capture.h +++ b/interfaces/kits/c/native_avscreen_capture.h @@ -594,6 +594,19 @@ OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_StrategyForPickerPopUp( */ OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_StrategyForFillMode( OH_AVScreenCapture_CaptureStrategy *strategy, OH_AVScreenCapture_FillMode mode); + +/** + * @brief set the highlight style of recording area. + * @syscap SystemCapability.Multimedia.Media.AVScreenCapture + * @param {OH_AVScreenCapture*} capture Pointer to an OH_AVScreenCapture which want to set highlight style. + * @param {OH_AVScreenCaptureHighLightConfig} config value of the highlight setting + * @return Function result code. + * {@link AV_SCREEN_CAPTURE_ERR_OK} if the execution is successful. + * {@link AV_SCREEN_CAPTURE_ERR_INVALID_VAL} input capture is nullptr or config is invalid. + * @since 20 + */ +OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_SetCaptureAreaHighlight(struct OH_AVScreenCapture *capture, + OH_AVScreenCaptureHighLightConfig config); #ifdef __cplusplus } #endif diff --git a/interfaces/kits/c/native_avscreen_capture_base.h b/interfaces/kits/c/native_avscreen_capture_base.h index f88931093..8cc47d7b4 100644 --- a/interfaces/kits/c/native_avscreen_capture_base.h +++ b/interfaces/kits/c/native_avscreen_capture_base.h @@ -291,6 +291,19 @@ typedef struct OH_RecorderInfo { OH_ContainerFormatType fileFormat; } OH_RecorderInfo; +/** + * @brief set the highlight style of recording area. + * @syscap SystemCapability.Multimedia.Media.AVScreenCapture + * + * @since 20 + * @version 1.0 + */ +typedef struct OH_AVScreenCaptureHighLightConfig { + uint32_t lineThickness; + uint32_t lineColor; + OH_ScreenCapture_HighLight_Mode mode; +} OH_AVScreenCaptureHighLightConfig; + /** * @brief AV screeen capture config info * @syscap SystemCapability.Multimedia.Media.AVScreenCapture @@ -514,6 +527,20 @@ typedef enum OH_AVScreenCapture_FillMode { OH_SCREENCAPTURE_FILLMODE_SCALE_TO_FILL = 1, } OH_AVScreenCapture_FillMode; +/** + * @brief high light mode. + * + * @since 20 + */ +typedef enum OH_ScreenCapture_HighLight_Mode { + /* Default mode */ + OH_HIGHLIGHT_MODE_CLOSED = 0, + /* corner wrap mode */ + OH_HIGHLIGHT_MODE_CORNER_WRAP = 1, + /* rectangle wrap mode */ + OH_HIGHLIGHT_MODE_RECTANGLE_WRAP = 2, +} OH_ScreenCapture_HighLight_Mode; + /** * @brief When state of OH_AVScreenCapture is changed, the function pointer will be called. * @syscap SystemCapability.Multimedia.Media.AVScreenCapture diff --git a/services/include/i_screen_capture_service.h b/services/include/i_screen_capture_service.h index 01564d197..a16577fdd 100644 --- a/services/include/i_screen_capture_service.h +++ b/services/include/i_screen_capture_service.h @@ -56,6 +56,7 @@ public: virtual int32_t SetScreenCaptureCallback(const std::shared_ptr &callback) = 0; virtual void Release() = 0; virtual int32_t ExcludeContent(ScreenCaptureContentFilter &contentFilter) = 0; + virtual int32_t SetCaptureAreaHighlight(AVScreenCaptureHighLightConfig config) = 0; virtual int32_t SetScreenCaptureStrategy(ScreenCaptureStrategy strategy) = 0; virtual int32_t UpdateSurface(sptr surface) = 0; virtual int32_t SetCaptureArea(uint64_t displayId, OHOS::Rect area) = 0; diff --git a/services/services/screen_capture/client/screen_capture_client.cpp b/services/services/screen_capture/client/screen_capture_client.cpp index cdd9d9872..95b888d4a 100644 --- a/services/services/screen_capture/client/screen_capture_client.cpp +++ b/services/services/screen_capture/client/screen_capture_client.cpp @@ -271,6 +271,13 @@ int32_t ScreenCaptureClient::SetScreenCaptureStrategy(ScreenCaptureStrategy stra CHECK_AND_RETURN_RET_LOG(screenCaptureProxy_ != nullptr, MSERR_NO_MEMORY, "screenCapture service does not exist."); return screenCaptureProxy_->SetScreenCaptureStrategy(strategy); } + +int32_t ScreenCaptureClient::SetCaptureAreaHighlight(AVScreenCaptureHighLightConfig config) +{ + std::lock_guard lock(mutex_); + CHECK_AND_RETURN_RET_LOG(screenCaptureProxy_ != nullptr, MSERR_NO_MEMORY, "screenCapture service does not exist."); + return screenCaptureProxy_->SetCaptureAreaHighlight(config); +} int32_t ScreenCaptureClient::UpdateSurface(sptr surface) { diff --git a/services/services/screen_capture/client/screen_capture_client.h b/services/services/screen_capture/client/screen_capture_client.h index 0d404c8a7..3a5040240 100644 --- a/services/services/screen_capture/client/screen_capture_client.h +++ b/services/services/screen_capture/client/screen_capture_client.h @@ -59,6 +59,7 @@ public: void Release() override; int32_t ExcludeContent(ScreenCaptureContentFilter &contentFilter) override; int32_t SetScreenCaptureStrategy(ScreenCaptureStrategy strategy) override; + int32_t SetCaptureAreaHighlight(AVScreenCaptureHighLightConfig config) override; int32_t UpdateSurface(sptr surface) override; int32_t SetCaptureArea(uint64_t displayId, OHOS::Rect area) override; diff --git a/services/services/screen_capture/ipc/i_standard_screen_capture_service.h b/services/services/screen_capture/ipc/i_standard_screen_capture_service.h index 06766d854..d3fe82d73 100644 --- a/services/services/screen_capture/ipc/i_standard_screen_capture_service.h +++ b/services/services/screen_capture/ipc/i_standard_screen_capture_service.h @@ -58,6 +58,7 @@ public: virtual int32_t ReleaseAudioBuffer(AudioCaptureSourceType type) = 0; virtual int32_t ReleaseVideoBuffer() = 0; virtual int32_t ExcludeContent(ScreenCaptureContentFilter &contentFilter) = 0; + virtual int32_t SetCaptureAreaHighlight(AVScreenCaptureHighLightConfig config) = 0; virtual int32_t SetScreenCaptureStrategy(ScreenCaptureStrategy strategy) = 0; virtual int32_t UpdateSurface(sptr surface) = 0; virtual int32_t SetCaptureArea(uint64_t displayId, OHOS::Rect area) = 0; @@ -96,6 +97,7 @@ public: SET_STRATEGY = 27, UPDATE_SURFACE = 28, SET_CAPTURE_AREA = 29, + SET_HIGHT_LIGTH_MODE = 30, }; DECLARE_INTERFACE_DESCRIPTOR(u"IStandardScreenCaptureService"); diff --git a/services/services/screen_capture/ipc/screen_capture_service_proxy.cpp b/services/services/screen_capture/ipc/screen_capture_service_proxy.cpp index 5ac4c5c32..7aae5618c 100644 --- a/services/services/screen_capture/ipc/screen_capture_service_proxy.cpp +++ b/services/services/screen_capture/ipc/screen_capture_service_proxy.cpp @@ -624,6 +624,25 @@ int32_t ScreenCaptureServiceProxy::SetMaxVideoFrameRate(int32_t frameRate) return reply.ReadInt32(); } +int32_t ScreenCaptureServiceProxy::SetCaptureAreaHighlight(AVScreenCaptureHighLightConfig config) +{ + MessageParcel data; + MessageParcel reply; + MessageOption option; + + bool token = data.WriteInterfaceToken(ScreenCaptureServiceProxy::GetDescriptor()); + CHECK_AND_RETURN_RET_LOG(token, MSERR_INVALID_OPERATION, "Failed to write descriptor!"); + + token = data.WriteUint32(config.lineThickness) && data.WriteUint32(config.lineColor) && + data.WriteInt32(static_cast(config.mode)); + CHECK_AND_RETURN_RET_LOG(token, MSERR_INVALID_OPERATION, "Failed to write config!"); + + int error = Remote()->SendRequest(SET_HIGHT_LIGTH_MODE, data, reply, option); + CHECK_AND_RETURN_RET_LOG(error == MSERR_OK, MSERR_INVALID_OPERATION, + "SetCaptureAreaHighlight failed, error: %{public}d", error); + return reply.ReadInt32(); +} + int32_t ScreenCaptureServiceProxy::SetScreenCaptureStrategy(ScreenCaptureStrategy strategy) { MessageParcel data; diff --git a/services/services/screen_capture/ipc/screen_capture_service_proxy.h b/services/services/screen_capture/ipc/screen_capture_service_proxy.h index 7a0f1040b..0c8ad44d8 100644 --- a/services/services/screen_capture/ipc/screen_capture_service_proxy.h +++ b/services/services/screen_capture/ipc/screen_capture_service_proxy.h @@ -54,6 +54,7 @@ public: int32_t SetListenerObject(const sptr &object) override; int32_t ExcludeContent(ScreenCaptureContentFilter &contentFilter) override; int32_t SetScreenCaptureStrategy(ScreenCaptureStrategy strategy) override; + int32_t SetCaptureAreaHighlight(AVScreenCaptureHighLightConfig config) override; int32_t UpdateSurface(sptr surface) override; int32_t SetCaptureArea(uint64_t displayId, OHOS::Rect area) override; diff --git a/services/services/screen_capture/ipc/screen_capture_service_stub.cpp b/services/services/screen_capture/ipc/screen_capture_service_stub.cpp index 9beafb668..a3a03c353 100644 --- a/services/services/screen_capture/ipc/screen_capture_service_stub.cpp +++ b/services/services/screen_capture/ipc/screen_capture_service_stub.cpp @@ -84,6 +84,7 @@ int32_t ScreenCaptureServiceStub::Init() screenCaptureStubFuncs_[SET_STRATEGY] = &ScreenCaptureServiceStub::SetScreenCaptureStrategy; screenCaptureStubFuncs_[UPDATE_SURFACE] = &ScreenCaptureServiceStub::UpdateSurface; screenCaptureStubFuncs_[SET_CAPTURE_AREA] = &ScreenCaptureServiceStub::SetCaptureArea; + screenCaptureStubFuncs_[SET_HIGHT_LIGTH_MODE] = &ScreenCaptureServiceStub::SetCaptureAreaHighlight; return MSERR_OK; } @@ -323,6 +324,13 @@ int32_t ScreenCaptureServiceStub::SetScreenCaptureStrategy(ScreenCaptureStrategy return screenCaptureServer_->SetScreenCaptureStrategy(strategy); } +int32_t ScreenCaptureServiceStub::SetCaptureAreaHighlight(AVScreenCaptureHighLightConfig config) +{ + CHECK_AND_RETURN_RET_LOG(screenCaptureServer_ != nullptr, MSERR_INVALID_STATE, + "screen capture server is nullptr"); + return screenCaptureServer_->SetCaptureAreaHighlight(config); +} + int32_t ScreenCaptureServiceStub::SetCaptureArea(uint64_t displayId, OHOS::Rect area) { CHECK_AND_RETURN_RET_LOG(screenCaptureServer_ != nullptr, MSERR_INVALID_STATE, @@ -708,6 +716,19 @@ int32_t ScreenCaptureServiceStub::DestroyStub(MessageParcel &data, MessageParcel return MSERR_OK; } +int32_t ScreenCaptureServiceStub::SetCaptureAreaHighlight(MessageParcel &data, MessageParcel &reply) +{ + CHECK_AND_RETURN_RET_LOG(screenCaptureServer_ != nullptr, MSERR_INVALID_STATE, + "screen capture server is nullptr"); + AVScreenCaptureHighLightConfig config; + config.lineThickness = data.ReadUInt32(); + config.lineColor = data.ReadUInt32(); + config.mode = static_cast(data.ReadInt32()); + int32_t ret = SetCaptureAreaHighlight(config); + reply.WriteInt32(ret); + return MSERR_OK; +} + int32_t ScreenCaptureServiceStub::SetScreenCaptureStrategy(MessageParcel &data, MessageParcel &reply) { CHECK_AND_RETURN_RET_LOG(screenCaptureServer_ != nullptr, MSERR_INVALID_STATE, diff --git a/services/services/screen_capture/ipc/screen_capture_service_stub.h b/services/services/screen_capture/ipc/screen_capture_service_stub.h index e459ca60a..02e03acba 100644 --- a/services/services/screen_capture/ipc/screen_capture_service_stub.h +++ b/services/services/screen_capture/ipc/screen_capture_service_stub.h @@ -89,6 +89,7 @@ private: int32_t SetMaxVideoFrameRate(MessageParcel &data, MessageParcel &reply); int32_t ExcludeContent(MessageParcel &data, MessageParcel &reply); int32_t SetScreenCaptureStrategy(MessageParcel &data, MessageParcel &reply); + int32_t SetCaptureAreaHighlight(MessageParcel &data, MessageParcel &reply); int32_t UpdateSurface(MessageParcel &data, MessageParcel &reply); int32_t SetCaptureArea(MessageParcel &data, MessageParcel &reply); diff --git a/services/services/screen_capture/server/screen_capture_server.cpp b/services/services/screen_capture/server/screen_capture_server.cpp index de6c27482..30e0be29f 100644 --- a/services/services/screen_capture/server/screen_capture_server.cpp +++ b/services/services/screen_capture/server/screen_capture_server.cpp @@ -1856,7 +1856,14 @@ int32_t ScreenCaptureServer::OnStartScreenCapture() { MediaTrace trace("ScreenCaptureServer::OnStartScreenCapture"); MEDIA_LOGI("OnStartScreenCapture start, dataType:%{public}d", captureConfig_.dataType); - captureState_ = AVScreenCaptureState::STARTING; + if (captureConfig_.captureMode == CaptureMode::CAPTURE_SPECIFIED_WINDOW) { + selectionInfo.selectType = SELECT_TYPE_WINDOW; + sptr defaultDisplay = Rosen::DisplayManager::GetInstance().GetDefaultDisplaySync(); + CHECK_AND_RETURN_LOG(defaultDisplay != nullptr, "PrepareUserSelectionInfo GetDefaultDisplaySync failed"); + selectionInfo.displayId = GetDisplayIdOfWindows(defaultDisplay->GetScreenId()); + auto ret = WindowManager::GetInstance().UpdateOutline(); + //missionIds_ + } int32_t ret = MSERR_UNSUPPORT; if (captureConfig_.dataType == DataType::ORIGINAL_STREAM) { ret = StartScreenCaptureStream(); @@ -4103,6 +4110,14 @@ void ScreenCaptureServer::PostStopScreenCapture(AVScreenCaptureStateCode stateCo MediaTrace trace("ScreenCaptureServer::PostStopScreenCapture"); MEDIA_LOGI("ScreenCaptureServer: 0x%{public}06" PRIXPTR " PostStopScreenCapture start, stateCode:%{public}d.", FAKE_POINTER(this), stateCode); + if (captureConfig_.captureMode == CaptureMode::CAPTURE_SPECIFIED_WINDOW) { + selectionInfo.selectType = SELECT_TYPE_WINDOW; + sptr defaultDisplay = Rosen::DisplayManager::GetInstance().GetDefaultDisplaySync(); + CHECK_AND_RETURN_LOG(defaultDisplay != nullptr, "PrepareUserSelectionInfo GetDefaultDisplaySync failed"); + selectionInfo.displayId = GetDisplayIdOfWindows(defaultDisplay->GetScreenId()); + auto ret = WindowManager::GetInstance().UpdateOutline(nullptr, ); + //missionIds_ + } SetSystemScreenRecorderStatus(false); ScreenCaptureMonitorServer::GetInstance()->CallOnScreenCaptureFinished(appInfo_.appPid); if (screenCaptureCb_ != nullptr && stateCode != AVScreenCaptureStateCode::SCREEN_CAPTURE_STATE_INVLID) { @@ -4186,6 +4201,15 @@ void ScreenCaptureServer::ReleaseInner() MEDIA_LOGI("0x%{public}06" PRIXPTR " Instances ReleaseInner E", FAKE_POINTER(this)); } +int32_t ScreenCaptureServer::SetCaptureAreaHighlight(AVScreenCaptureHighLightConfig config) +{ + std::lock_guard lock(mutex_); + MEDIA_LOGI("SetCaptureAreaHighlight lineThickness: %{public}d, lineColor: %{public}d, mode: %{public}d", + config.lineThickness, config.lineColor, static_cast(config.mode)); + captureConfig_.config = config; + return MSERR_OK; +} + int32_t ScreenCaptureServer::SetScreenCaptureStrategy(ScreenCaptureStrategy strategy) { std::lock_guard lock(mutex_); diff --git a/services/services/screen_capture/server/screen_capture_server.h b/services/services/screen_capture/server/screen_capture_server.h index 08f66d3f6..a234ad0c5 100644 --- a/services/services/screen_capture/server/screen_capture_server.h +++ b/services/services/screen_capture/server/screen_capture_server.h @@ -97,6 +97,7 @@ public: void Release() override; int32_t ExcludeContent(ScreenCaptureContentFilter &contentFilter) override; int32_t SetScreenCaptureStrategy(ScreenCaptureStrategy strategy) override; + int32_t SetCaptureAreaHighlight(AVScreenCaptureHighLightConfig config) override; int32_t UpdateSurface(sptr surface) override; int32_t SetCaptureArea(uint64_t displayId, OHOS::Rect area) override; -- Gitee