diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..e454a52586f29b8ce8a6799163eac1f875e9ac01
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,178 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
diff --git a/OAT.xml b/OAT.xml
new file mode 100644
index 0000000000000000000000000000000000000000..a7d94aeda1e61d117e05c88679e374986e8c91f7
--- /dev/null
+++ b/OAT.xml
@@ -0,0 +1,65 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/README.en.md b/README.en.md
deleted file mode 100644
index c889106c91c4aafdda1b94d04bb4f892dd575499..0000000000000000000000000000000000000000
--- a/README.en.md
+++ /dev/null
@@ -1,36 +0,0 @@
-# distributed_screen
-
-#### Description
-{**When you're done, you can delete the content in this README and update the file with details for others getting started with your repository**}
-
-#### Software Architecture
-Software architecture description
-
-#### Installation
-
-1. xxxx
-2. xxxx
-3. xxxx
-
-#### Instructions
-
-1. xxxx
-2. xxxx
-3. xxxx
-
-#### Contribution
-
-1. Fork the repository
-2. Create Feat_xxx branch
-3. Commit your code
-4. Create Pull Request
-
-
-#### Gitee Feature
-
-1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md
-2. Gitee blog [blog.gitee.com](https://blog.gitee.com)
-3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore)
-4. The most valuable open source project [GVP](https://gitee.com/gvp)
-5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help)
-6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)
diff --git a/README.md b/README.md
deleted file mode 100644
index 86aba9515eea36d46ebce9f882d5e3d79c6b579b..0000000000000000000000000000000000000000
--- a/README.md
+++ /dev/null
@@ -1,39 +0,0 @@
-# distributed_screen
-
-#### 介绍
-{**以下是 Gitee 平台说明,您可以替换此简介**
-Gitee 是 OSCHINA 推出的基于 Git 的代码托管平台(同时支持 SVN)。专为开发者提供稳定、高效、安全的云端软件开发协作平台
-无论是个人、团队、或是企业,都能够用 Gitee 实现代码托管、项目管理、协作开发。企业项目请看 [https://gitee.com/enterprises](https://gitee.com/enterprises)}
-
-#### 软件架构
-软件架构说明
-
-
-#### 安装教程
-
-1. xxxx
-2. xxxx
-3. xxxx
-
-#### 使用说明
-
-1. xxxx
-2. xxxx
-3. xxxx
-
-#### 参与贡献
-
-1. Fork 本仓库
-2. 新建 Feat_xxx 分支
-3. 提交代码
-4. 新建 Pull Request
-
-
-#### 特技
-
-1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md
-2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com)
-3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目
-4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目
-5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help)
-6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)
diff --git a/README_ZH.md b/README_ZH.md
new file mode 100644
index 0000000000000000000000000000000000000000..b2223c472272f2b36821fe0ea1febbe4ac8b92c1
--- /dev/null
+++ b/README_ZH.md
@@ -0,0 +1,87 @@
+# **分布式屏幕组件**
+
+## **简介**
+
+分布式屏幕是一种屏幕虚拟化能力,支持用户指定任意设备的屏幕作为Display的显示区域。在分布式硬件子系统中,分布式屏幕提供跨设备屏幕能力调用,为OpenHarmony操作系统提供系统投屏、屏幕镜像、屏幕分割等能力的实现。
+
+系统架构如下图所示:
+
+
+
+**屏幕区域管理(ScreenRegionManager)**:管理主控端映射在被控端屏幕上的显示区域的状态,包括为显示区域指定显示的display,设置显示区域的宽高,解码类型等参数。
+
+**分布式屏幕管理(DScreenManager)**:管理被控端屏幕的参数和状态,负责主控端相关对象的创建和销毁。
+
+**屏幕服务(ScreenService)**:分布式屏幕主控端SA服务和分布式屏幕被控端SA服务,负责处理分布式硬件管理框架的IPC调用
+
+**软总线适配器(SoftbusAdapter)**:对接软总线传输接口,为屏幕图像、输入事件等提供封装的统一调用接口,实现设备间的流数据、字节数据传输和交互。
+
+**屏幕传输组件(ScreenTransport)**:分布式屏幕传输模块,实现屏幕图像数据编码、解码、发送、接收。
+
+**屏幕代理客户端(ScreenClient)**:屏幕图像显示代理客户端,用于在设备上显示其他设备投射过来的屏幕图像数据。
+
+
+## **目录**
+
+```
+/foundation/distributedhardware/distributedscreen
+├── common # 分布式屏幕公共数据定义,包括常量、错误码、日志、工具等
+├── interface # 分布式屏幕SDK,包含主控端和被控端服务调用接口
+├── sa_profile # 分布式屏幕的SA配置信息
+├── services # 分布式屏幕主控端和被控端功能主体业务实现
+│ └── common # 分布式屏幕功能主控端、被控端共用功能实现
+│ ├── databuffer # 屏幕数据存储定义
+│ └── screen_channel # 屏幕数据传输通道接口定义
+│ └── screenclient # 分布式屏幕代理客户端实现
+│ └── screenservice # 分布式屏幕主体功能实现
+│ └── sinkservice # 分布式屏幕被控端服务功能实现
+│ ├── dscreenservice # 分布式屏幕被控端SA
+│ └── screenregionmgr # 分布式屏幕被控端显示区域管理
+│ └── sourceservice # 分布式屏幕主控端服务功能实现
+│ ├── dscreenmgr # 分布式屏幕主控端屏幕管理
+│ └── dscreenservice # 分布式屏幕主控端SA
+│ └── screentransport # 分布式屏幕传输组件
+│ ├── screendatachannel # 屏幕数据传输通道,用于传输组件和编解码器之间数据传输
+│ ├── screensinkprocessor # 分布式屏幕被控端数据处理模块,包括解码等
+│ ├── screensinktrans # 分布式屏幕被控端数据传输组件,包含数据传输通道channel和数据处理模块processor
+│ ├── screensourceprocessor # 分布式屏幕主控端数据处理模块,包括编码等
+│ └── screensourcetrans # 分布式屏幕主控端数据传输组件,包含数据传输通道channel和数据处理模块processor
+│ └── softbusadapter # 软总线接口适配器,为屏幕传输、触控事件传输提供统一传输接口
+└── screenhandler # 分布式屏幕硬件信息上报、设备状态变化通知,由分布式硬件管理框架加载
+```
+
+## **约束**
+**语言限制**:C++语言。
+**组网环境**:必须确保设备在同一个局域网中。
+**操作系统限制**:OpenHarmony操作系统。
+
+## **说明**
+### **概念说明**
+主控端(source):控制端,通过调用分布式屏幕能力,使用被控端的屏幕用于显示主控端设备的屏幕内容。
+被控端(sink):被控制端,通过分布式屏幕接收主控端的控制,在本地对接窗口用于接收和显示主控端设备的屏幕内容。
+
+### **接口说明**
+分布式屏幕实现分布式硬件管理框架提供的接口,由分布式硬件管理框架统一调用接口实现虚拟屏幕硬件的创建和注册功能。
+
+### **流程说明**
+#### **1. 设备开机启动**
+系统拉起分布式屏幕的SA服务,Source侧被初始化,相关模块被初始化。
+
+#### **2. 设备组网上线**
+设备上线后,分布式硬件管理框架同步到上线设备的屏幕硬件信息并使能,使能成功后在系统中会新增虚拟屏幕并通知到窗口子系统,窗口子系统统一管理本地屏幕和分布式屏幕;北向应用通过窗口子系统提供的接口可以查询到分布式屏幕,并按照窗口子系统提供的接口来使用分布式屏幕。
+
+#### **3. 屏幕数据流转**
+(1)主控端图形子系统将需要发送屏幕数据保存在编码器创建的输入Surface中。
+(2)主控端编码器将输入数据进行编码,并将编码结果返回传输组件screensourcetrans。
+(3)主控端传输组件screensourcetrans将编码后的数据通过传输通道screendatachannel发送到softbusadapter,并经由软总线子系统发送到被控端端设备。
+(4)被控端设备软总线子系统收到屏幕数据后,通过softbusadapter返回给被控端传输通道screendatachannel。
+(5)被控端传输通道screendatachannel将获取到的屏幕数据传递给解码器进行解码。
+(6)解码器将屏幕数据解码,并将解码后的数据保存到被控端代理显示窗口设置到解码器的Surface中,最终由窗口将画面显示在屏幕上。
+
+#### **4. 设备下线**
+设备下线后,分布式硬件管理框架去使能下线设备的屏幕硬件,本地移除对应的虚拟屏幕并通知窗口子系统,此时下线设备的分布式屏幕不可用。
+
+## **涉及仓**
+****
+**分布式屏幕**
+[distributed_screen](https://gitee.com/openharmony/distributed_screen)
\ No newline at end of file
diff --git a/bundle.json b/bundle.json
new file mode 100644
index 0000000000000000000000000000000000000000..c89001c4d7aafd1795574fcb81772b4c54460a96
--- /dev/null
+++ b/bundle.json
@@ -0,0 +1,87 @@
+{
+ "name":"@ohos/distributed_screen",
+ "description":"distributed hardware screen",
+ "version":"3.1",
+ "author":{},
+ "repository":"https://gitee.com/openharmony/distributed_screen",
+ "license":"Apache License 2.0",
+ "publishAs":"code-segment",
+ "segment":{
+ "destPath":"foundation/distributedhardware/distributedscreen/"
+ },
+ "dirs":{},
+ "scripts":{},
+ "component":{
+ "name":"distributed_screen",
+ "subsystem":"distributedhardware",
+ "syscap":[
+ "SystemCapability.distributedhardware.distributed_screen"
+ ],
+ "features":[],
+ "adapted_system_type":[
+ "standard"
+ ],
+ "rom":"2000k",
+ "ram":"6M",
+ "deps":{
+ "components":[
+ "appexecfwk_standard",
+ "eventhandler",
+ "hiviewdfx_hilog_native",
+ "ipc",
+ "safwk",
+ "samgr_standard",
+ "dsoftbus_standard",
+ "utils_base",
+ "graphic_standard",
+ "distributed_hardware_fwk",
+ "multimedia_media_standard"
+ ],
+ "third_party":[
+ "json"
+ ]
+ },
+ "build":{
+ "sub_component":[
+ "//foundation/distributedhardware/distributedscreen/common:distributed_screen_utils",
+ "//foundation/distributedhardware/distributedscreen/interfaces/innerkits/native_cpp/screen_sink:distributed_screen_sink_sdk",
+ "//foundation/distributedhardware/distributedscreen/interfaces/innerkits/native_cpp/screen_source:distributed_screen_source_sdk",
+ "//foundation/distributedhardware/distributedscreen/services/screenclient:distributed_screen_client",
+ "//foundation/distributedhardware/distributedscreen/screenhandler:distributed_screen_handler",
+ "//foundation/distributedhardware/distributedscreen/services/screentransport/screensinktrans:distributed_screen_sinktrans",
+ "//foundation/distributedhardware/distributedscreen/services/screentransport/screensourcetrans:distributed_screen_sourcetrans",
+ "//foundation/distributedhardware/distributedscreen/services/screenservice/sinkservice:distributed_screen_sink",
+ "//foundation/distributedhardware/distributedscreen/services/screenservice/sourceservice:distributed_screen_source",
+ "//foundation/distributedhardware/distributedscreen/sa_profile:dscreen_sa_profile"
+ ],
+ "inner_kits":[
+ {
+ "type": "so",
+ "name": "//foundation/distributedhardware/distributedscreen/interfaces/innerkits/native_cpp/screen_sink:distributed_screen_sink_sdk",
+ "header": {
+ "header_base": "//foundation/distributedhardware/distributedscreen/interfaces/innerkits/native_cpp/screen_sink/include",
+ "header_files": [
+ "idscreen_sink.h"
+ ]
+ }
+ },
+ {
+ "type": "so",
+ "name": "//foundation/distributedhardware/distributedscreen/interfaces/innerkits/native_cpp/screen_source:distributed_screen_source_sdk",
+ "header": {
+ "header_base": "//foundation/distributedhardware/distributedscreen/interfaces/innerkits/native_cpp/screen_source/include",
+ "header_files": [
+ "idscreen_source.h"
+ ]
+ }
+ }
+ ],
+ "test":[
+ "//foundation/distributedhardware/distributedscreen/services/screentransport/test/unittest:screen_transport_test",
+ "//foundation/distributedhardware/distributedscreen/services/softbusadapter/test/unittest:SoftBusAdapterTest",
+ "//foundation/distributedhardware/distributedscreen/services/screenclient/test/unittest:screen_client_test",
+ "//foundation/distributedhardware/distributedscreen/services/common/test/unittest:service_common_test"
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/common/BUILD.gn b/common/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..7dd03dcd631fe907e5d57d8a7e6079f71e38c6f3
--- /dev/null
+++ b/common/BUILD.gn
@@ -0,0 +1,47 @@
+# Copyright (c) 2022 Huawei Device Co., Ltd.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import("//build/ohos.gni")
+import("//build/ohos_var.gni")
+import("//foundation/distributedhardware/distributedscreen/distributedscreen.gni")
+
+ohos_shared_library("distributed_screen_utils") {
+ include_dirs = [
+ "//utils/native/base/include",
+ "include",
+ ]
+
+ sources = [
+ "src/dscreen_util.cpp",
+ "src/dscreen_log.cpp",
+ ]
+
+ deps = [
+ "//utils/native/base:utils",
+ ]
+
+ external_deps = [
+ "dsoftbus_standard:softbus_client",
+ "hiviewdfx_hilog_native:libhilog",
+ ]
+
+ defines = [
+ "HI_LOG_ENABLE",
+ "DH_LOG_TAG=\"dscreenutil\"",
+ "LOG_DOMAIN=0xD004100",
+ ]
+
+ subsystem_name = "distributedhardware"
+
+ part_name = "distributed_screen"
+}
\ No newline at end of file
diff --git a/common/include/dscreen_constants.h b/common/include/dscreen_constants.h
new file mode 100644
index 0000000000000000000000000000000000000000..50c0b15d22d6d8d7a18a24a88f73b6bba3dfad1f
--- /dev/null
+++ b/common/include/dscreen_constants.h
@@ -0,0 +1,126 @@
+/*
+ * Copyright (c) 2022 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef OHOS_DSCREEN_CONSTANTS_H
+#define OHOS_DSCREEN_CONSTANTS_H
+
+#include
+#include
+#include
+
+namespace OHOS {
+namespace DistributedHardware {
+enum RpcEventType {
+ NOTIFY_SINK_SETUP = 1,
+ NOTIFY_SOURCE_SETUP_RESULT = 2,
+};
+
+enum DScreenState {
+ DISABLED,
+ ENABLED,
+ DISABLING,
+ ENABLING,
+ CONNECTING,
+ CONNECTED,
+ DISCONNECTING,
+};
+
+enum TaskType {
+ TASK_ENABLE,
+ TASK_DISABLE,
+ TASK_CONNECT,
+ TASK_DISCONNECT,
+};
+
+enum CodecType : uint8_t {
+ VIDEO_CODEC_TYPE_VIDEO_H264 = 0,
+ VIDEO_CODEC_TYPE_VIDEO_H265 = 1,
+};
+
+enum VideoFormat : uint8_t {
+ VIDEO_DATA_FORMAT_YUVI420 = 0,
+ VIDEO_DATA_FORMAT_NV12 = 1,
+ VIDEO_DATA_FORMAT_NV21 = 2,
+};
+
+/* Screen package name */
+const std::string PKG_NAME = "DBinderBus_" + std::to_string(getpid());
+
+/* Screen data session name */
+const std::string DATA_SESSION_NAME = "DBinder.ohos.dhardware.dscreen.data";
+
+/* Screen session name max len */
+constexpr uint32_t DSCREEN_MAX_SESSION_NAME_LEN = 50;
+
+constexpr uint32_t DSCREEN_MAX_DEVICE_ID_LEN = 100;
+/* Screen data received max length */
+constexpr uint32_t DSCREEN_MAX_RECV_DATA_LEN = 104857600;
+
+/* Screen max video data width */
+constexpr uint32_t DSCREEN_MAX_VIDEO_DATA_WIDTH = 2560;
+
+/* Screen max video data height */
+constexpr uint32_t DSCREEN_MAX_VIDEO_DATA_HEIGHT = 1600;
+
+/* Screen max screen data width */
+constexpr uint32_t DSCREEN_MAX_SCREEN_DATA_WIDTH = 2560;
+
+/* Screen max screen data height */
+constexpr uint32_t DSCREEN_MAX_SCREEN_DATA_HEIGHT = 1600;
+
+/* YUV420 buffer size max size */
+constexpr int64_t MAX_YUV420_BUFFER_SIZE = 2560 * 1600 * (3 / 2) * 2;
+constexpr int32_t LOG_MAX_LEN = 4096;
+
+constexpr int32_t INVALID_WINDOW_ID = -1;
+
+const std::string DSCREEN_LOG_TITLE_TAG = "DSCREEN";
+const std::string DSCREEN_PREFIX = "DISTRIBUTED_SCREEN";
+const std::string SCREEN_PREFIX = "SCREEN";
+const std::string DSCREEN_VERSION = "1.0";
+const std::string SEPERATOR = "#";
+const std::string KEY_VERSION = "screenVersion";
+const std::string KEY_DISPLAY_ID = "displayId";
+const std::string KEY_SCREEN_ID = "screenId";
+const std::string KEY_DISPLAY_RECT = "displayRect";
+const std::string KEY_SCREEN_RECT = "screenRect";
+const std::string KEY_POINT_START_X = "startX";
+const std::string KEY_POINT_START_Y = "startY";
+const std::string KEY_WIDTH = "width";
+const std::string KEY_HEIGHT = "height";
+const std::string KEY_SCREEN_WIDTH = "screenWidth";
+const std::string KEY_SCREEN_HEIGHT = "screenHeight";
+const std::string KEY_VIDEO_WIDTH = "videoWidth";
+const std::string KEY_VIDEO_HEIGHT = "videoHeight";
+const std::string KEY_FPS = "fps";
+const std::string KEY_CODECTYPE = "codecType";
+const std::string SCREEN_CLIENT_WINDOW = "screenClientWindow";
+const std::string KEY_DH_ID = "dhId";
+const std::string KEY_ERR_CODE = "errCode";
+const std::string KEY_ERR_CONTENT = "errContent";
+const std::string KEY_VIDEO_PARAM = "videoParam";
+const std::string KEY_MAPRELATION = "mapRelation";
+constexpr float DEFAULT_DENSITY = 2.0;
+constexpr int32_t DEFAULT_SCREEN_FLAGS = 0;
+constexpr uint32_t DEFAULT_FPS = 30;
+constexpr uint8_t DEFAULT_CODECTYPE = VIDEO_CODEC_TYPE_VIDEO_H264;
+constexpr uint8_t DEFAULT_VIDEO_FORMAT = VIDEO_DATA_FORMAT_NV21;
+constexpr int32_t DISTRIBUTED_HARDWARE_SCREEN_SOURCE_SA_ID = 4807;
+constexpr int32_t DISTRIBUTED_HARDWARE_SCREEN_SINK_SA_ID = 4808;
+constexpr uint64_t SCREEN_ID_INVALID = -1ULL;
+constexpr uint64_t SCREEN_ID_DEFAULT = 0;
+} // namespace DistributedHardware
+} // namespace OHOS
+#endif
\ No newline at end of file
diff --git a/common/include/dscreen_errcode.h b/common/include/dscreen_errcode.h
new file mode 100644
index 0000000000000000000000000000000000000000..7315a32b9a438f6f77501730ba475d42b368945a
--- /dev/null
+++ b/common/include/dscreen_errcode.h
@@ -0,0 +1,94 @@
+/*
+ * Copyright (c) 2022 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef OHOS_DSCREEN_ERRCODE_H
+#define OHOS_DSCREEN_ERRCODE_H
+
+namespace OHOS {
+namespace DistributedHardware {
+enum DScreenErrorCode {
+ DH_SUCCESS = 0,
+ // SA error code
+ ERR_DH_SCREEN_SA_GET_SAMGR_FAIL = -50000,
+ ERR_DH_SCREEN_SA_GET_SOURCESERVICE_FAIL = -50001,
+ ERR_DH_SCREEN_SA_GET_SOURCEPROXY_FAIL = -50002,
+ ERR_DH_SCREEN_SA_GET_SOURCECALLBACKPROXY_FAIL = -50003,
+ ERR_DH_SCREEN_SA_SOURCEPROXY_NOT_INIT = -50004,
+ ERR_DH_SCREEN_SA_SOURCEPCALLBACK_NOT_INIT = -50005,
+ ERR_DH_SCREEN_SA_GET_SINKSERVICE_FAIL = -50006,
+ ERR_DH_SCREEN_SA_GET_SINKPROXY_FAIL = -50007,
+ ERR_DH_SCREEN_SA_SINKPROXY_NOT_INIT = -50008,
+ ERR_DH_SCREEN_SA_REGISTERCALLBACK_NOT_FOUND = -50009,
+ ERR_DH_SCREEN_SA_UNREGISTERCALLBACK_NOT_FOUND = -50010,
+ ERR_DH_SCREEN_SA_REQUEST_CODE_INVALID = -50011,
+ ERR_DH_SCREEN_SA_WRITEINTERFACETOKEN_FAILED = -50012,
+ ERR_DH_SCREEN_SA_WRITEPARAM_FAILED = -50013,
+ ERR_DH_SCREEN_SA_READPARAM_FAILED = -50014,
+ ERR_DH_SCREEN_SA_DSCREENMGR_NOT_INIT = -50015,
+ ERR_DH_SCREEN_SA_ENABLE_FAILED = -50016,
+ ERR_DH_SCREEN_SA_DISABLE_FAILED = -50017,
+ ERR_DH_SCREEN_SA_SOURCETRANS_NOT_INIT = -50018,
+ ERR_DH_SCREEN_SA_SCREENREGIONMGR_NOT_INIT = -50019,
+ ERR_DH_SCREEN_SA_SINKTRANS_NOT_INIT = -50020,
+ ERR_DH_SCREEN_SA_GET_REMOTE_SOURCE_SERVICE_FAIL = -50021,
+ ERR_DH_SCREEN_SA_GET_REMOTE_SINK_SERVICE_FAIL = -50022,
+ ERR_DH_SCREEN_SA_SCREENREGION_SETUP_FAIL = -50023,
+ ERR_DH_SCREEN_SA_SCREENREGION_START_FAIL = -50024,
+ ERR_DH_SCREEN_SA_REMOVE_VIRTUALSCREEN_FAIL = -50025,
+ ERR_DH_SCREEN_SA_DSCREEN_TASK_NOT_VALID = -50026,
+ ERR_DH_SCREEN_SA_DSCREEN_SCREENGION_SETUP_FAILED = -50027,
+ ERR_DH_SCREEN_SA_INVALID_IPC_CALL = -50028,
+ ERR_DH_SCREEN_SA_REGISTER_SCREENLISTENER_FAIL = -520029,
+ ERR_DH_SCREEN_SA_UNREGISTER_SCREENLISTENER_FAIL = -520030,
+ // Transport component error code
+ ERR_DH_SCREEN_TRANS_ERROR = -51000,
+ ERR_DH_SCREEN_TRANS_TIMEOUT = -51001,
+ ERR_DH_SCREEN_TRANS_NULL_VALUE = -51002,
+ ERR_DH_SCREEN_TRANS_ILLEGAL_PARAM = -51003,
+ ERR_DH_SCREEN_TRANS_ILLEGAL_OPERATION = -51004,
+ ERR_DH_SCREEN_TRANS_SESSION_CLOSED = -51005,
+ ERR_DH_SCREEN_TRANS_CREATE_CODEC_FAILED = -51006,
+ ERR_DH_SCREEN_TRANS_RELEASE_CODEC_FAILED = -51007,
+ ERR_DH_SCREEN_TRANS_START_CODEC_FAILED = -51008,
+ ERR_DH_SCREEN_TRANS_STOP_CODEC_FAILED = -51009,
+ ERR_DH_SCREEN_TRANS_CREATE_SURFACE_FAILED = -51010,
+ ERR_DH_SCREEN_TRANS_SESSION_NOT_OPEN = -51011,
+ // adapter
+ ERR_DH_SCREEN_ADAPTER_SESSION_ID_NOT_FIND = -52000,
+ ERR_DH_SCREEN_ADAPTER_UNREGISTER_SOFTBUS_LISTENER_FAIL = -52001,
+ ERR_DH_SCREEN_ADAPTER_REGISTER_SOFTBUS_LISTENER_FAIL = -52002,
+ ERR_DH_SCREEN_ADAPTER_FIND_SOFTBUS_LISTENER_FAIL = -52003,
+ ERR_DH_SCREEN_ADAPTER_BAD_VALUE = -52004,
+ ERR_DH_SCREEN_ADAPTER_OPEN_SESSION_FAIL = -52005,
+ ERR_DH_SCREEN_ADAPTER_PARA_ERROR = -52006,
+ // Encoder & Decoder
+ ERR_DH_SCREEN_CODEC_RELEASE_FAILED = -53000,
+ ERR_DH_SCREEN_CODEC_PREPARE_FAILED = -53001,
+ ERR_DH_SCREEN_CODEC_START_FAILED = -53002,
+ ERR_DH_SCREEN_CODEC_FLUSH_FAILED = -53003,
+ ERR_DH_SCREEN_CODEC_STOP_FAILED = -53004,
+ ERR_DH_SCREEN_CODEC_SET_CALLBACK_FAILED = -53005,
+ ERR_DH_SCREEN_CODEC_CONFIGURE_FAILED = -53006,
+ ERR_DH_SCREEN_CODEC_SURFACE_ERROR = -53007,
+ // ScreenClient error code
+ ERR_DH_SCREEN_SCREENCLIENT_SHOW_WINDOW_ERROR = -54000,
+ ERR_DH_SCREEN_SCREENCLIENT_REMOVE_WINDOW_ERROR = -54001,
+ ERR_DH_SCREEN_SCREENCLIENT_ADD_WINDOW_ERROR = -54002,
+ ERR_DH_SCREEN_SCREENCLIENT_MOVE_WINDOW_ERROR = -54003,
+ ERR_DH_SCREEN_SCREENCLIENT_HIDE_WINDOW_ERROR = -54004,
+};
+} // namespace DistributedHardware
+} // namespace OHOS
+#endif
\ No newline at end of file
diff --git a/common/include/dscreen_log.h b/common/include/dscreen_log.h
new file mode 100644
index 0000000000000000000000000000000000000000..b8c92965be134d1bdc5f9d3752b791d171344bcb
--- /dev/null
+++ b/common/include/dscreen_log.h
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2022 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef OHOS_DSCREEN_LOG_H
+#define OHOS_DSCREEN_LOG_H
+
+namespace OHOS {
+namespace DistributedHardware {
+typedef enum {
+ DH_LOG_DEBUG,
+ DH_LOG_INFO,
+ DH_LOG_WARN,
+ DH_LOG_ERROR,
+} DHLogLevel;
+
+void DHLog(DHLogLevel logLevel, const char *fmt, ...);
+
+#define DHLOGD(fmt, ...) DHLog(DH_LOG_DEBUG, \
+ (std::string("[") + DH_LOG_TAG + "][" + __FUNCTION__ + "]:" + fmt).c_str(), ##__VA_ARGS__)
+
+#define DHLOGI(fmt, ...) DHLog(DH_LOG_INFO, \
+ (std::string("[") + DH_LOG_TAG + "][" + __FUNCTION__ + "]:" + fmt).c_str(), ##__VA_ARGS__)
+
+#define DHLOGW(fmt, ...) DHLog(DH_LOG_WARN, \
+ (std::string("[") + DH_LOG_TAG + "][" + __FUNCTION__ + "]:" + fmt).c_str(), ##__VA_ARGS__)
+
+#define DHLOGE(fmt, ...) DHLog(DH_LOG_ERROR, \
+ (std::string("[") + DH_LOG_TAG + "][" + __FUNCTION__ + "]:" + fmt).c_str(), ##__VA_ARGS__)
+} // namespace DistributedHardware
+} // namespace OHOS
+#endif
\ No newline at end of file
diff --git a/common/include/dscreen_util.h b/common/include/dscreen_util.h
new file mode 100644
index 0000000000000000000000000000000000000000..8b113e525815b1c1cb1dbb4e8f9144fad7d3fa29
--- /dev/null
+++ b/common/include/dscreen_util.h
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2022 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef OHOS_DSCREEN_UTIL_H
+#define OHOS_DSCREEN_UTIL_H
+
+#include
+
+namespace OHOS {
+namespace DistributedHardware {
+int32_t GetLocalDeviceNetworkId(std::string &networkId);
+std::string GetRandomID();
+std::string GetAnonyString(const std::string &value);
+} // namespace DistributedHardware
+} // namespace OHOS
+#endif
\ No newline at end of file
diff --git a/common/src/dscreen_log.cpp b/common/src/dscreen_log.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..ec34b603e0021e976697619e77a3c05747ca98d3
--- /dev/null
+++ b/common/src/dscreen_log.cpp
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 2022 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "dscreen_log.h"
+
+#include "securec.h"
+
+#ifdef HI_LOG_ENABLE
+#include "hilog/log.h"
+#else
+#include
+#endif
+
+#include "dscreen_constants.h"
+
+namespace OHOS {
+namespace DistributedHardware {
+static void DHLogOut(DHLogLevel logLevel, const char *logBuf)
+{
+#ifdef HI_LOG_ENABLE
+ LogLevel hiLogLevel = LOG_INFO;
+ switch (logLevel) {
+ case DH_LOG_DEBUG:
+ hiLogLevel = LOG_DEBUG;
+ break;
+ case DH_LOG_INFO:
+ hiLogLevel = LOG_INFO;
+ break;
+ case DH_LOG_WARN:
+ hiLogLevel = LOG_WARN;
+ break;
+ case DH_LOG_ERROR:
+ hiLogLevel = LOG_ERROR;
+ break;
+ default:
+ break;
+ }
+ (void)HiLogPrint(LOG_CORE, hiLogLevel, LOG_DOMAIN, DSCREEN_LOG_TITLE_TAG.c_str(), "%{public}s", logBuf);
+#else
+ switch (logLevel) {
+ case DH_LOG_DEBUG:
+ printf("[D]%s\n", logBuf);
+ break;
+ case DH_LOG_INFO:
+ printf("[I]%s\n", logBuf);
+ break;
+ case DH_LOG_WARN:
+ printf("[W]%s\n", logBuf);
+ break;
+ case DH_LOG_ERROR:
+ printf("[E]%s\n", logBuf);
+ break;
+ default:
+ break;
+ }
+#endif
+}
+
+void DHLog(DHLogLevel logLevel, const char *fmt, ...)
+{
+ char logBuf[LOG_MAX_LEN] = {0};
+ va_list arg;
+
+ (void)memset_s(&arg, sizeof(va_list), 0, sizeof(va_list));
+ va_start(arg, fmt);
+ int32_t ret = vsprintf_s(logBuf, sizeof(logBuf), fmt, arg);
+ va_end(arg);
+ if (ret < 0) {
+ DHLogOut(logLevel, "DH log length error.");
+ return;
+ }
+ DHLogOut(logLevel, logBuf);
+}
+} // namespace DistributedHardware
+} // namespace OHOS
\ No newline at end of file
diff --git a/common/src/dscreen_util.cpp b/common/src/dscreen_util.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..95ba2b78aa8791f95842c74acf0ecb579c3e10f9
--- /dev/null
+++ b/common/src/dscreen_util.cpp
@@ -0,0 +1,97 @@
+/*
+ * Copyright (c) 2022 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "dscreen_util.h"
+
+#include
+#include
+#include
+#include
+
+#include "softbus_bus_center.h"
+
+#include "dscreen_constants.h"
+#include "dscreen_errcode.h"
+#include "dscreen_log.h"
+
+namespace OHOS {
+namespace DistributedHardware {
+constexpr int32_t WORD_WIDTH_8 = 8;
+constexpr int32_t WORD_WIDTH_4 = 4;
+
+int32_t GetLocalDeviceNetworkId(std::string &networkId)
+{
+ NodeBasicInfo basicInfo = { { 0 } };
+ int32_t ret = GetLocalNodeDeviceInfo(PKG_NAME.c_str(), &basicInfo);
+ if (ret != DH_SUCCESS) {
+ DHLOGE("GetLocalDeviceNetworkId failed ret: %d", ret);
+ return ret;
+ }
+
+ networkId = std::string(basicInfo.networkId);
+ return DH_SUCCESS;
+}
+
+std::string GetRandomID()
+{
+ static std::random_device rd;
+ static std::uniform_int_distribution dist(0ULL, 0xFFFFFFFFFFFFFFFFULL);
+ uint64_t ab = dist(rd);
+ uint64_t cd = dist(rd);
+ uint32_t a, b, c, d;
+ std::stringstream ss;
+ ab = (ab & 0xFFFFFFFFFFFF0FFFULL) | 0x0000000000004000ULL;
+ cd = (cd & 0x3FFFFFFFFFFFFFFFULL) | 0x8000000000000000ULL;
+ a = (ab >> 32U);
+ b = (ab & 0xFFFFFFFFU);
+ c = (cd >> 32U);
+ d = (cd & 0xFFFFFFFFU);
+ ss << std::hex << std::nouppercase << std::setfill('0');
+ ss << std::setw(WORD_WIDTH_8) << (a);
+ ss << std::setw(WORD_WIDTH_4) << (b >> 16U);
+ ss << std::setw(WORD_WIDTH_4) << (b & 0xFFFFU);
+ ss << std::setw(WORD_WIDTH_4) << (c >> 16U);
+ ss << std::setw(WORD_WIDTH_4) << (c & 0xFFFFU);
+ ss << std::setw(WORD_WIDTH_8) << d;
+
+ return ss.str();
+}
+
+std::string GetAnonyString(const std::string &value)
+{
+ constexpr size_t INT32_SHORT_ID_LENGTH = 20;
+ constexpr size_t INT32_MIN_ID_LENGTH = 3;
+ std::string res;
+ std::string tmpStr("******");
+ size_t strLen = value.length();
+ if (strLen < INT32_MIN_ID_LENGTH) {
+ return tmpStr;
+ }
+
+ if (strLen <= INT32_SHORT_ID_LENGTH) {
+ res += value[0];
+ res += tmpStr;
+ res += value[strLen - 1];
+ } else {
+ constexpr size_t INT32_PLAINTEXT_LENGTH = 4;
+ res.append(value, 0, INT32_PLAINTEXT_LENGTH);
+ res += tmpStr;
+ res.append(value, strLen - INT32_PLAINTEXT_LENGTH, INT32_PLAINTEXT_LENGTH);
+ }
+
+ return res;
+}
+} // namespace DistributedHardware
+} // namespace OHOS
\ No newline at end of file
diff --git a/distributedscreen.gni b/distributedscreen.gni
new file mode 100644
index 0000000000000000000000000000000000000000..217b56cfbb6cdddad7a933b385d47905c940b325
--- /dev/null
+++ b/distributedscreen.gni
@@ -0,0 +1,25 @@
+# Copyright (c) 2022 Huawei Device Co., Ltd.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+distributedscreen_path = "//foundation/distributedhardware/distributedscreen"
+distributedhardwarefwk_path = "//foundation/distributedhardware/distributedhardwarefwk"
+windowmanager_path = "//foundation/windowmanager"
+mediastandard_path = "//foundation/multimedia/media_standard"
+graphicstandard_path = "//foundation/graphic/standard"
+common_path = "${distributedscreen_path}/common"
+services_path = "${distributedscreen_path}/services"
+interfaces_path = "${distributedscreen_path}/interfaces"
+fwk_utils_path = "${distributedhardwarefwk_path}/utils"
+fwk_common_path = "${distributedhardwarefwk_path}/common"
+fwk_services_path = "${distributedhardwarefwk_path}/services"
+build_flags = ["-Werror"]
\ No newline at end of file
diff --git a/figures/distributedscreen_arch.png b/figures/distributedscreen_arch.png
new file mode 100644
index 0000000000000000000000000000000000000000..e4c0deb8bb27e9718ef77cd0a9e4736e5d53ff66
Binary files /dev/null and b/figures/distributedscreen_arch.png differ
diff --git a/interfaces/innerkits/native_cpp/screen_sink/BUILD.gn b/interfaces/innerkits/native_cpp/screen_sink/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..bcbb3e9b0c1f0757fcabceb1fd95bbc8cf1d1317
--- /dev/null
+++ b/interfaces/innerkits/native_cpp/screen_sink/BUILD.gn
@@ -0,0 +1,55 @@
+# Copyright (c) 2022 Huawei Device Co., Ltd.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import("//build/ohos.gni")
+import("//build/ohos_var.gni")
+import("//foundation/distributedhardware/distributedscreen/distributedscreen.gni")
+
+ohos_shared_library("distributed_screen_sink_sdk") {
+ include_dirs = [
+ "//utils/system/safwk/native/include",
+ "${fwk_common_path}/utils/include",
+ ]
+
+ include_dirs += [
+ "include",
+ "${common_path}/include",
+ ]
+
+ sources = [
+ "src/dscreen_sink_handler.cpp",
+ "src/dscreen_sink_proxy.cpp",
+ ]
+
+ deps = [
+ "//utils/native/base:utils",
+ "${common_path}:distributed_screen_utils",
+ ]
+
+ defines = [
+ "HI_LOG_ENABLE",
+ "DH_LOG_TAG=\"dscreensinksdk\"",
+ "LOG_DOMAIN=0xD004100",
+ ]
+
+ external_deps = [
+ "hiviewdfx_hilog_native:libhilog",
+ "ipc:ipc_core",
+ "safwk:system_ability_fwk",
+ "samgr_standard:samgr_proxy",
+ ]
+
+ subsystem_name = "distributedhardware"
+
+ part_name = "distributed_screen"
+}
\ No newline at end of file
diff --git a/interfaces/innerkits/native_cpp/screen_sink/include/dscreen_sink_handler.h b/interfaces/innerkits/native_cpp/screen_sink/include/dscreen_sink_handler.h
new file mode 100644
index 0000000000000000000000000000000000000000..152884ded32f1622fff676707a4840e759c8c4a1
--- /dev/null
+++ b/interfaces/innerkits/native_cpp/screen_sink/include/dscreen_sink_handler.h
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2022 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef OHOS_DSCREEN_SINK_HANDLER_H
+#define OHOS_DSCREEN_SINK_HANDLER_H
+
+#include
+
+#include "idistributed_hardware_sink.h"
+#include "single_instance.h"
+
+#include "idscreen_sink.h"
+
+namespace OHOS {
+namespace DistributedHardware {
+class DScreenSinkHandler : public IDistributedHardwareSink {
+DECLARE_SINGLE_INSTANCE_BASE(DScreenSinkHandler);
+public:
+ int32_t InitSink(const std::string ¶ms) override;
+ int32_t ReleaseSink() override;
+ int32_t SubscribeLocalHardware(const std::string &dhId, const std::string ¶m) override;
+ int32_t UnsubscribeLocalHardware(const std::string &dhId) override;
+ void OnRemoteSinkSvrDied(const wptr &remote);
+private:
+ class DScreenSinkSvrRecipient : public IRemoteObject::DeathRecipient {
+ public:
+ void OnRemoteDied(const wptr &remote) override;
+ };
+
+ DScreenSinkHandler();
+ ~DScreenSinkHandler();
+
+ std::mutex mutex_;
+ sptr dScreenSinkProxy_ = nullptr;
+ sptr sinkSvrRecipient_ = nullptr;
+};
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+__attribute__((visibility("default"))) IDistributedHardwareSink *GetSinkHardwareHandler();
+#ifdef __cplusplus
+}
+#endif
+} // namespace DistributedHardware
+} // namespace OHOS
+#endif
\ No newline at end of file
diff --git a/interfaces/innerkits/native_cpp/screen_sink/include/dscreen_sink_proxy.h b/interfaces/innerkits/native_cpp/screen_sink/include/dscreen_sink_proxy.h
new file mode 100644
index 0000000000000000000000000000000000000000..ca69db104f5401a98b17343bafc3fdd5dde5206e
--- /dev/null
+++ b/interfaces/innerkits/native_cpp/screen_sink/include/dscreen_sink_proxy.h
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2022 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef OHOS_DSCREEN_SINK_PROXY_H
+#define OHOS_DSCREEN_SINK_PROXY_H
+
+#include "iremote_broker.h"
+#include "iremote_proxy.h"
+
+#include "idscreen_sink.h"
+
+namespace OHOS {
+namespace DistributedHardware {
+class DScreenSinkProxy : public IRemoteProxy {
+public:
+ explicit DScreenSinkProxy(const sptr impl)
+ : IRemoteProxy(impl)
+ {
+ }
+
+ ~DScreenSinkProxy() {}
+ int32_t InitSink(const std::string ¶ms) override;
+ int32_t ReleaseSink() override;
+ int32_t SubscribeLocalHardware(const std::string &dhId, const std::string ¶m) override;
+ int32_t UnsubscribeLocalHardware(const std::string &dhId) override;
+ void DScreenNotify(const std::string &devId, int32_t eventCode, const std::string &eventContent) override;
+
+private:
+ static inline BrokerDelegator delegator_;
+};
+} // namespace DistributedHardware
+} // namespace OHOS
+#endif
diff --git a/interfaces/innerkits/native_cpp/screen_sink/include/idscreen_sink.h b/interfaces/innerkits/native_cpp/screen_sink/include/idscreen_sink.h
new file mode 100644
index 0000000000000000000000000000000000000000..96be07e54d07b645956f56109305996d79c7243c
--- /dev/null
+++ b/interfaces/innerkits/native_cpp/screen_sink/include/idscreen_sink.h
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2022 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef OHOS_IDSCREEN_SINK_H
+#define OHOS_IDSCREEN_SINK_H
+
+#include "iremote_broker.h"
+
+namespace OHOS {
+namespace DistributedHardware {
+class IDScreenSink : public OHOS::IRemoteBroker {
+public:
+ DECLARE_INTERFACE_DESCRIPTOR(u"ohos.distributedhardware.distributedscreensink");
+ enum {
+ INIT_SINK = 0,
+ RELEASE_SINK = 1,
+ SUBSCRIBE_DISTRIBUTED_HARDWARE = 2,
+ UNSUBSCRIBE_DISTRIBUTED_HARDWARE = 3,
+ DSCREEN_NOTIFY = 4,
+ };
+
+ IDScreenSink() = default;
+ virtual ~IDScreenSink() = default;
+ virtual int32_t InitSink(const std::string ¶ms) = 0;
+ virtual int32_t ReleaseSink() = 0;
+ virtual int32_t SubscribeLocalHardware(const std::string &dhId, const std::string ¶m) = 0;
+ virtual int32_t UnsubscribeLocalHardware(const std::string &dhId) = 0;
+ virtual void DScreenNotify(const std::string &devId, int32_t eventCode, const std::string &eventContent) = 0;
+};
+} // namespace DistributedHardware
+} // namespace OHOS
+#endif
\ No newline at end of file
diff --git a/interfaces/innerkits/native_cpp/screen_sink/src/dscreen_sink_handler.cpp b/interfaces/innerkits/native_cpp/screen_sink/src/dscreen_sink_handler.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..8f4472cc86dbe81d3017d4c9235957fd3d9e33f3
--- /dev/null
+++ b/interfaces/innerkits/native_cpp/screen_sink/src/dscreen_sink_handler.cpp
@@ -0,0 +1,136 @@
+/*
+ * Copyright (c) 2022 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "dscreen_sink_handler.h"
+
+#include "if_system_ability_manager.h"
+#include "iservice_registry.h"
+
+#include "dscreen_constants.h"
+#include "dscreen_errcode.h"
+#include "dscreen_log.h"
+
+namespace OHOS {
+namespace DistributedHardware {
+IMPLEMENT_SINGLE_INSTANCE(DScreenSinkHandler);
+
+DScreenSinkHandler::DScreenSinkHandler()
+{
+ DHLOGI("DScreenSinkHandler construct.");
+ std::lock_guard lock(mutex_);
+ if (!sinkSvrRecipient_) {
+ sinkSvrRecipient_ = new DScreenSinkSvrRecipient();
+ }
+}
+
+DScreenSinkHandler::~DScreenSinkHandler()
+{
+ DHLOGI("~DScreenSinkHandler.");
+}
+
+int32_t DScreenSinkHandler::InitSink(const std::string ¶ms)
+{
+ DHLOGD("InitSink");
+ std::lock_guard lock(mutex_);
+
+ if (!dScreenSinkProxy_) {
+ sptr samgr =
+ SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager();
+ if (!samgr) {
+ DHLOGE("Failed to get system ability mgr.");
+ return ERR_DH_SCREEN_SA_GET_SAMGR_FAIL;
+ }
+ sptr remoteObject = samgr->GetSystemAbility(DISTRIBUTED_HARDWARE_SCREEN_SINK_SA_ID);
+ if (!remoteObject) {
+ DHLOGE("Failed to get dscreen sink service.");
+ return ERR_DH_SCREEN_SA_GET_SINKSERVICE_FAIL;
+ }
+
+ remoteObject->AddDeathRecipient(sinkSvrRecipient_);
+ dScreenSinkProxy_ = iface_cast(remoteObject);
+ if ((!dScreenSinkProxy_) || (!dScreenSinkProxy_->AsObject())) {
+ DHLOGE("Failed to get dscreen sink proxy.");
+ return ERR_DH_SCREEN_SA_GET_SINKPROXY_FAIL;
+ }
+ }
+ int32_t ret = dScreenSinkProxy_->InitSink(params);
+ return ret;
+}
+
+int32_t DScreenSinkHandler::ReleaseSink()
+{
+ DHLOGD("ReleaseSink");
+ std::lock_guard lock(mutex_);
+ if (!dScreenSinkProxy_) {
+ DHLOGE("screen sink proxy not init.");
+ return ERR_DH_SCREEN_SA_SINKPROXY_NOT_INIT;
+ }
+
+ int32_t ret = dScreenSinkProxy_->ReleaseSink();
+ return ret;
+}
+
+int32_t DScreenSinkHandler::SubscribeLocalHardware(const std::string &dhId, const std::string ¶m)
+{
+ DHLOGD("SubscribeLocalHardware");
+ std::lock_guard lock(mutex_);
+ if (!dScreenSinkProxy_) {
+ DHLOGE("screen sink proxy not init.");
+ return ERR_DH_SCREEN_SA_SINKPROXY_NOT_INIT;
+ }
+ int32_t ret = dScreenSinkProxy_->SubscribeLocalHardware(dhId, param);
+ return ret;
+}
+
+int32_t DScreenSinkHandler::UnsubscribeLocalHardware(const std::string &dhId)
+{
+ DHLOGD("UnsubscribeLocalHardware");
+ std::lock_guard lock(mutex_);
+ if (!dScreenSinkProxy_) {
+ DHLOGE("screen sink proxy not init.");
+ return ERR_DH_SCREEN_SA_SINKPROXY_NOT_INIT;
+ }
+ int32_t ret = dScreenSinkProxy_->UnsubscribeLocalHardware(dhId);
+ return ret;
+}
+
+void DScreenSinkHandler::DScreenSinkSvrRecipient::OnRemoteDied(const wptr &remote)
+{
+ DHLOGI("DScreenSinkSvrRecipient OnRemoteDied.");
+ DScreenSinkHandler::GetInstance().OnRemoteSinkSvrDied(remote);
+}
+
+void DScreenSinkHandler::OnRemoteSinkSvrDied(const wptr &remote)
+{
+ DHLOGI("OnRemoteSinkSvrDied");
+ sptr remoteObject = remote.promote();
+ if (!remoteObject) {
+ DHLOGE("OnRemoteDied remote promoted failed");
+ return;
+ }
+ std::lock_guard lock(mutex_);
+ if (!dScreenSinkProxy_) {
+ dScreenSinkProxy_->AsObject()->RemoveDeathRecipient(sinkSvrRecipient_);
+ dScreenSinkProxy_ = nullptr;
+ }
+}
+
+IDistributedHardwareSink *GetSinkHardwareHandler()
+{
+ DHLOGD("GetSinkHardwareHandler");
+ return &DScreenSinkHandler::GetInstance();
+}
+} // namespace DistributedHardware
+} // namespace OHOS
\ No newline at end of file
diff --git a/interfaces/innerkits/native_cpp/screen_sink/src/dscreen_sink_proxy.cpp b/interfaces/innerkits/native_cpp/screen_sink/src/dscreen_sink_proxy.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..a6d1e999f2994237f36913bcb3ad2f603f7d659b
--- /dev/null
+++ b/interfaces/innerkits/native_cpp/screen_sink/src/dscreen_sink_proxy.cpp
@@ -0,0 +1,123 @@
+/*
+ * Copyright (c) 2022 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "dscreen_sink_proxy.h"
+
+#include "parcel.h"
+
+#include "dscreen_errcode.h"
+#include "dscreen_log.h"
+
+namespace OHOS {
+namespace DistributedHardware {
+int32_t DScreenSinkProxy::InitSink(const std::string ¶ms)
+{
+ DHLOGD("InitSink");
+ MessageParcel data;
+ MessageParcel reply;
+ MessageOption option;
+ if (!data.WriteInterfaceToken(GetDescriptor())) {
+ DHLOGE("WriteInterfaceToken failed");
+ return ERR_DH_SCREEN_SA_WRITEINTERFACETOKEN_FAILED;
+ }
+
+ if (!data.WriteString(params)) {
+ DHLOGE("Write param failed.");
+ return ERR_DH_SCREEN_SA_WRITEPARAM_FAILED;
+ }
+
+ Remote()->SendRequest(INIT_SINK, data, reply, option);
+ int32_t ret = reply.ReadInt32();
+ return ret;
+}
+
+int32_t DScreenSinkProxy::ReleaseSink()
+{
+ DHLOGD("ReleaseSink");
+ MessageParcel data;
+ MessageParcel reply;
+ MessageOption option;
+ if (!data.WriteInterfaceToken(GetDescriptor())) {
+ DHLOGE("WriteInterfaceToken failed");
+ return ERR_DH_SCREEN_SA_WRITEINTERFACETOKEN_FAILED;
+ }
+
+ Remote()->SendRequest(RELEASE_SINK, data, reply, option);
+ int32_t ret = reply.ReadInt32();
+ return ret;
+}
+
+int32_t DScreenSinkProxy::SubscribeLocalHardware(const std::string &dhId, const std::string ¶m)
+{
+ DHLOGD("SubscribeLocalHardware");
+ MessageParcel data;
+ MessageParcel reply;
+ MessageOption option;
+ if (!data.WriteInterfaceToken(GetDescriptor())) {
+ DHLOGE("WriteInterfaceToken failed");
+ return ERR_DH_SCREEN_SA_WRITEINTERFACETOKEN_FAILED;
+ }
+
+ if (!data.WriteString(dhId) || !data.WriteString(param)) {
+ DHLOGE("Write param failed.");
+ return ERR_DH_SCREEN_SA_WRITEPARAM_FAILED;
+ }
+
+ Remote()->SendRequest(SUBSCRIBE_DISTRIBUTED_HARDWARE, data, reply, option);
+ int32_t ret = reply.ReadInt32();
+ return ret;
+}
+
+int32_t DScreenSinkProxy::UnsubscribeLocalHardware(const std::string &dhId)
+{
+ DHLOGD("UnsubscribeLocalHardware");
+ MessageParcel data;
+ MessageParcel reply;
+ MessageOption option;
+ if (!data.WriteInterfaceToken(GetDescriptor())) {
+ DHLOGE("WriteInterfaceToken failed");
+ return ERR_DH_SCREEN_SA_WRITEINTERFACETOKEN_FAILED;
+ }
+
+ if (!data.WriteString(dhId)) {
+ DHLOGE("Write param failed.");
+ return ERR_DH_SCREEN_SA_WRITEPARAM_FAILED;
+ }
+
+ Remote()->SendRequest(UNSUBSCRIBE_DISTRIBUTED_HARDWARE, data, reply, option);
+ int32_t ret = reply.ReadInt32();
+ return ret;
+}
+
+void DScreenSinkProxy::DScreenNotify(const std::string &devId, int32_t eventCode, const std::string &eventContent)
+{
+ DHLOGD("DScreenNotify");
+ MessageParcel data;
+ MessageParcel reply;
+ MessageOption option = { MessageOption::TF_ASYNC };
+ if (!data.WriteInterfaceToken(GetDescriptor())) {
+ DHLOGE("WriteInterfaceToken failed");
+ return;
+ }
+
+ if (!data.WriteString(devId) || !data.WriteInt32(eventCode) || !data.WriteString(eventContent)) {
+ DHLOGE("Write param failed.");
+ return;
+ }
+
+ Remote()->SendRequest(DSCREEN_NOTIFY, data, reply, option);
+}
+} // namespace DistributedHardware
+} // namespace OHOS
\ No newline at end of file
diff --git a/interfaces/innerkits/native_cpp/screen_source/BUILD.gn b/interfaces/innerkits/native_cpp/screen_source/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..fec91820c36aa63208f420b31e63f6815ff8b66d
--- /dev/null
+++ b/interfaces/innerkits/native_cpp/screen_source/BUILD.gn
@@ -0,0 +1,58 @@
+# Copyright (c) 2022 Huawei Device Co., Ltd.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import("//build/ohos.gni")
+import("//build/ohos_var.gni")
+import("//foundation/distributedhardware/distributedscreen/distributedscreen.gni")
+
+ohos_shared_library("distributed_screen_source_sdk") {
+ include_dirs = [
+ "//utils/system/safwk/native/include",
+ "${fwk_common_path}/utils/include",
+ ]
+
+ include_dirs += [
+ "include",
+ "include/callback",
+ "${common_path}/include",
+ ]
+
+ sources = [
+ "src/dscreen_source_handler.cpp",
+ "src/dscreen_source_proxy.cpp",
+ "src/callback/dscreen_source_callback_stub.cpp",
+ "src/callback/dscreen_source_callback.cpp",
+ ]
+
+ deps = [
+ "//utils/native/base:utils",
+ "${common_path}:distributed_screen_utils",
+ ]
+
+ defines = [
+ "HI_LOG_ENABLE",
+ "DH_LOG_TAG=\"dscreensourcesdk\"",
+ "LOG_DOMAIN=0xD004100",
+ ]
+
+ external_deps = [
+ "hiviewdfx_hilog_native:libhilog",
+ "ipc:ipc_core",
+ "safwk:system_ability_fwk",
+ "samgr_standard:samgr_proxy",
+ ]
+
+ subsystem_name = "distributedhardware"
+
+ part_name = "distributed_screen"
+}
\ No newline at end of file
diff --git a/interfaces/innerkits/native_cpp/screen_source/include/callback/dscreen_source_callback.h b/interfaces/innerkits/native_cpp/screen_source/include/callback/dscreen_source_callback.h
new file mode 100644
index 0000000000000000000000000000000000000000..3eb89ddadf28ff3d24c1a77ce1a75658a1cf1d7c
--- /dev/null
+++ b/interfaces/innerkits/native_cpp/screen_source/include/callback/dscreen_source_callback.h
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2022 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef OHOS_DSCREEN_SOURCE_CALLBACK_H
+#define OHOS_DSCREEN_SOURCE_CALLBACK_H
+
+#include