mirror of
https://github.com/openharmony/ohos_bundles.git
synced 2026-07-01 06:41:17 -04:00
add OpenHarmony 1.0 baseline
This commit is contained in:
+202
@@ -0,0 +1,202 @@
|
||||
|
||||
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
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
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.
|
||||
@@ -0,0 +1,216 @@
|
||||
# 介绍<a name="ZH-CN_TOPIC_0000001054301947"></a>
|
||||
|
||||
## 简介<a name="section11660541593"></a>
|
||||
|
||||
**轻量级元能力框架子系统**,是OpenHarmony为开发者提供的一套开发鸿蒙应用的开发框架。轻量级元能力框架子系统由如下模块组成:
|
||||
|
||||
**图1** 轻量级元能力框架子系统框架图
|
||||
|
||||

|
||||
|
||||
Ability是应用所具备的能力的抽象,一个应用可以包含一个或多个Ability。Ability分为两种类型:FA(Feature Ability)和AA(Atomic Ability)。
|
||||
|
||||
- **FA**:由三方基于元能力框架开发的、实现单一功能的有UI界面的程序实体,用于支持与用户交互的能力。一个Page实例可以包含一组相关页面,每个页面用一个AbilitySlice实例表示。Page模板是Feature Ability唯一支持的模板。用户可以基于JavaScript语言开发FA,也可以基于C/C++语言开发FA。
|
||||
|
||||
- Page模板的Ability的生命周期流转图
|
||||
|
||||
**图2** Ability生命周期流转图
|
||||
|
||||
Page模板的Ability生命周期各状态解析
|
||||
|
||||
- **UNINITIALIZED**:未初始状态,为临时状态,Ability创建后会直接调用Init初始化,进入INITIAL状态;
|
||||
|
||||
- **INITIAL**:初始化状态,也表示停止状态,表示当前Ability未运行,调用Start后进入INACTIVE,同时回调开发者的OnSatrt生命周期回调;
|
||||
|
||||
- **INACTIVE**:未激活状态,表示当前窗口已显示但是无焦点状态,由于Window暂未支持焦点的概念,当前状态与ACTIVE一致。调用Active后进入ACTIVE,同时回调开发者的OnActive生命周期回调;调用Background后进入BACKGROUND,同时回调开发者的OnBackground生命周期回调;
|
||||
|
||||
- **ACTIVE**:前台激活状态,表示当前窗口已显示,并获取焦点。调用Inactive后进入INACTIVE;
|
||||
|
||||
- **BACKGROUND**: 后台状态,表示当前Ability退到后台。调用Active后进入ACTIVE,同时回调开发者的OnActive生命周期回调;调用Stop后进入INITIAL,同时回调开发者的OnStop生命周期回调;
|
||||
|
||||
- **AbilitySlice**
|
||||
|
||||
一个使用Page模板的Ability由AbilitySlice构成,AbilitySlice是单个页面及其控制逻辑的总和。一个Page可以包含多个AbilitySlice,此时,这些页面提供的业务能力应当是高度相关的。Page模板的Ability与AbilitySlice的关系如下图:
|
||||
|
||||
**图3 **Ability与AbilitySlice的关系图
|
||||
|
||||

|
||||
|
||||
|
||||
- **AA**:由三方基于元能力框架开发的、实现单一功能的无UI界面的支持后台任务的程序实体。AA与FA的区别是,AA无UI界面。仅对系统服务有依赖关系,AA之间不存在依赖关系 。Service模板是AA支持的模板。
|
||||
- **注册Ability**
|
||||
|
||||
Ability的模板通过在清单文件中注册时指定。如下所示,开发者可以配置Ability元素的type属性,其取值page、service分别代表Page模板、Service模板。
|
||||
|
||||
```
|
||||
"module": {
|
||||
......
|
||||
"abilities": [
|
||||
{
|
||||
"name": "default",
|
||||
"type": "pages",
|
||||
"label": "sdfasf"
|
||||
}
|
||||
], ’
|
||||
......
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
- **AbilityKit**:元能力的开发框架,运行在开发者的应用程序进程中,和AbilityMs通过IPC通信,开发者基于该框架开发自己的Ability。
|
||||
|
||||
- **AbilityMs**:元能力运行管理服务,元能力生命周期的调度统一由AbilityMs管理。
|
||||
- **AppSpawn:**进程孵化器,元能力进程由AppSpawn负责孵化并拉起。
|
||||
|
||||
## 目录<a name="section1464106163817"></a>
|
||||
|
||||
轻量级元能力框架子系统源代码目录结构如下图所示:
|
||||
|
||||
**表 1** 轻量级元能力框架子系统源代码目录结构
|
||||
|
||||
<a name="table2977131081412"></a>
|
||||
<table><thead align="left"><tr id="row7977610131417"><th class="cellrowborder" valign="top" width="36.18%" id="mcps1.2.3.1.1"><p id="p18792459121314"><a name="p18792459121314"></a><a name="p18792459121314"></a>名称</p>
|
||||
</th>
|
||||
<th class="cellrowborder" valign="top" width="63.82%" id="mcps1.2.3.1.2"><p id="p77921459191317"><a name="p77921459191317"></a><a name="p77921459191317"></a>描述</p>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><tr id="row17977171010144"><td class="cellrowborder" valign="top" width="36.18%" headers="mcps1.2.3.1.1 "><p id="p2793159171311"><a name="p2793159171311"></a><a name="p2793159171311"></a>foundation/aafwk/frameworks/ability_lite</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="63.82%" headers="mcps1.2.3.1.2 "><p id="p879375920132"><a name="p879375920132"></a><a name="p879375920132"></a>元能力框架核心代码</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row6978161091412"><td class="cellrowborder" valign="top" width="36.18%" headers="mcps1.2.3.1.1 "><p id="p0780163617556"><a name="p0780163617556"></a><a name="p0780163617556"></a>foundation/aafwk/frameworks/want_lite</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="63.82%" headers="mcps1.2.3.1.2 "><p id="p6793059171318"><a name="p6793059171318"></a><a name="p6793059171318"></a>元能力之间通信的实体</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row1897841071415"><td class="cellrowborder" valign="top" width="36.18%" headers="mcps1.2.3.1.1 "><p id="p20749155715720"><a name="p20749155715720"></a><a name="p20749155715720"></a>foundation/aafwk/interfaces/kits</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="63.82%" headers="mcps1.2.3.1.2 "><p id="p14793959161317"><a name="p14793959161317"></a><a name="p14793959161317"></a>元能力框架对外接口</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row965423512587"><td class="cellrowborder" valign="top" width="36.18%" headers="mcps1.2.3.1.1 "><p id="p12654103516589"><a name="p12654103516589"></a><a name="p12654103516589"></a>foundation/aafwk/interfaces/kits/ability_lite</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="63.82%" headers="mcps1.2.3.1.2 "><p id="p12658142611466"><a name="p12658142611466"></a><a name="p12658142611466"></a>元能力运行管理服务对外接口</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row673463115813"><td class="cellrowborder" valign="top" width="36.18%" headers="mcps1.2.3.1.1 "><p id="p127343312581"><a name="p127343312581"></a><a name="p127343312581"></a>foundation/aafwk/interfaces/kits/want_lite</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="63.82%" headers="mcps1.2.3.1.2 "><p id="p191041469363"><a name="p191041469363"></a><a name="p191041469363"></a>元能力之间通信的实体对外接口</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row164593855812"><td class="cellrowborder" valign="top" width="36.18%" headers="mcps1.2.3.1.1 "><p id="p1864523835812"><a name="p1864523835812"></a><a name="p1864523835812"></a>foundation/aafwk/services/abilitymgr_lite</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="63.82%" headers="mcps1.2.3.1.2 "><p id="p4645133805811"><a name="p4645133805811"></a><a name="p4645133805811"></a>元能力运行管理服务</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row35051315317"><td class="cellrowborder" valign="top" width="36.18%" headers="mcps1.2.3.1.1 "><p id="p991413565611"><a name="p991413565611"></a><a name="p991413565611"></a>foundation/aafwk/services/abilitymgr_lite/tools</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="63.82%" headers="mcps1.2.3.1.2 "><p id="p0793185971316"><a name="p0793185971316"></a><a name="p0793185971316"></a>元能力调测工具</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
## 约束<a name="section1718733212019"></a>
|
||||
|
||||
- 语言版本
|
||||
- C++11版本或以上
|
||||
|
||||
- 框架针对不同的芯片平台和底层OS能力,规格有所区别
|
||||
- Cortex-M RAM/ROM:
|
||||
- RAM:建议大于20K
|
||||
- ROM: \> 300K (包含ACE,UIKit及引擎等强相关子系统)
|
||||
|
||||
- Cortex-A RAM/ROM:
|
||||
- RAM:建议大于2M
|
||||
- ROM:\> 2M (包含ACE,UIKit及引擎等强相关子系统)
|
||||
|
||||
|
||||
|
||||
# 使用<a name="ZH-CN_TOPIC_0000001054621964"></a>
|
||||
|
||||
## 编译轻量级元能力框架子系统<a name="section36321223144015"></a>
|
||||
|
||||
- 添加对轻量级元能力框架子系统的编译,以hi3516dv300\_liteos\_a为例
|
||||
- 在build/lite/platform/hi3516dv300\_liteos\_a/platform.json中的subsystem\_list字段下面添加aafwk,代码如下:
|
||||
|
||||
```
|
||||
{
|
||||
"name":"aafwk",
|
||||
"project":"hmf/aafwk/services/abilitymgr_lite",
|
||||
"path":"build/lite/config/subsystem/aafwk",
|
||||
"dir":"foundation/aafwk/services/abilitymgr_lite",
|
||||
"desc":"Ability Services Manager",
|
||||
"requirement":"yes",
|
||||
"default":"yes",
|
||||
"selected":"yes"
|
||||
},
|
||||
```
|
||||
|
||||
- 在build/lite/platform/hi3516dv300\_liteos\_a/template/ipcamera.json的“template\_subsystem\_list”字段下面添加"aafwk",代码如下:
|
||||
|
||||
```
|
||||
"template_subsystem_list" : [
|
||||
......
|
||||
"distributedschedule",
|
||||
"aafwk",
|
||||
"communication",
|
||||
......
|
||||
],
|
||||
```
|
||||
|
||||
- 在build/lite/config/subsystem/aafwk/BUILD.gn中添加对用户程序框架中具体组件的编译,如下:
|
||||
|
||||
```
|
||||
import("//build/lite/config/subsystem/lite_subsystem.gni")
|
||||
|
||||
lite_subsystem("aafwk") {
|
||||
subsystem_components = [
|
||||
"//foundation/aafwk/frameworks/kits/ability_lite:aafwk_abilitykit_lite",
|
||||
"//foundation/aafwk/frameworks/kits/ability_lite:aafwk_abilityMain_lite",
|
||||
"//foundation/aafwk/services/abilitymgr_lite:aafwk_services_lite",
|
||||
"//foundation/aafwk/frameworks/kits/tools_lite:tools_lite",
|
||||
"//foundation/aafwk/frameworks/kits/ability_lite/test:aafwk_testapp_lite",
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
- 在foundation/aafwk下面添加对业务模块的编译,各个模块都有自己的BUILD.gn文件
|
||||
|
||||
- 添加完上述的配置后,执行如下命令编译整个系统:
|
||||
|
||||
```
|
||||
python build.py ipcamera -p hi3516dv300_liteos_a -b release
|
||||
```
|
||||
|
||||
运行轻量级元能力运行管理服务
|
||||
|
||||
- 轻量级元能力运行管理服务为AbilityMs,服务运行于foudation进程中。
|
||||
- AbilityMs注册到sa\_manager中,sa\_manager运行于foundation进程中,sa\_manager为AbilityMs创建线程运行环境。具体创建AbilityMs服务的方式以及使用该服务的方式,可参考[系统服务框架子系统](zh-cn_topic_0000001051589563.md)。
|
||||
- 在foundation/distributedschedule/services/safwk\_lite/BUILD.gn中添加对abilityms,如下:
|
||||
|
||||
```
|
||||
deps = [
|
||||
"//foundation/distributedschedule/services/samgr_lite/samgr_server:server",
|
||||
"//base/dfx/lite/liteos-a/source/log:hilog_a_shared",
|
||||
"//foundation/aafwk/services/abilitymgr_lite:abilityms",
|
||||
"//base/security/services/iam_lite:pms_target",
|
||||
"//foundation/distributedschedule/services/dtbschedmgr_lite:dtbschedmgr",
|
||||
]
|
||||
```
|
||||
|
||||
- 刷机后系统启动,AbilityMs会随系统启动而启动,在shell中运行如下命令,可以看到foudation进程中包含了libabilityms
|
||||
|
||||
|
||||
## 运行基于AbilityKit开发的Ability<a name="section18459401331"></a>
|
||||
|
||||
- 包安装完成后,通过如下命令,运行Demo
|
||||
|
||||
```
|
||||
./bin/aa start -p com.huawei.launcher -n MainAbility
|
||||
```
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"name": "@ohos/ability",
|
||||
"version": "1.8.0",
|
||||
"publishAs": "code-segment",
|
||||
"description": "轻量级元能力框架子系统,是OpenHarmony为开发者提供的一套开发鸿蒙应用的开发框架",
|
||||
"scripts": {
|
||||
"install": "DEST_PATH=${DEP_BUNDLE_BASE}/foundation/aafwk &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH"
|
||||
},
|
||||
"keywords": [
|
||||
"ability"
|
||||
],
|
||||
"license": "Apache V2",
|
||||
"repository": "",
|
||||
"homepage": "",
|
||||
"tags": [
|
||||
"foundation"
|
||||
],
|
||||
"ohos": {
|
||||
"os": "1.0.0",
|
||||
"kernel": "liteos-a",
|
||||
"board": "hi3516,hi3518"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,202 @@
|
||||
|
||||
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
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
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.
|
||||
@@ -0,0 +1,30 @@
|
||||
# appspawn\_README
|
||||
|
||||
# 应用孵化模块<a name="ZH-CN_TOPIC_0000001054063214"></a>
|
||||
|
||||
## 简介<a name="section469617221261"></a>
|
||||
|
||||
应用孵化模块,appspawn进程,配合轻量级元能力框架子系统,通过轻量级IPC机制接收来自AMS的消息,根据消息解析结果启动元能力进程AbilityMain并赋予其对应权限。
|
||||
|
||||
模块二进制部署在/bin/appspawn。
|
||||
|
||||
## 目录<a name="section15884114210197"></a>
|
||||
|
||||
```
|
||||
base
|
||||
├──startup 启动恢复子系统根目录
|
||||
└──── services
|
||||
├── appspawn_lite 应用孵化模块
|
||||
├── BUILD.gn 应用孵化模块编译配置
|
||||
├── include 应用孵化模块头文件目录
|
||||
├── LICENSE 开源LICENSE文件
|
||||
├── moduletest 应用孵化模块自测试代码目录
|
||||
└── src 应用孵化模块源文件目录
|
||||
```
|
||||
|
||||
## 约束<a name="section12212842173518"></a>
|
||||
|
||||
目前仅支持Hi3516DV300和Hi3518EV300版本。
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"name": "@ohos/app_verify",
|
||||
"version": "1.8.0",
|
||||
"publishAs": "code-segment",
|
||||
"description": "为了确保应用内容的完整性,HarmonyOS通过应用签名和Profile对应用的来源进行管控,设备上仅允许安装内部预置或来自华为应用市场的应用。",
|
||||
"scripts": {
|
||||
"install": "DEST_PATH=${DEP_BUNDLE_BASE}/base/security &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH"
|
||||
},
|
||||
"keywords": [
|
||||
"appverify"
|
||||
],
|
||||
"license": "Apache V2",
|
||||
"repository": "",
|
||||
"homepage": "",
|
||||
"tags": [
|
||||
"base"
|
||||
],
|
||||
"ohos": {
|
||||
"os": "1.0.0",
|
||||
"kernel": "liteos-a",
|
||||
"board": "hi3516,hi3518"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,202 @@
|
||||
|
||||
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
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
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.
|
||||
@@ -0,0 +1,30 @@
|
||||
# appspawn\_README
|
||||
|
||||
# 应用孵化模块<a name="ZH-CN_TOPIC_0000001054063214"></a>
|
||||
|
||||
## 简介<a name="section469617221261"></a>
|
||||
|
||||
应用孵化模块,appspawn进程,配合轻量级元能力框架子系统,通过轻量级IPC机制接收来自AMS的消息,根据消息解析结果启动元能力进程AbilityMain并赋予其对应权限。
|
||||
|
||||
模块二进制部署在/bin/appspawn。
|
||||
|
||||
## 目录<a name="section15884114210197"></a>
|
||||
|
||||
```
|
||||
base
|
||||
├──startup 启动恢复子系统根目录
|
||||
└──── services
|
||||
├── appspawn_lite 应用孵化模块
|
||||
├── BUILD.gn 应用孵化模块编译配置
|
||||
├── include 应用孵化模块头文件目录
|
||||
├── LICENSE 开源LICENSE文件
|
||||
├── moduletest 应用孵化模块自测试代码目录
|
||||
└── src 应用孵化模块源文件目录
|
||||
```
|
||||
|
||||
## 约束<a name="section12212842173518"></a>
|
||||
|
||||
目前仅支持Hi3516DV300和Hi3518EV300版本。
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"name": "@ohos/appspawn",
|
||||
"version": "1.8.0",
|
||||
"publishAs": "code-segment",
|
||||
"description": "应用孵化模块,appspawn进程,配合轻量级元能力框架子系统,通过轻量级IPC机制接收来自AMS的消息,根据消息解析结果启动元能力进程AbilityMain并赋予其对应权限。",
|
||||
"scripts": {
|
||||
"install": "DEST_PATH=${DEP_BUNDLE_BASE}/base/startup/services/appspawn_lite &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH"
|
||||
},
|
||||
"keywords": [
|
||||
"appspawn"
|
||||
],
|
||||
"license": "Apache V2",
|
||||
"repository": "",
|
||||
"homepage": "",
|
||||
"tags": [
|
||||
"base"
|
||||
],
|
||||
"ohos": {
|
||||
"os": "1.0.0",
|
||||
"kernel": "liteos-a",
|
||||
"board": "hi3516,hi3518"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,202 @@
|
||||
|
||||
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
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
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.
|
||||
@@ -0,0 +1,58 @@
|
||||
# AudioManager\_README
|
||||
|
||||
# 项目介绍<a name="ZH-CN_TOPIC_0000001054622017"></a>
|
||||
|
||||
## 简介<a name="section469617221261"></a>
|
||||
|
||||
音频管理模块支持对音频数据的采集和播放,即音频输入输出模块。
|
||||
|
||||
在进行应用的开发前,开发者应了解以下基本概念:
|
||||
|
||||
- 流媒体技术
|
||||
|
||||
流媒体技术是把连续的影像和声音信息进行编码处理后放在网络服务器上,让浏览者一边下载、一边观看与收听,而不需要等整个多媒体文件下载完成就可以即时观看、收听的技术。
|
||||
|
||||
|
||||
- 视频帧率
|
||||
|
||||
帧率是用于测量显示帧数的度量,帧数就是在每秒钟时间里传输的图片数量。每秒钟帧数 \(FPS\) 越多,所显示的画面就会越流畅。
|
||||
|
||||
- 码率
|
||||
|
||||
码率就是数据传输时单位时间传送的数据位数,常用单位是kbps即千位每秒。
|
||||
|
||||
- 采样率
|
||||
|
||||
采样率为每秒从连续信号中提取并组成离散信号的采样个数,单位用赫兹(Hz)来表示。
|
||||
|
||||
|
||||
## 目录<a name="section1464106163817"></a>
|
||||
|
||||
音频管理模块源代码目录结构如下图所示:
|
||||
|
||||
**表 1** 音频模块源代码目录结构
|
||||
|
||||
<a name="table2977131081412"></a>
|
||||
<table><thead align="left"><tr id="row7977610131417"><th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.1"><p id="p18792459121314"><a name="p18792459121314"></a><a name="p18792459121314"></a>名称</p>
|
||||
</th>
|
||||
<th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.2"><p id="p77921459191317"><a name="p77921459191317"></a><a name="p77921459191317"></a>描述</p>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><tr id="row17977171010144"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p2793159171311"><a name="p2793159171311"></a><a name="p2793159171311"></a>foundation/multimedia/frameworks/audio_lite</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p879375920132"><a name="p879375920132"></a><a name="p879375920132"></a>音频模块实现</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row6978161091412"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p992717142910"><a name="p992717142910"></a><a name="p992717142910"></a>foundation/multimedia/interfaces/kits/audio_lit</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p6793059171318"><a name="p6793059171318"></a><a name="p6793059171318"></a>音频模块对外头文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
# 使用说明<a name="ZH-CN_TOPIC_0000001054063379"></a>
|
||||
|
||||
请参考player和recorder模块readme。
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"name": "@ohos/audio_manager",
|
||||
"version": "1.8.0",
|
||||
"publishAs": "code-segment",
|
||||
"description": "音频管理模块支持对音频数据的采集和播放,即音频输入输出模块。",
|
||||
"scripts": {
|
||||
"install": "DEST_PATH=${DEP_BUNDLE_BASE}/foundation/multimedia &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH"
|
||||
},
|
||||
"keywords": [
|
||||
"audio"
|
||||
],
|
||||
"license": "Apache V2",
|
||||
"repository": "",
|
||||
"homepage": "",
|
||||
"tags": [
|
||||
"foundation"
|
||||
],
|
||||
"ohos": {
|
||||
"os": "1.0.0",
|
||||
"kernel": "liteos-a",
|
||||
"board": "hi3516,hi3518"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,202 @@
|
||||
|
||||
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
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
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.
|
||||
@@ -0,0 +1,42 @@
|
||||
# bootstrap\_readme
|
||||
|
||||
# 项目介绍<a name="ZH-CN_TOPIC_0000001054692064"></a>
|
||||
|
||||
## 简介<a name="section469617221261"></a>
|
||||
|
||||
bootstrap启动服务模块:
|
||||
|
||||
支持使用LiteOS-M内核的平台,当前包括:Hi3861平台。
|
||||
|
||||
提供了各服务和功能的启动入口标识。在SAMGR启动时,会调用boostrap标识的入口函数,并启动系统服务。
|
||||
|
||||
## 目录<a name="section1464106163817"></a>
|
||||
|
||||
**表 1** bootstrap启动服务模块目录结构
|
||||
|
||||
<a name="table2977131081412"></a>
|
||||
<table><thead align="left"><tr id="row7977610131417"><th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.1"><p id="p18792459121314"><a name="p18792459121314"></a><a name="p18792459121314"></a>名称</p>
|
||||
</th>
|
||||
<th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.2"><p id="p77921459191317"><a name="p77921459191317"></a><a name="p77921459191317"></a>描述</p>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><tr id="row17977171010144"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p1823814275563"><a name="p1823814275563"></a><a name="p1823814275563"></a>base/startup/services/bootstrap_lite</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p15238152713562"><a name="p15238152713562"></a><a name="p15238152713562"></a>服务启动模块,启动系统核心服务外的其他服务。</p>
|
||||
<p id="p101610019353"><a name="p101610019353"></a><a name="p101610019353"></a>Hi3861</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
## 使用<a name="section1483211215513"></a>
|
||||
|
||||
bootstrap模块无需单独配置,在SAMGR启动时会自动调用,用于启动系统服务。
|
||||
|
||||
## 涉及仓<a name="section134824191082"></a>
|
||||
|
||||
startup\_services\_bootstrap\_lite
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"name": "@ohos/bootstrap",
|
||||
"version": "1.8.0",
|
||||
"publishAs": "code-segment",
|
||||
"description": "bootstrap启动服务模块:-支持使用LiteOS-M内核的平台,当前包括:Hi3861平台。提供了各服务和功能的启动入口标识。在SAMGR启动时,会调用boostrap标识的入口函数,并启动系统服务。",
|
||||
"scripts": {
|
||||
"install": "DEST_PATH=${DEP_BUNDLE_BASE}/base/startup/services/bootstrap_lite &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH"
|
||||
},
|
||||
"keywords": [
|
||||
"bootstrap"
|
||||
],
|
||||
"license": "Apache V2",
|
||||
"repository": "",
|
||||
"homepage": "",
|
||||
"tags": [
|
||||
"base"
|
||||
],
|
||||
"ohos": {
|
||||
"os": "1.0.0",
|
||||
"kernel": "liteos-m",
|
||||
"board": "hi3861"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,202 @@
|
||||
|
||||
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
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
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.
|
||||
@@ -0,0 +1,9 @@
|
||||
# bounds_checking_function
|
||||
|
||||
#### Description
|
||||
|
||||
- following the standard of C11 Annex K (bound-checking interfaces), functions of the common memory/string operation classes, such as memcpy_s, strcpy_s, are selected and implemented.
|
||||
|
||||
- other standard functions in C11 Annex K will be analyzed in the future and implemented in this organization if necessary.
|
||||
|
||||
- handles the release, update, and maintenance of bounds_checking_function.
|
||||
@@ -0,0 +1,6 @@
|
||||
# bounds_checking_function
|
||||
|
||||
#### 介绍
|
||||
- 遵循C11 Annex K (Bounds-checking interfaces)的标准,选取并实现了常见的内存/字符串操作类的函数,如memcpy_s、strcpy_s等函数。
|
||||
- 未来将分析C11 Annex K中的其他标准函数,如果有必要,将在该组织中实现。
|
||||
- 处理边界检查函数的版本发布、更新以及维护。
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"name": "@ohos/bounds_checking_function",
|
||||
"version": "1.8.0",
|
||||
"publishAs": "code-segment",
|
||||
"scripts": {
|
||||
"install": "DEST_PATH=${DEP_BUNDLE_BASE}/third_party/bounds_checking_function &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH"
|
||||
},
|
||||
"description": "following the standard of C11 Annex K (bound-checking interfaces), functions of the common memory/string operation classes, such as memcpy_s, strcpy_s, are selected and implemented",
|
||||
"keywords": [
|
||||
"thirdparty"
|
||||
],
|
||||
"license": "Apache V2",
|
||||
"repository": "https://gitee.com/openeuler/bounds_checking_function",
|
||||
"homepage": "https://gitee.com/openeuler/bounds_checking_function",
|
||||
"tags": [
|
||||
"third_party"
|
||||
],
|
||||
"ohos": {
|
||||
"os": "1.0.0",
|
||||
"kernel": "",
|
||||
"board": ""
|
||||
}
|
||||
}
|
||||
+202
@@ -0,0 +1,202 @@
|
||||
|
||||
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
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
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.
|
||||
+281
@@ -0,0 +1,281 @@
|
||||
# 编译构建子系统README
|
||||
|
||||
# 编译构建子系统<a name="ZH-CN_TOPIC_0000001052340730"></a>
|
||||
|
||||
## 简介<a name="section11660541593"></a>
|
||||
|
||||
编译构建提供了一个在GN与ninja基础上的编译构建框架。支持以下功能:
|
||||
|
||||
1. 构建不同芯片平台的产品。如:Hi3518EV300平台的ipcamera产品,Hi3516DV300平台的ipcamera产品,Hi3861平台的wifi模组产品。
|
||||
2. 构建HPM包管理配置生成的自定义产品。
|
||||
|
||||
## 目录<a name="section1464106163817"></a>
|
||||
|
||||
```
|
||||
build/lite # 编译构建主目录
|
||||
├── config # 编译相关的配置项
|
||||
│ ├── boards # 开发板相关的变量定义。包括:开发板名、目标架构、目标CPU等
|
||||
│ ├── component # OpenHarmony组件相关的模板定义。包括:静态库、动态库、扩展组件、模拟器库等
|
||||
│ ├── kernel # OpenHarmony内核的编译变量定义与配置参数
|
||||
│ └── subsystem # OpenHarmony子系统列表
|
||||
├── ndk # NDK相关编译脚本与配置参数
|
||||
├── platform # 平台相关的配置文件
|
||||
│ ├── hi3516dv300_liteos_a # hi3516dv300, liteos_a平台。包括:平台配置参数、平台已有产品模板等。
|
||||
│ ├── hi3518ev300_liteos_a # hi3518ev300, liteos_a平台。包括:平台配置参数、平台已有产品模板等。
|
||||
│ └── hi3861v100_liteos_riscv # hi3861v100, liteos_riscv平台。包括:平台配置参数、平台已有产品模板等。
|
||||
├── product # 产品全量配置表。包括:配置单元、子系统列表、编译器等。
|
||||
├── toolchain # 编译工具链相关。包括:编译器路径、编译选项、链接选项等。
|
||||
└── tools # 编译构建依赖的工具。包括:mkfs等。
|
||||
```
|
||||
|
||||
## 约束<a name="section1718733212019"></a>
|
||||
|
||||
编译构建框架开发者需预装GN和ninja构建工具,且加入环境变量。
|
||||
|
||||
## 使用<a name="section641210360552"></a>
|
||||
|
||||
- 编译已有产品
|
||||
|
||||
```
|
||||
# 编译WIFI-IOT平台
|
||||
python build.py wifiiot
|
||||
|
||||
# 编译基于Hi3518ev300的ipcamera:
|
||||
python build.py ipcamera_hi3518ev300
|
||||
|
||||
# 编译基于Hi3516dv300的ipcamera:
|
||||
python build.py ipcamera_hi3516dv300
|
||||
```
|
||||
|
||||
- 编译组件
|
||||
|
||||
本节以添加一个自定义的组件为例,描述了如何编译组件、编译库、编译可执行文件。
|
||||
|
||||
示例组件example由两个功能feature1和feature2组成。feture1为一个动态库,feature2为一个可执行文件。
|
||||
|
||||
示例组件example的完整目录结构如下:
|
||||
|
||||
```
|
||||
example # 自定义组件
|
||||
├── BUILD.gn # 自定义组件gn脚本,BUILD.gn为固定名称
|
||||
├── feature1 # 自定义单元1
|
||||
│ ├── BUILD.gn # 自定义单元1的gn脚本,BUILD.gn为固定名称
|
||||
│ ├── include # 头文件文件夹
|
||||
│ │ └── helloworld1.h # 头文件1
|
||||
│ └── src # 源文件文件夹
|
||||
│ └── helloworld1.c # 源文件1
|
||||
├── feature2 # 自定义单元2
|
||||
│ ├── BUILD.gn # 自定义单元2的gn脚本,BUILD.gn为固定名称
|
||||
│ ├── include # 头文件文件夹
|
||||
│ │ └── helloworld2.h # 头文件2
|
||||
│ └── src # 源文件文件夹
|
||||
│ └── helloworld2.c # 源文件2
|
||||
├── build.sh # 自定义组件build.sh脚本,非必要
|
||||
└── Makefile # 自定义组件Makefile脚本,非必
|
||||
```
|
||||
|
||||
- 第一步:编写example/feature1/BUILD.gn,动态库的gn脚本
|
||||
|
||||
使用lite\_library模板,可以编译出动态库与静态库。示例如下:
|
||||
|
||||
```
|
||||
# helloworld动态库编译示例
|
||||
# helloworld的Build.gn文件
|
||||
lite_library("helloworld_lib") {
|
||||
target_type = "shared_library" # 编译动态库
|
||||
#target_type = "static_library" # 编译静态库
|
||||
sources = [
|
||||
"src/helloworld1.c"
|
||||
]
|
||||
include_dirs = [
|
||||
"include",
|
||||
"../feature2_example/include" # 如果依赖 feature2_example 可以加入该include
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
- 第二步:编写example/feature2/BUILD.gn,可执行文件的gn脚本
|
||||
|
||||
使用gn自带模板executable,可编译出可执行文件。示例如下:
|
||||
|
||||
```
|
||||
#编译可执行.bin文件
|
||||
executable("hello_world_bin") {
|
||||
sources = [
|
||||
"src/helloworld.c"
|
||||
]
|
||||
include_dirs = [
|
||||
"include",
|
||||
#"../feature2_example/include" # 如果依赖 feature2_example 可以加入该include
|
||||
]
|
||||
# 如果依赖 feature1_example 可以加入该deps
|
||||
#deps = [
|
||||
# "../feature1_example:helloworld1"
|
||||
#]
|
||||
}
|
||||
```
|
||||
|
||||
- 第三步:编写example/BUILD.gn,组件gn脚本
|
||||
|
||||
```
|
||||
import("//build/lite/config/component/lite_component.gni")
|
||||
|
||||
#工程全篇使用BUILD.gn脚本编译
|
||||
lite_component("example_gn") {
|
||||
features = [
|
||||
"feature_example1:helloworld_lib",
|
||||
"feature_example2:hello_world_bin",
|
||||
]
|
||||
}
|
||||
|
||||
#融入自带build.sh或Makefile工程, 用gn脚本调用混合编译
|
||||
build_ext_component("example_mk") {
|
||||
exec_path = rebase_path(rebase_path(".", root_build_dir))
|
||||
outdir = rebase_path(get_path_info(".", "out_dir"))
|
||||
prebuilts = "sh build.sh"
|
||||
command = "make clean && make"
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
- 可用的编译构建变量
|
||||
|
||||
全局可引用的变量定义在://build/lite/ohos\_var.gni
|
||||
|
||||
用户常用变量说明见表1:
|
||||
|
||||
**表 1**
|
||||
|
||||
<a name="table3296103714372"></a>
|
||||
<table><thead align="left"><tr id="row529623712377"><th class="cellrowborder" valign="top" width="16.89%" id="mcps1.2.4.1.1"><p id="p1629723723717"><a name="p1629723723717"></a><a name="p1629723723717"></a>变量</p>
|
||||
</th>
|
||||
<th class="cellrowborder" valign="top" width="32.98%" id="mcps1.2.4.1.2"><p id="p13297137163720"><a name="p13297137163720"></a><a name="p13297137163720"></a>取值范围</p>
|
||||
</th>
|
||||
<th class="cellrowborder" valign="top" width="50.129999999999995%" id="mcps1.2.4.1.3"><p id="p1423425618374"><a name="p1423425618374"></a><a name="p1423425618374"></a>说明</p>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><tr id="row14297437193710"><td class="cellrowborder" valign="top" width="16.89%" headers="mcps1.2.4.1.1 "><p id="p62978371374"><a name="p62978371374"></a><a name="p62978371374"></a>ohos_kernel_type</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="32.98%" headers="mcps1.2.4.1.2 "><p id="p1229716378376"><a name="p1229716378376"></a><a name="p1229716378376"></a>"liteos_a", "liteos_riscv"</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50.129999999999995%" headers="mcps1.2.4.1.3 "><p id="p17234105673718"><a name="p17234105673718"></a><a name="p17234105673718"></a>内核类型</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row8722028184617"><td class="cellrowborder" valign="top" width="16.89%" headers="mcps1.2.4.1.1 "><p id="p773182820463"><a name="p773182820463"></a><a name="p773182820463"></a>board_name</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="32.98%" headers="mcps1.2.4.1.2 "><p id="p20731128124612"><a name="p20731128124612"></a><a name="p20731128124612"></a>"hi3516dv300", "hi3518ev300", "hi3861v100"</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50.129999999999995%" headers="mcps1.2.4.1.3 "><p id="p2737281461"><a name="p2737281461"></a><a name="p2737281461"></a>开发板类型</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row1813718203473"><td class="cellrowborder" valign="top" width="16.89%" headers="mcps1.2.4.1.1 "><p id="p1813715200473"><a name="p1813715200473"></a><a name="p1813715200473"></a>ohos_build_compiler</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="32.98%" headers="mcps1.2.4.1.2 "><p id="p1913713206476"><a name="p1913713206476"></a><a name="p1913713206476"></a>"gcc", "clang"</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50.129999999999995%" headers="mcps1.2.4.1.3 "><p id="p013732013476"><a name="p013732013476"></a><a name="p013732013476"></a>编译工具链类型</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
举例:ohos\_kernel\_type的使用,component\_example/feature2\_example/BUILD.gn
|
||||
|
||||
```
|
||||
lite_library("helloworld") {
|
||||
if (ohos_kernel_type == "liteos_a") {
|
||||
target_type = "shared_library"
|
||||
}
|
||||
else if (ohos_kernel_type == "liteos_riscv") {
|
||||
target_type = "static_library"
|
||||
}
|
||||
sources = [
|
||||
"src/helloworld1.c"
|
||||
]
|
||||
include_dirs = [
|
||||
"include"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
- 编译HPM的解决方案
|
||||
|
||||
通过HPM下载后,用户自定的全量模板在//build/lite/product 目录下。
|
||||
|
||||
如ipcamera\_hi3516dv300.json,构建时会读取该文件包含所有用户自定义子系统、组件等配置。
|
||||
|
||||
- 编译输出
|
||||
|
||||
编译所生产的文件都归档在out目录下
|
||||
|
||||
例在代码所在目录下,运行"python build.py wifiiot",编译wifiiot完成后,会有如下结果生成:
|
||||
|
||||
```
|
||||
out/
|
||||
└── wifiiot # 产品名
|
||||
├── args.gn # gn编译,用户自定义变量
|
||||
├── build.log # 编译日志
|
||||
├── build.ninja
|
||||
├── build.ninja.d
|
||||
├── gen
|
||||
├── Hi3861_boot_signed_B.bin # 带签名的bootloader备份文件
|
||||
├── Hi3861_boot_signed.bin # 带签名的bootloader文件
|
||||
├── Hi3861_loader_signed.bin # 烧写工具使用的加载文件,烧写程序建议使 用 “Hi3861_demo_allinone.bin
|
||||
├── Hi3861_wifiiot_app_allinone.bin # 产线工装烧写文件(已经包含独立烧写程序 和loader程序)
|
||||
├── Hi3861_wifiiot_app.asm # Kernel asm文件
|
||||
├── Hi3861_wifiiot_app_burn.bin # 烧写文件,烧写程序建议使用 “Hi3861_wifiiot_app_allinone.bin”
|
||||
├── Hi3861_wifiiot_app_flash_boot_ota.bin # Flash Boot升级文件
|
||||
├── Hi3861_wifiiot_app.map # Kernel map文件
|
||||
├── Hi3861_wifiiot_app_ota.bin # Kernel 升级文件
|
||||
├── Hi3861_wifiiot_app.out # Kernel 输出文件
|
||||
├── Hi3861_wifiiot_app_vercfg.bin # 安全启动开启的时候,配置boot和kernel版本号,防版本回滚
|
||||
├── libs # 库文件夹
|
||||
├── NOTICE_FILE
|
||||
├── obj
|
||||
├── suites
|
||||
└── toolchain.ninja
|
||||
```
|
||||
|
||||
运行"python build.py ipcamera\_hi3518ev300",编译ipcamera\_hi3518ev300完成后,会有如下结果生成(同ipcamera\_hi3516dv300):
|
||||
|
||||
```
|
||||
out/
|
||||
└── ipcamera_hi3518ev300 # 产品名
|
||||
├── args.gn # gn编译,用户自定义变量
|
||||
├── bin # 链接bin所在文件夹
|
||||
├── bm_tool.map # map文件
|
||||
├── build.log # 编译日志
|
||||
├── build.ninja
|
||||
├── build.ninja.d
|
||||
├── bundle_daemon_tool.map # map文件
|
||||
├── data
|
||||
├── dev_tools
|
||||
├── foundation.map # map文件
|
||||
├── gen
|
||||
├── libaudio_api.so
|
||||
├── libs
|
||||
├── liteos.bin # liteos基础内核bin文件
|
||||
├── media_server.map # map文件
|
||||
├── NOTICE_FILE
|
||||
├── obj # 二进制文件,编译结果文件夹
|
||||
├── OHOS_Image # liteos整包bin文件,未strip
|
||||
├── OHOS_Image.asm # 汇编代码
|
||||
├── OHOS_Image.bin # liteos整包烧录bin文件
|
||||
├── OHOS_Image.map # map文件
|
||||
├── rootfs.img # 编译出的库和app的镜像
|
||||
├── rootfs.tar # rootfs的压缩
|
||||
├── suites # xts编译结果
|
||||
├── test # 测试用例编译结果
|
||||
├── toolchain.ninja
|
||||
├── userfs # 用户可读写的分区
|
||||
├── userfs.img # img格式的用户可读写的分区,对应启动之后的/storage目录
|
||||
└── vendor # 芯片的Firmware文件及配置文件
|
||||
```
|
||||
|
||||
## 涉及仓<a name="section6299103515474"></a>
|
||||
|
||||
build\_lite
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"name": "@ohos/build",
|
||||
"version": "1.8.0",
|
||||
"publishAs": "code-segment",
|
||||
"description": "编译构建提供了一个在GN与ninja基础上的编译构建框架。支持以下功能:-构建不同芯片平台的产品。如:Hi3518EV300平台的ipcamera产品,Hi3516DV300平台的ipcamera产品,Hi3861平台的wifi模组产品。构建HPM包管理配置生成的自定义产品。",
|
||||
"scripts": {
|
||||
"install": "DEST_PATH=${DEP_BUNDLE_BASE}/build &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH"
|
||||
},
|
||||
"keywords": [
|
||||
"build"
|
||||
],
|
||||
"license": "Apache V2",
|
||||
"repository": "",
|
||||
"homepage": "",
|
||||
"tags": [
|
||||
"build"
|
||||
],
|
||||
"ohos": {
|
||||
"os": "1.0.0",
|
||||
"kernel": "liteos-a,liteos-m",
|
||||
"board": "hi3516,hi3518,hi3861"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,202 @@
|
||||
|
||||
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
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
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.
|
||||
@@ -0,0 +1,207 @@
|
||||
# bundlemgr\_README
|
||||
|
||||
# 项目介绍<a name="ZH-CN_TOPIC_0000001054501975"></a>
|
||||
|
||||
## 简介<a name="section469617221261"></a>
|
||||
|
||||
**轻量级包管理框架子系统**,是鸿蒙系统为开发者提供的安装包管理框架。轻量级包管理框架子系统的由如下模块组成:
|
||||
|
||||

|
||||
|
||||
**图1** 轻量级包管理框架子系统框架图
|
||||
|
||||
- **包扫描器**:用来解析本地预制或者安装的安装包,提取里面的各种信息,供管理子模块进行管理,持久化
|
||||
|
||||
- **包安装子模块**:安装,卸载,升级一个包;Installed一个单独进程的用于创建删除安装目录,具有较高的权限。
|
||||
|
||||
- **包管理子模块**:管理安装包相关的信息
|
||||
|
||||
- **安全子模块**:签名检查、权限授予、权限管理
|
||||
|
||||
## 目录<a name="section1464106163817"></a>
|
||||
|
||||
轻量级包管理框架子系统源代码目录结构如下图所示:
|
||||
|
||||
**表 1** 轻量级包管理框架子系统代码目录结构
|
||||
|
||||
<a name="table2977131081412"></a>
|
||||
<table><thead align="left"><tr id="row7977610131417"><th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.1"><p id="p18792459121314"><a name="p18792459121314"></a><a name="p18792459121314"></a>名称</p>
|
||||
</th>
|
||||
<th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.2"><p id="p77921459191317"><a name="p77921459191317"></a><a name="p77921459191317"></a>描述</p>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><tr id="row1897841071415"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p10698114117583"><a name="p10698114117583"></a><a name="p10698114117583"></a>foundation/appexecfwk/frameworks/bundle_lite</p>
|
||||
<p id="p86931748213"><a name="p86931748213"></a><a name="p86931748213"></a>foundation/appexecfwk/interfaces/innerkits/bundlemgr_lite</p>
|
||||
<p id="p11839171152117"><a name="p11839171152117"></a><a name="p11839171152117"></a>foundation/appexecfwk/interfaces/kits/bundle_lite</p>
|
||||
<p id="p14119113219"><a name="p14119113219"></a><a name="p14119113219"></a>foundation/appexecfwk/services/bundlemgr_lite</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p1169814112585"><a name="p1169814112585"></a><a name="p1169814112585"></a>用户程序运行的包信息、元能力信息、异步事件处理等基本接口</p>
|
||||
<p id="p12693148215"><a name="p12693148215"></a><a name="p12693148215"></a>用户程序包管理服务对外接口</p>
|
||||
<p id="p158391810217"><a name="p158391810217"></a><a name="p158391810217"></a>用户程序运行的包信息、元能力信息、异步事件处理机制的实现逻辑</p>
|
||||
<p id="p64110114210"><a name="p64110114210"></a><a name="p64110114210"></a>用户程序包管理服务实现逻辑</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
# 资源文档<a name="ZH-CN_TOPIC_0000001054621947"></a>
|
||||
|
||||
## 开发指南<a name="section11441957184310"></a>
|
||||
|
||||
编译轻量级包管理框架子系统
|
||||
|
||||
- 添加对轻量级包管理框架子系统的编译,以hi3516dv300\_liteos\_a为例
|
||||
- 在build/lite/platform/hi3516dv300\_liteos\_a/platform.json中的subsystem\_list字段下面添加appexecfwk,代码如下:
|
||||
|
||||
```
|
||||
{
|
||||
"name":"appexecfwk",
|
||||
"project": "hmf/appexecfwk/services/bundlemgr_lite",
|
||||
"path": "build/lite/config/subsystem/appexecfwk",
|
||||
"dir": "foundation/appexecfwk/services/bundlemgr_lite",
|
||||
"desc":"Bundle Services Manager",
|
||||
"requirement":"yes",
|
||||
"default":"yes",
|
||||
"selected":"yes"
|
||||
},
|
||||
```
|
||||
|
||||
- 在build/lite/platform/hi3516dv300\_liteos\_a/template/ipcamera.json的“template\_subsystem\_list”字段下面添加"appexecfwk"和"aafwk",代码如下:
|
||||
|
||||
```
|
||||
"template_subsystem_list" : [
|
||||
......
|
||||
"distributedschedule",
|
||||
"appexecfwk",
|
||||
"communication",
|
||||
......
|
||||
],
|
||||
```
|
||||
|
||||
- 在build/lite/config/subsystem/aafwk/BUILD.gn和/build/lite/config/subsystem/appexecfwk/BUILD.gn中添加对用户程序框架中具体组件的编译,如下:
|
||||
|
||||
```
|
||||
import("//build/lite/config/subsystem/lite_subsystem.gni")
|
||||
|
||||
lite_subsystem("appexecfwk") {
|
||||
subsystem_components = [
|
||||
"//foundation/appexecfwk/kits/appkit_lite:appexecfwk_kit_lite",
|
||||
"//foundation/appexecfwk/services/bundlemgr_lite:appexecfwk_services_lite",
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
- 在foundation/aafwk和foundation/appexecfwk下面添加对业务模块的编译,各个模块都有自己的BUILD.gn文件
|
||||
|
||||
- 添加完上述的配置后,执行如下命令编译整个系统:
|
||||
|
||||
```
|
||||
python build.py ipcamera -p hi3516dv300_liteos_a -b release
|
||||
```
|
||||
|
||||
运行轻量级包管理服务
|
||||
|
||||
- 轻量级包管理服务为BundleMs,服务运行于foudation进程中。
|
||||
- BundleMs注册到sa\_manager中,sa\_manager运行于foundation进程中,sa\_manager为BundleMs创建线程运行环境。具体创建BundleMs服务的方式以及使用该服务的方式,可参考[系统服务框架子系统](zh-cn_topic_0000001051589563.md)。
|
||||
- 在foundation/distributedschedule/services/safwk\_lite/BUILD.gn中添加对bundlems,如下:
|
||||
|
||||
```
|
||||
deps = [
|
||||
"//foundation/distributedschedule/services/samgr_lite/samgr_server:server",
|
||||
"//base/dfx/lite/liteos-a/source/log:hilog_a_shared",
|
||||
"//foundation/appexecfwk/services/bundlemgr_lite:bundlems",
|
||||
"//base/security/services/iam_lite:pms_target",
|
||||
"//foundation/distributedschedule/services/dtbschedmgr_lite:dtbschedmgr",
|
||||
]
|
||||
```
|
||||
|
||||
- 刷机后系统启动,BundleMs会随系统启动而启动,在shell中运行如下命令,可以看到foudation进程中包含了libbundlems
|
||||
|
||||
## 运行基于AbilityKit开发的Ability<a name="section1012532233211"></a>
|
||||
|
||||
- 基于AbilityKit开发的Ability的Demo代码位于foundation/aafwk/frameworks/kits/ability\_lite/test路径下,如有需要修改其中的功能,可在unittest的文件中修改代码或增加代码文件,并在BUILD.gn中做相应的修改。
|
||||
- 编译该Demo,在shell中执行如下命令,编译成功后,在out/ipcamera\_hi3516dv300\_liteos\_a下面生成libLauncher.so文件:
|
||||
|
||||
```
|
||||
python build.py ipcamera -p hi3516dv300_liteos_a -T //foundation/aafwk/frameworks/kits/ability_lite/test:Launcher
|
||||
```
|
||||
|
||||
- 编写config.json,内容如下:
|
||||
|
||||
```
|
||||
{
|
||||
"app": {
|
||||
"bundleName": "com.huawei.launcher",
|
||||
"vendor": "huawei",
|
||||
"version": {
|
||||
"code": 1,
|
||||
"name": "1.0"
|
||||
}
|
||||
},
|
||||
"deviceConfig": {
|
||||
"default": {
|
||||
"reqSdk": {
|
||||
"compatible": "zsdk 1.0.0",
|
||||
"target": "zsdk 1.0.1"
|
||||
},
|
||||
"keepAlive": false
|
||||
},
|
||||
},
|
||||
"module": {
|
||||
"deviceType": [
|
||||
"smartCamera"
|
||||
],
|
||||
"distro": {
|
||||
"deliveryWithInstall": true,
|
||||
"moduleName": "Launcher",
|
||||
"moduleType": "entry"
|
||||
},
|
||||
"abilities": [{
|
||||
"name": "MainAbility",
|
||||
"icon": "res/drawable/phone.png",
|
||||
"label": "test app 1",
|
||||
"launchType": "standard",
|
||||
"type": "page",
|
||||
"visible": true
|
||||
},
|
||||
{
|
||||
"name": "SecondAbility",
|
||||
"icon": "res/drawable/phone.png",
|
||||
"label": "test app 2",
|
||||
"launchType": "standard",
|
||||
"type": "page",
|
||||
"visible": true
|
||||
},
|
||||
{
|
||||
"name": "ServiceAbility",
|
||||
"icon": "res/drawable/phone.png",
|
||||
"label": "test app 2",
|
||||
"launchType": "standard",
|
||||
"type": "service",
|
||||
"visible": true
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
- 生成hap包
|
||||
- 按照如下目录结构存放文件,res/drawable下面放置资源文件:
|
||||
|
||||

|
||||
|
||||
- 将上述文件打包生成zip包,修改后缀为.hap,例如Launcher.hap
|
||||
|
||||
- 安装hap包
|
||||
|
||||
- 将上述hap包放置到指定目录下面
|
||||
- 执行安装命令,安装hap包:
|
||||
|
||||
```
|
||||
./bin/bm install -p /nfs/hap/Launcher.hap
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"name": "@ohos/bundle_mgr",
|
||||
"version": "1.8.0",
|
||||
"publishAs": "code-segment",
|
||||
"description": "轻量级包管理框架子系统,是鸿蒙系统为开发者提供的安装包管理框架",
|
||||
"scripts": {
|
||||
"install": "DEST_PATH=${DEP_BUNDLE_BASE}/foundation/appexecfwk &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH"
|
||||
},
|
||||
"keywords": [
|
||||
"mgr"
|
||||
],
|
||||
"license": "Apache V2",
|
||||
"repository": "",
|
||||
"homepage": "",
|
||||
"tags": [
|
||||
"foundation"
|
||||
],
|
||||
"ohos": {
|
||||
"os": "1.0.0",
|
||||
"kernel": "liteos-a",
|
||||
"board": "hi3516,hi3518"
|
||||
}
|
||||
}
|
||||
+202
@@ -0,0 +1,202 @@
|
||||
|
||||
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
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
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.
|
||||
@@ -0,0 +1,638 @@
|
||||
# Camera\_README
|
||||
|
||||
# 介绍<a name="ZH-CN_TOPIC_0000001054063377"></a>
|
||||
|
||||
## 基本概念<a name="section175012297491"></a>
|
||||
|
||||
相机是HarmonyOS多媒体进程提供的服务之一,提供了相机的录像、预览、拍照功能,支持多用户并发取流。
|
||||
|
||||
在进行应用的开发前,开发者应了解以下基本概念:
|
||||
|
||||
- 视频帧
|
||||
|
||||
视频流指的是将一系列图片数据按照固定时间间隔排列形成的数据流,每一张图片数据成为一帧,这样的一帧称为视频帧。
|
||||
|
||||
- 帧速率\(FPS: Frames Per Second\)
|
||||
|
||||
视频播放每秒钟刷新图片的速度,或是视频每秒的帧数,帧速率越高,视频的观感越流畅。
|
||||
|
||||
- 分辨率
|
||||
|
||||
每一帧的图片信息都是由像素点组成的,分辨率描述了一张图片中像素点的个数。例如1920\*1080\(1080P\),是指图片宽1920像素,高1080像素。
|
||||
|
||||
|
||||
## 运作机制<a name="section193961322175011"></a>
|
||||
|
||||
- 多媒体服务进程
|
||||
|
||||
多媒体服务作为系统服务,在系统启动时由Init进程拉起,并初始化和分配媒体硬件资源(内存/显示硬件/图像传感器/编解码器等)。初始化过程解析配置文件,确定了多媒体各个服务的能力和资源上限,通常由OEM厂商通过配置文件进行配置。相机服务在多媒体进程初始化时有以下配置项:
|
||||
|
||||
- 内存池:所有媒体服务依赖于内存池中的内存轮转运行
|
||||
- 图像传感器:包括了传感器类型、分辨率、ISP等
|
||||
- 图像处理器:分辨率、码率、图像翻转等
|
||||
- 图像编码器:编码格式、码率、分辨率等
|
||||
|
||||
|
||||
- 关键类的解释
|
||||
|
||||
应用通过持有下面4个类,配置和使用Camera的功能,包括了Camera类和它的三个异步回调类,三类回调分别对应了不同类型的异步处理场景,详见[表1](#table486418149411)。
|
||||
|
||||
**表 1** 关键类的解释
|
||||
|
||||
<a name="table486418149411"></a>
|
||||
<table><thead align="left"><tr id="row19864414104115"><th class="cellrowborder" valign="top" width="22.322232223222326%" id="mcps1.2.4.1.1"><p id="p128641914114112"><a name="p128641914114112"></a><a name="p128641914114112"></a>对象</p>
|
||||
</th>
|
||||
<th class="cellrowborder" valign="top" width="44.34443444344435%" id="mcps1.2.4.1.2"><p id="p1386471410411"><a name="p1386471410411"></a><a name="p1386471410411"></a>用途</p>
|
||||
</th>
|
||||
<th class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.2.4.1.3"><p id="p1486541484116"><a name="p1486541484116"></a><a name="p1486541484116"></a>举例</p>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><tr id="row138651914104113"><td class="cellrowborder" valign="top" width="22.322232223222326%" headers="mcps1.2.4.1.1 "><p id="p1886515147416"><a name="p1886515147416"></a><a name="p1886515147416"></a>Camera</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="44.34443444344435%" headers="mcps1.2.4.1.2 "><p id="p48653148414"><a name="p48653148414"></a><a name="p48653148414"></a>对相机进行静态配置(通过配置类),触发相机基本功能</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.3 "><p id="p986510145416"><a name="p986510145416"></a><a name="p986510145416"></a>拍照/录像/预览</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row98656144413"><td class="cellrowborder" valign="top" width="22.322232223222326%" headers="mcps1.2.4.1.1 "><p id="p13865161412412"><a name="p13865161412412"></a><a name="p13865161412412"></a>CameraDeviceCallback</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="44.34443444344435%" headers="mcps1.2.4.1.2 "><p id="p1986517141413"><a name="p1986517141413"></a><a name="p1986517141413"></a>处理相机硬件状态变化</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.3 "><p id="p286531413419"><a name="p286531413419"></a><a name="p286531413419"></a>可用/不可用</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row167872310411"><td class="cellrowborder" valign="top" width="22.322232223222326%" headers="mcps1.2.4.1.1 "><p id="p196793230419"><a name="p196793230419"></a><a name="p196793230419"></a>CameraStateCallback</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="44.34443444344435%" headers="mcps1.2.4.1.2 "><p id="p14679823144110"><a name="p14679823144110"></a><a name="p14679823144110"></a>处理camera自身状态变化</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.3 "><p id="p6679102354112"><a name="p6679102354112"></a><a name="p6679102354112"></a>创建/释放</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row886581414118"><td class="cellrowborder" valign="top" width="22.322232223222326%" headers="mcps1.2.4.1.1 "><p id="p1865614194116"><a name="p1865614194116"></a><a name="p1865614194116"></a>FrameStateCallback</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="44.34443444344435%" headers="mcps1.2.4.1.2 "><p id="p1865171420410"><a name="p1865171420410"></a><a name="p1865171420410"></a>处理帧状态的变化</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.3 "><p id="p486541444119"><a name="p486541444119"></a><a name="p486541444119"></a>拍照开始和结束/帧率发生变化</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
- 流的传递
|
||||
|
||||
Surface是多媒体传递音视频的基本数据结构,Camera一般作为Surface中数据的生产者,在不同的场景下有特定的消费者。
|
||||
|
||||
相机的预览和录像输出均为视频流,拍照输出为图像帧,二者均通过Surface类进行传递。Surface类可以屏蔽进程内/跨进程的场景,进行多媒体信息流的传递。
|
||||
|
||||
以录像为例,用户首先创建Recorder实例,并从Recorder中获取对应Surface,再将此Surface传递给Camera实例,此时Camera将作为生产者向Surface注入视频流,而Recorder作为消费者从Surface中取出视频流进行保存,用户的行为类似桥接,把二者通过Surface连接起来。
|
||||
|
||||
类似的,用户也可以自行创建Surface传递给Camera实例,并实现消费者逻辑(例如通过网络传输视频流,或是将拍照的帧数据保存成图片文件)。
|
||||
|
||||
图形图像模块也通过Surface从Camera获取流资源,具体步骤详见[图形图像开发指导](zh-cn_topic_0000001051770388.md)。
|
||||
|
||||
- 相机运行流程
|
||||
1. Camera创建流程
|
||||
|
||||
本进程通过CameraManager创建Camera实例,并从服务端绑定camera设备,创建成功后异步通知user。类之间的时序图如下:
|
||||
|
||||
**图 1** Camera创建时序图<a name="fig9882125184416"></a>
|
||||
|
||||
|
||||

|
||||
|
||||
|
||||
1. Camera录像/预览流程
|
||||
|
||||
用户首先通过CameraKit创建Camera,然后FrameConfig类对录像或者预览帧属性进行配置。录像/预览时序如下:
|
||||
|
||||
**图 2** Camera录像/预览时序图<a name="fig642695404512"></a>
|
||||
|
||||
|
||||

|
||||
|
||||
|
||||
|
||||
# 安装<a name="ZH-CN_TOPIC_0000001054143316"></a>
|
||||
|
||||
相机相关动态库安装到设备/usr/lib中
|
||||
|
||||
# 使用<a name="ZH-CN_TOPIC_0000001054302035"></a>
|
||||
|
||||
使用场景
|
||||
|
||||
使用Camera产生图片帧(拍照)。
|
||||
|
||||
接口说明
|
||||
|
||||
**表 1** API列表
|
||||
|
||||
<a name="table2069447114914"></a>
|
||||
<table><thead align="left"><tr id="row4903852104914"><th class="cellrowborder" valign="top" width="14.93%" id="mcps1.2.4.1.1"><p id="p2903252174918"><a name="p2903252174918"></a><a name="p2903252174918"></a>类名</p>
|
||||
</th>
|
||||
<th class="cellrowborder" valign="top" width="61.660000000000004%" id="mcps1.2.4.1.2"><p id="p1595113912507"><a name="p1595113912507"></a><a name="p1595113912507"></a>接口名</p>
|
||||
</th>
|
||||
<th class="cellrowborder" valign="top" width="23.41%" id="mcps1.2.4.1.3"><p id="p15951597508"><a name="p15951597508"></a><a name="p15951597508"></a>描述</p>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><tr id="row492815717494"><td class="cellrowborder" valign="top" width="14.93%" headers="mcps1.2.4.1.1 "><p id="p1592812716495"><a name="p1592812716495"></a><a name="p1592812716495"></a>CameraKit</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="61.660000000000004%" headers="mcps1.2.4.1.2 "><p id="p1492837144919"><a name="p1492837144919"></a><a name="p1492837144919"></a>int32_t GetCameraIdList(std::list<string> cameraList)</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="23.41%" headers="mcps1.2.4.1.3 "><p id="p2092807134919"><a name="p2092807134919"></a><a name="p2092807134919"></a>获取cameraId列表</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row11928157114912"><td class="cellrowborder" valign="top" width="14.93%" headers="mcps1.2.4.1.1 "><p id="p139287774911"><a name="p139287774911"></a><a name="p139287774911"></a>CameraKit</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="61.660000000000004%" headers="mcps1.2.4.1.2 "><p id="p9928107174915"><a name="p9928107174915"></a><a name="p9928107174915"></a>CameraAbility& GetCameraAbility(string cameraId)</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="23.41%" headers="mcps1.2.4.1.3 "><p id="p139281171494"><a name="p139281171494"></a><a name="p139281171494"></a>获取指定camera的能力</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row119282719496"><td class="cellrowborder" valign="top" width="14.93%" headers="mcps1.2.4.1.1 "><p id="p159288734914"><a name="p159288734914"></a><a name="p159288734914"></a>CameraKit</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="61.660000000000004%" headers="mcps1.2.4.1.2 "><p id="p99280794913"><a name="p99280794913"></a><a name="p99280794913"></a>void RegisterCameraDeviceCallback(CameraDeviceCallback* callback, EventHandler* handler)</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="23.41%" headers="mcps1.2.4.1.3 "><p id="p8928197134910"><a name="p8928197134910"></a><a name="p8928197134910"></a>注册camera设备状态回调</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row4928673496"><td class="cellrowborder" valign="top" width="14.93%" headers="mcps1.2.4.1.1 "><p id="p14928770497"><a name="p14928770497"></a><a name="p14928770497"></a>CameraKit</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="61.660000000000004%" headers="mcps1.2.4.1.2 "><p id="p14928197194915"><a name="p14928197194915"></a><a name="p14928197194915"></a>void UnregisterCameraDeviceCallback(CameraDeviceCallback* callback)</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="23.41%" headers="mcps1.2.4.1.3 "><p id="p17929197134913"><a name="p17929197134913"></a><a name="p17929197134913"></a>去注册camera设备状态回调</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row16929187104912"><td class="cellrowborder" valign="top" width="14.93%" headers="mcps1.2.4.1.1 "><p id="p6929157184911"><a name="p6929157184911"></a><a name="p6929157184911"></a>CameraKit</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="61.660000000000004%" headers="mcps1.2.4.1.2 "><p id="p1192910704914"><a name="p1192910704914"></a><a name="p1192910704914"></a>void CreateCamera(string cameraId, CameraStateCallback* callback, EventHandler* handler)</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="23.41%" headers="mcps1.2.4.1.3 "><p id="p12929167154912"><a name="p12929167154912"></a><a name="p12929167154912"></a>创建camera实例</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row592967184912"><td class="cellrowborder" valign="top" width="14.93%" headers="mcps1.2.4.1.1 "><p id="p9929127134915"><a name="p9929127134915"></a><a name="p9929127134915"></a>Camera</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="61.660000000000004%" headers="mcps1.2.4.1.2 "><p id="p0929107204913"><a name="p0929107204913"></a><a name="p0929107204913"></a>string GetCameraId()</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="23.41%" headers="mcps1.2.4.1.3 "><p id="p1592914710490"><a name="p1592914710490"></a><a name="p1592914710490"></a>获取cameraID</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row13929197104913"><td class="cellrowborder" valign="top" width="14.93%" headers="mcps1.2.4.1.1 "><p id="p16929167134913"><a name="p16929167134913"></a><a name="p16929167134913"></a>Camera</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="61.660000000000004%" headers="mcps1.2.4.1.2 "><p id="p15929175491"><a name="p15929175491"></a><a name="p15929175491"></a>CameraConfig& GetCameraConfig()</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="23.41%" headers="mcps1.2.4.1.3 "><p id="p19298714917"><a name="p19298714917"></a><a name="p19298714917"></a>获取camera配置信息</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row1892918764915"><td class="cellrowborder" valign="top" width="14.93%" headers="mcps1.2.4.1.1 "><p id="p69291072495"><a name="p69291072495"></a><a name="p69291072495"></a>Camera</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="61.660000000000004%" headers="mcps1.2.4.1.2 "><p id="p5930172494"><a name="p5930172494"></a><a name="p5930172494"></a>FrameConfig& GetFrameConfig(int32_t type)</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="23.41%" headers="mcps1.2.4.1.3 "><p id="p19301176495"><a name="p19301176495"></a><a name="p19301176495"></a>获取捕获帧类型</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row893019794915"><td class="cellrowborder" valign="top" width="14.93%" headers="mcps1.2.4.1.1 "><p id="p893016714919"><a name="p893016714919"></a><a name="p893016714919"></a>Camera</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="61.660000000000004%" headers="mcps1.2.4.1.2 "><p id="p1093067134915"><a name="p1093067134915"></a><a name="p1093067134915"></a>void Configure(CameraConfig& config)</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="23.41%" headers="mcps1.2.4.1.3 "><p id="p1493037114912"><a name="p1493037114912"></a><a name="p1493037114912"></a>配置camera</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row11930197174917"><td class="cellrowborder" valign="top" width="14.93%" headers="mcps1.2.4.1.1 "><p id="p4930197184914"><a name="p4930197184914"></a><a name="p4930197184914"></a>Camera</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="61.660000000000004%" headers="mcps1.2.4.1.2 "><p id="p19304717492"><a name="p19304717492"></a><a name="p19304717492"></a>void Release()</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="23.41%" headers="mcps1.2.4.1.3 "><p id="p189301479494"><a name="p189301479494"></a><a name="p189301479494"></a>释放camera</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row109304717499"><td class="cellrowborder" valign="top" width="14.93%" headers="mcps1.2.4.1.1 "><p id="p4930873496"><a name="p4930873496"></a><a name="p4930873496"></a>Camera</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="61.660000000000004%" headers="mcps1.2.4.1.2 "><p id="p1893017720490"><a name="p1893017720490"></a><a name="p1893017720490"></a>int TriggerLoopingCapture(FrameConfig& frameConfig)</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="23.41%" headers="mcps1.2.4.1.3 "><p id="p149307754918"><a name="p149307754918"></a><a name="p149307754918"></a>开始循环帧捕获</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row19306794915"><td class="cellrowborder" valign="top" width="14.93%" headers="mcps1.2.4.1.1 "><p id="p6930167194910"><a name="p6930167194910"></a><a name="p6930167194910"></a>Camera</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="61.660000000000004%" headers="mcps1.2.4.1.2 "><p id="p139311577499"><a name="p139311577499"></a><a name="p139311577499"></a>void StopLoopingCapture()</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="23.41%" headers="mcps1.2.4.1.3 "><p id="p693115764914"><a name="p693115764914"></a><a name="p693115764914"></a>停止循环帧捕获</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row593116713492"><td class="cellrowborder" valign="top" width="14.93%" headers="mcps1.2.4.1.1 "><p id="p1193187174913"><a name="p1193187174913"></a><a name="p1193187174913"></a>Camera</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="61.660000000000004%" headers="mcps1.2.4.1.2 "><p id="p1493111713496"><a name="p1493111713496"></a><a name="p1493111713496"></a>int32_t TriggerSingleCapture(FrameConfig& frameConfig)</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="23.41%" headers="mcps1.2.4.1.3 "><p id="p1193137104919"><a name="p1193137104919"></a><a name="p1193137104919"></a>抓图</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row1693112711491"><td class="cellrowborder" valign="top" width="14.93%" headers="mcps1.2.4.1.1 "><p id="p89312716494"><a name="p89312716494"></a><a name="p89312716494"></a>CameraConfig</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="61.660000000000004%" headers="mcps1.2.4.1.2 "><p id="p199312784912"><a name="p199312784912"></a><a name="p199312784912"></a>void SetFrameStateCallback(FrameStateCallback* callback, EventHandler* handler);</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="23.41%" headers="mcps1.2.4.1.3 "><p id="p49312714495"><a name="p49312714495"></a><a name="p49312714495"></a>设置帧状态回调</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row9931076492"><td class="cellrowborder" valign="top" width="14.93%" headers="mcps1.2.4.1.1 "><p id="p59317784917"><a name="p59317784917"></a><a name="p59317784917"></a>CameraConfig</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="61.660000000000004%" headers="mcps1.2.4.1.2 "><p id="p17931197124912"><a name="p17931197124912"></a><a name="p17931197124912"></a>static CameraConfig* CreateCameraConfig()</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="23.41%" headers="mcps1.2.4.1.3 "><p id="p5931177164912"><a name="p5931177164912"></a><a name="p5931177164912"></a>创建camera配置信息实例</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row29321744917"><td class="cellrowborder" valign="top" width="14.93%" headers="mcps1.2.4.1.1 "><p id="p1093219716492"><a name="p1093219716492"></a><a name="p1093219716492"></a>CameraAbility</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="61.660000000000004%" headers="mcps1.2.4.1.2 "><p id="p12932979493"><a name="p12932979493"></a><a name="p12932979493"></a>std::list<Size> GetSupportedSizes(int format)</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="23.41%" headers="mcps1.2.4.1.3 "><p id="p1493210764918"><a name="p1493210764918"></a><a name="p1493210764918"></a>根据类型获取支持输出图像尺寸大小</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row189321074495"><td class="cellrowborder" valign="top" width="14.93%" headers="mcps1.2.4.1.1 "><p id="p2932197124912"><a name="p2932197124912"></a><a name="p2932197124912"></a>CameraAbility</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="61.660000000000004%" headers="mcps1.2.4.1.2 "><p id="p493217724915"><a name="p493217724915"></a><a name="p493217724915"></a>std::vector<int32_t> GetSupportedAeMode()</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="23.41%" headers="mcps1.2.4.1.3 "><p id="p20932873499"><a name="p20932873499"></a><a name="p20932873499"></a>获取支持的ae模式</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row1093217710493"><td class="cellrowborder" valign="top" width="14.93%" headers="mcps1.2.4.1.1 "><p id="p793227114916"><a name="p793227114916"></a><a name="p793227114916"></a>CameraAbility</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="61.660000000000004%" headers="mcps1.2.4.1.2 "><p id="p4932877496"><a name="p4932877496"></a><a name="p4932877496"></a>std::list<uint32_t> GetSupportedParameters()</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="23.41%" headers="mcps1.2.4.1.3 "><p id="p89328714913"><a name="p89328714913"></a><a name="p89328714913"></a>获取支持的参数</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row1193267184910"><td class="cellrowborder" valign="top" width="14.93%" headers="mcps1.2.4.1.1 "><p id="p1393214717492"><a name="p1393214717492"></a><a name="p1393214717492"></a>CameraAbility</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="61.660000000000004%" headers="mcps1.2.4.1.2 "><p id="p119321477495"><a name="p119321477495"></a><a name="p119321477495"></a>std::list<T> GetParameterRange(uint32_t key)</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="23.41%" headers="mcps1.2.4.1.3 "><p id="p139331079491"><a name="p139331079491"></a><a name="p139331079491"></a>获取支持的参数范围</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row593318734911"><td class="cellrowborder" valign="top" width="14.93%" headers="mcps1.2.4.1.1 "><p id="p12933147144918"><a name="p12933147144918"></a><a name="p12933147144918"></a>CameraAbility</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="61.660000000000004%" headers="mcps1.2.4.1.2 "><p id="p179339710494"><a name="p179339710494"></a><a name="p179339710494"></a>std::list<uint32_t> GetSupportedResults()</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="23.41%" headers="mcps1.2.4.1.3 "><p id="p49335784911"><a name="p49335784911"></a><a name="p49335784911"></a>获取支持返回值</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row1693312712498"><td class="cellrowborder" valign="top" width="14.93%" headers="mcps1.2.4.1.1 "><p id="p1093313713491"><a name="p1093313713491"></a><a name="p1093313713491"></a>CameraAbility</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="61.660000000000004%" headers="mcps1.2.4.1.2 "><p id="p169335784914"><a name="p169335784914"></a><a name="p169335784914"></a>std::list<uint32_t> GetSupportedProperties()</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="23.41%" headers="mcps1.2.4.1.3 "><p id="p11933777493"><a name="p11933777493"></a><a name="p11933777493"></a>获取支持的属性</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row693313718499"><td class="cellrowborder" valign="top" width="14.93%" headers="mcps1.2.4.1.1 "><p id="p1793318714492"><a name="p1793318714492"></a><a name="p1793318714492"></a>CameraAbility</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="61.660000000000004%" headers="mcps1.2.4.1.2 "><p id="p119331677496"><a name="p119331677496"></a><a name="p119331677496"></a>T GetPropertyValue(uint32_t key)</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="23.41%" headers="mcps1.2.4.1.3 "><p id="p19933117174911"><a name="p19933117174911"></a><a name="p19933117174911"></a>获取支持的属性对应的值</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row0933197134920"><td class="cellrowborder" valign="top" width="14.93%" headers="mcps1.2.4.1.1 "><p id="p1493310764917"><a name="p1493310764917"></a><a name="p1493310764917"></a>CameraDevice</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="61.660000000000004%" headers="mcps1.2.4.1.2 "><p id="p493313724915"><a name="p493313724915"></a><a name="p493313724915"></a>CameraDeviceCallback()</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="23.41%" headers="mcps1.2.4.1.3 "><p id="p993416724915"><a name="p993416724915"></a><a name="p993416724915"></a>获取指定属性对应的值</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row12934137134912"><td class="cellrowborder" valign="top" width="14.93%" headers="mcps1.2.4.1.1 "><p id="p2093410794920"><a name="p2093410794920"></a><a name="p2093410794920"></a>CameraDevice</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="61.660000000000004%" headers="mcps1.2.4.1.2 "><p id="p293414794920"><a name="p293414794920"></a><a name="p293414794920"></a>void OnCameraAccessPrioritiesChanged(std::string cameraId)</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="23.41%" headers="mcps1.2.4.1.3 "><p id="p59341879494"><a name="p59341879494"></a><a name="p59341879494"></a>camera设备构造函数</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row093418712498"><td class="cellrowborder" valign="top" width="14.93%" headers="mcps1.2.4.1.1 "><p id="p159341779492"><a name="p159341779492"></a><a name="p159341779492"></a>CameraDevice</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="61.660000000000004%" headers="mcps1.2.4.1.2 "><p id="p1493411774912"><a name="p1493411774912"></a><a name="p1493411774912"></a>void OnCameraStatus(std::string cameraId, int32_t status)</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="23.41%" headers="mcps1.2.4.1.3 "><p id="p1393419715491"><a name="p1393419715491"></a><a name="p1393419715491"></a>camera设备状态变化时的回调</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row109348711497"><td class="cellrowborder" valign="top" width="14.93%" headers="mcps1.2.4.1.1 "><p id="p993419724914"><a name="p993419724914"></a><a name="p993419724914"></a>CameraStateCallback</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="61.660000000000004%" headers="mcps1.2.4.1.2 "><p id="p993418720497"><a name="p993418720497"></a><a name="p993418720497"></a>CameraStateCallback()</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="23.41%" headers="mcps1.2.4.1.3 "><p id="p693511794919"><a name="p693511794919"></a><a name="p693511794919"></a>camera状态回调</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row159358717497"><td class="cellrowborder" valign="top" width="14.93%" headers="mcps1.2.4.1.1 "><p id="p1992012253527"><a name="p1992012253527"></a><a name="p1992012253527"></a>CameraStateCallback</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="61.660000000000004%" headers="mcps1.2.4.1.2 "><p id="p29351077497"><a name="p29351077497"></a><a name="p29351077497"></a>void OnConfigured(Camera& camera)</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="23.41%" headers="mcps1.2.4.1.3 "><p id="p093515774914"><a name="p093515774914"></a><a name="p093515774914"></a>camera配置成功回调</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row9935147184918"><td class="cellrowborder" valign="top" width="14.93%" headers="mcps1.2.4.1.1 "><p id="p117291328135211"><a name="p117291328135211"></a><a name="p117291328135211"></a>CameraStateCallback</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="61.660000000000004%" headers="mcps1.2.4.1.2 "><p id="p19935174496"><a name="p19935174496"></a><a name="p19935174496"></a>void OnConfigureFailed(Camera& camera,int32_t errorCode)</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="23.41%" headers="mcps1.2.4.1.3 "><p id="p159352077495"><a name="p159352077495"></a><a name="p159352077495"></a>camera配置失败回调</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row1935279498"><td class="cellrowborder" valign="top" width="14.93%" headers="mcps1.2.4.1.1 "><p id="p1514619311525"><a name="p1514619311525"></a><a name="p1514619311525"></a>CameraStateCallback</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="61.660000000000004%" headers="mcps1.2.4.1.2 "><p id="p493512744915"><a name="p493512744915"></a><a name="p493512744915"></a>void OnCreated(Camera& camera)</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="23.41%" headers="mcps1.2.4.1.3 "><p id="p1493511784914"><a name="p1493511784914"></a><a name="p1493511784914"></a>camera创建成功回调</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row189351877493"><td class="cellrowborder" valign="top" width="14.93%" headers="mcps1.2.4.1.1 "><p id="p172071933175218"><a name="p172071933175218"></a><a name="p172071933175218"></a>CameraStateCallback</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="61.660000000000004%" headers="mcps1.2.4.1.2 "><p id="p129361977498"><a name="p129361977498"></a><a name="p129361977498"></a>void OnCreateFailed(std::string cameraId,int32_t errorCode)</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="23.41%" headers="mcps1.2.4.1.3 "><p id="p2936197114919"><a name="p2936197114919"></a><a name="p2936197114919"></a>camera创建失败回调</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row49361570491"><td class="cellrowborder" valign="top" width="14.93%" headers="mcps1.2.4.1.1 "><p id="p89451235135218"><a name="p89451235135218"></a><a name="p89451235135218"></a>CameraStateCallback</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="61.660000000000004%" headers="mcps1.2.4.1.2 "><p id="p693617764911"><a name="p693617764911"></a><a name="p693617764911"></a>void OnFatalError(Camera& camera,int32_t errorCode)</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="23.41%" headers="mcps1.2.4.1.3 "><p id="p119361972491"><a name="p119361972491"></a><a name="p119361972491"></a>camera内部错误回调</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row20936472491"><td class="cellrowborder" valign="top" width="14.93%" headers="mcps1.2.4.1.1 "><p id="p61213391523"><a name="p61213391523"></a><a name="p61213391523"></a>CameraStateCallback</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="61.660000000000004%" headers="mcps1.2.4.1.2 "><p id="p793697174919"><a name="p793697174919"></a><a name="p793697174919"></a>void OnReleased(Camera& camera)</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="23.41%" headers="mcps1.2.4.1.3 "><p id="p49361719495"><a name="p49361719495"></a><a name="p49361719495"></a>camera释放回调</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row159361179493"><td class="cellrowborder" valign="top" width="14.93%" headers="mcps1.2.4.1.1 "><p id="p10936147194918"><a name="p10936147194918"></a><a name="p10936147194918"></a>FrameStateCallback</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="61.660000000000004%" headers="mcps1.2.4.1.2 "><p id="p9936279496"><a name="p9936279496"></a><a name="p9936279496"></a>FrameStateCallback()</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="23.41%" headers="mcps1.2.4.1.3 "><p id="p49367718499"><a name="p49367718499"></a><a name="p49367718499"></a>帧状态回调</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row1893617744916"><td class="cellrowborder" valign="top" width="14.93%" headers="mcps1.2.4.1.1 "><p id="p136968511524"><a name="p136968511524"></a><a name="p136968511524"></a>FrameStateCallback</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="61.660000000000004%" headers="mcps1.2.4.1.2 "><p id="p209379744911"><a name="p209379744911"></a><a name="p209379744911"></a>void OnFrameFinished(Camera& camera, FrameConfig& frameConfig, FrameResult& frameResult)</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="23.41%" headers="mcps1.2.4.1.3 "><p id="p19374724913"><a name="p19374724913"></a><a name="p19374724913"></a>拍照帧完成回调</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row093719718495"><td class="cellrowborder" valign="top" width="14.93%" headers="mcps1.2.4.1.1 "><p id="p772975317527"><a name="p772975317527"></a><a name="p772975317527"></a>FrameStateCallback</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="61.660000000000004%" headers="mcps1.2.4.1.2 "><p id="p189371471498"><a name="p189371471498"></a><a name="p189371471498"></a>void OnFrameError(Camera& camera, FrameConfig& frameConfig, int32_t errorCode, FrameResult& frameResult)</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="23.41%" headers="mcps1.2.4.1.3 "><p id="p109371778497"><a name="p109371778497"></a><a name="p109371778497"></a>拍照帧异常回调</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row10937137174911"><td class="cellrowborder" valign="top" width="14.93%" headers="mcps1.2.4.1.1 "><p id="p2640155519527"><a name="p2640155519527"></a><a name="p2640155519527"></a>FrameStateCallback</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="61.660000000000004%" headers="mcps1.2.4.1.2 "><p id="p493718719491"><a name="p493718719491"></a><a name="p493718719491"></a>void OnFrameProgressed(Camera& camera, FrameConfig& frameConfig, FrameResult& frameResult)</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="23.41%" headers="mcps1.2.4.1.3 "><p id="p993797154912"><a name="p993797154912"></a><a name="p993797154912"></a>拍照帧处理中回调</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row1993720734914"><td class="cellrowborder" valign="top" width="14.93%" headers="mcps1.2.4.1.1 "><p id="p4477357205213"><a name="p4477357205213"></a><a name="p4477357205213"></a>FrameStateCallback</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="61.660000000000004%" headers="mcps1.2.4.1.2 "><p id="p493797104919"><a name="p493797104919"></a><a name="p493797104919"></a>void OnFrameStarted(Camera& camera, FrameConfig& frameConfig,long frameNumber,long timestamp)</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="23.41%" headers="mcps1.2.4.1.3 "><p id="p6937187174919"><a name="p6937187174919"></a><a name="p6937187174919"></a>拍照帧开始回调</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row179381979499"><td class="cellrowborder" valign="top" width="14.93%" headers="mcps1.2.4.1.1 "><p id="p169381975499"><a name="p169381975499"></a><a name="p169381975499"></a>FrameConfig</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="61.660000000000004%" headers="mcps1.2.4.1.2 "><p id="p1793867124910"><a name="p1793867124910"></a><a name="p1793867124910"></a>int32_t GetFrameConfigType()</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="23.41%" headers="mcps1.2.4.1.3 "><p id="p1993817744915"><a name="p1993817744915"></a><a name="p1993817744915"></a>获取帧配置类型</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row793817784912"><td class="cellrowborder" valign="top" width="14.93%" headers="mcps1.2.4.1.1 "><p id="p69381724914"><a name="p69381724914"></a><a name="p69381724914"></a>FrameConfig</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="61.660000000000004%" headers="mcps1.2.4.1.2 "><p id="p149382077496"><a name="p149382077496"></a><a name="p149382077496"></a>std::list<HarmonyOS::Surface> GetSurfaces()</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="23.41%" headers="mcps1.2.4.1.3 "><p id="p893867114919"><a name="p893867114919"></a><a name="p893867114919"></a>获取帧配置的surface</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row69388774911"><td class="cellrowborder" valign="top" width="14.93%" headers="mcps1.2.4.1.1 "><p id="p39389717494"><a name="p39389717494"></a><a name="p39389717494"></a>FrameConfig</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="61.660000000000004%" headers="mcps1.2.4.1.2 "><p id="p1193887164919"><a name="p1193887164919"></a><a name="p1193887164919"></a>int32_t GetAeMode()</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="23.41%" headers="mcps1.2.4.1.3 "><p id="p11938147204915"><a name="p11938147204915"></a><a name="p11938147204915"></a>获取AE模式</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row1893819724917"><td class="cellrowborder" valign="top" width="14.93%" headers="mcps1.2.4.1.1 "><p id="p1393816784919"><a name="p1393816784919"></a><a name="p1393816784919"></a>FrameConfig</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="61.660000000000004%" headers="mcps1.2.4.1.2 "><p id="p19938673491"><a name="p19938673491"></a><a name="p19938673491"></a>Rect& GetAeRect()</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="23.41%" headers="mcps1.2.4.1.3 "><p id="p109391871498"><a name="p109391871498"></a><a name="p109391871498"></a>获取AE位置</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row1493918784920"><td class="cellrowborder" valign="top" width="14.93%" headers="mcps1.2.4.1.1 "><p id="p1493915711493"><a name="p1493915711493"></a><a name="p1493915711493"></a>FrameConfig</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="61.660000000000004%" headers="mcps1.2.4.1.2 "><p id="p293913714492"><a name="p293913714492"></a><a name="p293913714492"></a>int32_t GetImageRotation()</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="23.41%" headers="mcps1.2.4.1.3 "><p id="p193914717495"><a name="p193914717495"></a><a name="p193914717495"></a>获取图片旋转状态</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row593947174913"><td class="cellrowborder" valign="top" width="14.93%" headers="mcps1.2.4.1.1 "><p id="p49390718495"><a name="p49390718495"></a><a name="p49390718495"></a>FrameConfig</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="61.660000000000004%" headers="mcps1.2.4.1.2 "><p id="p159399764917"><a name="p159399764917"></a><a name="p159399764917"></a>T Get(uint32_t key)</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="23.41%" headers="mcps1.2.4.1.3 "><p id="p993997184920"><a name="p993997184920"></a><a name="p993997184920"></a>获取指定key对应的值</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row993977164919"><td class="cellrowborder" valign="top" width="14.93%" headers="mcps1.2.4.1.1 "><p id="p89391473492"><a name="p89391473492"></a><a name="p89391473492"></a>FrameConfig</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="61.660000000000004%" headers="mcps1.2.4.1.2 "><p id="p59393719494"><a name="p59393719494"></a><a name="p59393719494"></a>std::list<uint32_t> GetKeys()</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="23.41%" headers="mcps1.2.4.1.3 "><p id="p189401377499"><a name="p189401377499"></a><a name="p189401377499"></a>获取当前key列表</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row109401570498"><td class="cellrowborder" valign="top" width="14.93%" headers="mcps1.2.4.1.1 "><p id="p294019712492"><a name="p294019712492"></a><a name="p294019712492"></a>FrameConfig</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="61.660000000000004%" headers="mcps1.2.4.1.2 "><p id="p19940170499"><a name="p19940170499"></a><a name="p19940170499"></a>void AddSurface(HarmonyOS::AGP::UISurface& surface);</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="23.41%" headers="mcps1.2.4.1.3 "><p id="p11940197144915"><a name="p11940197144915"></a><a name="p11940197144915"></a>添加surface</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row994018711492"><td class="cellrowborder" valign="top" width="14.93%" headers="mcps1.2.4.1.1 "><p id="p1094016718493"><a name="p1094016718493"></a><a name="p1094016718493"></a>FrameConfig</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="61.660000000000004%" headers="mcps1.2.4.1.2 "><p id="p139411279498"><a name="p139411279498"></a><a name="p139411279498"></a>void RemoveSurface(HarmonyOS::AGP::UISurface& surface);</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="23.41%" headers="mcps1.2.4.1.3 "><p id="p39415717494"><a name="p39415717494"></a><a name="p39415717494"></a>删除surface</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row39411376494"><td class="cellrowborder" valign="top" width="14.93%" headers="mcps1.2.4.1.1 "><p id="p12941187154916"><a name="p12941187154916"></a><a name="p12941187154916"></a>FrameConfig</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="61.660000000000004%" headers="mcps1.2.4.1.2 "><p id="p2094117710491"><a name="p2094117710491"></a><a name="p2094117710491"></a>void SetAeMode(int32_t aeMode, Rect& rect)</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="23.41%" headers="mcps1.2.4.1.3 "><p id="p169411675494"><a name="p169411675494"></a><a name="p169411675494"></a>配置AE模式</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row39411878493"><td class="cellrowborder" valign="top" width="14.93%" headers="mcps1.2.4.1.1 "><p id="p109412716491"><a name="p109412716491"></a><a name="p109412716491"></a>FrameConfig</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="61.660000000000004%" headers="mcps1.2.4.1.2 "><p id="p5941117104918"><a name="p5941117104918"></a><a name="p5941117104918"></a>void SetImageRotation(int32_t degrees)</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="23.41%" headers="mcps1.2.4.1.3 "><p id="p169411076498"><a name="p169411076498"></a><a name="p169411076498"></a>配置图片旋转状态</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row8941187114912"><td class="cellrowborder" valign="top" width="14.93%" headers="mcps1.2.4.1.1 "><p id="p0941207114910"><a name="p0941207114910"></a><a name="p0941207114910"></a>FrameConfig</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="61.660000000000004%" headers="mcps1.2.4.1.2 "><p id="p209413713492"><a name="p209413713492"></a><a name="p209413713492"></a>void SetParameter(uint32_t key, const T value)</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="23.41%" headers="mcps1.2.4.1.3 "><p id="p094114764917"><a name="p094114764917"></a><a name="p094114764917"></a>配置指定参数</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row11942779494"><td class="cellrowborder" valign="top" width="14.93%" headers="mcps1.2.4.1.1 "><p id="p69421777498"><a name="p69421777498"></a><a name="p69421777498"></a>FrameConfig</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="61.660000000000004%" headers="mcps1.2.4.1.2 "><p id="p1294277154912"><a name="p1294277154912"></a><a name="p1294277154912"></a>void GetParameter(uint32_t key, const T value)</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="23.41%" headers="mcps1.2.4.1.3 "><p id="p5942107204910"><a name="p5942107204910"></a><a name="p5942107204910"></a>获取指定key对应的参数</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
约束与限制
|
||||
|
||||
无。
|
||||
|
||||
开发步骤
|
||||
|
||||
1. 实现设备状态回调的派生类,用户在设备状态发生变更(如新插入相机设备/相机掉线)时,自定义操作。
|
||||
|
||||
```
|
||||
class SampleCameraDeviceCallback : public CameraDeviceCallback {
|
||||
void onCameraStatus(std::string cameraId, int32_t status) override
|
||||
{
|
||||
//do something when camera is available/unavailable
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
2. 实现帧事件回调的派生类,这里在拿到帧数据以后将其转存为文件。
|
||||
|
||||
```
|
||||
class TestFrameStateCallback : public FrameStateCallback {
|
||||
void OnFrameFinished(Camera &camera, FrameConfig &fc, FrameResult &result) override
|
||||
{
|
||||
cout << "Receive frame complete inform." << endl;
|
||||
if (fc.GetFrameConfigType() == FRAME_CONFIG_CAPTURE) {
|
||||
cout << "Capture frame received." << endl;
|
||||
list<Surface *> surfaceList = fc.GetSurfaces();
|
||||
for (Surface *surface : surfaceList) {
|
||||
SurfaceBuffer *buffer = surface->AcquireBuffer();
|
||||
if (buffer != nullptr) {
|
||||
char *virtAddr = static_cast<char *>(buffer->GetVirAddr());
|
||||
if (virtAddr != nullptr) {
|
||||
SampleSaveCapture(virtAddr, buffer->GetSize());
|
||||
}
|
||||
surface->ReleaseBuffer(buffer);
|
||||
}
|
||||
delete surface;
|
||||
}
|
||||
delete &fc;
|
||||
}
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
3. 实现相机状态回调的派生类,当相机状态发生变化(配置成功/失败,创建成功/失败\)时,自定义操作。
|
||||
|
||||
```
|
||||
static void SampleSaveCapture(const char *p, uint32_t size)
|
||||
{
|
||||
cout << "Start saving picture" << endl;
|
||||
struct timeval tv;
|
||||
gettimeofday(&tv, NULL);
|
||||
struct tm *ltm = localtime(&tv.tv_sec);
|
||||
if (ltm != nullptr) {
|
||||
ostringstream ss("Capture_");
|
||||
ss << "Capture" << ltm->tm_hour << "-" << ltm->tm_min << "-" << ltm->tm_sec << ".jpg";
|
||||
|
||||
ofstream pic("/tmp/" + ss.str(), ofstream::out | ofstream::trunc);
|
||||
cout << "write " << size << " bytes" << endl;
|
||||
pic.write(p, size);
|
||||
cout << "Saving picture end" << endl;
|
||||
}
|
||||
}
|
||||
|
||||
class TestFrameStateCallback : public FrameStateCallback {
|
||||
void OnFrameFinished(Camera &camera, FrameConfig &fc, FrameResult &result) override
|
||||
{
|
||||
cout << "Receive frame complete inform." << endl;
|
||||
if (fc.GetFrameConfigType() == FRAME_CONFIG_CAPTURE) {
|
||||
cout << "Capture frame received." << endl;
|
||||
list<Surface *> surfaceList = fc.GetSurfaces();
|
||||
for (Surface *surface : surfaceList) {
|
||||
SurfaceBuffer *buffer = surface->AcquireBuffer();
|
||||
if (buffer != nullptr) {
|
||||
char *virtAddr = static_cast<char *>(buffer->GetVirAddr());
|
||||
if (virtAddr != nullptr) {
|
||||
SampleSaveCapture(virtAddr, buffer->GetSize());
|
||||
}
|
||||
surface->ReleaseBuffer(buffer);
|
||||
}
|
||||
delete surface;
|
||||
}
|
||||
delete &fc;
|
||||
}
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
4. 创建CameraKit,用于创建和获取camera信息。
|
||||
|
||||
```
|
||||
CameraKit *camKit = CameraKit::GetInstance();
|
||||
list<string> camList = camKit->GetCameraIdList();
|
||||
string camId;
|
||||
for (auto &cam : camList) {
|
||||
cout << "camera name:" << cam << endl;
|
||||
const CameraAbility *ability = camKit->GetCameraAbility(cam);
|
||||
/* find camera which fits user's ability */
|
||||
list<CameraPicSize> sizeList = ability->GetSupportedSizes(0);
|
||||
if (find(sizeList.begin(), sizeList.end(), CAM_PIC_1080P) != sizeList.end()) {
|
||||
camId = cam;
|
||||
break;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
5. 创建Camera实例。
|
||||
|
||||
```
|
||||
EventHandler eventHdlr; // Create a thread to handle callback events
|
||||
SampleCameraStateMng CamStateMng(eventHdlr);
|
||||
|
||||
camKit->CreateCamera(camId, CamStateMng, eventHdlr);
|
||||
```
|
||||
|
||||
6. 根据[步骤1](zh-cn_topic_0000001050754209.md#li378084192111)、[步骤2](zh-cn_topic_0000001050754209.md#li8716104682913)、[步骤3](zh-cn_topic_0000001050754209.md#li6671035102514)中的回调设计,camera实例创建成功后会进行配置操作,主流程中app需要设计同步机制。
|
||||
|
||||
```
|
||||
void OnCreated(Camera &c) override
|
||||
{
|
||||
cout << "Sample recv OnCreate camera." << endl;
|
||||
auto config = CameraConfig::CreateCameraConfig();
|
||||
config->SetFrameStateCallback(&fsCb_, &eventHdlr_);
|
||||
c.Configure(*config);
|
||||
cam_ = &c;
|
||||
}
|
||||
|
||||
void Capture()
|
||||
{
|
||||
if (cam_ == nullptr) {
|
||||
cout << "Camera is not ready." << endl;
|
||||
return;
|
||||
}
|
||||
FrameConfig *fc = new FrameConfig(FRAME_CONFIG_CAPTURE);
|
||||
Surface *surface = Surface::CreateSurface();
|
||||
if (surface == nullptr) {
|
||||
delete fc;
|
||||
}
|
||||
surface->SetWidthAndHeight(1920, 1080); /* 1920:width,1080:height */
|
||||
fc->AddSurface(*surface);
|
||||
cam_->TriggerSingleCapture(*fc);
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"name": "@ohos/camera",
|
||||
"version": "1.8.0",
|
||||
"publishAs": "code-segment",
|
||||
"description": "相机是HarmonyOS多媒体进程提供的服务之一,提供了相机的录像、预览、拍照功能,支持多用户并发取流。",
|
||||
"scripts": {
|
||||
"install": "DEST_PATH=${DEP_BUNDLE_BASE}/foundation/multimedia &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH"
|
||||
},
|
||||
"keywords": [
|
||||
"camera"
|
||||
],
|
||||
"license": "Apache V2",
|
||||
"repository": "",
|
||||
"homepage": "",
|
||||
"tags": [
|
||||
"foundation"
|
||||
],
|
||||
"ohos": {
|
||||
"os": "1.0.0",
|
||||
"kernel": "liteos-a",
|
||||
"board": "hi3516,hi3518"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,202 @@
|
||||
|
||||
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
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
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.
|
||||
@@ -0,0 +1 @@
|
||||
readme
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"name": "@ohos/camera_sample_app",
|
||||
"version": "1.8.0",
|
||||
"publishAs": "code-segment",
|
||||
"description": "camera_sample_app",
|
||||
"scripts": {
|
||||
"install": "DEST_PATH=${DEP_BUNDLE_BASE}/applications/sample/camera &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH"
|
||||
},
|
||||
"keywords": [
|
||||
"app"
|
||||
],
|
||||
"license": "Apache V2",
|
||||
"repository": "",
|
||||
"homepage": "",
|
||||
"tags": [
|
||||
"application"
|
||||
],
|
||||
"ohos": {
|
||||
"os": "1.0.0",
|
||||
"kernel": "liteos-a",
|
||||
"board": "hi3516,hi3518"
|
||||
}
|
||||
}
|
||||
+202
@@ -0,0 +1,202 @@
|
||||
|
||||
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
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
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.
|
||||
+571
@@ -0,0 +1,571 @@
|
||||
# cJSON
|
||||
|
||||
Ultralightweight JSON parser in ANSI C.
|
||||
|
||||
## Table of contents
|
||||
* [License](#license)
|
||||
* [Usage](#usage)
|
||||
* [Welcome to cJSON](#welcome-to-cjson)
|
||||
* [Building](#building)
|
||||
* [Copying the source](#copying-the-source)
|
||||
* [CMake](#cmake)
|
||||
* [Makefile](#makefile)
|
||||
* [Vcpkg](#Vcpkg)
|
||||
* [Including cJSON](#including-cjson)
|
||||
* [Data Structure](#data-structure)
|
||||
* [Working with the data structure](#working-with-the-data-structure)
|
||||
* [Basic types](#basic-types)
|
||||
* [Arrays](#arrays)
|
||||
* [Objects](#objects)
|
||||
* [Parsing JSON](#parsing-json)
|
||||
* [Printing JSON](#printing-json)
|
||||
* [Example](#example)
|
||||
* [Printing](#printing)
|
||||
* [Parsing](#parsing)
|
||||
* [Caveats](#caveats)
|
||||
* [Zero Character](#zero-character)
|
||||
* [Character Encoding](#character-encoding)
|
||||
* [C Standard](#c-standard)
|
||||
* [Floating Point Numbers](#floating-point-numbers)
|
||||
* [Deep Nesting Of Arrays And Objects](#deep-nesting-of-arrays-and-objects)
|
||||
* [Thread Safety](#thread-safety)
|
||||
* [Case Sensitivity](#case-sensitivity)
|
||||
* [Duplicate Object Members](#duplicate-object-members)
|
||||
* [Enjoy cJSON!](#enjoy-cjson)
|
||||
|
||||
## License
|
||||
|
||||
MIT License
|
||||
|
||||
> Copyright (c) 2009-2017 Dave Gamble and cJSON contributors
|
||||
>
|
||||
> Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
> of this software and associated documentation files (the "Software"), to deal
|
||||
> in the Software without restriction, including without limitation the rights
|
||||
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
> copies of the Software, and to permit persons to whom the Software is
|
||||
> furnished to do so, subject to the following conditions:
|
||||
>
|
||||
> The above copyright notice and this permission notice shall be included in
|
||||
> all copies or substantial portions of the Software.
|
||||
>
|
||||
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
> THE SOFTWARE.
|
||||
|
||||
## Usage
|
||||
|
||||
### Welcome to cJSON.
|
||||
|
||||
cJSON aims to be the dumbest possible parser that you can get your job done with.
|
||||
It's a single file of C, and a single header file.
|
||||
|
||||
JSON is described best here: http://www.json.org/
|
||||
It's like XML, but fat-free. You use it to move data around, store things, or just
|
||||
generally represent your program's state.
|
||||
|
||||
As a library, cJSON exists to take away as much legwork as it can, but not get in your way.
|
||||
As a point of pragmatism (i.e. ignoring the truth), I'm going to say that you can use it
|
||||
in one of two modes: Auto and Manual. Let's have a quick run-through.
|
||||
|
||||
I lifted some JSON from this page: http://www.json.org/fatfree.html
|
||||
That page inspired me to write cJSON, which is a parser that tries to share the same
|
||||
philosophy as JSON itself. Simple, dumb, out of the way.
|
||||
|
||||
### Building
|
||||
|
||||
There are several ways to incorporate cJSON into your project.
|
||||
|
||||
#### copying the source
|
||||
|
||||
Because the entire library is only one C file and one header file, you can just copy `cJSON.h` and `cJSON.c` to your projects source and start using it.
|
||||
|
||||
cJSON is written in ANSI C (C89) in order to support as many platforms and compilers as possible.
|
||||
|
||||
#### CMake
|
||||
|
||||
With CMake, cJSON supports a full blown build system. This way you get the most features. CMake with an equal or higher version than 2.8.5 is supported. With CMake it is recommended to do an out of tree build, meaning the compiled files are put in a directory separate from the source files. So in order to build cJSON with CMake on a Unix platform, make a `build` directory and run CMake inside it.
|
||||
|
||||
```
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ..
|
||||
```
|
||||
|
||||
This will create a Makefile and a bunch of other files. You can then compile it:
|
||||
|
||||
```
|
||||
make
|
||||
```
|
||||
|
||||
And install it with `make install` if you want. By default it installs the headers `/usr/local/include/cjson` and the libraries to `/usr/local/lib`. It also installs files for pkg-config to make it easier to detect and use an existing installation of CMake. And it installs CMake config files, that can be used by other CMake based projects to discover the library.
|
||||
|
||||
You can change the build process with a list of different options that you can pass to CMake. Turn them on with `On` and off with `Off`:
|
||||
|
||||
* `-DENABLE_CJSON_TEST=On`: Enable building the tests. (on by default)
|
||||
* `-DENABLE_CJSON_UTILS=On`: Enable building cJSON_Utils. (off by default)
|
||||
* `-DENABLE_TARGET_EXPORT=On`: Enable the export of CMake targets. Turn off if it makes problems. (on by default)
|
||||
* `-DENABLE_CUSTOM_COMPILER_FLAGS=On`: Enable custom compiler flags (currently for Clang, GCC and MSVC). Turn off if it makes problems. (on by default)
|
||||
* `-DENABLE_VALGRIND=On`: Run tests with [valgrind](http://valgrind.org). (off by default)
|
||||
* `-DENABLE_SANITIZERS=On`: Compile cJSON with [AddressSanitizer](https://github.com/google/sanitizers/wiki/AddressSanitizer) and [UndefinedBehaviorSanitizer](https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html) enabled (if possible). (off by default)
|
||||
* `-DENABLE_SAFE_STACK`: Enable the [SafeStack](https://clang.llvm.org/docs/SafeStack.html) instrumentation pass. Currently only works with the Clang compiler. (off by default)
|
||||
* `-DBUILD_SHARED_LIBS=On`: Build the shared libraries. (on by default)
|
||||
* `-DBUILD_SHARED_AND_STATIC_LIBS=On`: Build both shared and static libraries. (off by default)
|
||||
* `-DCMAKE_INSTALL_PREFIX=/usr`: Set a prefix for the installation.
|
||||
* `-DENABLE_LOCALES=On`: Enable the usage of localeconv method. ( on by default )
|
||||
* `-DCJSON_OVERRIDE_BUILD_SHARED_LIBS=On`: Enable overriding the value of `BUILD_SHARED_LIBS` with `-DCJSON_BUILD_SHARED_LIBS`.
|
||||
|
||||
If you are packaging cJSON for a distribution of Linux, you would probably take these steps for example:
|
||||
```
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DENABLE_CJSON_UTILS=On -DENABLE_CJSON_TEST=Off -DCMAKE_INSTALL_PREFIX=/usr
|
||||
make
|
||||
make DESTDIR=$pkgdir install
|
||||
```
|
||||
|
||||
On Windows CMake is usually used to create a Visual Studio solution file by running it inside the Developer Command Prompt for Visual Studio, for exact steps follow the official documentation from CMake and Microsoft and use the online search engine of your choice. The descriptions of the the options above still generally apply, although not all of them work on Windows.
|
||||
|
||||
#### Makefile
|
||||
|
||||
**NOTE:** This Method is deprecated. Use CMake if at all possible. Makefile support is limited to fixing bugs.
|
||||
|
||||
If you don't have CMake available, but still have GNU make. You can use the makefile to build cJSON:
|
||||
|
||||
Run this command in the directory with the source code and it will automatically compile static and shared libraries and a little test program (not the full test suite).
|
||||
|
||||
```
|
||||
make all
|
||||
```
|
||||
|
||||
If you want, you can install the compiled library to your system using `make install`. By default it will install the headers in `/usr/local/include/cjson` and the libraries in `/usr/local/lib`. But you can change this behavior by setting the `PREFIX` and `DESTDIR` variables: `make PREFIX=/usr DESTDIR=temp install`. And uninstall them with: `make PREFIX=/usr DESTDIR=temp uninstall`.
|
||||
|
||||
#### Vcpkg
|
||||
|
||||
You can download and install cJSON using the [vcpkg](https://github.com/Microsoft/vcpkg) dependency manager:
|
||||
```
|
||||
git clone https://github.com/Microsoft/vcpkg.git
|
||||
cd vcpkg
|
||||
./bootstrap-vcpkg.sh
|
||||
./vcpkg integrate install
|
||||
vcpkg install cjson
|
||||
```
|
||||
|
||||
The cJSON port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository.
|
||||
|
||||
### Including cJSON
|
||||
|
||||
If you installed it via CMake or the Makefile, you can include cJSON like this:
|
||||
|
||||
```c
|
||||
#include <cjson/cJSON.h>
|
||||
```
|
||||
|
||||
### Data Structure
|
||||
|
||||
cJSON represents JSON data using the `cJSON` struct data type:
|
||||
|
||||
```c
|
||||
/* The cJSON structure: */
|
||||
typedef struct cJSON
|
||||
{
|
||||
struct cJSON *next;
|
||||
struct cJSON *prev;
|
||||
struct cJSON *child;
|
||||
int type;
|
||||
char *valuestring;
|
||||
/* writing to valueint is DEPRECATED, use cJSON_SetNumberValue instead */
|
||||
int valueint;
|
||||
double valuedouble;
|
||||
char *string;
|
||||
} cJSON;
|
||||
```
|
||||
|
||||
An item of this type represents a JSON value. The type is stored in `type` as a bit-flag (**this means that you cannot find out the type by just comparing the value of `type`**).
|
||||
|
||||
To check the type of an item, use the corresponding `cJSON_Is...` function. It does a `NULL` check followed by a type check and returns a boolean value if the item is of this type.
|
||||
|
||||
The type can be one of the following:
|
||||
|
||||
* `cJSON_Invalid` (check with `cJSON_IsInvalid`): Represents an invalid item that doesn't contain any value. You automatically have this type if you set the item to all zero bytes.
|
||||
* `cJSON_False` (check with `cJSON_IsFalse`): Represents a `false` boolean value. You can also check for boolean values in general with `cJSON_IsBool`.
|
||||
* `cJSON_True` (check with `cJSON_IsTrue`): Represents a `true` boolean value. You can also check for boolean values in general with `cJSON_IsBool`.
|
||||
* `cJSON_NULL` (check with `cJSON_IsNull`): Represents a `null` value.
|
||||
* `cJSON_Number` (check with `cJSON_IsNumber`): Represents a number value. The value is stored as a double in `valuedouble` and also in `valueint`. If the number is outside of the range of an integer, `INT_MAX` or `INT_MIN` are used for `valueint`.
|
||||
* `cJSON_String` (check with `cJSON_IsString`): Represents a string value. It is stored in the form of a zero terminated string in `valuestring`.
|
||||
* `cJSON_Array` (check with `cJSON_IsArray`): Represent an array value. This is implemented by pointing `child` to a linked list of `cJSON` items that represent the values in the array. The elements are linked together using `next` and `prev`, where the first element has `prev.next == NULL` and the last element `next == NULL`.
|
||||
* `cJSON_Object` (check with `cJSON_IsObject`): Represents an object value. Objects are stored same way as an array, the only difference is that the items in the object store their keys in `string`.
|
||||
* `cJSON_Raw` (check with `cJSON_IsRaw`): Represents any kind of JSON that is stored as a zero terminated array of characters in `valuestring`. This can be used, for example, to avoid printing the same static JSON over and over again to save performance. cJSON will never create this type when parsing. Also note that cJSON doesn't check if it is valid JSON.
|
||||
|
||||
Additionally there are the following two flags:
|
||||
|
||||
* `cJSON_IsReference`: Specifies that the item that `child` points to and/or `valuestring` is not owned by this item, it is only a reference. So `cJSON_Delete` and other functions will only deallocate this item, not its `child`/`valuestring`.
|
||||
* `cJSON_StringIsConst`: This means that `string` points to a constant string. This means that `cJSON_Delete` and other functions will not try to deallocate `string`.
|
||||
|
||||
### Working with the data structure
|
||||
|
||||
For every value type there is a `cJSON_Create...` function that can be used to create an item of that type.
|
||||
All of these will allocate a `cJSON` struct that can later be deleted with `cJSON_Delete`.
|
||||
Note that you have to delete them at some point, otherwise you will get a memory leak.
|
||||
**Important**: If you have added an item to an array or an object already, you **mustn't** delete it with `cJSON_Delete`. Adding it to an array or object transfers its ownership so that when that array or object is deleted,
|
||||
it gets deleted as well. You also could use `cJSON_SetValuestring` to change a `cJSON_String`'s `valuestring`, and you needn't to free the previous `valuestring` manually.
|
||||
|
||||
#### Basic types
|
||||
|
||||
* **null** is created with `cJSON_CreateNull`
|
||||
* **booleans** are created with `cJSON_CreateTrue`, `cJSON_CreateFalse` or `cJSON_CreateBool`
|
||||
* **numbers** are created with `cJSON_CreateNumber`. This will set both `valuedouble` and `valueint`. If the number is outside of the range of an integer, `INT_MAX` or `INT_MIN` are used for `valueint`
|
||||
* **strings** are created with `cJSON_CreateString` (copies the string) or with `cJSON_CreateStringReference` (directly points to the string. This means that `valuestring` won't be deleted by `cJSON_Delete` and you are responsible for its lifetime, useful for constants)
|
||||
|
||||
#### Arrays
|
||||
|
||||
You can create an empty array with `cJSON_CreateArray`. `cJSON_CreateArrayReference` can be used to create an array that doesn't "own" its content, so its content doesn't get deleted by `cJSON_Delete`.
|
||||
|
||||
To add items to an array, use `cJSON_AddItemToArray` to append items to the end.
|
||||
Using `cJSON_AddItemReferenceToArray` an element can be added as a reference to another item, array or string. This means that `cJSON_Delete` will not delete that items `child` or `valuestring` properties, so no double frees are occurring if they are already used elsewhere.
|
||||
To insert items in the middle, use `cJSON_InsertItemInArray`. It will insert an item at the given 0 based index and shift all the existing items to the right.
|
||||
|
||||
If you want to take an item out of an array at a given index and continue using it, use `cJSON_DetachItemFromArray`, it will return the detached item, so be sure to assign it to a pointer, otherwise you will have a memory leak.
|
||||
|
||||
Deleting items is done with `cJSON_DeleteItemFromArray`. It works like `cJSON_DetachItemFromArray`, but deletes the detached item via `cJSON_Delete`.
|
||||
|
||||
You can also replace an item in an array in place. Either with `cJSON_ReplaceItemInArray` using an index or with `cJSON_ReplaceItemViaPointer` given a pointer to an element. `cJSON_ReplaceItemViaPointer` will return `0` if it fails. What this does internally is to detach the old item, delete it and insert the new item in its place.
|
||||
|
||||
To get the size of an array, use `cJSON_GetArraySize`. Use `cJSON_GetArrayItem` to get an element at a given index.
|
||||
|
||||
Because an array is stored as a linked list, iterating it via index is inefficient (`O(n²)`), so you can iterate over an array using the `cJSON_ArrayForEach` macro in `O(n)` time complexity.
|
||||
|
||||
#### Objects
|
||||
|
||||
You can create an empty object with `cJSON_CreateObject`. `cJSON_CreateObjectReference` can be used to create an object that doesn't "own" its content, so its content doesn't get deleted by `cJSON_Delete`.
|
||||
|
||||
To add items to an object, use `cJSON_AddItemToObject`. Use `cJSON_AddItemToObjectCS` to add an item to an object with a name that is a constant or reference (key of the item, `string` in the `cJSON` struct), so that it doesn't get freed by `cJSON_Delete`.
|
||||
Using `cJSON_AddItemReferenceToArray` an element can be added as a reference to another object, array or string. This means that `cJSON_Delete` will not delete that items `child` or `valuestring` properties, so no double frees are occurring if they are already used elsewhere.
|
||||
|
||||
If you want to take an item out of an object, use `cJSON_DetachItemFromObjectCaseSensitive`, it will return the detached item, so be sure to assign it to a pointer, otherwise you will have a memory leak.
|
||||
|
||||
Deleting items is done with `cJSON_DeleteItemFromObjectCaseSensitive`. It works like `cJSON_DetachItemFromObjectCaseSensitive` followed by `cJSON_Delete`.
|
||||
|
||||
You can also replace an item in an object in place. Either with `cJSON_ReplaceItemInObjectCaseSensitive` using a key or with `cJSON_ReplaceItemViaPointer` given a pointer to an element. `cJSON_ReplaceItemViaPointer` will return `0` if it fails. What this does internally is to detach the old item, delete it and insert the new item in its place.
|
||||
|
||||
To get the size of an object, you can use `cJSON_GetArraySize`, this works because internally objects are stored as arrays.
|
||||
|
||||
If you want to access an item in an object, use `cJSON_GetObjectItemCaseSensitive`.
|
||||
|
||||
To iterate over an object, you can use the `cJSON_ArrayForEach` macro the same way as for arrays.
|
||||
|
||||
cJSON also provides convenient helper functions for quickly creating a new item and adding it to an object, like `cJSON_AddNullToObject`. They return a pointer to the new item or `NULL` if they failed.
|
||||
|
||||
### Parsing JSON
|
||||
|
||||
Given some JSON in a zero terminated string, you can parse it with `cJSON_Parse`.
|
||||
|
||||
```c
|
||||
cJSON *json = cJSON_Parse(string);
|
||||
```
|
||||
|
||||
Given some JSON in a string (whether zero terminated or not), you can parse it with `cJSON_ParseWithLength`.
|
||||
|
||||
```c
|
||||
cJSON *json = cJSON_ParseWithLength(string, buffer_length);
|
||||
```
|
||||
|
||||
It will parse the JSON and allocate a tree of `cJSON` items that represents it. Once it returns, you are fully responsible for deallocating it after use with `cJSON_Delete`.
|
||||
|
||||
The allocator used by `cJSON_Parse` is `malloc` and `free` by default but can be changed (globally) with `cJSON_InitHooks`.
|
||||
|
||||
If an error occurs a pointer to the position of the error in the input string can be accessed using `cJSON_GetErrorPtr`. Note though that this can produce race conditions in multithreading scenarios, in that case it is better to use `cJSON_ParseWithOpts` with `return_parse_end`.
|
||||
By default, characters in the input string that follow the parsed JSON will not be considered as an error.
|
||||
|
||||
If you want more options, use `cJSON_ParseWithOpts(const char *value, const char **return_parse_end, cJSON_bool require_null_terminated)`.
|
||||
`return_parse_end` returns a pointer to the end of the JSON in the input string or the position that an error occurs at (thereby replacing `cJSON_GetErrorPtr` in a thread safe way). `require_null_terminated`, if set to `1` will make it an error if the input string contains data after the JSON.
|
||||
|
||||
If you want more options giving buffer length, use `cJSON_ParseWithLengthOpts(const char *value, size_t buffer_length, const char **return_parse_end, cJSON_bool require_null_terminated)`.
|
||||
|
||||
### Printing JSON
|
||||
|
||||
Given a tree of `cJSON` items, you can print them as a string using `cJSON_Print`.
|
||||
|
||||
```c
|
||||
char *string = cJSON_Print(json);
|
||||
```
|
||||
|
||||
It will allocate a string and print a JSON representation of the tree into it. Once it returns, you are fully responsible for deallocating it after use with your allocator. (usually `free`, depends on what has been set with `cJSON_InitHooks`).
|
||||
|
||||
`cJSON_Print` will print with whitespace for formatting. If you want to print without formatting, use `cJSON_PrintUnformatted`.
|
||||
|
||||
If you have a rough idea of how big your resulting string will be, you can use `cJSON_PrintBuffered(const cJSON *item, int prebuffer, cJSON_bool fmt)`. `fmt` is a boolean to turn formatting with whitespace on and off. `prebuffer` specifies the first buffer size to use for printing. `cJSON_Print` currently uses 256 bytes for its first buffer size. Once printing runs out of space, a new buffer is allocated and the old gets copied over before printing is continued.
|
||||
|
||||
These dynamic buffer allocations can be completely avoided by using `cJSON_PrintPreallocated(cJSON *item, char *buffer, const int length, const cJSON_bool format)`. It takes a buffer to a pointer to print to and its length. If the length is reached, printing will fail and it returns `0`. In case of success, `1` is returned. Note that you should provide 5 bytes more than is actually needed, because cJSON is not 100% accurate in estimating if the provided memory is enough.
|
||||
|
||||
### Example
|
||||
|
||||
In this example we want to build and parse the following JSON:
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "Awesome 4K",
|
||||
"resolutions": [
|
||||
{
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"width": 1920,
|
||||
"height": 1080
|
||||
},
|
||||
{
|
||||
"width": 3840,
|
||||
"height": 2160
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
#### Printing
|
||||
|
||||
Let's build the above JSON and print it to a string:
|
||||
|
||||
```c
|
||||
//create a monitor with a list of supported resolutions
|
||||
//NOTE: Returns a heap allocated string, you are required to free it after use.
|
||||
char *create_monitor(void)
|
||||
{
|
||||
const unsigned int resolution_numbers[3][2] = {
|
||||
{1280, 720},
|
||||
{1920, 1080},
|
||||
{3840, 2160}
|
||||
};
|
||||
char *string = NULL;
|
||||
cJSON *name = NULL;
|
||||
cJSON *resolutions = NULL;
|
||||
cJSON *resolution = NULL;
|
||||
cJSON *width = NULL;
|
||||
cJSON *height = NULL;
|
||||
size_t index = 0;
|
||||
|
||||
cJSON *monitor = cJSON_CreateObject();
|
||||
if (monitor == NULL)
|
||||
{
|
||||
goto end;
|
||||
}
|
||||
|
||||
name = cJSON_CreateString("Awesome 4K");
|
||||
if (name == NULL)
|
||||
{
|
||||
goto end;
|
||||
}
|
||||
/* after creation was successful, immediately add it to the monitor,
|
||||
* thereby transferring ownership of the pointer to it */
|
||||
cJSON_AddItemToObject(monitor, "name", name);
|
||||
|
||||
resolutions = cJSON_CreateArray();
|
||||
if (resolutions == NULL)
|
||||
{
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToObject(monitor, "resolutions", resolutions);
|
||||
|
||||
for (index = 0; index < (sizeof(resolution_numbers) / (2 * sizeof(int))); ++index)
|
||||
{
|
||||
resolution = cJSON_CreateObject();
|
||||
if (resolution == NULL)
|
||||
{
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToArray(resolutions, resolution);
|
||||
|
||||
width = cJSON_CreateNumber(resolution_numbers[index][0]);
|
||||
if (width == NULL)
|
||||
{
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToObject(resolution, "width", width);
|
||||
|
||||
height = cJSON_CreateNumber(resolution_numbers[index][1]);
|
||||
if (height == NULL)
|
||||
{
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToObject(resolution, "height", height);
|
||||
}
|
||||
|
||||
string = cJSON_Print(monitor);
|
||||
if (string == NULL)
|
||||
{
|
||||
fprintf(stderr, "Failed to print monitor.\n");
|
||||
}
|
||||
|
||||
end:
|
||||
cJSON_Delete(monitor);
|
||||
return string;
|
||||
}
|
||||
```
|
||||
|
||||
Alternatively we can use the `cJSON_Add...ToObject` helper functions to make our lifes a little easier:
|
||||
|
||||
```c
|
||||
//NOTE: Returns a heap allocated string, you are required to free it after use.
|
||||
char *create_monitor_with_helpers(void)
|
||||
{
|
||||
const unsigned int resolution_numbers[3][2] = {
|
||||
{1280, 720},
|
||||
{1920, 1080},
|
||||
{3840, 2160}
|
||||
};
|
||||
char *string = NULL;
|
||||
cJSON *resolutions = NULL;
|
||||
size_t index = 0;
|
||||
|
||||
cJSON *monitor = cJSON_CreateObject();
|
||||
|
||||
if (cJSON_AddStringToObject(monitor, "name", "Awesome 4K") == NULL)
|
||||
{
|
||||
goto end;
|
||||
}
|
||||
|
||||
resolutions = cJSON_AddArrayToObject(monitor, "resolutions");
|
||||
if (resolutions == NULL)
|
||||
{
|
||||
goto end;
|
||||
}
|
||||
|
||||
for (index = 0; index < (sizeof(resolution_numbers) / (2 * sizeof(int))); ++index)
|
||||
{
|
||||
cJSON *resolution = cJSON_CreateObject();
|
||||
|
||||
if (cJSON_AddNumberToObject(resolution, "width", resolution_numbers[index][0]) == NULL)
|
||||
{
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (cJSON_AddNumberToObject(resolution, "height", resolution_numbers[index][1]) == NULL)
|
||||
{
|
||||
goto end;
|
||||
}
|
||||
|
||||
cJSON_AddItemToArray(resolutions, resolution);
|
||||
}
|
||||
|
||||
string = cJSON_Print(monitor);
|
||||
if (string == NULL)
|
||||
{
|
||||
fprintf(stderr, "Failed to print monitor.\n");
|
||||
}
|
||||
|
||||
end:
|
||||
cJSON_Delete(monitor);
|
||||
return string;
|
||||
}
|
||||
```
|
||||
|
||||
#### Parsing
|
||||
|
||||
In this example we will parse a JSON in the above format and check if the monitor supports a Full HD resolution while printing some diagnostic output:
|
||||
|
||||
```c
|
||||
/* return 1 if the monitor supports full hd, 0 otherwise */
|
||||
int supports_full_hd(const char * const monitor)
|
||||
{
|
||||
const cJSON *resolution = NULL;
|
||||
const cJSON *resolutions = NULL;
|
||||
const cJSON *name = NULL;
|
||||
int status = 0;
|
||||
cJSON *monitor_json = cJSON_Parse(monitor);
|
||||
if (monitor_json == NULL)
|
||||
{
|
||||
const char *error_ptr = cJSON_GetErrorPtr();
|
||||
if (error_ptr != NULL)
|
||||
{
|
||||
fprintf(stderr, "Error before: %s\n", error_ptr);
|
||||
}
|
||||
status = 0;
|
||||
goto end;
|
||||
}
|
||||
|
||||
name = cJSON_GetObjectItemCaseSensitive(monitor_json, "name");
|
||||
if (cJSON_IsString(name) && (name->valuestring != NULL))
|
||||
{
|
||||
printf("Checking monitor \"%s\"\n", name->valuestring);
|
||||
}
|
||||
|
||||
resolutions = cJSON_GetObjectItemCaseSensitive(monitor_json, "resolutions");
|
||||
cJSON_ArrayForEach(resolution, resolutions)
|
||||
{
|
||||
cJSON *width = cJSON_GetObjectItemCaseSensitive(resolution, "width");
|
||||
cJSON *height = cJSON_GetObjectItemCaseSensitive(resolution, "height");
|
||||
|
||||
if (!cJSON_IsNumber(width) || !cJSON_IsNumber(height))
|
||||
{
|
||||
status = 0;
|
||||
goto end;
|
||||
}
|
||||
|
||||
if ((width->valuedouble == 1920) && (height->valuedouble == 1080))
|
||||
{
|
||||
status = 1;
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
cJSON_Delete(monitor_json);
|
||||
return status;
|
||||
}
|
||||
```
|
||||
|
||||
Note that there are no NULL checks except for the result of `cJSON_Parse` because `cJSON_GetObjectItemCaseSensitive` checks for `NULL` inputs already, so a `NULL` value is just propagated and `cJSON_IsNumber` and `cJSON_IsString` return `0` if the input is `NULL`.
|
||||
|
||||
### Caveats
|
||||
|
||||
#### Zero Character
|
||||
|
||||
cJSON doesn't support strings that contain the zero character `'\0'` or `\u0000`. This is impossible with the current API because strings are zero terminated.
|
||||
|
||||
#### Character Encoding
|
||||
|
||||
cJSON only supports UTF-8 encoded input. In most cases it doesn't reject invalid UTF-8 as input though, it just propagates it through as is. As long as the input doesn't contain invalid UTF-8, the output will always be valid UTF-8.
|
||||
|
||||
#### C Standard
|
||||
|
||||
cJSON is written in ANSI C (or C89, C90). If your compiler or C library doesn't follow this standard, correct behavior is not guaranteed.
|
||||
|
||||
NOTE: ANSI C is not C++ therefore it shouldn't be compiled with a C++ compiler. You can compile it with a C compiler and link it with your C++ code however. Although compiling with a C++ compiler might work, correct behavior is not guaranteed.
|
||||
|
||||
#### Floating Point Numbers
|
||||
|
||||
cJSON does not officially support any `double` implementations other than IEEE754 double precision floating point numbers. It might still work with other implementations but bugs with these will be considered invalid.
|
||||
|
||||
The maximum length of a floating point literal that cJSON supports is currently 63 characters.
|
||||
|
||||
#### Deep Nesting Of Arrays And Objects
|
||||
|
||||
cJSON doesn't support arrays and objects that are nested too deeply because this would result in a stack overflow. To prevent this cJSON limits the depth to `CJSON_NESTING_LIMIT` which is 1000 by default but can be changed at compile time.
|
||||
|
||||
#### Thread Safety
|
||||
|
||||
In general cJSON is **not thread safe**.
|
||||
|
||||
However it is thread safe under the following conditions:
|
||||
|
||||
* `cJSON_GetErrorPtr` is never used (the `return_parse_end` parameter of `cJSON_ParseWithOpts` can be used instead)
|
||||
* `cJSON_InitHooks` is only ever called before using cJSON in any threads.
|
||||
* `setlocale` is never called before all calls to cJSON functions have returned.
|
||||
|
||||
#### Case Sensitivity
|
||||
|
||||
When cJSON was originally created, it didn't follow the JSON standard and didn't make a distinction between uppercase and lowercase letters. If you want the correct, standard compliant, behavior, you need to use the `CaseSensitive` functions where available.
|
||||
|
||||
#### Duplicate Object Members
|
||||
|
||||
cJSON supports parsing and printing JSON that contains objects that have multiple members with the same name. `cJSON_GetObjectItemCaseSensitive` however will always only return the first one.
|
||||
|
||||
# Enjoy cJSON!
|
||||
|
||||
- Dave Gamble (original author)
|
||||
- Max Bruckner and Alan Wang (current maintainer)
|
||||
- and the other [cJSON contributors](CONTRIBUTORS.md)
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"name": "@ohos/cjson",
|
||||
"version": "1.8.0",
|
||||
"description": "Ultralightweight JSON parser in ANSI C",
|
||||
"publishAs": "code-segment",
|
||||
"scripts": {
|
||||
"install": "DEST_PATH=${DEP_BUNDLE_BASE}/third_party/cJSON && mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH"
|
||||
},
|
||||
"keywords": [
|
||||
"json"
|
||||
],
|
||||
"author": {},
|
||||
"repository": "https://github.com/DaveGamble/cJSON",
|
||||
"license": "Apache V2",
|
||||
"tags": [
|
||||
"third_party"
|
||||
],
|
||||
"ohos": {
|
||||
"os": "1.0.0",
|
||||
"kernel": "",
|
||||
"board": ""
|
||||
}
|
||||
}
|
||||
+202
@@ -0,0 +1,202 @@
|
||||
|
||||
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
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
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.
|
||||
+138
@@ -0,0 +1,138 @@
|
||||
# CMSIS Version 5
|
||||
|
||||
The branch *master* of this GitHub repository contains the CMSIS Version 5.6.0. The [documentation](http://arm-software.github.io/CMSIS_5/General/html/index.html) is available under http://arm-software.github.io/CMSIS_5/General/html/index.html
|
||||
|
||||
Use [Issues](https://github.com/ARM-software/CMSIS_5#issues-and-labels) to provide feedback and report problems for CMSIS Version 5.
|
||||
|
||||
**Note:** The branch *develop* of this GitHub repository reflects our current state of development and is constantly updated. It gives our users and partners contiguous access to the CMSIS development. It allows you to review the work and provide feedback or create pull requests for contributions.
|
||||
|
||||
A [pre-built documentation](http://www.keil.com/pack/doc/CMSIS_Dev/index.html) is updated from time to time, but may be also generated using the instructions under [Generate CMSIS Pack for Release](https://github.com/ARM-software/CMSIS_5#generate-cmsis-pack-for-release).
|
||||
|
||||
## Overview of CMSIS Components
|
||||
|
||||
The following is an list of all CMSIS components that are available.
|
||||
|
||||
| CMSIS-... | Target Processors | Description |
|
||||
|:----------|:--------------------|:-------------|
|
||||
|[Core(M)](http://arm-software.github.io/CMSIS_5/Core/html/index.html) | All Cortex-M, SecurCore | Standardized API for the Cortex-M processor core and peripherals. Includes intrinsic functions for Cortex-M4/M7/M33/M35P SIMD instructions.|
|
||||
|[Core(A)](http://arm-software.github.io/CMSIS_5/Core_A/html/index.html)| Cortex-A5/A7/A9 | API and basic run-time system for the Cortex-A5/A7/A9 processor core and peripherals.|
|
||||
|[Driver](http://arm-software.github.io/CMSIS_5/Driver/html/index.html) | All Cortex-M, SecurCore | Generic peripheral driver interfaces for middleware. Connects microcontroller peripherals with middleware that implements for example communication stacks, file systems, or graphic user interfaces.|
|
||||
|[DSP](http://arm-software.github.io/CMSIS_5/DSP/html/index.html) | All Cortex-M | DSP library collection with over 60 Functions for various data types: fixed-point (fractional q7, q15, q31) and single precision floating-point (32-bit). Implementations optimized for the SIMD instruction set are available for Cortex-M4/M7/M33/M35P.|
|
||||
|[NN](http://arm-software.github.io/CMSIS_5/NN/html/index.html) | All Cortex-M | Collection of efficient neural network kernels developed to maximize the performance and minimize the memory footprint on Cortex-M processor cores.|
|
||||
|[RTOS v1](http://arm-software.github.io/CMSIS_5/RTOS/html/index.html) | Cortex-M0/M0+/M3/M4/M7 | Common API for real-time operating systems along with a reference implementation based on RTX. It enables software components that can work across multiple RTOS systems.|
|
||||
|[RTOS v2](http://arm-software.github.io/CMSIS_5/RTOS2/html/index.html)| All Cortex-M, Cortex-A5/A7/A9 | Extends CMSIS-RTOS v1 with Armv8-M support, dynamic object creation, provisions for multi-core systems, binary compatible interface. |
|
||||
|[Pack](http://arm-software.github.io/CMSIS_5/Pack/html/index.html) | All Cortex-M, SecurCore, Cortex-A5/A7/A9 | Describes a delivery mechanism for software components, device parameters, and evaluation board support. It simplifies software re-use and product life-cycle management (PLM). |
|
||||
|[SVD](http://arm-software.github.io/CMSIS_5/SVD/html/index.html) | All Cortex-M, SecurCore | Peripheral description of a device that can be used to create peripheral awareness in debuggers or CMSIS-Core header files.|
|
||||
|[DAP](http://arm-software.github.io/CMSIS_5/DAP/html/index.html) | All Cortex | Firmware for a debug unit that interfaces to the CoreSight Debug Access Port. |
|
||||
|[Zone](http://arm-software.github.io/CMSIS_5/Zone/html/index.html) | All Cortex | Defines methods to describe system resources and to partition these resources into multiple projects and execution areas. |
|
||||
|
||||
## Implemented Enhancements
|
||||
- CMSIS-Core-A, RTX5: implementation for Cortex-A5/A7/A9
|
||||
- Support for Armv8-M Architecture (Mainline and Baseline) as well as devices Cortex-M23 and Cortex-M33
|
||||
- CMSIS-RTOS2: RTX 5 is now available for IAR, GCC, Arm Compiler 5, Arm Compiler 6
|
||||
- CMSIS-RTOS2: FreeRTOS adoption (release) is available https://github.com/ARM-software/CMSIS-FreeRTOS
|
||||
- CMSIS-NN: Bare metal Neural Network function library.
|
||||
- CMSIS-DAP v2: with WinUSB for faster communication and separate pipe for SWO support
|
||||
- Config Wizard extension: access enum’s for configuration information
|
||||
|
||||
## Further Planned Enhancements
|
||||
- CMSIS-Zone: management of complex system
|
||||
- CMSIS-Pack:
|
||||
- System Description SDF Format: describe more complex debug topologies than with a Debug Description in a tool agnostic way
|
||||
- Github based workflow: allows to develop software packs using github infra-structure
|
||||
- Flash algorithm via debugger: Some TurstZone enable devices cannot execute RAM. Commands that allow flash programming will be added to Debug Description.
|
||||
- CPDSC project file format: allows project templates that are agnostic of an IDE
|
||||
- Minimize need for IDE specific settings: CMSIS-Pack supports IDE specific parameters. Analyze and minimize
|
||||
|
||||
For further details see also the [Slides of the Embedded World CMSIS Partner Meeting](https://github.com/ARM-software/CMSIS_5/blob/develop/CMSIS_EW2019.pdf).
|
||||
|
||||
## Other related GitHub repositories
|
||||
|
||||
| Repository | Description |
|
||||
|:--------------------------- |:--------------------------------------------------------- |
|
||||
| [cmsis-pack-eclipse](https://github.com/ARM-software/cmsis-pack-eclipse) | CMSIS-Pack Management for Eclipse reference implementation Pack support |
|
||||
| [CMSIS-FreeRTOS](https://github.com/arm-software/CMSIS-FreeRTOS) | CMSIS-RTOS adoption of FreeRTOS |
|
||||
| [CMSIS-Driver](https://github.com/arm-software/CMSIS-Driver) | Generic MCU driver implementations and templates for Ethernet MAC/PHY and Flash. |
|
||||
| [CMSIS-Driver_Validation](https://github.com/ARM-software/CMSIS-Driver_Validation) | CMSIS-Driver Validation can be used to verify CMSIS-Driver in a user system |
|
||||
| [CMSIS-Zone](https://github.com/ARM-software/CMSIS-Zone) | CMSIS-Zone Utility along with example projects and FreeMarker templates |
|
||||
| [NXP_LPC](https://github.com/ARM-software/NXP_LPC) | CMSIS Driver Implementations for the NXP LPC Microcontroller Series |
|
||||
| [mdk-packs](https://github.com/mdk-packs) | IoT cloud connectors as trail implementations for MDK (help us to make it generic)|
|
||||
| [trustedfirmware.org](https://www.trustedfirmware.org/) | Arm Trusted Firmware provides a reference implementation of secure world software for Armv8-A and Armv8-M.|
|
||||
|
||||
|
||||
## Directory Structure
|
||||
|
||||
| Directory | Content |
|
||||
|:-------------------- |:--------------------------------------------------------- |
|
||||
| CMSIS/Core | CMSIS-Core(M) related files (for release) |
|
||||
| CMSIS/Core_A | CMSIS-Core(A) related files (for release) |
|
||||
| CMSIS/CoreValidation | Validation for Core(M) and Core(A) (NOT part of release) |
|
||||
| CMSIS/DAP | CMSIS-DAP related files and examples |
|
||||
| CMSIS/Driver | CMSIS-Driver API headers and template files |
|
||||
| CMSIS/DSP | CMSIS-DSP related files |
|
||||
| CMSIS/NN | CMSIS-NN related files |
|
||||
| CMSIS/RTOS | RTOS v1 related files (for Cortex-M) |
|
||||
| CMSIS/RTOS2 | RTOS v2 related files (for Cortex-M & Armv8-M) |
|
||||
| CMSIS/Pack | CMSIS-Pack examples and tutorials |
|
||||
| CMSIS/DoxyGen | Source of the documentation |
|
||||
| CMSIS/Utilities | Utility programs |
|
||||
|
||||
## Generate CMSIS Pack for Release
|
||||
|
||||
This GitHub development repository contains already pre-built libraries (stored in Git-LFS) of various software components (DSP, RTOS, RTOS2).
|
||||
These libraries are validated for release. Git-LFS needs to be installed to retrieve the actual binary files, please see https://git-lfs.github.com/.
|
||||
|
||||
To build a complete CMSIS pack for installation the following additional tools are required:
|
||||
- **doxygen.exe** Version: 1.8.6 (Documentation Generator)
|
||||
- **mscgen.exe** Version: 0.20 (Message Sequence Chart Converter)
|
||||
- **7z.exe (7-Zip)** Version: 16.02 (File Archiver)
|
||||
|
||||
Using these tools, you can generate on a Windows PC:
|
||||
- **CMSIS Software Pack** using the batch file **gen_pack.bat** (located in ./CMSIS/Utilities). This batch file also generates the documentation.
|
||||
|
||||
- **CMSIS Documentation** using the batch file **genDoc.bat** (located in ./CMSIS/Doxygen).
|
||||
|
||||
The file ./CMSIS/DoxyGen/How2Doc.txt describes the rules for creating API documentation.
|
||||
|
||||
## License
|
||||
|
||||
Arm CMSIS is licensed under Apache-2.0.
|
||||
|
||||
## Contributions and Pull Requests
|
||||
|
||||
Contributions are accepted under Apache-2.0. Only submit contributions where you have authored all of the code.
|
||||
|
||||
### Issues and Labels
|
||||
|
||||
Please feel free to raise an [issue on GitHub](https://github.com/ARM-software/CMSIS_5/issues)
|
||||
to report misbehavior (i.e. bugs) or start discussions about enhancements. This
|
||||
is your best way to interact directly with the maintenance team and the community.
|
||||
We encourage you to append implementation suggestions as this helps to decrease the
|
||||
workload of the very limited maintenance team.
|
||||
|
||||
We will be monitoring and responding to issues as best we can.
|
||||
Please attempt to avoid filing duplicates of open or closed items when possible.
|
||||
In the spirit of openness we will be tagging issues with the following:
|
||||
|
||||
- **bug** – We consider this issue to be a bug that will be investigated.
|
||||
|
||||
- **wontfix** - We appreciate this issue but decided not to change the current behavior.
|
||||
|
||||
- **enhancement** – Denotes something that will be implemented soon.
|
||||
|
||||
- **future** - Denotes something not yet schedule for implementation.
|
||||
|
||||
- **out-of-scope** - We consider this issue loosely related to CMSIS. It might by implemented outside of CMSIS. Let us know about your work.
|
||||
|
||||
- **question** – We have further questions to this issue. Please review and provide feedback.
|
||||
|
||||
- **documentation** - This issue is a documentation flaw that will be improved in future.
|
||||
|
||||
- **review** - This issue is under review. Please be patient.
|
||||
|
||||
- **DONE** - We consider this issue as resolved - please review and close it. In case of no further activity this issues will be closed after a week.
|
||||
|
||||
- **duplicate** - This issue is already addressed elsewhere, see comment with provided references.
|
||||
|
||||
- **Important Information** - We provide essential informations regarding planned or resolved major enhancements.
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"name": "@ohos/cmsis",
|
||||
"version": "1.8.0",
|
||||
"description": "Provides standard, universal real-time operating system (RTOS) APIs",
|
||||
"publishAs": "code-segment",
|
||||
"scripts": {
|
||||
"install": "DEST_PATH=${DEP_BUNDLE_BASE}/third_party/cmsis && mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH"
|
||||
},
|
||||
"keywords": [
|
||||
"api",
|
||||
"rtos"
|
||||
],
|
||||
"author": {},
|
||||
"homepage": "https://hpm.cbg.huawei.com",
|
||||
"repository": "",
|
||||
"license": "Apache V2",
|
||||
"tags": [
|
||||
"third_party"
|
||||
],
|
||||
"ohos": {
|
||||
"os": "1.0.0",
|
||||
"kernel": "",
|
||||
"board": ""
|
||||
}
|
||||
}
|
||||
+202
@@ -0,0 +1,202 @@
|
||||
|
||||
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
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
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.
|
||||
@@ -0,0 +1,33 @@
|
||||
# crypto\_README
|
||||
|
||||
# 数据加解密模块<a name="ZH-CN_TOPIC_0000001054143192"></a>
|
||||
|
||||
## 简介<a name="section469617221261"></a>
|
||||
|
||||
数据加解密模块,配合轻量级ACE开发框架子系统,提供支持RSA及AES加解密功能的js api。
|
||||
|
||||
## 目录<a name="section1464106163817"></a>
|
||||
|
||||
```
|
||||
base
|
||||
├──security 安全子系统根目录
|
||||
└──── frameworks
|
||||
├── crypto_lite 数据加解密模块
|
||||
├── cipher
|
||||
├── BUILD.gn cipher模块编译配置
|
||||
├── include cipher模块头文件目录
|
||||
└── src cipher模块源文件目录
|
||||
├── js
|
||||
├── builtin
|
||||
├── BUILD.gn js对接模块编译配置
|
||||
├── include js对接模块头文件目录
|
||||
└── src js对接模块源文件目录
|
||||
└── LICENSE 开源LICENSE文件
|
||||
```
|
||||
|
||||
## 约束<a name="section0560184083217"></a>
|
||||
|
||||
目前仅支持Hi3516DV300版本。
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"name": "@ohos/crypto",
|
||||
"version": "1.8.0",
|
||||
"publishAs": "code-segment",
|
||||
"description": "数据加解密模块,配合轻量级ACE开发框架子系统,提供支持RSA及AES加解密功能的js api。",
|
||||
"scripts": {
|
||||
"install": "DEST_PATH=${DEP_BUNDLE_BASE}/base/security &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH"
|
||||
},
|
||||
"keywords": [
|
||||
"crypto"
|
||||
],
|
||||
"license": "Apache V2",
|
||||
"repository": "",
|
||||
"homepage": "",
|
||||
"tags": [
|
||||
"base"
|
||||
],
|
||||
"ohos": {
|
||||
"os": "1.0.0",
|
||||
"kernel": "liteos-a",
|
||||
"board": "hi3516,hi3518"
|
||||
}
|
||||
}
|
||||
+202
@@ -0,0 +1,202 @@
|
||||
|
||||
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
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
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.
|
||||
@@ -0,0 +1,86 @@
|
||||

|
||||
|
||||
[](https://bestpractices.coreinfrastructure.org/projects/63)
|
||||
[](https://scan.coverity.com/projects/curl)
|
||||
[](https://travis-ci.org/curl/curl)
|
||||
[](https://ci.appveyor.com/project/curlorg/curl)
|
||||
[](https://dev.azure.com/daniel0244/curl/_build/latest?definitionId=1&branchName=master)
|
||||
[](https://cirrus-ci.com/github/curl/curl)
|
||||
[](#backers)
|
||||
[](#sponsors)
|
||||
[](https://lgtm.com/projects/g/curl/curl/context:cpp)
|
||||
[](https://www.codacy.com/app/curl/curl?utm_source=github.com&utm_medium=referral&utm_content=curl/curl&utm_campaign=Badge_Grade)
|
||||
[](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:curl)
|
||||
|
||||
Curl is a command-line tool for transferring data specified with URL
|
||||
syntax. Find out how to use curl by reading [the curl.1 man
|
||||
page](https://curl.haxx.se/docs/manpage.html) or [the MANUAL
|
||||
document](https://curl.haxx.se/docs/manual.html). Find out how to install Curl
|
||||
by reading [the INSTALL document](https://curl.haxx.se/docs/install.html).
|
||||
|
||||
libcurl is the library curl is using to do its job. It is readily available to
|
||||
be used by your software. Read [the libcurl.3 man
|
||||
page](https://curl.haxx.se/libcurl/c/libcurl.html) to learn how!
|
||||
|
||||
You can find answers to the most frequent questions we get in [the FAQ
|
||||
document](https://curl.haxx.se/docs/faq.html).
|
||||
|
||||
Study [the COPYING file](https://curl.haxx.se/docs/copyright.html) for
|
||||
distribution terms and similar. If you distribute curl binaries or other
|
||||
binaries that involve libcurl, you might enjoy [the LICENSE-MIXING
|
||||
document](https://curl.haxx.se/legal/licmix.html).
|
||||
|
||||
## Contact
|
||||
|
||||
If you have problems, questions, ideas or suggestions, please contact us by
|
||||
posting to a suitable [mailing list](https://curl.haxx.se/mail/).
|
||||
|
||||
All contributors to the project are listed in [the THANKS
|
||||
document](https://curl.haxx.se/docs/thanks.html).
|
||||
|
||||
## Website
|
||||
|
||||
Visit the [curl web site](https://curl.haxx.se/) for the latest news and
|
||||
downloads.
|
||||
|
||||
## Git
|
||||
|
||||
To download the very latest source from the Git server do this:
|
||||
|
||||
git clone https://github.com/curl/curl.git
|
||||
|
||||
(you'll get a directory named curl created, filled with the source code)
|
||||
|
||||
## Security problems
|
||||
|
||||
Report suspected security problems via [our HackerOne
|
||||
page](https://hackerone.com/curl) and not in public!
|
||||
|
||||
## Notice
|
||||
|
||||
Curl contains pieces of source code that is Copyright (c) 1998, 1999 Kungliga
|
||||
Tekniska Högskolan. This notice is included here to comply with the
|
||||
distribution terms.
|
||||
|
||||
## Backers
|
||||
|
||||
Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/curl#backer)]
|
||||
|
||||
<a href="https://opencollective.com/curl#backers" target="_blank"><img src="https://opencollective.com/curl/backers.svg?width=890"></a>
|
||||
|
||||
## Sponsors
|
||||
|
||||
Support this project by becoming a sponsor. Your logo will show up here with a
|
||||
link to your website. [[Become a
|
||||
sponsor](https://opencollective.com/curl#sponsor)]
|
||||
|
||||
<a href="https://opencollective.com/curl/sponsor/0/website" target="_blank"><img src="https://opencollective.com/curl/sponsor/0/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/curl/sponsor/1/website" target="_blank"><img src="https://opencollective.com/curl/sponsor/1/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/curl/sponsor/2/website" target="_blank"><img src="https://opencollective.com/curl/sponsor/2/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/curl/sponsor/3/website" target="_blank"><img src="https://opencollective.com/curl/sponsor/3/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/curl/sponsor/4/website" target="_blank"><img src="https://opencollective.com/curl/sponsor/4/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/curl/sponsor/5/website" target="_blank"><img src="https://opencollective.com/curl/sponsor/5/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/curl/sponsor/6/website" target="_blank"><img src="https://opencollective.com/curl/sponsor/6/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/curl/sponsor/7/website" target="_blank"><img src="https://opencollective.com/curl/sponsor/7/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/curl/sponsor/8/website" target="_blank"><img src="https://opencollective.com/curl/sponsor/8/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/curl/sponsor/9/website" target="_blank"><img src="https://opencollective.com/curl/sponsor/9/avatar.svg"></a>
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"name": "@ohos/curl",
|
||||
"version": "1.8.0",
|
||||
"description": "A command line tool and library for transferring data with URL syntax, supporting HTTP, HTTPS, FTP, FTPS, GOPHER, TFTP, SCP, SFTP, SMB, TELNET, DICT, LDAP, LDAPS, FILE, IMAP, SMTP, POP3, RTSP and RTMP. libcurl offers a myriad of powerful features.",
|
||||
"publishAs": "code-segment",
|
||||
"scripts": {
|
||||
"install": "DEST_PATH=${DEP_BUNDLE_BASE}/third_party/curl && mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH"
|
||||
},
|
||||
"keywords": [
|
||||
"json"
|
||||
],
|
||||
"author": {},
|
||||
"homepage": "https://curl.haxx.se/",
|
||||
"repository": "https://github.com/curl/curl.git",
|
||||
"license": "Apache V2",
|
||||
"tags": [
|
||||
"third_party"
|
||||
],
|
||||
"ohos": {
|
||||
"os": "1.0.0",
|
||||
"kernel": "",
|
||||
"board": ""
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,202 @@
|
||||
|
||||
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
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
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.
|
||||
@@ -0,0 +1,430 @@
|
||||
# 测试子系统README
|
||||
|
||||
# 测试子系统<a name="ZH-CN_TOPIC_0000001050883540"></a>
|
||||
|
||||
## 简介<a name="section7375710115617"></a>
|
||||
|
||||
开发过程采用测试驱动开发模式,开发者基于系统新增特性可以通过开发者自己开发用例保证,对于系统已有特性的修改,也可通过修改项目中原有自测试用例保证,开发者自测试旨在帮助开发者在开发阶段就能开发出高质量代码
|
||||
|
||||
## 目录<a name="section102031353175317"></a>
|
||||
|
||||
**表 1** 开发者自测试工具源代码目录结构
|
||||
|
||||
<a name="table2977131081412"></a>
|
||||
<table><thead align="left"><tr id="row7977610131417"><th class="cellrowborder" valign="top" width="33.879999999999995%" id="mcps1.2.3.1.1"><p id="p18792459121314"><a name="p18792459121314"></a><a name="p18792459121314"></a>名称</p>
|
||||
</th>
|
||||
<th class="cellrowborder" valign="top" width="66.12%" id="mcps1.2.3.1.2"><p id="p77921459191317"><a name="p77921459191317"></a><a name="p77921459191317"></a>描述</p>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><tr id="row17977171010144"><td class="cellrowborder" valign="top" width="33.879999999999995%" headers="mcps1.2.3.1.1 "><p id="p2793159171311"><a name="p2793159171311"></a><a name="p2793159171311"></a>developertest</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="66.12%" headers="mcps1.2.3.1.2 "><p id="p879375920132"><a name="p879375920132"></a><a name="p879375920132"></a>开发自测试框架</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row259142201312"><td class="cellrowborder" valign="top" width="33.879999999999995%" headers="mcps1.2.3.1.1 "><p id="p640585013134"><a name="p640585013134"></a><a name="p640585013134"></a>developertest/src</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="66.12%" headers="mcps1.2.3.1.2 "><p id="p10406450131319"><a name="p10406450131319"></a><a name="p10406450131319"></a>测试框架源码</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row1188919458130"><td class="cellrowborder" valign="top" width="33.879999999999995%" headers="mcps1.2.3.1.1 "><p id="p115448132141"><a name="p115448132141"></a><a name="p115448132141"></a>developertest/src/core</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="66.12%" headers="mcps1.2.3.1.2 "><p id="p1254413131146"><a name="p1254413131146"></a><a name="p1254413131146"></a>测试执行器</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row6978161091412"><td class="cellrowborder" valign="top" width="33.879999999999995%" headers="mcps1.2.3.1.1 "><p id="p37931659101311"><a name="p37931659101311"></a><a name="p37931659101311"></a>developertest/src/core/build</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="66.12%" headers="mcps1.2.3.1.2 "><p id="p6793059171318"><a name="p6793059171318"></a><a name="p6793059171318"></a>自测试用例编译</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row6978201031415"><td class="cellrowborder" valign="top" width="33.879999999999995%" headers="mcps1.2.3.1.1 "><p id="p1738210441049"><a name="p1738210441049"></a><a name="p1738210441049"></a>developertest/src/core/command</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="66.12%" headers="mcps1.2.3.1.2 "><p id="p1629020401941"><a name="p1629020401941"></a><a name="p1629020401941"></a>对用户输入的命令行处理</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row1596814581415"><td class="cellrowborder" valign="top" width="33.879999999999995%" headers="mcps1.2.3.1.1 "><p id="p158313363613"><a name="p158313363613"></a><a name="p158313363613"></a>developertest/src/core/config</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="66.12%" headers="mcps1.2.3.1.2 "><p id="p12969358749"><a name="p12969358749"></a><a name="p12969358749"></a>测试框架配置管理</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row175618551244"><td class="cellrowborder" valign="top" width="33.879999999999995%" headers="mcps1.2.3.1.1 "><p id="p73791172718"><a name="p73791172718"></a><a name="p73791172718"></a>developertest/src/core/driver</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="66.12%" headers="mcps1.2.3.1.2 "><p id="p107568558416"><a name="p107568558416"></a><a name="p107568558416"></a>测试框架驱动执行器</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row114431614115"><td class="cellrowborder" valign="top" width="33.879999999999995%" headers="mcps1.2.3.1.1 "><p id="p1644216201111"><a name="p1644216201111"></a><a name="p1644216201111"></a>developertest/src/core/resource</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="66.12%" headers="mcps1.2.3.1.2 "><p id="p15441116171113"><a name="p15441116171113"></a><a name="p15441116171113"></a>测试框架配置文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row16289143217239"><td class="cellrowborder" valign="top" width="33.879999999999995%" headers="mcps1.2.3.1.1 "><p id="p82908327236"><a name="p82908327236"></a><a name="p82908327236"></a>developertest/src/core/testcase</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="66.12%" headers="mcps1.2.3.1.2 "><p id="p129013219235"><a name="p129013219235"></a><a name="p129013219235"></a>测试用例管理</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row1403172313113"><td class="cellrowborder" valign="top" width="33.879999999999995%" headers="mcps1.2.3.1.1 "><p id="p5403202371115"><a name="p5403202371115"></a><a name="p5403202371115"></a>developertest/src/core/common.py</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="66.12%" headers="mcps1.2.3.1.2 "><p id="p84031423201110"><a name="p84031423201110"></a><a name="p84031423201110"></a>测试框架公共操作</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row1688681821114"><td class="cellrowborder" valign="top" width="33.879999999999995%" headers="mcps1.2.3.1.1 "><p id="p4886718121111"><a name="p4886718121111"></a><a name="p4886718121111"></a>developertest/src/core/constants.py</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="66.12%" headers="mcps1.2.3.1.2 "><p id="p10886151811115"><a name="p10886151811115"></a><a name="p10886151811115"></a>测试框架全局常量</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row13247163492"><td class="cellrowborder" valign="top" width="33.879999999999995%" headers="mcps1.2.3.1.1 "><p id="p710851611910"><a name="p710851611910"></a><a name="p710851611910"></a>developertest/src/core/exception.py</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="66.12%" headers="mcps1.2.3.1.2 "><p id="p112471431895"><a name="p112471431895"></a><a name="p112471431895"></a>测试框架异常定义</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row1392104161718"><td class="cellrowborder" valign="top" width="33.879999999999995%" headers="mcps1.2.3.1.1 "><p id="p292154131715"><a name="p292154131715"></a><a name="p292154131715"></a>developertest/src/core/utils.py</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="66.12%" headers="mcps1.2.3.1.2 "><p id="p139224117173"><a name="p139224117173"></a><a name="p139224117173"></a>测试框架工具方法</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row43471438181714"><td class="cellrowborder" valign="top" width="33.879999999999995%" headers="mcps1.2.3.1.1 "><p id="p1134883851719"><a name="p1134883851719"></a><a name="p1134883851719"></a>developertest/src/main</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="66.12%" headers="mcps1.2.3.1.2 "><p id="p7348123861711"><a name="p7348123861711"></a><a name="p7348123861711"></a>测试框架平台</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row144751036111712"><td class="cellrowborder" valign="top" width="33.879999999999995%" headers="mcps1.2.3.1.1 "><p id="p16475163681716"><a name="p16475163681716"></a><a name="p16475163681716"></a>developertest/src/main/__main__.py</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="66.12%" headers="mcps1.2.3.1.2 "><p id="p11475103641712"><a name="p11475103641712"></a><a name="p11475103641712"></a>测试框架内部入口</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row11435113411716"><td class="cellrowborder" valign="top" width="33.879999999999995%" headers="mcps1.2.3.1.1 "><p id="p4435153416170"><a name="p4435153416170"></a><a name="p4435153416170"></a>developertest/example</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="66.12%" headers="mcps1.2.3.1.2 "><p id="p643523491711"><a name="p643523491711"></a><a name="p643523491711"></a>测试框架demo用例</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row988116194289"><td class="cellrowborder" valign="top" width="33.879999999999995%" headers="mcps1.2.3.1.1 "><p id="p7881161913283"><a name="p7881161913283"></a><a name="p7881161913283"></a>developertest/third_party</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="66.12%" headers="mcps1.2.3.1.2 "><p id="p58815196285"><a name="p58815196285"></a><a name="p58815196285"></a>测试框架依赖第三方组件适配</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row11235133231718"><td class="cellrowborder" valign="top" width="33.879999999999995%" headers="mcps1.2.3.1.1 "><p id="p19235153291712"><a name="p19235153291712"></a><a name="p19235153291712"></a>developertest/BUILD.gn</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="66.12%" headers="mcps1.2.3.1.2 "><p id="p19235143291715"><a name="p19235143291715"></a><a name="p19235143291715"></a>测试子系统编译配置</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row153133019174"><td class="cellrowborder" valign="top" width="33.879999999999995%" headers="mcps1.2.3.1.1 "><p id="p163153019174"><a name="p163153019174"></a><a name="p163153019174"></a>developertest/start.bat</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="66.12%" headers="mcps1.2.3.1.2 "><p id="p194133051713"><a name="p194133051713"></a><a name="p194133051713"></a>开发者自测试入口(Windows)</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row6640152712173"><td class="cellrowborder" valign="top" width="33.879999999999995%" headers="mcps1.2.3.1.1 "><p id="p2641202751712"><a name="p2641202751712"></a><a name="p2641202751712"></a>developertest/start.sh</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="66.12%" headers="mcps1.2.3.1.2 "><p id="p86419276175"><a name="p86419276175"></a><a name="p86419276175"></a>开发者自测试入口(Linux)</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
## 约束<a name="section87444710110"></a>
|
||||
|
||||
测试工具环境依赖
|
||||
|
||||
1. python版本\>=3.7.5
|
||||
2. NFS版本\>=V4
|
||||
3. 运行操作系统:Windows版本\>=Win10,Linux为Ubuntu18.04
|
||||
|
||||
## 安装<a name="section1347156474"></a>
|
||||
|
||||
依赖python环境:
|
||||
|
||||
需要本地的python安装串口插件pyserial,在shell界面执行安装命令pip intall pyserial,安装成功如下图
|
||||
|
||||

|
||||
|
||||
## 编写测试用例<a name="section125411936102918"></a>
|
||||
|
||||
- 自测试用例规范
|
||||
- 命名规范
|
||||
|
||||
测试用例源文件名称和测试套内容保持一致,测试套与用例之间关系1:N,测试套与测试源文件之间关系1:1,每个源文件全局唯一,格式:\[特性\]\_\[功能\]\_\[子功能1\]\_\[子功能1.1\],子功能支持向下细分。
|
||||
|
||||
文件命名采用大驼峰方式命名,以Test结尾,如demo用例:developertest/example/cxx\_demo
|
||||
|
||||
- 用例编码规范
|
||||
|
||||
开发者自测试用例原则上与特性代码编码规范保持一致,另外需要添加必要的用例描述信息,详见[•自测试用例模板](#li2069415903917)
|
||||
|
||||
- 测试用例编译配置规范
|
||||
|
||||
用例采用GN方式编译,配置遵循本开源项目的编译指导[使用](zh-cn_topic_0000001051580775.md)
|
||||
|
||||
|
||||
- <a name="li2069415903917"></a>自测试用例模板
|
||||
|
||||
详见测试demo用例developertest/example/cxx\_demo/test/unittest/common/calc\_subtraction\_test.cpp
|
||||
|
||||
> **说明:**
|
||||
>Feature: 被测特性的描述
|
||||
>Function: 被测特性功能
|
||||
>SubFunction:被测特性子功能
|
||||
>FunctionPoints:被测的功能点
|
||||
>EnvConditions:被测特性的环境与被测条件
|
||||
>CaseDescription:测试用例描述
|
||||
>step:测试复杂逻辑时注明用例执行的步骤
|
||||
|
||||
- 自测试用例目录规划
|
||||
|
||||
```
|
||||
subsystem(子系统,系统组件)
|
||||
├── module(模块)
|
||||
│ └── test(模块测试目录)
|
||||
│ └── unittest(单元测试)
|
||||
│ ├── common(公共用例)
|
||||
│ ├── liteos(仅liteos核用例)
|
||||
│ └── linux(仅Linux核用例)
|
||||
│ └── moduletest(模块测试)
|
||||
│ ├── common
|
||||
│ ├── liteos
|
||||
│ └── linux
|
||||
└── test(子系统测试目录)
|
||||
└── unittest(单元测试)
|
||||
├── common
|
||||
├── liteos
|
||||
├── linux
|
||||
└── moduletest(模块测试)
|
||||
├── common
|
||||
├── liteos
|
||||
├── linux
|
||||
|
||||
```
|
||||
|
||||
> **说明:**
|
||||
>其中liteos和Linux仅不同设备形态举例,对于同一特性在不同开发板上,如果用例没有差异,则用例放置common目录下,如果同一特性,用例区分不同设备形态,可能包含内核差异,芯片平台差异,则用例以目录区分
|
||||
|
||||
- 编写自测试用例步骤
|
||||
1. 添加用例文件头注释说明
|
||||
2. 引用gtest头文件和ext命名空间
|
||||
3. 添加被测试类头文件
|
||||
4. 定义测试套(测试类)
|
||||
5. 实现该测试套具体的测试用例,包括用例注释和用例逻辑实现
|
||||
6. 编写用例编译配置
|
||||
|
||||
> **说明:**
|
||||
>\*样例参考:developertest/example/cxx\_demo/test/unittest/common/calc\_subtraction\_test.cpp
|
||||
>注意点如下:
|
||||
>a、SetUp & TearDown是针对该测试套下每条用例执行前和执行后的处理逻辑
|
||||
>b、SetUpTestCase & TearDownTestCase是针对该测试套下所有用例执行前和执行后的处理逻辑
|
||||
>c、HWTEST的使用:特点:只适合做简单测试(执行不依赖Setup & Teardown)缺点:多个测试场景需要相同数据配置的情况不适用,测试用例之间可能相互影响,不具备独立性
|
||||
>d、使用printf函数打印日志
|
||||
|
||||
|
||||
- 编写用例编译文件
|
||||
- 定义用例编译构建目标
|
||||
1. 添加用例编译文件头注释信息
|
||||
2. 导入用例编译模板文件
|
||||
3. 指定用例文件输出路径
|
||||
4. 配置用例编译依赖包含目录
|
||||
5. 指定用例编译目标输出的用例执行文件名称
|
||||
6. 编写具体的用例编译脚本(添加需要参与编译的源文件、配置和依赖 )
|
||||
7. 对目标用例文件进行条件分组(分组名称固定为:unittest/moduletest\)
|
||||
|
||||
- 如果存在多个测试套,定义公共编译配置
|
||||
- 将测试用例添加到构建系统中
|
||||
|
||||
> **说明:**
|
||||
>\*样例参考:developertest/example/cxx\_demo/test/unittest/common/BUILD.gn
|
||||
|
||||
|
||||
- 测试用例级别定义
|
||||
- 基本(Level1):<1s
|
||||
- 重要(Level2):<10s
|
||||
- 一般(Level3):<5min
|
||||
- 生僻(Level4):\>5min
|
||||
|
||||
|
||||
## 使用测试框架<a name="section75882026185016"></a>
|
||||
|
||||
- 安装xdevice基础框架
|
||||
1. 以Windows环境为例,打开xdevice安装目录:test\\xdevice
|
||||
2. 打开控制台窗口,执行如下命令
|
||||
|
||||
```
|
||||
python setup.py install
|
||||
```
|
||||
|
||||
3. 安装成功如下图
|
||||
|
||||

|
||||
|
||||
|
||||
- 修改xdevice基础框架配置
|
||||
|
||||
文件:xdevice/config/user\_config.xml
|
||||
|
||||
1. \[device\] \# 配置标签为ipcamera的串口信息,COM口和波特率,例如
|
||||
|
||||
```
|
||||
<device type="com" label="ipcamera">
|
||||
<serial>
|
||||
<com>COM1</com>
|
||||
<type>cmd</type>
|
||||
<baund_rate>115200</baund_rate>
|
||||
<data_bits>8</data_bits>
|
||||
<stop_bits>1</stop_bits>
|
||||
<timeout>1</timeout>
|
||||
</serial>
|
||||
</device>
|
||||
```
|
||||
|
||||
|
||||
- 修改developertest组件配置
|
||||
|
||||
文件:resource/config/user\_config.xml
|
||||
|
||||
1. \[test\_cases\] \# 指定测试用例的输出路径,编译输出目录,例如
|
||||
|
||||
```
|
||||
<test_cases>
|
||||
<dir>S:\out\ipcamera_hi3518ev300_liteos_a\test</dir>
|
||||
</test_cases>
|
||||
```
|
||||
|
||||
2. \[NFS\] \# 指定NFS的映射路径,host\_dir为PC侧的NFS目录,board\_dir为板侧创建的目录,例如
|
||||
|
||||
```
|
||||
<NFS>
|
||||
<host_dir>D:\nfs</host_dir>
|
||||
<board_dir>user</board_dir>
|
||||
</NFS>
|
||||
```
|
||||
|
||||
|
||||
- 执行自测试用例前的环境检查
|
||||
- 系统镜像与文件系统已烧录进开发板,开发板上系统正常运行,在系统模式下,如shell登录时设备提示符OHOS\#
|
||||
- 开发主机和开发板串口连接正常,网口连接正常
|
||||
- 开发主机IP与开发板IP处在同一小网网段,相互可以ping通
|
||||
- 开发主机侧创建空目录用于开发板通过NFS挂载测试用例,并且NFS服务启动正常
|
||||
|
||||
- 运行测试套
|
||||
- 启动测试框架
|
||||
1. Windows环境启动测试框架
|
||||
|
||||
```
|
||||
start.bat
|
||||
```
|
||||
|
||||
2. Linux环境启动测试框架
|
||||
|
||||
```
|
||||
./strat.sh
|
||||
```
|
||||
|
||||
|
||||
- 设备形态选择
|
||||
|
||||
根据实际的开发板选择,设备形态配置:developertest/src/core/resource/config/framework\_config.xml
|
||||
|
||||
- 执行测试指令
|
||||
1. 执行测试指令示例,其中-t ut为必选,-ss和-tm为可选字段
|
||||
|
||||
```
|
||||
run -t ut -ss test -tm example
|
||||
```
|
||||
|
||||
2. 参数说明:指定参数可以执行特定特性、模块对应的测试套
|
||||
|
||||
```
|
||||
usage: __main__.py [-h] [-p PRODUCTFORM] [-t [TESTTYPE [TESTTYPE ...]]]
|
||||
[-ss SUBSYSTEM] [-tm TESTMODULE] [-ts TESTSUIT]
|
||||
[-tc TESTCASE] [-tl TESTLEVEL] [-os TARGET_OS_NAME]
|
||||
[-bv BUILD_VARIANT] [-b [BUILD [BUILD ...]]]
|
||||
[-cov COVERAGE] [-tf TESTFILE] [-res RESOURCE]
|
||||
[-sn DEVICE_SN] [-c CONFIG] [-rp REPORTPATH] [-e EXECTYPE]
|
||||
[-td TEST_DRIVER]
|
||||
action Specify test para.positional arguments:
|
||||
action Specify action
|
||||
|
||||
optional arguments:
|
||||
-h, --help show this help message and exit
|
||||
-p PRODUCTFORM, --productform PRODUCTFORM Specified product form
|
||||
-t [TESTTYPE [TESTTYPE ...]], --testtype [TESTTYPE [TESTTYPE ...]]
|
||||
Specify test type(UT,MST,ST,PERF,ALL)
|
||||
-ss SUBSYSTEM, --subsystem SUBSYSTEM Specify test subsystem
|
||||
-tm TESTMODULE, --testmodule TESTMODULE Specified test module
|
||||
-ts TESTSUIT, --testsuit TESTSUIT Specify test suit
|
||||
-tc TESTCASE, --testcase TESTCASE Specify test case
|
||||
-tl TESTLEVEL, --testlevel TESTLEVEL Specify test level
|
||||
-bv BUILD_VARIANT, --build_variant BUILD_VARIANT Specify build variant(release,debug)
|
||||
-b [BUILD [BUILD ...]], --build [BUILD [BUILD ...]]
|
||||
Specify build values(version,testcase)
|
||||
-tf TESTFILE, --testfile TESTFILE Specify test suites list file
|
||||
-res RESOURCE, --resource RESOURCE Specify test resource
|
||||
-sn DEVICE_SN, --device_sn DEVICE_SN Specify device serial number
|
||||
-c CONFIG, --config CONFIG Specify test config file
|
||||
-rp REPORTPATH, --reportpath REPORTPATH Specify test report path
|
||||
-e EXECTYPE, --exectype EXECTYPE Specify test execute type
|
||||
-td TEST_DRIVER, --testdriver TEST_DRIVER Specify test driver id
|
||||
```
|
||||
|
||||
|
||||
|
||||
- 测试框架帮助
|
||||
- 帮助指令,用于查询测试平台支持哪些测试指令
|
||||
|
||||
```
|
||||
help
|
||||
```
|
||||
|
||||
|
||||
|
||||
## 测试结果与日志<a name="section414715805819"></a>
|
||||
|
||||
- 通过在测试框架中执行测试指令,即可以生成测试日志和测试报告
|
||||
- 测试结果
|
||||
- 测试用例的结果会直接显示在控制台上,执行一次的测试结果根路径如下:
|
||||
|
||||
```
|
||||
reports/xxxx-xx-xx-xx-xx-xx
|
||||
```
|
||||
|
||||
- 测试用例格式化结果
|
||||
|
||||
```
|
||||
result/
|
||||
```
|
||||
|
||||
- 测试用例日志
|
||||
|
||||
```
|
||||
log/plan_log_xxxx-xx-xx-xx-xx-xx.log
|
||||
```
|
||||
|
||||
- 测试报告概率
|
||||
|
||||
```
|
||||
summary_report.html
|
||||
```
|
||||
|
||||
- 测试报告详情
|
||||
|
||||
```
|
||||
details_report.html
|
||||
```
|
||||
|
||||
|
||||
- 测试框架日志
|
||||
|
||||
```
|
||||
reports/platform_log_xxxx-xx-xx-xx-xx-xx.log
|
||||
```
|
||||
|
||||
- 最近一次测试报告
|
||||
|
||||
```
|
||||
reports/latest
|
||||
```
|
||||
|
||||
|
||||
## 涉及仓<a name="section6299103515474"></a>
|
||||
|
||||
test\_developertest
|
||||
|
||||
test\_xdevice
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"name": "@ohos/developer_test",
|
||||
"version": "1.8.0",
|
||||
"publishAs": "code-segment",
|
||||
"description": "开发过程采用测试驱动开发模式,开发者基于系统新增特性可以通过开发者自己开发用例保证,对于系统已有特性的修改,也可通过修改项目中原有自测试用例保证,开发者自测试旨在帮助开发者在开发阶段就能开发出高质量代码",
|
||||
"scripts": {
|
||||
"install": "DEST_PATH=${DEP_BUNDLE_BASE}/test &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH"
|
||||
},
|
||||
"keywords": [
|
||||
"test"
|
||||
],
|
||||
"license": "Apache V2",
|
||||
"repository": "",
|
||||
"homepage": "",
|
||||
"tags": [
|
||||
"test"
|
||||
],
|
||||
"ohos": {
|
||||
"os": "1.0.0",
|
||||
"kernel": "liteos-a",
|
||||
"board": "hi3516,hi3518"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,202 @@
|
||||
|
||||
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
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
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.
|
||||
@@ -0,0 +1,12 @@
|
||||
# dfxcommon\_README
|
||||
|
||||
# DFX子系统通用介绍<a name="ZH-CN_TOPIC_0000001054383201"></a>
|
||||
|
||||
Log:日志支持流水实时输出和文件落盘。
|
||||
|
||||
Event:提供事件打点统一抽象接口,记录重要事件。
|
||||
|
||||
Dump:提供系统故障自动dump机制,暂不支持。
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"name": "@ohos/dfx_common",
|
||||
"version": "1.8.0",
|
||||
"publishAs": "code-segment",
|
||||
"description": "Log:日志支持流水实时输出和文件落盘。-Event:提供事件打点统一抽象接口,记录重要事件。Dump:提供系统故障自动dump机制,暂不支持。",
|
||||
"scripts": {
|
||||
"install": "DEST_PATH=${DEP_BUNDLE_BASE}/base/hiviewdfx/utils/lite &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH"
|
||||
},
|
||||
"keywords": [
|
||||
"dfxcommon"
|
||||
],
|
||||
"license": "Apache V2",
|
||||
"repository": "",
|
||||
"homepage": "",
|
||||
"tags": [
|
||||
"base"
|
||||
],
|
||||
"ohos": {
|
||||
"os": "1.0.0",
|
||||
"kernel": "liteos-m",
|
||||
"board": "hi3861"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,202 @@
|
||||
|
||||
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
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
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.
|
||||
@@ -0,0 +1,139 @@
|
||||
# 分布式任务调度子系统<a name="ZH-CN_TOPIC_0000001051983009"></a>
|
||||
|
||||
## 简介<a name="section11660541593"></a>
|
||||
|
||||
分布式任务调度模块,通过主(智慧屏设备)从设备(运动手表等小内存设备)服务代理机制,在异构操作系统上建立起分布式服务平台,支持OpenHarmony智慧屏与拉起其它OpenHarmony设备FA的能力。轻量分布式调度模块组成如下图所示:
|
||||
|
||||

|
||||
|
||||
## 目录<a name="section1464106163817"></a>
|
||||
|
||||
分布式任务调度源代码目录结构如下表所示:
|
||||
|
||||
**表1 **主要源代码目录结构
|
||||
|
||||
<a name="table43531856201716"></a>
|
||||
<table><thead align="left"><tr id="row20416556201718"><th class="cellrowborder" valign="top" width="50%" id="mcps1.1.3.1.1"><p id="p10416456121716"><a name="p10416456121716"></a><a name="p10416456121716"></a>名称</p>
|
||||
</th>
|
||||
<th class="cellrowborder" valign="top" width="50%" id="mcps1.1.3.1.2"><p id="p1841645631717"><a name="p1841645631717"></a><a name="p1841645631717"></a>描述</p>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><tr id="row64161056151718"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.1.3.1.1 "><p id="p9416656181720"><a name="p9416656181720"></a><a name="p9416656181720"></a>dtbschedmgr_lite</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.1.3.1.2 "><p id="p541645611177"><a name="p541645611177"></a><a name="p541645611177"></a>轻量级分布式任务调度实现。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row104169564177"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.1.3.1.1 "><p id="p17416125614179"><a name="p17416125614179"></a><a name="p17416125614179"></a>safwk_lite</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.1.3.1.2 "><p id="p04163569170"><a name="p04163569170"></a><a name="p04163569170"></a>系统服务进程实现。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row04161056121719"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.1.3.1.1 "><p id="p13416165621713"><a name="p13416165621713"></a><a name="p13416165621713"></a>samgr_lite</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.1.3.1.2 "><p id="p13417125611175"><a name="p13417125611175"></a><a name="p13417125611175"></a>本地服务管理实现。</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
其中轻量级分布式任务调度的源代码目录结构如下:
|
||||
|
||||
```
|
||||
├── BUILD.gn
|
||||
├── include
|
||||
│ ├── distributed_schedule_service.h # 分布式调度对外接口文件
|
||||
│ ├── dmslite_check_remote_permission.h # 分布式调度权限管理模块
|
||||
│ ├── dmslite_famgr.h # 分布式调度FA管理模块
|
||||
│ ├── dmslite_inner_common.h # 分布式调度服务文件
|
||||
│ ├── dmslite.h # 分布式调度实现
|
||||
│ ├── dmslite_log.h # 日志模块
|
||||
│ ├── dmslite_msg_parser.h # 通讯数据反序列化
|
||||
│ ├── dmslite_tlv_common.h # TLV格式数据解析模块
|
||||
│ └── dmslite_session.h # 跨设备通信辅助文件
|
||||
├── README.md
|
||||
├── LICENSE
|
||||
├── source
|
||||
├── distributed_schedule_service.c
|
||||
├── dmslite.c
|
||||
├── dmslite_check_remote_permission.c
|
||||
├── dmslite_famgr.c
|
||||
├── dmslite_msg_parser.c
|
||||
├── dmslite_tlv_common.c
|
||||
└── dmslite_session.c
|
||||
```
|
||||
|
||||
## 约束<a name="section1718733212019"></a>
|
||||
|
||||
语言限制:C语言。 组网环境:必须确保设备在同一个局域网中。操作系统限制:OpenHarmony操作系统。
|
||||
|
||||
**远程启动的约束与限制:**
|
||||
|
||||
- 支持远程启动FA,不支持远程启动SA。
|
||||
- 远程启动前必须确保主设备(智慧屏设备)与从设备间(运动手表等小内存设备)分布式组网成功(需要在同一网段内,可互相ping通),否则无法远程启动。
|
||||
|
||||
## 使用<a name="section10729231131110"></a>
|
||||
|
||||
**轻量级分布式调度模块编译**
|
||||
|
||||
轻量级分布式调度模块通过一些特性宏来定制不同平台上参与编译的功能代码,该部分代码位于build\\lite\\config\\subsystem\\distributedschedule\\目录下,目录结构如下:
|
||||
|
||||
```
|
||||
build/lite/config/subsystem/distributedschedule
|
||||
├── BUILD.gn
|
||||
```
|
||||
|
||||
在编译不同的平台目标时,需要使用对BUILD.gn进行修改,以下以平台hi3518ev300和hi3516dv300为例:
|
||||
|
||||
```
|
||||
zlite_subsystem("distributedschedule") {
|
||||
subsystem_components = [
|
||||
"//foundation/distributedschedule/services/samgr_lite:samgr",
|
||||
]
|
||||
if (board_name == "hi3518ev300" || board_name == "hi3516dv300") {
|
||||
subsystem_components += [
|
||||
"//foundation/distributedschedule/services/safwk_lite:safwk_lite",
|
||||
"//foundation/distributedschedule/services/dtbschedmgr_lite:dtbschedmgr", // 轻量级分布式调度模块配置
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**\* 主设备程序开发**(以拉起FA为例)
|
||||
|
||||
构造want,首先使用ElementName类表明需要启动的远端设备ID,包名,元能力类名,传入want中,然后设置want中的分布式标志位Want.FLAG\_ABILITYSLICE\_MULTI\_DEVICE表示需要远程启动。
|
||||
|
||||
```
|
||||
// 引入相关头文件
|
||||
import ohos.aafwk.ability.Ability;
|
||||
import ohos.aafwk.content.Want;
|
||||
import ohos.bundle.ElementName;
|
||||
|
||||
// 启动远程设备FA
|
||||
Want want = new Want(); // 封装启动远端FA的Want
|
||||
ElementName name = new ElementName("remote_device_id", "com.huawei.remote_package_name", "remote_class_name");
|
||||
want.setElement(name); // 将待启动的FA信息添加到Want中
|
||||
want.setFlags(Want.FLAG_ABILITYSLICE_MULTI_DEVICE); // 设置分布式标记,若不设置将无法使用分布式能力
|
||||
startAbility(want); // 按照Want启动指定FA,Want参数命名以实际开发平台API为准
|
||||
```
|
||||
|
||||
**\* 预置条件**
|
||||
|
||||
**主从设备间组网**:远程启动前必须确保主从设备分布式组网成功(需要在同一网段内,可互相ping通),否则无法远程启
|
||||
|
||||
**从设备FA安装:**安装测试或者自开发的FA到从设备
|
||||
|
||||
**\* 运行**(以拉起FA为例)
|
||||
|
||||
执行主设备(智慧屏)侧的startAbility即可拉起从设备(运动手表等小内存设备)FA
|
||||
|
||||
## 涉及仓<a name="section176111311166"></a>
|
||||
|
||||
distributedschedule\_interfaces\_kits\_samgr\_lite
|
||||
|
||||
distributedschedule\_services\_dtbschedmgr\_lite
|
||||
|
||||
distributedschedule\_services\_safwk\_lite
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"name": "@ohos/distributed_scheduler",
|
||||
"version": "1.8.0",
|
||||
"publishAs": "code-segment",
|
||||
"description": "分布式任务调度模块,通过主(智慧屏设备)从设备(运动手表等小内存设备)服务代理机制,在异构操作系统上建立起分布式服务平台,支持OpenHarmony智慧屏与拉起其它OpenHarmony设备FA的能力。",
|
||||
"scripts": {
|
||||
"install": "DEST_PATH=${DEP_BUNDLE_BASE}/foundation/distributedschedule/services/dtbschedmgr_lite &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH"
|
||||
},
|
||||
"keywords": [
|
||||
"distributedscheduler"
|
||||
],
|
||||
"license": "Apache V2",
|
||||
"repository": "",
|
||||
"homepage": "",
|
||||
"tags": [
|
||||
"foundation"
|
||||
],
|
||||
"ohos": {
|
||||
"os": "1.0.0",
|
||||
"kernel": "liteos-a",
|
||||
"board": "hi3516"
|
||||
}
|
||||
}
|
||||
+202
@@ -0,0 +1,202 @@
|
||||
|
||||
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
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
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.
|
||||
@@ -0,0 +1 @@
|
||||
readme
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"name": "@ohos/fatfs",
|
||||
"version": "1.8.0",
|
||||
"publishAs": "code-segment",
|
||||
"scripts": {
|
||||
"install": "DEST_PATH=${DEP_BUNDLE_BASE}/third_party/FatFs && mkdir -p $DEST_PATH&& cp -r ./* $DEST_PATH"
|
||||
},
|
||||
"description": "FatFs is a generic FAT/exFAT filesystem module for small embedded systems. The FatFs module is written in compliance with ANSI C (C89) and completely separated from the disk I/O layer. Therefore it is independent of the platform. It can be incorporated into small microcontrollers with limited resource, such as 8051, PIC, AVR, ARM, Z80, RX and etc. Also Petit FatFs module for tiny microcontrollers is available here.",
|
||||
"keywords": [
|
||||
"thirdparty",
|
||||
"fatfs"
|
||||
],
|
||||
"license": "Apache V2",
|
||||
"repository": "",
|
||||
"homepage": "http://elm-chan.org/fsw/ff/00index_e.html",
|
||||
"tags": [
|
||||
"third_party"
|
||||
],
|
||||
"ohos": {
|
||||
"os": "1.0.0",
|
||||
"kernel": "",
|
||||
"board": ""
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,202 @@
|
||||
|
||||
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
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
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.
|
||||
@@ -0,0 +1,628 @@
|
||||
# 系统服务框架子系统<a name="ZH-CN_TOPIC_0000001051589563"></a>
|
||||
|
||||
## 简介<a name="section11660541593"></a>
|
||||
|
||||
由于平台资源有限,且硬件平台多样,因此需要屏蔽不同硬件架构和资源的不同、以及运行形态的不同,提供统一化的系统服务开发框架。根据RISC-V、Cortex-M、Cortex-A不同硬件平台,分为两种硬件平台,以下简称M核、A核。
|
||||
|
||||
M核:处理架构为Cortex-M或同等处理能力的硬件平台,系统内存一般低于512KB,无文件系统或者仅提供一个可有限使用的轻量级文件系统,遵循CMSIS接口规范。
|
||||
|
||||
A核:处理架构为Cortex-A或同等处理能力的硬件平台,内存资源大于512KB,文件系统完善,可存储大量数据,遵循POSIX接口规范。
|
||||
|
||||
系统服务框架基于面向服务的架构,提供了服务开发、服务的子功能开发、对外接口的开发、以及多服务共进程、进程间服务调用等开发能力。其中:
|
||||
|
||||
- M核:包含服务开发、服务的子功能开发、对外接口的开发以及多服务共进程的开发框架。
|
||||
- A核:在M核能力基础之上,包含了进程间服务调用、进程间服务调用权限控制、进程间服务接口的开发等能力。
|
||||
|
||||
面向服务的架构:
|
||||
|
||||

|
||||
|
||||
Provider:服务的提供者,为系统提供能力(对外接口)。
|
||||
|
||||
Consumer:服务的消费者,调用服务提供的功能(对外接口)。
|
||||
|
||||
Samgr:做为中介者,管理Provider提供的能力,同时帮助Consumer发现Provider的能力。
|
||||
|
||||
系统服务开发框架主体对象:
|
||||
|
||||

|
||||
|
||||
- SamgrLite:主要提供服务的注册与发现能力。
|
||||
- Service:开发服务时,需要实现的服务的生命周期接口。
|
||||
- Feature:开发功能时,需要实现的功能的生命周期接口。
|
||||
- IUnknown:基于IUnknown开发服务或功能的对外接口。
|
||||
- IClientProxy:IPC调用时,消费者的消息发送代理。
|
||||
- IServerProxy:IPC调用时,开发者需要实现提供者的消息处理接口。
|
||||
|
||||
## 目录<a name="section1464106163817"></a>
|
||||
|
||||
**表 1** 系统服务框架源代码目录结构
|
||||
|
||||
<a name="table2977131081412"></a>
|
||||
<table><thead align="left"><tr id="row7977610131417"><th class="cellrowborder" valign="top" width="31.3%" id="mcps1.2.3.1.1"><p id="p18792459121314"><a name="p18792459121314"></a><a name="p18792459121314"></a>名称</p>
|
||||
</th>
|
||||
<th class="cellrowborder" valign="top" width="68.7%" id="mcps1.2.3.1.2"><p id="p77921459191317"><a name="p77921459191317"></a><a name="p77921459191317"></a>描述</p>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><tr id="row17977171010144"><td class="cellrowborder" valign="top" width="31.3%" headers="mcps1.2.3.1.1 "><p id="p2793159171311"><a name="p2793159171311"></a><a name="p2793159171311"></a>interfaces/kits/samgr_lite/samgr</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="68.7%" headers="mcps1.2.3.1.2 "><p id="p879375920132"><a name="p879375920132"></a><a name="p879375920132"></a>M核和A核系统服务框架对外接口定义。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row6978161091412"><td class="cellrowborder" valign="top" width="31.3%" headers="mcps1.2.3.1.1 "><p id="p37931659101311"><a name="p37931659101311"></a><a name="p37931659101311"></a>interfaces/kits/samgr_lite/registry</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="68.7%" headers="mcps1.2.3.1.2 "><p id="p6793059171318"><a name="p6793059171318"></a><a name="p6793059171318"></a>A核进程间服务调用的对外接口定义。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row6978201031415"><td class="cellrowborder" valign="top" width="31.3%" headers="mcps1.2.3.1.1 "><p id="p117935599130"><a name="p117935599130"></a><a name="p117935599130"></a>interfaces/kits/samgr_lite/communication/broadcast</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="68.7%" headers="mcps1.2.3.1.2 "><p id="p0793185971316"><a name="p0793185971316"></a><a name="p0793185971316"></a>M核和A核进程内事件广播服务的对外接口定义。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row124243183397"><td class="cellrowborder" valign="top" width="31.3%" headers="mcps1.2.3.1.1 "><p id="p104249183396"><a name="p104249183396"></a><a name="p104249183396"></a>services/samgr_lite/samgr/adapter</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="68.7%" headers="mcps1.2.3.1.2 "><p id="p2424318203914"><a name="p2424318203914"></a><a name="p2424318203914"></a>POSIX和CMSIS接口适配层来屏蔽A核M核接口差异。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row1634915717405"><td class="cellrowborder" valign="top" width="31.3%" headers="mcps1.2.3.1.1 "><p id="p193493571406"><a name="p193493571406"></a><a name="p193493571406"></a>services/samgr_lite/samgr/registry</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="68.7%" headers="mcps1.2.3.1.2 "><p id="p14349257184012"><a name="p14349257184012"></a><a name="p14349257184012"></a>M核服务注册发现的桩函数。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row1385432741312"><td class="cellrowborder" valign="top" width="31.3%" headers="mcps1.2.3.1.1 "><p id="p1485582714135"><a name="p1485582714135"></a><a name="p1485582714135"></a>services/samgr_lite/samgr/source</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="68.7%" headers="mcps1.2.3.1.2 "><p id="p085522751319"><a name="p085522751319"></a><a name="p085522751319"></a>M核和A核系统服务开发框架基础代码。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row7968155877"><td class="cellrowborder" valign="top" width="31.3%" headers="mcps1.2.3.1.1 "><p id="p89681851717"><a name="p89681851717"></a><a name="p89681851717"></a>services/samgr_lite/samgr_client</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="68.7%" headers="mcps1.2.3.1.2 "><p id="p169681051873"><a name="p169681051873"></a><a name="p169681051873"></a>A核进程间服务调用的注册与发现。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row18291912179"><td class="cellrowborder" valign="top" width="31.3%" headers="mcps1.2.3.1.1 "><p id="p1729111214715"><a name="p1729111214715"></a><a name="p1729111214715"></a>services/samgr_lite/samgr_server</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="68.7%" headers="mcps1.2.3.1.2 "><p id="p7839893352"><a name="p7839893352"></a><a name="p7839893352"></a>A核进程间服务调用的IPC地址管理和访问控制。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row6971514279"><td class="cellrowborder" valign="top" width="31.3%" headers="mcps1.2.3.1.1 "><p id="p1797118141671"><a name="p1797118141671"></a><a name="p1797118141671"></a>services/samgr_lite/samgr_endpoint</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="68.7%" headers="mcps1.2.3.1.2 "><p id="p597119145716"><a name="p597119145716"></a><a name="p597119145716"></a>A核IPC通信消息收发包管理。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row33121991272"><td class="cellrowborder" valign="top" width="31.3%" headers="mcps1.2.3.1.1 "><p id="p143121991875"><a name="p143121991875"></a><a name="p143121991875"></a>services/samgr_lite/communication/broadcast</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="68.7%" headers="mcps1.2.3.1.2 "><p id="p16312169179"><a name="p16312169179"></a><a name="p16312169179"></a>M核和A核进程内事件广播服务。</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
## 约束<a name="section1718733212019"></a>
|
||||
|
||||
系统服务开发框架统一使用C开发。
|
||||
|
||||
同进程内服务间调用统一使用IUnknown接口对外象,消息接口统一由IUnknown接口传递给本服务。
|
||||
|
||||
服务名和功能名必需使用常量字符串且长度小于16个字节。
|
||||
|
||||
M核:系统依赖上bootstrap服务,在系统启动函数中调用OHOS\_SystemInit\(\)函数。
|
||||
|
||||
A核:系统依赖samgr库,在main函数中调用SAMGR\_Bootstrap\(\)函数。
|
||||
|
||||
## 开发服务<a name="section159991817144514"></a>
|
||||
|
||||
- 继承并重新定义服务:
|
||||
|
||||
```
|
||||
typedef struct ExampleService {
|
||||
INHERIT_SERVICE;
|
||||
INHERIT_IUNKNOWNENTRY(DefaultFeatureApi);
|
||||
Identity identity;
|
||||
} ExampleService;
|
||||
```
|
||||
|
||||
- 实现服务的生命周期函数:
|
||||
|
||||
```
|
||||
static const char *GetName(Service *service)
|
||||
{
|
||||
return EXAMPLE_SERVICE;
|
||||
}
|
||||
|
||||
static BOOL Initialize(Service *service, Identity identity)
|
||||
{
|
||||
ExampleService *example = (ExampleService *)service;
|
||||
// 保存服务的唯一身份标识,用来自己的IUnknown接口对服务发消息时使用。
|
||||
example->identity = identity;
|
||||
return TRUE;
|
||||
}
|
||||
static BOOL MessageHandle(Service *service, Request *msg)
|
||||
{
|
||||
ExampleService *example = (ExampleService *)service;
|
||||
switch (msg->msgId) {
|
||||
case MSG_SYNC:
|
||||
// 业务处理
|
||||
break;
|
||||
default:break;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
static TaskConfig GetTaskConfig(Service *service)
|
||||
{
|
||||
TaskConfig config = {LEVEL_HIGH, PRI_BELOW_NORMAL,
|
||||
0x800, 20, SHARED_TASK};
|
||||
return config;
|
||||
}
|
||||
```
|
||||
|
||||
- 创建服务对象:
|
||||
|
||||
```
|
||||
static ExampleService g_example = {
|
||||
.GetName = GetName,
|
||||
.Initialize = Initialize,
|
||||
.MessageHandle = MessageHandle,
|
||||
.GetTaskConfig = GetTaskConfig,
|
||||
SERVER_IPROXY_IMPL_BEGIN,
|
||||
.Invoke = NULL,
|
||||
.SyncCall = SyncCall,
|
||||
IPROXY_END,
|
||||
};
|
||||
```
|
||||
|
||||
- 向SAMGR注册服务及接口:
|
||||
|
||||
```
|
||||
static void Init(void)
|
||||
{
|
||||
SAMGR_GetInstance()->RegisterService((Service *)&g_example);
|
||||
SAMGR_GetInstance()->RegisterDefaultFeatureApi(EXAMPLE_SERVICE, GET_IUNKNOWN(g_example));
|
||||
}
|
||||
```
|
||||
|
||||
- 定义服务的初始化入口:
|
||||
|
||||
```
|
||||
SYSEX_SERVICE_INIT(Init);
|
||||
|
||||
```
|
||||
|
||||
|
||||
## 开发服务的子功能<a name="section11510542164514"></a>
|
||||
|
||||
- 继承并重新定义功能:
|
||||
|
||||
```
|
||||
typedef struct DemoFeature {
|
||||
INHERIT_FEATURE;
|
||||
INHERIT_IUNKNOWNENTRY(DemoApi);
|
||||
Identity identity;
|
||||
Service *parent;
|
||||
} DemoFeature;
|
||||
```
|
||||
|
||||
- 实现功能的生命周期函数:
|
||||
|
||||
```
|
||||
static const char *FEATURE_GetName(Feature *feature)
|
||||
{
|
||||
return EXAMPLE_FEATURE;
|
||||
}
|
||||
|
||||
static void FEATURE_OnInitialize(Feature *feature, Service *parent, Identity identity)
|
||||
{
|
||||
DemoFeature *demoFeature = (DemoFeature *)feature;
|
||||
demoFeature->identity = identity;
|
||||
demoFeature->parent = parent;
|
||||
}
|
||||
|
||||
static void FEATURE_OnStop(Feature *feature, Identity identity)
|
||||
{
|
||||
g_example.identity.queueId = NULL;
|
||||
g_example.identity.featureId = -1;
|
||||
g_example.identity.serviceId = -1;
|
||||
}
|
||||
|
||||
static BOOL FEATURE_OnMessage(Feature *feature, Request *request)
|
||||
{
|
||||
if (request->msgId == MSG_PROC) {
|
||||
Response response = {.data = "Yes, you did!", .len = 0};
|
||||
SAMGR_SendResponse(request, &response);
|
||||
return TRUE;
|
||||
} else {
|
||||
if (request->msgId == MSG_TIME_PROC) {
|
||||
LOS_Msleep(WAIT_FEATURE_PROC * 10);
|
||||
if (request->msgValue) {
|
||||
SAMGR_PrintServices();
|
||||
} else {
|
||||
SAMGR_PrintOperations();
|
||||
}
|
||||
AsyncTimeCall(GET_IUNKNOWN(g_example));
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
```
|
||||
|
||||
- 创建功能对象:
|
||||
|
||||
```
|
||||
static DemoFeature g_example = {
|
||||
.GetName = FEATURE_GetName,
|
||||
.OnInitialize = FEATURE_OnInitialize,
|
||||
.OnStop = FEATURE_OnStop,
|
||||
.OnMessage = FEATURE_OnMessage,
|
||||
DEFAULT_IUNKNOWN_ENTRY_BEGIN,
|
||||
.AsyncCall = AsyncCall,
|
||||
.AsyncTimeCall = AsyncTimeCall,
|
||||
.SyncCall = SyncCall,
|
||||
.AsyncCallBack = AsyncCallBack,
|
||||
DEFAULT_IUNKNOWN_ENTRY_END,
|
||||
.identity = {-1, -1, NULL},
|
||||
};
|
||||
```
|
||||
|
||||
- 向SAMGR注册功能及接口:
|
||||
|
||||
```
|
||||
static void Init(void){
|
||||
SAMGR_GetInstance()->RegisterFeature(EXAMPLE_SERVICE, (Feature *)&g_example);
|
||||
SAMGR_GetInstance()->RegisterFeatureApi(EXAMPLE_SERVICE, EXAMPLE_FEATURE, GET_IUNKNOWN(g_example));
|
||||
}
|
||||
```
|
||||
|
||||
- 定义功能的初始化入口:
|
||||
|
||||
```
|
||||
SYSEX_FEATURE_INIT(Init);
|
||||
|
||||
```
|
||||
|
||||
|
||||
## 开发进程内对外接口<a name="section1685211117463"></a>
|
||||
|
||||
- 定义IUnknown接口:
|
||||
|
||||
```
|
||||
typedef struct DemoApi {
|
||||
INHERIT_IUNKNOWN;
|
||||
BOOL (*AsyncCall)(IUnknown *iUnknown, const char *buff);
|
||||
BOOL (*AsyncTimeCall)(IUnknown *iUnknown);
|
||||
BOOL (*SyncCall)(IUnknown *iUnknown, struct Payload *payload);
|
||||
BOOL (*AsyncCallBack)(IUnknown *iUnknown, const char *buff, Handler handler);
|
||||
} DemoApi;
|
||||
```
|
||||
|
||||
- 定义IUnknown的引用对象:
|
||||
|
||||
```
|
||||
typedef struct DemoRefApi {
|
||||
INHERIT_IUNKNOWNENTRY(DemoApi);
|
||||
} DemoRefApi;
|
||||
```
|
||||
|
||||
- 初始化接口对象:
|
||||
|
||||
```
|
||||
static DemoRefApi api = {
|
||||
DEFAULT_IUNKNOWN_ENTRY_BEGIN,
|
||||
.AsyncCall = AsyncCall,
|
||||
.AsyncTimeCall = AsyncTimeCall,
|
||||
.SyncCall = SyncCall,
|
||||
.AsyncCallBack = AsyncCallBack,
|
||||
DEFAULT_IUNKNOWN_ENTRY_END,
|
||||
};
|
||||
```
|
||||
|
||||
- 注册服务接口:
|
||||
|
||||
```
|
||||
SAMGR_GetInstance()->RegisterFeatureApi(EXAMPLE_SERVICE, EXAMPLE_FEATURE, GET_IUNKNOWN(api));
|
||||
|
||||
```
|
||||
|
||||
|
||||
## 调用进程内服务<a name="section3690162916462"></a>
|
||||
|
||||
- 获取服务的对外接口:
|
||||
|
||||
```
|
||||
DemoApi *demoApi = NULL;
|
||||
IUnknown *iUnknown = SAMGR_GetInstance()->GetFeatureApi(EXAMPLE_SERVICE, EXAMPLE_FEATURE);
|
||||
if (iUnknown == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
int result = iUnknown->QueryInterface(iUnknown, DEFAULT_VERSION, (void **)&demoApi);
|
||||
if (result != 0 || demoApi == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
```
|
||||
|
||||
- 接口调用:
|
||||
|
||||
```
|
||||
if (demoApi->AsyncCallBack == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
demoApi->AsyncCallBack((IUnknown *)demoApi, "I wanna async call callback good result!", AsyncHandler);
|
||||
```
|
||||
|
||||
- 释放接口:
|
||||
|
||||
```
|
||||
int32 ref = demoApi->Release((IUnknown *)demoApi);
|
||||
|
||||
```
|
||||
|
||||
|
||||
## 开发跨进程间对外接口<a name="section9220246194615"></a>
|
||||
|
||||
- 继承IServerProxy替代继承IUnknown:INHERIT\_SERVER\_IPROXY
|
||||
|
||||
```
|
||||
typedef struct DemoFeatureApi {
|
||||
INHERIT_SERVER_IPROXY;
|
||||
BOOL (*AsyncCall)(IUnknown *iUnknown, const char *buff);
|
||||
BOOL (*AsyncTimeCall)(IUnknown *iUnknown);
|
||||
BOOL (*SyncCall)(IUnknown *iUnknown, struct Payload *payload);
|
||||
BOOL (*AsyncCallBack)(IUnknown *iUnknown, const char *buff, IOwner notify, INotifyFunc handler);
|
||||
} DemoFeatureApi;
|
||||
```
|
||||
|
||||
- 初始化IServerProxy对象:
|
||||
|
||||
```
|
||||
static DemoFeature g_example = {
|
||||
SERVER_IPROXY_IMPL_BEGIN,
|
||||
.Invoke = Invoke,
|
||||
.AsyncCall = AsyncCall,
|
||||
.AsyncTimeCall = AsyncTimeCall,
|
||||
.SyncCall = SyncCall,
|
||||
.AsyncCallBack = AsyncCallBack,
|
||||
IPROXY_END,
|
||||
};
|
||||
```
|
||||
|
||||
- 实现Invoke函数来处理Ipc消息:
|
||||
|
||||
```
|
||||
static int32 Invoke(IServerProxy *iProxy, int funcId, void *origin, IpcIo *req, IpcIo *reply)
|
||||
{
|
||||
DemoFeatureApi *api = (DemoFeatureApi *)iProxy;
|
||||
BOOL ret;
|
||||
size_t len = 0;
|
||||
switch (funcId) {
|
||||
case ID_ASYNCALL:
|
||||
ret = api->AsyncCall((IUnknown *)iProxy, (char *)IpcIoPopString(req, &len));
|
||||
IpcIoPushBool(reply, ret);
|
||||
break;
|
||||
case ID_ASYNTIMECALL:
|
||||
ret = api->AsyncTimeCall((IUnknown *)iProxy);
|
||||
IpcIoPushBool(reply, ret);
|
||||
break;
|
||||
case ID_SYNCCALL: {
|
||||
struct Payload payload;
|
||||
payload.id = IpcIoPopInt32(req);
|
||||
payload.value = IpcIoPopInt32(req);
|
||||
payload.name = (char *)IpcIoPopString(req, &len);
|
||||
ret = api->SyncCall((IUnknown *)iProxy, &payload);
|
||||
IpcIoPushString(reply, ret ? "TRUE" : "FALSE");
|
||||
}
|
||||
break;
|
||||
case ID_ASYNCCALLBACK: { // convert to sync proxy
|
||||
IpcIoPushString(reply, "Yes, you did!");
|
||||
IpcIoPushBool(reply, TRUE);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
IpcIoPushBool(reply, FALSE);
|
||||
break;
|
||||
}
|
||||
return EC_SUCCESS;
|
||||
}
|
||||
```
|
||||
|
||||
- 注册接口:与进程内接口注册一致
|
||||
|
||||
```
|
||||
SAMGR_GetInstance()->RegisterFeatureApi(EXAMPLE_SERVICE, EXAMPLE_FEATURE, GET_IUNKNOWN(g_example));
|
||||
|
||||
```
|
||||
|
||||
|
||||
## 调用跨进程间服务<a name="section114372711475"></a>
|
||||
|
||||
- 获取跨进程服务的对外接口:
|
||||
|
||||
```
|
||||
IClientProxy *demoApi = NULL;
|
||||
IUnknown *iUnknown = SAMGR_GetInstance()->GetFeatureApi(EXAMPLE_SERVICE, EXAMPLE_FEATURE);
|
||||
if (iUnknown == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
int result = iUnknown->QueryInterface(iUnknown, CLIENT_PROXY_VER, (void **)&demoApi);
|
||||
if (result != 0 || demoApi == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
```
|
||||
|
||||
- 调用Ipc消息接口:
|
||||
|
||||
```
|
||||
IpcIo request;char data[250];
|
||||
IpcIoInit(&request, data, sizeof(data), 0);
|
||||
demoApi->Invoke(demoApi, 0, &request, NULL, NULL);
|
||||
```
|
||||
|
||||
- 释放接口:
|
||||
|
||||
```
|
||||
int32 ref = demoApi->Release((IUnknown *)demoApi);
|
||||
|
||||
```
|
||||
|
||||
|
||||
## 开发跨进程间服务调用客户端代理<a name="section09341923114710"></a>
|
||||
|
||||
- 定义IPC接口客户端代理:
|
||||
|
||||
```
|
||||
typedef struct DemoClientProxy {
|
||||
INHERIT_CLIENT_IPROXY;
|
||||
BOOL (*AsyncCall)(IUnknown *iUnknown, const char *buff);
|
||||
BOOL (*AsyncTimeCall)(IUnknown *iUnknown);
|
||||
BOOL (*SyncCall)(IUnknown *iUnknown, struct Payload *payload);
|
||||
BOOL (*AsyncCallBack)(IUnknown *iUnknown, const char *buff, IOwner notify, INotifyFunc handler);
|
||||
} DemoClientProxy;
|
||||
typedef struct DemoClientEntry {
|
||||
INHERIT_IUNKNOWNENTRY(DemoClientProxy);
|
||||
} DemoClientEntry;
|
||||
```
|
||||
|
||||
- 实现客户端代理封装Ipc消息接口:
|
||||
|
||||
```
|
||||
static BOOL AsyncCall(IUnknown *iUnknown, const char *buff)
|
||||
{
|
||||
DemoClientProxy *proxy = (DemoClientProxy *)iUnknown;
|
||||
IpcIo request;
|
||||
char data[MAX_DATA_LEN];
|
||||
IpcIoInit(&request, data, MAX_DATA_LEN, 0);
|
||||
IpcIoPushString(&request, buff);
|
||||
int ret = proxy->Invoke((IClientProxy *)proxy, ID_ASYNCALL, &request, NULL, NULL);
|
||||
return ret == EC_SUCCESS;
|
||||
}
|
||||
|
||||
static BOOL AsyncTimeCall(IUnknown *iUnknown)
|
||||
{
|
||||
DemoClientProxy *proxy = (DemoClientProxy *)iUnknown;
|
||||
IpcIo request;
|
||||
char data[MAX_DATA_LEN];
|
||||
IpcIoInit(&request, data, MAX_DATA_LEN, 0);
|
||||
int ret = proxy->Invoke((IClientProxy *)proxy, ID_ASYNTIMECALL, &request, NULL, NULL);
|
||||
return ret == EC_SUCCESS;
|
||||
}
|
||||
|
||||
static int Callback(IOwner owner, int code, IpcIo *reply)
|
||||
{
|
||||
size_t len = 0;
|
||||
return strcpy_s(owner, MAX_DATA_LEN, (char *)IpcIoPopString(reply, &len));
|
||||
}
|
||||
|
||||
static BOOL SyncCall(IUnknown *iUnknown, struct Payload *payload)
|
||||
{
|
||||
DemoClientProxy *proxy = (DemoClientProxy *)iUnknown;
|
||||
IpcIo request;
|
||||
char data[MAX_DATA_LEN];
|
||||
IpcIoInit(&request, data, MAX_DATA_LEN, 0);
|
||||
IpcIoPushInt32(&request, payload->id);
|
||||
IpcIoPushInt32(&request, payload->value);
|
||||
IpcIoPushString(&request, payload->name);
|
||||
int ret = proxy->Invoke((IClientProxy *)proxy, ID_SYNCCALL, &request, data, Callback);
|
||||
data[MAX_DATA_LEN - 1] = 0;
|
||||
HILOG_INFO(HILOG_MODULE_APP, "[TID:0x%lx]Remote response is %s!", pthread_self(), data);
|
||||
return ret == EC_SUCCESS;
|
||||
}
|
||||
|
||||
struct CurrentNotify {
|
||||
IOwner notify;
|
||||
INotifyFunc handler;
|
||||
};
|
||||
|
||||
static int CurrentCallback(IOwner owner, int code, IpcIo *reply)
|
||||
{
|
||||
struct CurrentNotify *notify = (struct CurrentNotify *)owner;
|
||||
size_t len = 0;
|
||||
char *response = (char *)IpcIoPopString(reply, &len);
|
||||
HILOG_INFO(HILOG_MODULE_APP, "[TID:0x%lx]Notify Remote response is %s!", pthread_self(), response);
|
||||
notify->handler(notify->notify, response);
|
||||
return EC_SUCCESS;
|
||||
}
|
||||
|
||||
static BOOL AsyncCallBack(IUnknown *iUnknown, const char *buff, IOwner notify, INotifyFunc handler)
|
||||
{
|
||||
struct CurrentNotify owner = {notify, handler};
|
||||
DemoClientProxy *proxy = (DemoClientProxy *)iUnknown;
|
||||
IpcIo request;
|
||||
char data[MAX_DATA_LEN];
|
||||
IpcIoInit(&request, data, MAX_DATA_LEN, 0);
|
||||
IpcIoPushString(&request, buff);
|
||||
int ret = proxy->Invoke((IClientProxy *)proxy, ID_ASYNCCALLBACK, &request, &owner, CurrentCallback);
|
||||
return ret == EC_SUCCESS;
|
||||
}
|
||||
```
|
||||
|
||||
- 实现客户端代理的工厂方法:
|
||||
|
||||
```
|
||||
void *DEMO_CreatClient(const char *service, const char *feature, uint32 size)
|
||||
{
|
||||
(void)service;
|
||||
(void)feature;
|
||||
uint32 len = size + sizeof(DemoClientEntry);
|
||||
uint8 *client = malloc(len);
|
||||
(void)memset_s(client, len, 0, len);
|
||||
DemoClientEntry *entry = (DemoClientEntry *)&client[size];
|
||||
entry->ver = ((uint16)CLIENT_PROXY_VER | (uint16)DEFAULT_VERSION);
|
||||
entry->ref = 1;
|
||||
entry->iUnknown.QueryInterface = IUNKNOWN_QueryInterface;
|
||||
entry->iUnknown.AddRef = IUNKNOWN_AddRef;
|
||||
entry->iUnknown.Release = IUNKNOWN_Release;
|
||||
entry->iUnknown.Invoke = NULL;
|
||||
entry->iUnknown.AsyncCall = AsyncCall;
|
||||
entry->iUnknown.AsyncTimeCall = AsyncTimeCall;
|
||||
entry->iUnknown.SyncCall = SyncCall;
|
||||
entry->iUnknown.AsyncCallBack = AsyncCallBack;
|
||||
return client;
|
||||
}
|
||||
void DEMO_DestroyClient(const char *service, const char *feature, void *iproxy)
|
||||
{
|
||||
free(iproxy);
|
||||
}
|
||||
```
|
||||
|
||||
- 将客户端代理的工厂方法注册到SAMGR:
|
||||
|
||||
```
|
||||
SAMGR_RegisterFactory(EXAMPLE_SERVICE, EXAMPLE_FEATURE, DEMO_CreatClient, DEMO_DestroyClient);
|
||||
```
|
||||
|
||||
- 获取跨进程服务的对外接口:
|
||||
|
||||
```
|
||||
DemoClientProxy *demoApi = NULL;
|
||||
IUnknown *iUnknown = SAMGR_GetInstance()->GetFeatureApi(EXAMPLE_SERVICE, EXAMPLE_FEATURE);
|
||||
if (iUnknown == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
int result = iUnknown->QueryInterface(iUnknown, DEFAULT_VERSION, (void **)&demoApi);
|
||||
if (result != 0 || demoApi == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
```
|
||||
|
||||
- 调用跨进程服务的客户端代理接口:
|
||||
|
||||
```
|
||||
if (demoApi->AsyncCallBack == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
demoApi->AsyncCallBack((IUnknown *)demoApi,
|
||||
"I wanna async call callback good result!", NULL, AsyncHandler);
|
||||
```
|
||||
|
||||
- 释放接口:
|
||||
|
||||
```
|
||||
int32 ref = demoApi->Release((IUnknown *)demoApi);
|
||||
```
|
||||
|
||||
|
||||
## 涉及仓<a name="section10365113863719"></a>
|
||||
|
||||
distributedschedule\_interfaces\_kits\_samgr\_lite
|
||||
|
||||
distributedschedule\_services\_samgr\_lite
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"name": "@ohos/foundation",
|
||||
"version": "1.8.0",
|
||||
"publishAs": "code-segment",
|
||||
"description": "由于平台资源有限,且硬件平台多样,因此需要屏蔽不同硬件架构和资源的不同、以及运行形态的不同,提供统一化的系统服务开发框架。根据RISC-V、Cortex-M、Cortex-A不同硬件平台,分为两种硬件平台,以下简称M核、A核。",
|
||||
"scripts": {
|
||||
"install": "DEST_PATH=${DEP_BUNDLE_BASE}/foundation/distributedschedule/services/safwk_lite&&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH"
|
||||
},
|
||||
"keywords": [
|
||||
"foundation"
|
||||
],
|
||||
"license": "Apache V2",
|
||||
"repository": "",
|
||||
"homepage": "",
|
||||
"tags": [
|
||||
"foundation"
|
||||
],
|
||||
"ohos": {
|
||||
"os": "1.0.0",
|
||||
"kernel": "liteos-a",
|
||||
"board": "hi3516,hi3518"
|
||||
}
|
||||
}
|
||||
+202
@@ -0,0 +1,202 @@
|
||||
|
||||
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
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
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.
|
||||
@@ -0,0 +1,86 @@
|
||||
This is the top level of the FreeBSD source directory. This file
|
||||
was last revised on:
|
||||
$FreeBSD: releng/11.4/README 329145 2018-02-12 01:08:44Z kevans $
|
||||
|
||||
For copyright information, please see the file COPYRIGHT in this
|
||||
directory (additional copyright information also exists for some
|
||||
sources in this tree - please see the specific source directories for
|
||||
more information).
|
||||
|
||||
The Makefile in this directory supports a number of targets for
|
||||
building components (or all) of the FreeBSD source tree. See build(7)
|
||||
and http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/makeworld.html
|
||||
for more information, including setting make(1) variables.
|
||||
|
||||
The `buildkernel` and `installkernel` targets build and install
|
||||
the kernel and the modules (see below). Please see the top of
|
||||
the Makefile in this directory for more information on the
|
||||
standard build targets and compile-time flags.
|
||||
|
||||
Building a kernel is a somewhat more involved process. See build(7), config(8),
|
||||
and http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig.html
|
||||
for more information.
|
||||
|
||||
Note: If you want to build and install the kernel with the
|
||||
`buildkernel` and `installkernel` targets, you might need to build
|
||||
world before. More information is available in the handbook.
|
||||
|
||||
The kernel configuration files reside in the sys/<arch>/conf
|
||||
sub-directory. GENERIC is the default configuration used in release builds.
|
||||
NOTES contains entries and documentation for all possible
|
||||
devices, not just those commonly used.
|
||||
|
||||
|
||||
Source Roadmap:
|
||||
---------------
|
||||
|
||||
bin System/user commands.
|
||||
|
||||
cddl Various commands and libraries under the Common Development
|
||||
and Distribution License.
|
||||
|
||||
contrib Packages contributed by 3rd parties.
|
||||
|
||||
crypto Cryptography stuff (see crypto/README).
|
||||
|
||||
etc Template files for /etc.
|
||||
|
||||
gnu Various commands and libraries under the GNU Public License.
|
||||
Please see gnu/COPYING* for more information.
|
||||
|
||||
include System include files.
|
||||
|
||||
kerberos5 Kerberos5 (Heimdal) package.
|
||||
|
||||
lib System libraries.
|
||||
|
||||
libexec System daemons.
|
||||
|
||||
release Release building Makefile & associated tools.
|
||||
|
||||
rescue Build system for statically linked /rescue utilities.
|
||||
|
||||
sbin System commands.
|
||||
|
||||
secure Cryptographic libraries and commands.
|
||||
|
||||
share Shared resources.
|
||||
|
||||
stand Boot loader sources.
|
||||
|
||||
sys Kernel sources.
|
||||
|
||||
tests Regression tests which can be run by Kyua. See tests/README
|
||||
for additional information.
|
||||
|
||||
tools Utilities for regression testing and miscellaneous tasks.
|
||||
|
||||
usr.bin User commands.
|
||||
|
||||
usr.sbin System administration commands.
|
||||
|
||||
|
||||
For information on synchronizing your source tree with one or more of
|
||||
the FreeBSD Project's development branches, please see:
|
||||
|
||||
https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/updating-src.html
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"name": "@ohos/freebsd",
|
||||
"version": "1.8.0",
|
||||
"publishAs": "code-segment",
|
||||
"description": "FreeBSD",
|
||||
"scripts": {
|
||||
"install": "DEST_PATH=${DEP_BUNDLE_BASE}/third_party/FreeBSD &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH"
|
||||
},
|
||||
"keywords": [
|
||||
"thirdparty",
|
||||
"freebsd"
|
||||
],
|
||||
"license": "Apache V2",
|
||||
"repository": "",
|
||||
"homepage": "",
|
||||
"tags": [
|
||||
"third_party"
|
||||
],
|
||||
"ohos": {
|
||||
"os": "1.0.0",
|
||||
"kernel": "",
|
||||
"board": ""
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,202 @@
|
||||
|
||||
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
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
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.
|
||||
@@ -0,0 +1,84 @@
|
||||
FreeType 2.10.1
|
||||
===============
|
||||
|
||||
Homepage: https://www.freetype.org
|
||||
|
||||
FreeType is a freely available software library to render fonts.
|
||||
|
||||
It is written in C, designed to be small, efficient, highly
|
||||
customizable, and portable while capable of producing high-quality
|
||||
output (glyph images) of most vector and bitmap font formats.
|
||||
|
||||
Please read the docs/CHANGES file, it contains IMPORTANT
|
||||
INFORMATION.
|
||||
|
||||
Read the files `docs/INSTALL*' for installation instructions; see
|
||||
the file `docs/LICENSE.TXT' for the available licenses.
|
||||
|
||||
The FreeType 2 API reference is located in `docs/reference/site';
|
||||
use the file `index.html' as the top entry point. Additional
|
||||
documentation is available as a separate package from our sites. Go
|
||||
to
|
||||
|
||||
https://download.savannah.gnu.org/releases/freetype/
|
||||
|
||||
and download one of the following files.
|
||||
|
||||
freetype-doc-2.10.1.tar.xz
|
||||
freetype-doc-2.10.1.tar.gz
|
||||
ftdoc2101.zip
|
||||
|
||||
To view the documentation online, go to
|
||||
|
||||
https://www.freetype.org/freetype2/docs/
|
||||
|
||||
|
||||
Mailing Lists
|
||||
=============
|
||||
|
||||
The preferred way of communication with the FreeType team is using
|
||||
e-mail lists.
|
||||
|
||||
general use and discussion: freetype@nongnu.org
|
||||
engine internals, porting, etc.: freetype-devel@nongnu.org
|
||||
announcements: freetype-announce@nongnu.org
|
||||
git repository tracker: freetype-commit@nongnu.org
|
||||
|
||||
The lists are moderated; see
|
||||
|
||||
https://www.freetype.org/contact.html
|
||||
|
||||
how to subscribe.
|
||||
|
||||
|
||||
Bugs
|
||||
====
|
||||
|
||||
Please submit bug reports at
|
||||
|
||||
https://savannah.nongnu.org/bugs/?group=freetype
|
||||
|
||||
Alternatively, you might report bugs by e-mail to
|
||||
`freetype-devel@nongnu.org'. Don't forget to send a detailed
|
||||
explanation of the problem -- there is nothing worse than receiving
|
||||
a terse message that only says `it doesn't work'.
|
||||
|
||||
|
||||
Enjoy!
|
||||
|
||||
|
||||
The FreeType Team
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Copyright (C) 2006-2019 by
|
||||
David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||
|
||||
This file is part of the FreeType project, and may only be used,
|
||||
modified, and distributed under the terms of the FreeType project
|
||||
license, LICENSE.TXT. By continuing to use, modify, or distribute
|
||||
this file you indicate that you have read the license and understand
|
||||
and accept it fully.
|
||||
|
||||
|
||||
--- end of README ---
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"name": "@ohos/freetype",
|
||||
"version": "1.8.0",
|
||||
"description": "FreeType is a freely available software library to render fonts.",
|
||||
"publishAs": "code-segment",
|
||||
"scripts": {
|
||||
"install": "DEST_PATH=${DEP_BUNDLE_BASE}/third_party/freetype && mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH"
|
||||
},
|
||||
"keywords": [
|
||||
"font"
|
||||
],
|
||||
"author": {},
|
||||
"homepage": "https://www.freetype.org",
|
||||
"repository": "https://github.com/DaveGamble/cJSON",
|
||||
"license": "Apache V2",
|
||||
"tags": [
|
||||
"third_party"
|
||||
],
|
||||
"ohos": {
|
||||
"os": "1.0.0",
|
||||
"kernel": "",
|
||||
"board": ""
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,202 @@
|
||||
|
||||
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
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
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.
|
||||
@@ -0,0 +1,18 @@
|
||||
# 项目介绍<a name="ZH-CN_TOPIC_0000001054438981"></a>
|
||||
|
||||
## 全球化子系统<a name="section11516137123416"></a>
|
||||
|
||||
OpenHarmony设备上用户可以设置语言和地区,规划中预计会支持68种语言;考虑到OpenHarmony设备间互联时,会涉及从OpenHarmony设备同步语言和地区设置到另一台OpenHarmony设备。因此需要考虑多语言资源回溯和多偏好语言支持的能力。
|
||||
|
||||
全球化资源管理模块主要提供语言资源回溯和多偏好语言支持的能力:
|
||||
|
||||
- 多语言资源回溯:系统在运行的时候会面临使用不同母语、来至不同地区各种文化背景的用户,如何用有限的翻译语言、最小的冗余来提供匹配该用户文化背景的翻译内容是资源加载中的一项核心功能,是系统支持多语言本地化的基本能力。
|
||||
|
||||
- 多偏好语言支持:系统可以根据用户设置的多个偏好语言来选择符合用户习惯的语言来显示,解决多母语用户尤其是像瑞士这样使用多母语用户的需求。
|
||||
|
||||
## 涉及仓<a name="section5889165803317"></a>
|
||||
|
||||
global\_frameworks\_resmgr\_lite
|
||||
|
||||
global\_interfaces\_innerkits\_resmgr\_lite
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"name": "@ohos/global_resource_manager",
|
||||
"version": "1.8.0",
|
||||
"publishAs": "code-segment",
|
||||
"description": "OpenHarmony设备上用户可以设置语言和地区,规划中预计会支持68种语言;考虑到OpenHarmony设备间互联时,会涉及从OpenHarmony设备同步语言和地区设置到另一台OpenHarmony设备。因此需要考虑多语言资源回溯和多偏好语言支持的能力。",
|
||||
"scripts": {
|
||||
"install": "DEST_PATH=${DEP_BUNDLE_BASE}/base/global &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH"
|
||||
},
|
||||
"keywords": [
|
||||
"app"
|
||||
],
|
||||
"license": "Apache V2",
|
||||
"repository": "",
|
||||
"homepage": "",
|
||||
"tags": [
|
||||
"base"
|
||||
],
|
||||
"ohos": {
|
||||
"os": "1.0.0",
|
||||
"kernel": "liteos-a",
|
||||
"board": "hi3516"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,202 @@
|
||||
|
||||
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
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
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.
|
||||
@@ -0,0 +1,130 @@
|
||||
|
||||
# Google Test #
|
||||
|
||||
[](https://travis-ci.org/google/googletest)
|
||||
[](https://ci.appveyor.com/project/GoogleTestAppVeyor/googletest/branch/master)
|
||||
|
||||
**Future Plans**:
|
||||
* 1.8.x Release - the 1.8.x will be the last release that works with pre-C++11 compilers. The 1.8.x will not accept any requests for any new features and any bugfix requests will only be accepted if proven "critical"
|
||||
* Post 1.8.x - work to improve/cleanup/pay technical debt. When this work is completed there will be a 1.9.x tagged release
|
||||
* Post 1.9.x googletest will follow [Abseil Live at Head philosophy](https://abseil.io/about/philosophy)
|
||||
|
||||
|
||||
Welcome to **Google Test**, Google's C++ test framework!
|
||||
|
||||
This repository is a merger of the formerly separate GoogleTest and
|
||||
GoogleMock projects. These were so closely related that it makes sense to
|
||||
maintain and release them together.
|
||||
|
||||
Please see the project page above for more information as well as the
|
||||
mailing list for questions, discussions, and development. There is
|
||||
also an IRC channel on [OFTC](https://webchat.oftc.net/) (irc.oftc.net) #gtest available. Please
|
||||
join us!
|
||||
|
||||
Getting started information for **Google Test** is available in the
|
||||
[Google Test Primer](googletest/docs/primer.md) documentation.
|
||||
|
||||
**Google Mock** is an extension to Google Test for writing and using C++ mock
|
||||
classes. See the separate [Google Mock documentation](googlemock/README.md).
|
||||
|
||||
More detailed documentation for googletest (including build instructions) are
|
||||
in its interior [googletest/README.md](googletest/README.md) file.
|
||||
|
||||
## Features ##
|
||||
|
||||
* An [xUnit](https://en.wikipedia.org/wiki/XUnit) test framework.
|
||||
* Test discovery.
|
||||
* A rich set of assertions.
|
||||
* User-defined assertions.
|
||||
* Death tests.
|
||||
* Fatal and non-fatal failures.
|
||||
* Value-parameterized tests.
|
||||
* Type-parameterized tests.
|
||||
* Various options for running the tests.
|
||||
* XML test report generation.
|
||||
|
||||
## Platforms ##
|
||||
|
||||
Google test has been used on a variety of platforms:
|
||||
|
||||
* Linux
|
||||
* Mac OS X
|
||||
* Windows
|
||||
* Cygwin
|
||||
* MinGW
|
||||
* Windows Mobile
|
||||
* Symbian
|
||||
|
||||
## Who Is Using Google Test? ##
|
||||
|
||||
In addition to many internal projects at Google, Google Test is also used by
|
||||
the following notable projects:
|
||||
|
||||
* The [Chromium projects](http://www.chromium.org/) (behind the Chrome
|
||||
browser and Chrome OS).
|
||||
* The [LLVM](http://llvm.org/) compiler.
|
||||
* [Protocol Buffers](https://github.com/google/protobuf), Google's data
|
||||
interchange format.
|
||||
* The [OpenCV](http://opencv.org/) computer vision library.
|
||||
* [tiny-dnn](https://github.com/tiny-dnn/tiny-dnn): header only, dependency-free deep learning framework in C++11.
|
||||
|
||||
## Related Open Source Projects ##
|
||||
|
||||
[GTest Runner](https://github.com/nholthaus/gtest-runner) is a Qt5 based automated test-runner and Graphical User Interface with powerful features for Windows and Linux platforms.
|
||||
|
||||
[Google Test UI](https://github.com/ospector/gtest-gbar) is test runner that runs
|
||||
your test binary, allows you to track its progress via a progress bar, and
|
||||
displays a list of test failures. Clicking on one shows failure text. Google
|
||||
Test UI is written in C#.
|
||||
|
||||
[GTest TAP Listener](https://github.com/kinow/gtest-tap-listener) is an event
|
||||
listener for Google Test that implements the
|
||||
[TAP protocol](https://en.wikipedia.org/wiki/Test_Anything_Protocol) for test
|
||||
result output. If your test runner understands TAP, you may find it useful.
|
||||
|
||||
[gtest-parallel](https://github.com/google/gtest-parallel) is a test runner that
|
||||
runs tests from your binary in parallel to provide significant speed-up.
|
||||
|
||||
[GoogleTest Adapter](https://marketplace.visualstudio.com/items?itemName=DavidSchuldenfrei.gtest-adapter) is a VS Code extension allowing to view Google Tests in a tree view, and run/debug your tests.
|
||||
|
||||
## Requirements ##
|
||||
|
||||
Google Test is designed to have fairly minimal requirements to build
|
||||
and use with your projects, but there are some. Currently, we support
|
||||
Linux, Windows, Mac OS X, and Cygwin. We will also make our best
|
||||
effort to support other platforms (e.g. Solaris, AIX, and z/OS).
|
||||
However, since core members of the Google Test project have no access
|
||||
to these platforms, Google Test may have outstanding issues there. If
|
||||
you notice any problems on your platform, please notify
|
||||
[googletestframework@googlegroups.com](https://groups.google.com/forum/#!forum/googletestframework). Patches for fixing them are
|
||||
even more welcome!
|
||||
|
||||
### Linux Requirements ###
|
||||
|
||||
These are the base requirements to build and use Google Test from a source
|
||||
package (as described below):
|
||||
|
||||
* GNU-compatible Make or gmake
|
||||
* POSIX-standard shell
|
||||
* POSIX(-2) Regular Expressions (regex.h)
|
||||
* A C++98-standard-compliant compiler
|
||||
|
||||
### Windows Requirements ###
|
||||
|
||||
* Microsoft Visual C++ 2015 or newer
|
||||
|
||||
### Cygwin Requirements ###
|
||||
|
||||
* Cygwin v1.5.25-14 or newer
|
||||
|
||||
### Mac OS X Requirements ###
|
||||
|
||||
* Mac OS X v10.4 Tiger or newer
|
||||
* Xcode Developer Tools
|
||||
|
||||
## Contributing change
|
||||
|
||||
Please read the [`CONTRIBUTING.md`](CONTRIBUTING.md) for details on
|
||||
how to contribute to this project.
|
||||
|
||||
Happy testing!
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"name": "@ohos/googletest",
|
||||
"version": "1.8.0",
|
||||
"description": "The 1.8.x is the last release supporting pre-C++11 compilers. The 1.8.x will not accept any requests for any new features and any bugfix requests will only be accepted if proven critical",
|
||||
"publishAs": "code-segment",
|
||||
"scripts": {
|
||||
"install": "DEST_PATH=${DEP_BUNDLE_BASE}/third_party/googletest && mkdir -p $DEST_PATH &&cp -r ./* $DEST_PATH"
|
||||
},
|
||||
"keywords": [
|
||||
"googletest"
|
||||
],
|
||||
"envs": {},
|
||||
"author": {},
|
||||
"homepage": "",
|
||||
"repository": "",
|
||||
"license": "Apache V2",
|
||||
"tags": [
|
||||
"third_party"
|
||||
],
|
||||
"ohos": {
|
||||
"os": "1.0.0",
|
||||
"kernel": "",
|
||||
"board": ""
|
||||
}
|
||||
}
|
||||
+202
@@ -0,0 +1,202 @@
|
||||
|
||||
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
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
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.
|
||||
@@ -0,0 +1,107 @@
|
||||
# 图形子系统<a name="ZH-CN_TOPIC_0000001051979319"></a>
|
||||
|
||||
## 简介<a name="section5243712115918"></a>
|
||||
|
||||
图形子系统主要包括UI组件、布局、动画、字体、输入事件、窗口管理、渲染绘制等模块,构建基于轻量OS的应用框架,满足硬件资源较小的物联网设备的OpenHarmony系统应用开发。
|
||||
|
||||
各模块介绍:
|
||||
|
||||
- Components: 应用组件,包括UIView、UIViewGoup、UIButton、UILabel、UILabelButton、UIList、UISlider等。
|
||||
- Layout:布局控件,包括Flexlayout、GridLayout、ListLayout等。
|
||||
- Animator:动画模块,开发者可以自定义动画。
|
||||
- Font:字体处理模块。
|
||||
- Event:事件模块,包括click、press、drag、long press等基础事件。
|
||||
- Task:任务管理模块。
|
||||
- Input:输入事件处理模块。
|
||||
- Display:显示处理模块。
|
||||
- Render:渲染绘制模块。
|
||||
- Draw2d:2d绘制模块,包括直线、矩形、圆、弧、图片、文字等绘制。包括软件绘制和硬件加速能力对接。
|
||||
- Surface:共享内存。
|
||||
- Window:窗口管理模块,包括窗口创建、显示隐藏、合成等处理。
|
||||
- Adapter:适配层,对接底层适配层接口。
|
||||
|
||||
## 目录<a name="section99241319175914"></a>
|
||||
|
||||
**表 1** 图形子系统源代码目录结构
|
||||
|
||||
<a name="table2977131081412"></a>
|
||||
<table><thead align="left"><tr id="row7977610131417"><th class="cellrowborder" valign="top" width="17.7%" id="mcps1.2.3.1.1"><p id="p18792459121314"><a name="p18792459121314"></a><a name="p18792459121314"></a>名称</p>
|
||||
</th>
|
||||
<th class="cellrowborder" valign="top" width="82.3%" id="mcps1.2.3.1.2"><p id="p77921459191317"><a name="p77921459191317"></a><a name="p77921459191317"></a>描述</p>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><tr id="row17977171010144"><td class="cellrowborder" valign="top" width="17.7%" headers="mcps1.2.3.1.1 "><p id="p2793159171311"><a name="p2793159171311"></a><a name="p2793159171311"></a>config</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="82.3%" headers="mcps1.2.3.1.2 "><p id="p879375920132"><a name="p879375920132"></a><a name="p879375920132"></a>配置文件目录。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row6978161091412"><td class="cellrowborder" valign="top" width="17.7%" headers="mcps1.2.3.1.1 "><p id="p37931659101311"><a name="p37931659101311"></a><a name="p37931659101311"></a>frameworks/surface</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="82.3%" headers="mcps1.2.3.1.2 "><p id="p6793059171318"><a name="p6793059171318"></a><a name="p6793059171318"></a>Surface共享内存。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row6978201031415"><td class="cellrowborder" valign="top" width="17.7%" headers="mcps1.2.3.1.1 "><p id="p117935599130"><a name="p117935599130"></a><a name="p117935599130"></a>frameworks/ui</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="82.3%" headers="mcps1.2.3.1.2 "><p id="p0793185971316"><a name="p0793185971316"></a><a name="p0793185971316"></a>UI模块,包括UI控件、动画、字体等功能。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row1897841071415"><td class="cellrowborder" valign="top" width="17.7%" headers="mcps1.2.3.1.1 "><p id="p16793185961315"><a name="p16793185961315"></a><a name="p16793185961315"></a>hals</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="82.3%" headers="mcps1.2.3.1.2 "><p id="p14793959161317"><a name="p14793959161317"></a><a name="p14793959161317"></a>HAL适配层逻辑。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row1420633124613"><td class="cellrowborder" valign="top" width="17.7%" headers="mcps1.2.3.1.1 "><p id="p16207133194613"><a name="p16207133194613"></a><a name="p16207133194613"></a>interfaces/ui</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="82.3%" headers="mcps1.2.3.1.2 "><p id="p182076317465"><a name="p182076317465"></a><a name="p182076317465"></a>UI模块对外接口头文件。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row1679114715461"><td class="cellrowborder" valign="top" width="17.7%" headers="mcps1.2.3.1.1 "><p id="p1079120477466"><a name="p1079120477466"></a><a name="p1079120477466"></a>interfaces/utils</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="82.3%" headers="mcps1.2.3.1.2 "><p id="p1279144754611"><a name="p1279144754611"></a><a name="p1279144754611"></a>图形子系统公共库头文件。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row1534591617478"><td class="cellrowborder" valign="top" width="17.7%" headers="mcps1.2.3.1.1 "><p id="p43456161472"><a name="p43456161472"></a><a name="p43456161472"></a>services/ims</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="82.3%" headers="mcps1.2.3.1.2 "><p id="p23451616124717"><a name="p23451616124717"></a><a name="p23451616124717"></a>输入管理服务,处理点击、按键等输入事件处理、分发。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row1044522874716"><td class="cellrowborder" valign="top" width="17.7%" headers="mcps1.2.3.1.1 "><p id="p644516283476"><a name="p644516283476"></a><a name="p644516283476"></a>services/wms</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="82.3%" headers="mcps1.2.3.1.2 "><p id="p194451528144716"><a name="p194451528144716"></a><a name="p194451528144716"></a>窗口管理服务,处理窗口的创建、管理和合成。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row48471930154713"><td class="cellrowborder" valign="top" width="17.7%" headers="mcps1.2.3.1.1 "><p id="p4847830134713"><a name="p4847830134713"></a><a name="p4847830134713"></a>utils</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="82.3%" headers="mcps1.2.3.1.2 "><p id="p8847193074715"><a name="p8847193074715"></a><a name="p8847193074715"></a>图形子系统公共库。</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
## 约束<a name="section37625514114"></a>
|
||||
|
||||
- 语言版本
|
||||
- C++11版本或以上
|
||||
|
||||
- 框架针对不同的芯片平台和底层OS能力,规格有所区别
|
||||
- Cortex-M RAM/ROM:
|
||||
- RAM:建议大于100K
|
||||
- ROM: \> 300K
|
||||
|
||||
- Cortex-A RAM/ROM:
|
||||
- RAM:建议大于1M
|
||||
- ROM:\> 1M
|
||||
|
||||
|
||||
|
||||
## 新增一个UI控件<a name="section266451716115"></a>
|
||||
|
||||
所有的控件都继承UIView,有通用的属性和样式。UI控件分为两大类:普通控件和容器控件。普通控件不能添加子节点,容器控件作为父容器可以添加子节点。
|
||||
|
||||
新增控件头文件放到interfaces/ui/components,cpp文件放到frameworks/ui/src/components目录。组件Override OnDraw绘制接口,在这个接口里实现本控件的绘制流程。在frameworks/ui/BUILD.gn添加对应的新增文件,构建时会编译到libui.so。
|
||||
|
||||
## 涉及仓<a name="section78781240113620"></a>
|
||||
|
||||
graphic\_lite
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"name": "@ohos/graphic",
|
||||
"version": "1.8.0",
|
||||
"publishAs": "code-segment",
|
||||
"description": "图形子系统主要包括UI组件、布局、动画、字体、输入事件、窗口管理、渲染绘制等模块,构建基于轻量OS的应用框架,满足硬件资源较小的物联网设备的OpenHarmony系统应用开发。",
|
||||
"scripts": {
|
||||
"install": "DEST_PATH=${DEP_BUNDLE_BASE}/foundation/graphic &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH"
|
||||
},
|
||||
"keywords": [
|
||||
"graphic"
|
||||
],
|
||||
"license": "Apache V2",
|
||||
"repository": "",
|
||||
"homepage": "",
|
||||
"tags": [
|
||||
"foundation"
|
||||
],
|
||||
"ohos": {
|
||||
"os": "1.0.0",
|
||||
"kernel": "liteos-a",
|
||||
"board": "hi3516,hi3518"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,202 @@
|
||||
|
||||
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
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
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.
|
||||
@@ -0,0 +1,25 @@
|
||||
[](https://travis-ci.org/harfbuzz/harfbuzz)
|
||||
[](https://ci.appveyor.com/project/harfbuzz/harfbuzz)
|
||||
[](https://circleci.com/gh/harfbuzz/harfbuzz/tree/master)
|
||||
[](https://oss-fuzz-build-logs.storage.googleapis.com/index.html)
|
||||
[](https://scan.coverity.com/projects/behdad-harfbuzz)
|
||||
[](https://app.codacy.com/app/behdad/harfbuzz)
|
||||
[](https://codecov.io/gh/harfbuzz/harfbuzz)
|
||||
[](https://coveralls.io/r/harfbuzz/harfbuzz)
|
||||
[ABI Tracker](http://abi-laboratory.pro/tracker/timeline/harfbuzz/)
|
||||
|
||||
This is HarfBuzz, a text shaping library.
|
||||
|
||||
For bug reports, mailing list, and other information please visit:
|
||||
|
||||
http://harfbuzz.org/
|
||||
|
||||
For license information, see [COPYING](COPYING).
|
||||
|
||||
For build information, see [BUILD.md](BUILD.md).
|
||||
|
||||
For custom configurations, see [CONFIG.md](CONFIG.md).
|
||||
|
||||
For test execution, see [TESTING.md](TESTING.md).
|
||||
|
||||
Documentation: https://harfbuzz.github.io
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"name": "@ohos/harfbuzz",
|
||||
"version": "1.8.0",
|
||||
"publishAs": "code-segment",
|
||||
"description": "HarfBuzz is a text shaping engine. It primarily supports OpenType, but also Apple Advanced Typography. HarfBuzz is used in Android, Chrome, ChromeOS, Firefox, GNOME, GTK+, KDE, LibreOffice, OpenJDK, PlayStation, Qt, XeTeX, and other places.",
|
||||
"scripts": {
|
||||
"install": "DEST_PATH=${DEP_BUNDLE_BASE}/third_party/harfbuzz &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH"
|
||||
},
|
||||
"keywords": [
|
||||
"harbfuzz"
|
||||
],
|
||||
"envs": {},
|
||||
"author": {},
|
||||
"homepage": "",
|
||||
"repository": "",
|
||||
"license": "Apache V2",
|
||||
"tags": [
|
||||
"third_party"
|
||||
],
|
||||
"ohos": {
|
||||
"os": "1.0.0",
|
||||
"kernel": "",
|
||||
"board": ""
|
||||
}
|
||||
}
|
||||
+202
@@ -0,0 +1,202 @@
|
||||
|
||||
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
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
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.
|
||||
+254
@@ -0,0 +1,254 @@
|
||||
# 驱动子系统<a name="ZH-CN_TOPIC_0000001052619216"></a>
|
||||
|
||||
## 简介<a name="section11660541593"></a>
|
||||
|
||||
OpenHarmony驱动子系统采用采用C面向对象编程模型构建,通过平台解耦、内核解耦,兼容不同内核,提供了归一化的驱动平台底座,旨在为开发者提供更精准、更高效的开发环境,力求做到一次开发,多系统部署。
|
||||
|
||||
为了缩减驱动开发者的驱动开发周期,降低三方设备驱动集成难度,OpenHarmony驱动子系统支持以下关键特性和能力。
|
||||
|
||||
- 弹性化的框架能力:
|
||||
|
||||
在传统的驱动框架能力的基础上,OpenHarmony驱动子系统通过构建弹性化的框架能力,可支持在百K级别到百兆级容量的终端产品形态部署。
|
||||
|
||||
|
||||
- 规范化的驱动接口:
|
||||
|
||||
定义了常见驱动接口,为驱动开发者和使用者提供丰富、稳定接口,并和未来开放的面向手机、平板、智慧屏等设备驱动接口保持API兼容性。
|
||||
|
||||
|
||||
- 组件化的驱动模型:
|
||||
|
||||
支持组件化的驱动模型,开发者提供更精细化的驱动管理,开发者可以对驱动进行组件化拆分,使得驱动开发者可以更多关注驱动与硬件交互部分。
|
||||
|
||||
同时系统也预置了部分模板化的驱动模型组件,如网络设备模型等。
|
||||
|
||||
|
||||
- 归一化的配置界面:
|
||||
|
||||
提供统一的配置界面,构建跨平台的配置转换和生成工具,实现跨平台的无缝切换
|
||||
|
||||
|
||||
为了方便驱动开发者更易于开发OpenHarmony驱动程序,OpenHarmony驱动子系统在DevEco集成驱动开发套件工具,支持驱动工程管理,驱动模板生成、配置管理等界面化的操作。
|
||||
|
||||
## 架构<a name="section101721227145613"></a>
|
||||
|
||||
OpenHarmony驱动框架采用主从架构设计模式,围绕着框架、模型、能力库和工具四个维度能力展开构建。
|
||||
|
||||
**图 1** 驱动和框架交互流程<a name="fig2213154653916"></a>
|
||||
|
||||
|
||||

|
||||
|
||||
- 驱动框架 -位于frameworks/core目录
|
||||
- 提供驱动框架能力,主要完成驱动加载和启动功能。
|
||||
- 通过对象管理器方式可实现驱动框架的弹性化部署和扩展。
|
||||
|
||||
- 驱动模型 - 位于frameworks/model目录
|
||||
- 提供了模型化驱动能力,如网络设备模型。
|
||||
|
||||
- 驱动能力库 - 位于frameworks/ability目录
|
||||
- 提供基础驱动能力模型,如IO通信能力模型。
|
||||
|
||||
- 驱动工具 - 位于frameworks\\tools目录
|
||||
- 提供HDI接口转换、驱动配置编译等工具。
|
||||
|
||||
- 驱动接口 - 位于lite\\hdi
|
||||
- 提供规范化的驱动接口。
|
||||
|
||||
- Support - 位于frameworks/support目录,
|
||||
- 提供规范化的平台驱动接口和系统接口抽象能力。
|
||||
|
||||
|
||||
## 目录<a name="section1464106163817"></a>
|
||||
|
||||
**表 1** OpenHarmony驱动框架源代码目录结构
|
||||
|
||||
<a name="table2977131081412"></a>
|
||||
<table><thead align="left"><tr id="row7977610131417"><th class="cellrowborder" valign="top" width="30.34%" id="mcps1.2.3.1.1"><p id="p18792459121314"><a name="p18792459121314"></a><a name="p18792459121314"></a>名称</p>
|
||||
</th>
|
||||
<th class="cellrowborder" valign="top" width="69.66%" id="mcps1.2.3.1.2"><p id="p77921459191317"><a name="p77921459191317"></a><a name="p77921459191317"></a>描述</p>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><tr id="row17666001869"><td class="cellrowborder" valign="top" width="30.34%" headers="mcps1.2.3.1.1 "><p id="p4667601064"><a name="p4667601064"></a><a name="p4667601064"></a>hdf</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="69.66%" headers="mcps1.2.3.1.2 "><p id="p154741318610"><a name="p154741318610"></a><a name="p154741318610"></a>OpenHarmony驱动框架。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row17977171010144"><td class="cellrowborder" valign="top" width="30.34%" headers="mcps1.2.3.1.1 "><p id="p2793159171311"><a name="p2793159171311"></a><a name="p2793159171311"></a>hdf\frameworks</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="69.66%" headers="mcps1.2.3.1.2 "><p id="p879375920132"><a name="p879375920132"></a><a name="p879375920132"></a>完成驱动框架、驱动模型和能力模型库相关代码。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row258624313915"><td class="cellrowborder" valign="top" width="30.34%" headers="mcps1.2.3.1.1 "><p id="p858718432912"><a name="p858718432912"></a><a name="p858718432912"></a>hdf\frameworks\ability</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="69.66%" headers="mcps1.2.3.1.2 "><p id="p1866016071012"><a name="p1866016071012"></a><a name="p1866016071012"></a>提供驱动开发的功能能力支持,如消息模型库等。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row6978161091412"><td class="cellrowborder" valign="top" width="30.34%" headers="mcps1.2.3.1.1 "><p id="p37931659101311"><a name="p37931659101311"></a><a name="p37931659101311"></a>hdf\frameworks\core</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="69.66%" headers="mcps1.2.3.1.2 "><p id="p6793059171318"><a name="p6793059171318"></a><a name="p6793059171318"></a>实现OpenHarmony驱动框架的核心代码部分。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row6978201031415"><td class="cellrowborder" valign="top" width="30.34%" headers="mcps1.2.3.1.1 "><p id="p117935599130"><a name="p117935599130"></a><a name="p117935599130"></a>hdf\frameworks\core\host</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="69.66%" headers="mcps1.2.3.1.2 "><p id="p53051522133"><a name="p53051522133"></a><a name="p53051522133"></a>提供驱动宿主环境框架功能,主要包含:</p>
|
||||
<p id="p168291956191214"><a name="p168291956191214"></a><a name="p168291956191214"></a>1、驱动加载、启动以及对外发布设备节点功能。</p>
|
||||
<p id="p945834131310"><a name="p945834131310"></a><a name="p945834131310"></a>2、提供驱动事件分发。</p>
|
||||
<p id="p1365513245138"><a name="p1365513245138"></a><a name="p1365513245138"></a>3、驱动内部电源状态管理功能。</p>
|
||||
<p id="p113814121414"><a name="p113814121414"></a><a name="p113814121414"></a>4、提供公共的驱动资源配置管理。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row138241821218"><td class="cellrowborder" valign="top" width="30.34%" headers="mcps1.2.3.1.1 "><p id="p1138321861211"><a name="p1138321861211"></a><a name="p1138321861211"></a>hdf\frameworks\core\manager</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="69.66%" headers="mcps1.2.3.1.2 "><p id="p103831518181211"><a name="p103831518181211"></a><a name="p103831518181211"></a>驱动框架管理模块主要包含:</p>
|
||||
<p id="p1125114971315"><a name="p1125114971315"></a><a name="p1125114971315"></a>1、驱动对外服务接口管理。</p>
|
||||
<p id="p419655510136"><a name="p419655510136"></a><a name="p419655510136"></a>2、驱动设备信息配置管理。</p>
|
||||
<p id="p95776361144"><a name="p95776361144"></a><a name="p95776361144"></a>3、驱动设备节点管理。</p>
|
||||
<p id="p75789456140"><a name="p75789456140"></a><a name="p75789456140"></a>4、安全管理模块。</p>
|
||||
<p id="p183476761517"><a name="p183476761517"></a><a name="p183476761517"></a>5、驱动故障恢复管理功能模块。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row116251627171512"><td class="cellrowborder" valign="top" width="30.34%" headers="mcps1.2.3.1.1 "><p id="p76251275152"><a name="p76251275152"></a><a name="p76251275152"></a>hdf\frameworks\core\shared</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="69.66%" headers="mcps1.2.3.1.2 "><p id="p56256278150"><a name="p56256278150"></a><a name="p56256278150"></a>提供host和manager共享模块代码。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row2306123015162"><td class="cellrowborder" valign="top" width="30.34%" headers="mcps1.2.3.1.1 "><p id="p10306143019164"><a name="p10306143019164"></a><a name="p10306143019164"></a>hdf\frameworks\model</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="69.66%" headers="mcps1.2.3.1.2 "><p id="p1030713021612"><a name="p1030713021612"></a><a name="p1030713021612"></a>提供驱动通用框架模型。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row2021312310176"><td class="cellrowborder" valign="top" width="30.34%" headers="mcps1.2.3.1.1 "><p id="p421315312177"><a name="p421315312177"></a><a name="p421315312177"></a>hdf\frameworks\model\network</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="69.66%" headers="mcps1.2.3.1.2 "><p id="p421313113179"><a name="p421313113179"></a><a name="p421313113179"></a>提供驱动网络设备模型。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row2167642189"><td class="cellrowborder" valign="top" width="30.34%" headers="mcps1.2.3.1.1 "><p id="p21683416181"><a name="p21683416181"></a><a name="p21683416181"></a>hdf\frameworks\support\</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="69.66%" headers="mcps1.2.3.1.2 "><p id="p71681548183"><a name="p71681548183"></a><a name="p71681548183"></a>提供驱动使用的系统接口资源和硬件资源,如GPIO、I2C、SPI等通用平台接口能力。</p>
|
||||
<p id="p19848191416195"><a name="p19848191416195"></a><a name="p19848191416195"></a>该接口部分与平台无关可支持跨平台迁移。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row15342553171918"><td class="cellrowborder" valign="top" width="30.34%" headers="mcps1.2.3.1.1 "><p id="p434255301916"><a name="p434255301916"></a><a name="p434255301916"></a>hdf\frameworks\support\osal</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="69.66%" headers="mcps1.2.3.1.2 "><p id="p1234211535198"><a name="p1234211535198"></a><a name="p1234211535198"></a>提供通用平台适配接口,如内存、线程、锁等资源。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row116634294203"><td class="cellrowborder" valign="top" width="30.34%" headers="mcps1.2.3.1.1 "><p id="p1866392919204"><a name="p1866392919204"></a><a name="p1866392919204"></a>hdf\frameworks\support\platform</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="69.66%" headers="mcps1.2.3.1.2 "><p id="p5663329202017"><a name="p5663329202017"></a><a name="p5663329202017"></a>提供通用平台硬件资源支撑接口,如GPIO、I2C、SPI等能力。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row193157275210"><td class="cellrowborder" valign="top" width="30.34%" headers="mcps1.2.3.1.1 "><p id="p1331513279211"><a name="p1331513279211"></a><a name="p1331513279211"></a>hdf\frameworks\tools</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="69.66%" headers="mcps1.2.3.1.2 "><p id="p131542762113"><a name="p131542762113"></a><a name="p131542762113"></a>提供驱动功能能力库,如HCS驱动配置编译工具等。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row66349163223"><td class="cellrowborder" valign="top" width="30.34%" headers="mcps1.2.3.1.1 "><p id="p2634161611224"><a name="p2634161611224"></a><a name="p2634161611224"></a>hdf\frameworks\utils</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="69.66%" headers="mcps1.2.3.1.2 "><p id="p26341516202215"><a name="p26341516202215"></a><a name="p26341516202215"></a>提供基础数据结构和算法等。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row1897841071415"><td class="cellrowborder" valign="top" width="30.34%" headers="mcps1.2.3.1.1 "><p id="p16793185961315"><a name="p16793185961315"></a><a name="p16793185961315"></a>hdf\lite\adapter</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="69.66%" headers="mcps1.2.3.1.2 "><p id="p14793959161317"><a name="p14793959161317"></a><a name="p14793959161317"></a>实现对内核操作接口适配,提供抽象化的接口供开发者使用。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row16448173512518"><td class="cellrowborder" valign="top" width="30.34%" headers="mcps1.2.3.1.1 "><p id="p644893514514"><a name="p644893514514"></a><a name="p644893514514"></a>hdf\lite\include</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="69.66%" headers="mcps1.2.3.1.2 "><p id="p1744933517511"><a name="p1744933517511"></a><a name="p1744933517511"></a>提供OpenHarmony驱动框架面向轻量化设备开放的驱动接口接口。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row192731625216"><td class="cellrowborder" valign="top" width="30.34%" headers="mcps1.2.3.1.1 "><p id="p10281116185217"><a name="p10281116185217"></a><a name="p10281116185217"></a>hdf\lite\hdi</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="69.66%" headers="mcps1.2.3.1.2 "><p id="p7286165524"><a name="p7286165524"></a><a name="p7286165524"></a>提供OpenHarmony驱动程序接口。</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
## 约束<a name="section1718733212019"></a>
|
||||
|
||||
无。
|
||||
|
||||
## 使用<a name="section8496817141616"></a>
|
||||
|
||||
**图 2** 驱动和框架交互流程<a name="fig1254113325118"></a>
|
||||
|
||||
|
||||

|
||||
|
||||
驱动框架完成大部分驱动加载的动作,用户只需注册自己所需的接口和配置,然后驱动框架就会根据解析,完成驱动加载和初始化动作。
|
||||
|
||||
开发者基于HDF驱动框架开发的驱动主要包含三大部分:
|
||||
|
||||
1、驱动程序部分 - 完成驱动的功能逻辑
|
||||
|
||||
2、驱动配置信息 - 指示驱动的加载信息内容
|
||||
|
||||
3、驱动资源配置 - 配置驱动的硬件配置信息。
|
||||
|
||||
驱动程序主要是完成驱动功能的开发部分:
|
||||
|
||||
对于开发者首先看到的是驱动入口部分,驱动入口部分通过DriverEntry对齐进行描述。
|
||||
|
||||
其中主要包含bind, init 和release三个接口。
|
||||
|
||||
```
|
||||
struct HdfDriverEntry g_deviceSample = {
|
||||
.moduleVersion = 1,
|
||||
.moduleName = "sample_driver",
|
||||
.Bind = SampleDriverBind,
|
||||
.Init = SampleDriverInit,
|
||||
.Release = SampleDriverRelease,
|
||||
};
|
||||
```
|
||||
|
||||
Bind接口描述:该接口的作用主要是完成驱动设备和设备服务接口的bind动作。
|
||||
|
||||
```
|
||||
int32_t SampleDriverBind(struct HdfDeviceObject *deviceObject)
|
||||
{
|
||||
//TODO: Bind and device service to device object.
|
||||
//And you can also initialize device resources here.
|
||||
return HDF_SUCCESS;
|
||||
}
|
||||
```
|
||||
|
||||
Init接口描述:当框架完成设备绑定动作后,就开始调用驱动初始化接口,当初始化成功后,驱动框架根据配置文件决定是否对外创建设备服务
|
||||
|
||||
接口,还是只是对当前服务接口可见。如果Init初始化失败的话,驱动框架就会主动释放创建的设备接口等信息。
|
||||
|
||||
```
|
||||
int32_t SampleDriverInit(struct HdfDeviceObject *deviceObject)
|
||||
{
|
||||
return HDF_SUCCESS;
|
||||
}
|
||||
```
|
||||
|
||||
Release接口描述:当用户需要卸载驱动时,驱动框架先通过该接口通知驱动程序释放资源。然后在执行其他内部资源释放。
|
||||
|
||||
```
|
||||
void SampleDriverRelease(struct HdfDeviceObject *deviceObject)
|
||||
{
|
||||
//Release all driver resources.
|
||||
return;
|
||||
}
|
||||
```
|
||||
|
||||
## 安装<a name="section14778154275818"></a>
|
||||
|
||||
OpenHarmony驱动主要部署在内核态,当前主要采用静态链接方式,随内核子系统编译和系统镜像打包。
|
||||
|
||||
**图 3** 驱动安装部署图<a name="fig675692712"></a>
|
||||
|
||||
|
||||

|
||||
|
||||
## 涉及仓<a name="section134812226297"></a>
|
||||
|
||||
drivers\_hdf\_frameworks
|
||||
|
||||
drivers\_hdf\_lite
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"name": "@ohos/hdf",
|
||||
"version": "1.8.0",
|
||||
"publishAs": "code-segment",
|
||||
"description": "OpenHarmony驱动子系统采用采用C面向对象编程模型构建,通过平台解耦、内核解耦,兼容不同内核,提供了归一化的驱动平台底座,旨在为开发者提供更精准、更高效的开发环境,力求做到一次开发,多系统部署。",
|
||||
"scripts": {
|
||||
"install": "DEST_PATH=${DEP_BUNDLE_BASE}/ &&mkdir -p $DEST_PATH && cp -r drivers vendor $DEST_PATH"
|
||||
},
|
||||
"keywords": [
|
||||
"hdf"
|
||||
],
|
||||
"license": "Apache V2",
|
||||
"repository": "",
|
||||
"homepage": "",
|
||||
"tags": [
|
||||
"drivers",
|
||||
"vendor"
|
||||
],
|
||||
"ohos": {
|
||||
"os": "1.0.0",
|
||||
"kernel": "liteos-a",
|
||||
"board": "hi3516,hi3518"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,202 @@
|
||||
|
||||
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
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
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.
|
||||
@@ -0,0 +1,298 @@
|
||||
# Hi3516dv300介绍<a name="ZH-CN_TOPIC_0000001054788038"></a>
|
||||
|
||||
## 简介<a name="section469617221261"></a>
|
||||
|
||||
海思(上海)媒体软件开发包用于适配不同芯片复杂的底层处理,为“媒体子系统”提供基础的多媒体处理功能。主要功能有:音视频采集、音视频编解码、音视频输出、视频前处理、封装、解封装、文件管理、存储管理、日志系统等。该软件包功能对应"媒体子系统"框架中红色框标注部分,如图1所示。所对应的目录为:vendor\\hisi\\hi35xx。
|
||||
|
||||
**图 1** 多媒体子系统框架图<a name="fig108579114217"></a>
|
||||

|
||||
|
||||
## 目录<a name="section1464106163817"></a>
|
||||
|
||||
海思(上海)媒体软件开发包目录结构如表1所示:
|
||||
|
||||
**表 1** hardware目录结构
|
||||
|
||||
<a name="table15811112718910"></a>
|
||||
<table><thead align="left"><tr id="row1181112718915"><th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.1"><p id="p28116271096"><a name="p28116271096"></a><a name="p28116271096"></a>名称</p>
|
||||
</th>
|
||||
<th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.2"><p id="p28111727292"><a name="p28111727292"></a><a name="p28111727292"></a>描述</p>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><tr id="row581122715917"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p7463423141214"><a name="p7463423141214"></a><a name="p7463423141214"></a>hi35xx\hardware</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p164391323161216"><a name="p164391323161216"></a><a name="p164391323161216"></a>媒体南向接口实现、框架及芯片对接层库目录</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
**表 2** hi35xx\_init目录结构
|
||||
|
||||
<a name="table78291813141320"></a>
|
||||
<table><thead align="left"><tr id="row10829191361312"><th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.1"><p id="p8829813111314"><a name="p8829813111314"></a><a name="p8829813111314"></a>名称</p>
|
||||
</th>
|
||||
<th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.2"><p id="p1182901301317"><a name="p1182901301317"></a><a name="p1182901301317"></a>描述</p>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><tr id="row98296133139"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p582915130134"><a name="p582915130134"></a><a name="p582915130134"></a>hi35xx\hi35xx_init\hi3516dv300</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p1882971311313"><a name="p1882971311313"></a><a name="p1882971311313"></a>编译打包16dv300内核镜像的编译脚本</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row1316718286548"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p167506431548"><a name="p167506431548"></a><a name="p167506431548"></a>hi35xx\hi35xx_init\hi3518ev300</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p5165122819547"><a name="p5165122819547"></a><a name="p5165122819547"></a>编译打包18ev300内核镜像的编译脚本</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
**表 3** hi3516dv300目录结构
|
||||
|
||||
<a name="table2977131081412"></a>
|
||||
<table><thead align="left"><tr id="row7977610131417"><th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.1"><p id="p18792459121314"><a name="p18792459121314"></a><a name="p18792459121314"></a>名称</p>
|
||||
</th>
|
||||
<th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.2"><p id="p77921459191317"><a name="p77921459191317"></a><a name="p77921459191317"></a>描述</p>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><tr id="row17977171010144"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p1881003717317"><a name="p1881003717317"></a><a name="p1881003717317"></a>hi35xx\hi3516dv300</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p879375920132"><a name="p879375920132"></a><a name="p879375920132"></a>Hi3516DV300芯片驱动软件,包括:媒体驱动子目录、媒体用户态库子目录、uboot的差异化内容目录、NOTICE文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row6978161091412"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p98744311516"><a name="p98744311516"></a><a name="p98744311516"></a>hi35xx\hi3516dv300\module_init\lib</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p6793059171318"><a name="p6793059171318"></a><a name="p6793059171318"></a>Hi3516DV300芯片媒体各模块驱动对应的库、LICENSE文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row6978201031415"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p6687137121713"><a name="p6687137121713"></a><a name="p6687137121713"></a>hi35xx\hi3516dv300\module_init\src</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p528302241710"><a name="p528302241710"></a><a name="p528302241710"></a>内核驱动初始化源代码、LICENSE文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row1897841071415"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p16793185961315"><a name="p16793185961315"></a><a name="p16793185961315"></a>hi35xx\hi3516dv300\soc\lib</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p14793959161317"><a name="p14793959161317"></a><a name="p14793959161317"></a>Hi3516DV300芯片的媒体库文件、LICENSE文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row1137581942013"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p19370171952013"><a name="p19370171952013"></a><a name="p19370171952013"></a>hi35xx\hi3516dv300\uboot\out\boot</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p137061910203"><a name="p137061910203"></a><a name="p137061910203"></a>采用hi35xx\third_party\uboot\u-boot-2020.01和hi35xx\hi3516dv300\uboot\reg\reg_info_hi3516dv300.bin编译成的uboot、README文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row1337421962012"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p837021982012"><a name="p837021982012"></a><a name="p837021982012"></a>hi35xx\hi3516dv300\uboot\reg</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p237031917201"><a name="p237031917201"></a><a name="p237031917201"></a>uboot配置文件、LICENSE文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row135651424162014"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p1072784514202"><a name="p1072784514202"></a><a name="p1072784514202"></a>hi35xx\hi3516dv300\uboot\secureboot_ohos</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p189415151506"><a name="p189415151506"></a><a name="p189415151506"></a>鸿蒙OS安全启动相关的编译脚本</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row656518242203"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p2900950132013"><a name="p2900950132013"></a><a name="p2900950132013"></a>hi35xx\hi3516dv300\uboot\secureboot_release</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p589812504207"><a name="p589812504207"></a><a name="p589812504207"></a>生成安全uboot的源代码、License目录</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
**表 4** hi3518ev300目录结构
|
||||
|
||||
<a name="table1769285811814"></a>
|
||||
<table><thead align="left"><tr id="row186921858681"><th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.1"><p id="p106927581786"><a name="p106927581786"></a><a name="p106927581786"></a>名称</p>
|
||||
</th>
|
||||
<th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.2"><p id="p1769220581982"><a name="p1769220581982"></a><a name="p1769220581982"></a>描述</p>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><tr id="row169217585818"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p2692758986"><a name="p2692758986"></a><a name="p2692758986"></a>hi35xx\hi3518ev300</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p116926581288"><a name="p116926581288"></a><a name="p116926581288"></a>Hi3518EV300芯片驱动软件,包括:媒体驱动子目录、媒体用户态库子目录、uboot的差异化内容目录、NOTICE文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row1269285819817"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p169219587818"><a name="p169219587818"></a><a name="p169219587818"></a>hi35xx\hi3518ev300\module_init\lib</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p1269210581689"><a name="p1269210581689"></a><a name="p1269210581689"></a>Hi3518EV300芯片媒体各模块驱动对应的库、LICENSE文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row86931358986"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p36937581882"><a name="p36937581882"></a><a name="p36937581882"></a>hi35xx\hi3518ev300\module_init\src</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p136931158287"><a name="p136931158287"></a><a name="p136931158287"></a>内核驱动初始化源代码、LICENSE文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row20693958681"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p11693258181"><a name="p11693258181"></a><a name="p11693258181"></a>hi35xx\hi3518ev300\soc\lib</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p1369315585818"><a name="p1369315585818"></a><a name="p1369315585818"></a>Hi3518EV300芯片的媒体库文件、LICENSE文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row369335817820"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p16931583815"><a name="p16931583815"></a><a name="p16931583815"></a>hi35xx\hi3518ev300\uboot\out\boot</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p269345817814"><a name="p269345817814"></a><a name="p269345817814"></a>采用hi35xx\third_party\uboot\u-boot-2020.01和hi35xx\hi3518ev300\uboot\reg\reg_info_hi3518ev300.bin编译成的uboot、README文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row769365813812"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p1669317585818"><a name="p1669317585818"></a><a name="p1669317585818"></a>hi35xx\hi3518ev300\uboot\reg</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p1469315585813"><a name="p1469315585813"></a><a name="p1469315585813"></a>uboot配置文件、LICENSE文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row9693185816812"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p126935586810"><a name="p126935586810"></a><a name="p126935586810"></a>hi35xx\hi3518ev300\uboot\secureboot_ohos</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p5693458781"><a name="p5693458781"></a><a name="p5693458781"></a>鸿蒙OS安全启动相关的编译脚本</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row26932581085"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p18693658184"><a name="p18693658184"></a><a name="p18693658184"></a>hi35xx\hi3518ev300\uboot\secureboot_release</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p106931358586"><a name="p106931358586"></a><a name="p106931358586"></a>生成安全uboot的源代码、License目录</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
**表 5** middleware目录结构
|
||||
|
||||
<a name="table9651175972417"></a>
|
||||
<table><thead align="left"><tr id="row1965112590241"><th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.1"><p id="p146513596248"><a name="p146513596248"></a><a name="p146513596248"></a>名称</p>
|
||||
</th>
|
||||
<th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.2"><p id="p10651859192419"><a name="p10651859192419"></a><a name="p10651859192419"></a>描述</p>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><tr id="row16653185915240"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p20653155942417"><a name="p20653155942417"></a><a name="p20653155942417"></a>hi35xx\middleware\source\common</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p1065385913243"><a name="p1065385913243"></a><a name="p1065385913243"></a>南向组件公共模块库目录</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row186531759192419"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p1865345914243"><a name="p1865345914243"></a><a name="p1865345914243"></a>hi35xx\middleware\source\component</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p19653205992414"><a name="p19653205992414"></a><a name="p19653205992414"></a>南向组件非公共模块库目录</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row6653125952412"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p5653105910248"><a name="p5653105910248"></a><a name="p5653105910248"></a>hi35xx\middleware\source\thirdparty</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p17653135914241"><a name="p17653135914241"></a><a name="p17653135914241"></a>南向插件依赖第三方开源软件目录</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
**表 6** platform目录结构
|
||||
|
||||
<a name="table397031661516"></a>
|
||||
<table><thead align="left"><tr id="row109701916151514"><th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.1"><p id="p16971121616153"><a name="p16971121616153"></a><a name="p16971121616153"></a>名称</p>
|
||||
</th>
|
||||
<th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.2"><p id="p17971616151513"><a name="p17971616151513"></a><a name="p17971616151513"></a>描述</p>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><tr id="row12971131610154"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p997151621512"><a name="p997151621512"></a><a name="p997151621512"></a>hi35xx\platform</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p1971161620156"><a name="p1971161620156"></a><a name="p1971161620156"></a>hi35xx平台驱动</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
**表 7** third\_party目录结构
|
||||
|
||||
<a name="table16381640161517"></a>
|
||||
<table><thead align="left"><tr id="row33814041510"><th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.1"><p id="p163812401154"><a name="p163812401154"></a><a name="p163812401154"></a>名称</p>
|
||||
</th>
|
||||
<th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.2"><p id="p163854019151"><a name="p163854019151"></a><a name="p163854019151"></a>描述</p>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><tr id="row12381640101512"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p14505145412188"><a name="p14505145412188"></a><a name="p14505145412188"></a>hi35xx\third_party\uboot\u-boot-2020.01</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p14381240161511"><a name="p14381240161511"></a><a name="p14381240161511"></a>uboot开源代码</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
## 约束<a name="section0364124983015"></a>
|
||||
|
||||
当前支持Hi3518EV300、Hi3516DV300芯片。
|
||||
|
||||
## 许可协议<a name="section1478215290"></a>
|
||||
|
||||
## hi3516dv300许可说明<a name="section172811306502"></a>
|
||||
|
||||
- hi35xx\\hi3516dv300\\module\_init\\lib和hi35xx\\hi3516dv300\\soc\\lib里面为海思(上海)的自研库,遵循海思(上海)的LICENSE,这两个目录下均有LICENSE文件,LICENSE文件结尾可以看到版权信息:
|
||||
|
||||
```
|
||||
Copyright (C) 2020 Hisilicon (Shanghai) Technologies Co., Ltd. All rights reserved.
|
||||
```
|
||||
|
||||
- hi35xx\\hi3516dv300\\module\_init\\src目录下为海思(上海)自研代码,使用基于Apache License Version 2.0许可的Hisilicon \(Shanghai\) 版权声明,在该目录下有Apache License Version 2.0的LICENSE文件,许可信息和版权信息通常可以在文件开头看到:
|
||||
|
||||
```
|
||||
/ *Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED. Licensed under the Apache License,* ... * /
|
||||
```
|
||||
|
||||
- hi35xx\\hi3516dv300\\uboot\\reg为海思(上海)的二进制文件,遵循海思(上海)的LICENSE,该目录下有LICENSE文件,LICENSE文件结尾可以看到:
|
||||
|
||||
```
|
||||
Copyright (C) 2020 Hisilicon (Shanghai) Technologies Co., Ltd. All rights reserved.
|
||||
```
|
||||
|
||||
- hi35xx\\hi3516dv300\\uboot\\out\\boot是由u-boot-2020.01和reg\_info\_hi3516dv300.bin编译成的uboot二进制文件,完全遵从u-boot-2020.01的整体协议,具体请参看hi35xx\\third\_party\\uboot\\u-boot-2020.01\\Licenses目录下的README。
|
||||
- hi35xx\\hi3516dv300\\uboot\\secureboot\_release为安全uboot的开源代码,其中自研的部分使用基于GPL许可的Hisilicon \(Shanghai\) 版权声明,在该目录下有License目录,许可信息和版权信息通常可以在文件开头看到:
|
||||
|
||||
```
|
||||
/ *Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
* ... * /
|
||||
```
|
||||
|
||||
|
||||
- hi35xx\\hi3516dv300\\NOTICE文件描述了使用到的三款开源软件:Das U-Boot 2020.01、mbed TLS 2.16.6、fdk-aac v2.0.1。
|
||||
|
||||
## hi3518ev300许可说明<a name="section172983094910"></a>
|
||||
|
||||
- hi35xx\\hi3518ev300\\module\_init\\lib和hi35xx\\hi3518ev300\\soc\\lib里面为海思(上海)的自研库,遵循海思(上海)的LICENSE,这两个目录下均有LICENSE文件,LICENSE文件结尾可以看到版权信息:
|
||||
|
||||
```
|
||||
Copyright (C) 2020 Hisilicon (Shanghai) Technologies Co., Ltd. All rights reserved.
|
||||
```
|
||||
|
||||
- hi35xx\\hi3518ev300\\module\_init\\src目录下为海思(上海)自研代码,使用基于Apache License Version 2.0许可的Hisilicon \(Shanghai\) 版权声明,在该目录下有Apache License Version 2.0的LICENSE文件,许可信息和版权信息通常可以在文件开头看到:
|
||||
|
||||
```
|
||||
/ *Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED. Licensed under the Apache License,* ... * /
|
||||
```
|
||||
|
||||
- hi35xx\\hi3518ev300\\uboot\\reg为海思(上海)的二进制文件,遵循海思(上海)的LICENSE,该目录下有LICENSE文件,LICENSE文件结尾可以看到:
|
||||
|
||||
```
|
||||
Copyright (C) 2020 Hisilicon (Shanghai) Technologies Co., Ltd. All rights reserved.
|
||||
```
|
||||
|
||||
- hi35xx\\hi3518ev300\\uboot\\out\\boot是由u-boot-2020.01和reg\_info\_hi3518ev300.bin编译成的uboot二进制文件,完全遵从u-boot-2020.01的整体协议,具体请参看hi35xx\\third\_party\\uboot\\u-boot-2020.01\\Licenses目录下的README。
|
||||
- hi35xx\\hi3518ev300\\uboot\\secureboot\_release为安全uboot的开源代码,其中自研的部分使用基于GPL许可的Hisilicon \(Shanghai\) 版权声明,在该目录下有License目录,许可信息和版权信息通常可以在文件开头看到:
|
||||
|
||||
```
|
||||
/ *Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
* ... * /
|
||||
```
|
||||
|
||||
- hi35xx\\hi3518ev300\\NOTICE文件描述了使用到的三款开源软件:Das U-Boot 2020.01、mbed TLS 2.16.6、fdk-aac v2.0.1。
|
||||
|
||||
## third\_party许可说明<a name="section148702720527"></a>
|
||||
|
||||
hi35xx\\third\_party\\uboot\\u-boot-2020.01为uboot开源代码,遵循软件版本自带的开源许可声明,具体请参看hi35xx\\third\_party\\uboot\\u-boot-2020.01\\Licenses目录下的README。
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"name": "@ohos/hi3516dv300",
|
||||
"version": "1.8.0",
|
||||
"publishAs": "code-segment",
|
||||
"description": "海思(上海)媒体软件开发包用于适配不同芯片复杂的底层处理,为“媒体子系统”提供基础的多媒体处理功能。主要功能有:音视频采集、音视频编解码、音视频输出、视频前处理、封装、解封装、文件管理、存储管理、日志系统等。该软件包功能对应\"媒体子系统\"框架中红色框标注部分,如图1所示。所对应的目录为:vendor\\hisi\\hi35xx。",
|
||||
"scripts": {
|
||||
"install": "DEST_PATH=${DEP_BUNDLE_BASE}/vendor/hisi/hi35xx &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH"
|
||||
},
|
||||
"keywords": [
|
||||
"vender"
|
||||
],
|
||||
"license": "Apache V2",
|
||||
"repository": "",
|
||||
"homepage": "",
|
||||
"tags": [
|
||||
"vendor"
|
||||
],
|
||||
"ohos": {
|
||||
"os": "1.0.0",
|
||||
"kernel": "liteos-a",
|
||||
"board": "hi3516"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,202 @@
|
||||
|
||||
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
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
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.
|
||||
@@ -0,0 +1,298 @@
|
||||
# Hi3516dv300介绍<a name="ZH-CN_TOPIC_0000001054788038"></a>
|
||||
|
||||
## 简介<a name="section469617221261"></a>
|
||||
|
||||
海思(上海)媒体软件开发包用于适配不同芯片复杂的底层处理,为“媒体子系统”提供基础的多媒体处理功能。主要功能有:音视频采集、音视频编解码、音视频输出、视频前处理、封装、解封装、文件管理、存储管理、日志系统等。该软件包功能对应"媒体子系统"框架中红色框标注部分,如图1所示。所对应的目录为:vendor\\hisi\\hi35xx。
|
||||
|
||||
**图 1** 多媒体子系统框架图<a name="fig108579114217"></a>
|
||||

|
||||
|
||||
## 目录<a name="section1464106163817"></a>
|
||||
|
||||
海思(上海)媒体软件开发包目录结构如表1所示:
|
||||
|
||||
**表 1** hardware目录结构
|
||||
|
||||
<a name="table15811112718910"></a>
|
||||
<table><thead align="left"><tr id="row1181112718915"><th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.1"><p id="p28116271096"><a name="p28116271096"></a><a name="p28116271096"></a>名称</p>
|
||||
</th>
|
||||
<th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.2"><p id="p28111727292"><a name="p28111727292"></a><a name="p28111727292"></a>描述</p>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><tr id="row581122715917"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p7463423141214"><a name="p7463423141214"></a><a name="p7463423141214"></a>hi35xx\hardware</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p164391323161216"><a name="p164391323161216"></a><a name="p164391323161216"></a>媒体南向接口实现、框架及芯片对接层库目录</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
**表 2** hi35xx\_init目录结构
|
||||
|
||||
<a name="table78291813141320"></a>
|
||||
<table><thead align="left"><tr id="row10829191361312"><th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.1"><p id="p8829813111314"><a name="p8829813111314"></a><a name="p8829813111314"></a>名称</p>
|
||||
</th>
|
||||
<th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.2"><p id="p1182901301317"><a name="p1182901301317"></a><a name="p1182901301317"></a>描述</p>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><tr id="row98296133139"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p582915130134"><a name="p582915130134"></a><a name="p582915130134"></a>hi35xx\hi35xx_init\hi3516dv300</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p1882971311313"><a name="p1882971311313"></a><a name="p1882971311313"></a>编译打包16dv300内核镜像的编译脚本</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row1316718286548"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p167506431548"><a name="p167506431548"></a><a name="p167506431548"></a>hi35xx\hi35xx_init\hi3518ev300</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p5165122819547"><a name="p5165122819547"></a><a name="p5165122819547"></a>编译打包18ev300内核镜像的编译脚本</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
**表 3** hi3516dv300目录结构
|
||||
|
||||
<a name="table2977131081412"></a>
|
||||
<table><thead align="left"><tr id="row7977610131417"><th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.1"><p id="p18792459121314"><a name="p18792459121314"></a><a name="p18792459121314"></a>名称</p>
|
||||
</th>
|
||||
<th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.2"><p id="p77921459191317"><a name="p77921459191317"></a><a name="p77921459191317"></a>描述</p>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><tr id="row17977171010144"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p1881003717317"><a name="p1881003717317"></a><a name="p1881003717317"></a>hi35xx\hi3516dv300</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p879375920132"><a name="p879375920132"></a><a name="p879375920132"></a>Hi3516DV300芯片驱动软件,包括:媒体驱动子目录、媒体用户态库子目录、uboot的差异化内容目录、NOTICE文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row6978161091412"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p98744311516"><a name="p98744311516"></a><a name="p98744311516"></a>hi35xx\hi3516dv300\module_init\lib</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p6793059171318"><a name="p6793059171318"></a><a name="p6793059171318"></a>Hi3516DV300芯片媒体各模块驱动对应的库、LICENSE文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row6978201031415"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p6687137121713"><a name="p6687137121713"></a><a name="p6687137121713"></a>hi35xx\hi3516dv300\module_init\src</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p528302241710"><a name="p528302241710"></a><a name="p528302241710"></a>内核驱动初始化源代码、LICENSE文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row1897841071415"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p16793185961315"><a name="p16793185961315"></a><a name="p16793185961315"></a>hi35xx\hi3516dv300\soc\lib</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p14793959161317"><a name="p14793959161317"></a><a name="p14793959161317"></a>Hi3516DV300芯片的媒体库文件、LICENSE文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row1137581942013"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p19370171952013"><a name="p19370171952013"></a><a name="p19370171952013"></a>hi35xx\hi3516dv300\uboot\out\boot</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p137061910203"><a name="p137061910203"></a><a name="p137061910203"></a>采用hi35xx\third_party\uboot\u-boot-2020.01和hi35xx\hi3516dv300\uboot\reg\reg_info_hi3516dv300.bin编译成的uboot、README文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row1337421962012"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p837021982012"><a name="p837021982012"></a><a name="p837021982012"></a>hi35xx\hi3516dv300\uboot\reg</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p237031917201"><a name="p237031917201"></a><a name="p237031917201"></a>uboot配置文件、LICENSE文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row135651424162014"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p1072784514202"><a name="p1072784514202"></a><a name="p1072784514202"></a>hi35xx\hi3516dv300\uboot\secureboot_ohos</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p189415151506"><a name="p189415151506"></a><a name="p189415151506"></a>鸿蒙OS安全启动相关的编译脚本</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row656518242203"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p2900950132013"><a name="p2900950132013"></a><a name="p2900950132013"></a>hi35xx\hi3516dv300\uboot\secureboot_release</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p589812504207"><a name="p589812504207"></a><a name="p589812504207"></a>生成安全uboot的源代码、License目录</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
**表 4** hi3518ev300目录结构
|
||||
|
||||
<a name="table1769285811814"></a>
|
||||
<table><thead align="left"><tr id="row186921858681"><th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.1"><p id="p106927581786"><a name="p106927581786"></a><a name="p106927581786"></a>名称</p>
|
||||
</th>
|
||||
<th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.2"><p id="p1769220581982"><a name="p1769220581982"></a><a name="p1769220581982"></a>描述</p>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><tr id="row169217585818"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p2692758986"><a name="p2692758986"></a><a name="p2692758986"></a>hi35xx\hi3518ev300</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p116926581288"><a name="p116926581288"></a><a name="p116926581288"></a>Hi3518EV300芯片驱动软件,包括:媒体驱动子目录、媒体用户态库子目录、uboot的差异化内容目录、NOTICE文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row1269285819817"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p169219587818"><a name="p169219587818"></a><a name="p169219587818"></a>hi35xx\hi3518ev300\module_init\lib</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p1269210581689"><a name="p1269210581689"></a><a name="p1269210581689"></a>Hi3518EV300芯片媒体各模块驱动对应的库、LICENSE文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row86931358986"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p36937581882"><a name="p36937581882"></a><a name="p36937581882"></a>hi35xx\hi3518ev300\module_init\src</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p136931158287"><a name="p136931158287"></a><a name="p136931158287"></a>内核驱动初始化源代码、LICENSE文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row20693958681"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p11693258181"><a name="p11693258181"></a><a name="p11693258181"></a>hi35xx\hi3518ev300\soc\lib</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p1369315585818"><a name="p1369315585818"></a><a name="p1369315585818"></a>Hi3518EV300芯片的媒体库文件、LICENSE文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row369335817820"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p16931583815"><a name="p16931583815"></a><a name="p16931583815"></a>hi35xx\hi3518ev300\uboot\out\boot</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p269345817814"><a name="p269345817814"></a><a name="p269345817814"></a>采用hi35xx\third_party\uboot\u-boot-2020.01和hi35xx\hi3518ev300\uboot\reg\reg_info_hi3518ev300.bin编译成的uboot、README文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row769365813812"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p1669317585818"><a name="p1669317585818"></a><a name="p1669317585818"></a>hi35xx\hi3518ev300\uboot\reg</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p1469315585813"><a name="p1469315585813"></a><a name="p1469315585813"></a>uboot配置文件、LICENSE文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row9693185816812"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p126935586810"><a name="p126935586810"></a><a name="p126935586810"></a>hi35xx\hi3518ev300\uboot\secureboot_ohos</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p5693458781"><a name="p5693458781"></a><a name="p5693458781"></a>鸿蒙OS安全启动相关的编译脚本</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row26932581085"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p18693658184"><a name="p18693658184"></a><a name="p18693658184"></a>hi35xx\hi3518ev300\uboot\secureboot_release</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p106931358586"><a name="p106931358586"></a><a name="p106931358586"></a>生成安全uboot的源代码、License目录</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
**表 5** middleware目录结构
|
||||
|
||||
<a name="table9651175972417"></a>
|
||||
<table><thead align="left"><tr id="row1965112590241"><th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.1"><p id="p146513596248"><a name="p146513596248"></a><a name="p146513596248"></a>名称</p>
|
||||
</th>
|
||||
<th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.2"><p id="p10651859192419"><a name="p10651859192419"></a><a name="p10651859192419"></a>描述</p>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><tr id="row16653185915240"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p20653155942417"><a name="p20653155942417"></a><a name="p20653155942417"></a>hi35xx\middleware\source\common</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p1065385913243"><a name="p1065385913243"></a><a name="p1065385913243"></a>南向组件公共模块库目录</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row186531759192419"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p1865345914243"><a name="p1865345914243"></a><a name="p1865345914243"></a>hi35xx\middleware\source\component</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p19653205992414"><a name="p19653205992414"></a><a name="p19653205992414"></a>南向组件非公共模块库目录</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row6653125952412"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p5653105910248"><a name="p5653105910248"></a><a name="p5653105910248"></a>hi35xx\middleware\source\thirdparty</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p17653135914241"><a name="p17653135914241"></a><a name="p17653135914241"></a>南向插件依赖第三方开源软件目录</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
**表 6** platform目录结构
|
||||
|
||||
<a name="table397031661516"></a>
|
||||
<table><thead align="left"><tr id="row109701916151514"><th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.1"><p id="p16971121616153"><a name="p16971121616153"></a><a name="p16971121616153"></a>名称</p>
|
||||
</th>
|
||||
<th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.2"><p id="p17971616151513"><a name="p17971616151513"></a><a name="p17971616151513"></a>描述</p>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><tr id="row12971131610154"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p997151621512"><a name="p997151621512"></a><a name="p997151621512"></a>hi35xx\platform</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p1971161620156"><a name="p1971161620156"></a><a name="p1971161620156"></a>hi35xx平台驱动</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
**表 7** third\_party目录结构
|
||||
|
||||
<a name="table16381640161517"></a>
|
||||
<table><thead align="left"><tr id="row33814041510"><th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.1"><p id="p163812401154"><a name="p163812401154"></a><a name="p163812401154"></a>名称</p>
|
||||
</th>
|
||||
<th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.2"><p id="p163854019151"><a name="p163854019151"></a><a name="p163854019151"></a>描述</p>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><tr id="row12381640101512"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p14505145412188"><a name="p14505145412188"></a><a name="p14505145412188"></a>hi35xx\third_party\uboot\u-boot-2020.01</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p14381240161511"><a name="p14381240161511"></a><a name="p14381240161511"></a>uboot开源代码</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
## 约束<a name="section0364124983015"></a>
|
||||
|
||||
当前支持Hi3518EV300、Hi3516DV300芯片。
|
||||
|
||||
## 许可协议<a name="section1478215290"></a>
|
||||
|
||||
## hi3516dv300许可说明<a name="section172811306502"></a>
|
||||
|
||||
- hi35xx\\hi3516dv300\\module\_init\\lib和hi35xx\\hi3516dv300\\soc\\lib里面为海思(上海)的自研库,遵循海思(上海)的LICENSE,这两个目录下均有LICENSE文件,LICENSE文件结尾可以看到版权信息:
|
||||
|
||||
```
|
||||
Copyright (C) 2020 Hisilicon (Shanghai) Technologies Co., Ltd. All rights reserved.
|
||||
```
|
||||
|
||||
- hi35xx\\hi3516dv300\\module\_init\\src目录下为海思(上海)自研代码,使用基于Apache License Version 2.0许可的Hisilicon \(Shanghai\) 版权声明,在该目录下有Apache License Version 2.0的LICENSE文件,许可信息和版权信息通常可以在文件开头看到:
|
||||
|
||||
```
|
||||
/ *Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED. Licensed under the Apache License,* ... * /
|
||||
```
|
||||
|
||||
- hi35xx\\hi3516dv300\\uboot\\reg为海思(上海)的二进制文件,遵循海思(上海)的LICENSE,该目录下有LICENSE文件,LICENSE文件结尾可以看到:
|
||||
|
||||
```
|
||||
Copyright (C) 2020 Hisilicon (Shanghai) Technologies Co., Ltd. All rights reserved.
|
||||
```
|
||||
|
||||
- hi35xx\\hi3516dv300\\uboot\\out\\boot是由u-boot-2020.01和reg\_info\_hi3516dv300.bin编译成的uboot二进制文件,完全遵从u-boot-2020.01的整体协议,具体请参看hi35xx\\third\_party\\uboot\\u-boot-2020.01\\Licenses目录下的README。
|
||||
- hi35xx\\hi3516dv300\\uboot\\secureboot\_release为安全uboot的开源代码,其中自研的部分使用基于GPL许可的Hisilicon \(Shanghai\) 版权声明,在该目录下有License目录,许可信息和版权信息通常可以在文件开头看到:
|
||||
|
||||
```
|
||||
/ *Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
* ... * /
|
||||
```
|
||||
|
||||
|
||||
- hi35xx\\hi3516dv300\\NOTICE文件描述了使用到的三款开源软件:Das U-Boot 2020.01、mbed TLS 2.16.6、fdk-aac v2.0.1。
|
||||
|
||||
## hi3518ev300许可说明<a name="section172983094910"></a>
|
||||
|
||||
- hi35xx\\hi3518ev300\\module\_init\\lib和hi35xx\\hi3518ev300\\soc\\lib里面为海思(上海)的自研库,遵循海思(上海)的LICENSE,这两个目录下均有LICENSE文件,LICENSE文件结尾可以看到版权信息:
|
||||
|
||||
```
|
||||
Copyright (C) 2020 Hisilicon (Shanghai) Technologies Co., Ltd. All rights reserved.
|
||||
```
|
||||
|
||||
- hi35xx\\hi3518ev300\\module\_init\\src目录下为海思(上海)自研代码,使用基于Apache License Version 2.0许可的Hisilicon \(Shanghai\) 版权声明,在该目录下有Apache License Version 2.0的LICENSE文件,许可信息和版权信息通常可以在文件开头看到:
|
||||
|
||||
```
|
||||
/ *Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED. Licensed under the Apache License,* ... * /
|
||||
```
|
||||
|
||||
- hi35xx\\hi3518ev300\\uboot\\reg为海思(上海)的二进制文件,遵循海思(上海)的LICENSE,该目录下有LICENSE文件,LICENSE文件结尾可以看到:
|
||||
|
||||
```
|
||||
Copyright (C) 2020 Hisilicon (Shanghai) Technologies Co., Ltd. All rights reserved.
|
||||
```
|
||||
|
||||
- hi35xx\\hi3518ev300\\uboot\\out\\boot是由u-boot-2020.01和reg\_info\_hi3518ev300.bin编译成的uboot二进制文件,完全遵从u-boot-2020.01的整体协议,具体请参看hi35xx\\third\_party\\uboot\\u-boot-2020.01\\Licenses目录下的README。
|
||||
- hi35xx\\hi3518ev300\\uboot\\secureboot\_release为安全uboot的开源代码,其中自研的部分使用基于GPL许可的Hisilicon \(Shanghai\) 版权声明,在该目录下有License目录,许可信息和版权信息通常可以在文件开头看到:
|
||||
|
||||
```
|
||||
/ *Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
* ... * /
|
||||
```
|
||||
|
||||
- hi35xx\\hi3518ev300\\NOTICE文件描述了使用到的三款开源软件:Das U-Boot 2020.01、mbed TLS 2.16.6、fdk-aac v2.0.1。
|
||||
|
||||
## third\_party许可说明<a name="section148702720527"></a>
|
||||
|
||||
hi35xx\\third\_party\\uboot\\u-boot-2020.01为uboot开源代码,遵循软件版本自带的开源许可声明,具体请参看hi35xx\\third\_party\\uboot\\u-boot-2020.01\\Licenses目录下的README。
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"name": "@ohos/hi3516dv300_adapter",
|
||||
"version": "1.8.0",
|
||||
"publishAs": "code-segment",
|
||||
"description": "海思(上海)媒体软件开发包用于适配不同芯片复杂的底层处理,为“媒体子系统”提供基础的多媒体处理功能。主要功能有:音视频采集、音视频编解码、音视频输出、视频前处理、封装、解封装、文件管理、存储管理、日志系统等。该软件包功能对应\"媒体子系统\"框架中红色框标注部分,如图1所示。所对应的目录为:vendor\\hisi\\hi35xx。",
|
||||
"scripts": {
|
||||
"install": "DEST_PATH=${DEP_BUNDLE_BASE}/vendor/hisi/hi35xx/ &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH"
|
||||
},
|
||||
"keywords": [
|
||||
"vender"
|
||||
],
|
||||
"license": "Apache V2",
|
||||
"repository": "",
|
||||
"homepage": "",
|
||||
"tags": [
|
||||
"vendor"
|
||||
],
|
||||
"ohos": {
|
||||
"os": "1.0.0",
|
||||
"kernel": "liteos-a",
|
||||
"board": "hi3516"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,202 @@
|
||||
|
||||
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
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
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.
|
||||
@@ -0,0 +1,298 @@
|
||||
# Hi3516dv300介绍<a name="ZH-CN_TOPIC_0000001054788038"></a>
|
||||
|
||||
## 简介<a name="section469617221261"></a>
|
||||
|
||||
海思(上海)媒体软件开发包用于适配不同芯片复杂的底层处理,为“媒体子系统”提供基础的多媒体处理功能。主要功能有:音视频采集、音视频编解码、音视频输出、视频前处理、封装、解封装、文件管理、存储管理、日志系统等。该软件包功能对应"媒体子系统"框架中红色框标注部分,如图1所示。所对应的目录为:vendor\\hisi\\hi35xx。
|
||||
|
||||
**图 1** 多媒体子系统框架图<a name="fig108579114217"></a>
|
||||

|
||||
|
||||
## 目录<a name="section1464106163817"></a>
|
||||
|
||||
海思(上海)媒体软件开发包目录结构如表1所示:
|
||||
|
||||
**表 1** hardware目录结构
|
||||
|
||||
<a name="table15811112718910"></a>
|
||||
<table><thead align="left"><tr id="row1181112718915"><th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.1"><p id="p28116271096"><a name="p28116271096"></a><a name="p28116271096"></a>名称</p>
|
||||
</th>
|
||||
<th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.2"><p id="p28111727292"><a name="p28111727292"></a><a name="p28111727292"></a>描述</p>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><tr id="row581122715917"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p7463423141214"><a name="p7463423141214"></a><a name="p7463423141214"></a>hi35xx\hardware</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p164391323161216"><a name="p164391323161216"></a><a name="p164391323161216"></a>媒体南向接口实现、框架及芯片对接层库目录</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
**表 2** hi35xx\_init目录结构
|
||||
|
||||
<a name="table78291813141320"></a>
|
||||
<table><thead align="left"><tr id="row10829191361312"><th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.1"><p id="p8829813111314"><a name="p8829813111314"></a><a name="p8829813111314"></a>名称</p>
|
||||
</th>
|
||||
<th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.2"><p id="p1182901301317"><a name="p1182901301317"></a><a name="p1182901301317"></a>描述</p>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><tr id="row98296133139"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p582915130134"><a name="p582915130134"></a><a name="p582915130134"></a>hi35xx\hi35xx_init\hi3516dv300</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p1882971311313"><a name="p1882971311313"></a><a name="p1882971311313"></a>编译打包16dv300内核镜像的编译脚本</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row1316718286548"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p167506431548"><a name="p167506431548"></a><a name="p167506431548"></a>hi35xx\hi35xx_init\hi3518ev300</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p5165122819547"><a name="p5165122819547"></a><a name="p5165122819547"></a>编译打包18ev300内核镜像的编译脚本</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
**表 3** hi3516dv300目录结构
|
||||
|
||||
<a name="table2977131081412"></a>
|
||||
<table><thead align="left"><tr id="row7977610131417"><th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.1"><p id="p18792459121314"><a name="p18792459121314"></a><a name="p18792459121314"></a>名称</p>
|
||||
</th>
|
||||
<th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.2"><p id="p77921459191317"><a name="p77921459191317"></a><a name="p77921459191317"></a>描述</p>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><tr id="row17977171010144"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p1881003717317"><a name="p1881003717317"></a><a name="p1881003717317"></a>hi35xx\hi3516dv300</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p879375920132"><a name="p879375920132"></a><a name="p879375920132"></a>Hi3516DV300芯片驱动软件,包括:媒体驱动子目录、媒体用户态库子目录、uboot的差异化内容目录、NOTICE文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row6978161091412"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p98744311516"><a name="p98744311516"></a><a name="p98744311516"></a>hi35xx\hi3516dv300\module_init\lib</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p6793059171318"><a name="p6793059171318"></a><a name="p6793059171318"></a>Hi3516DV300芯片媒体各模块驱动对应的库、LICENSE文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row6978201031415"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p6687137121713"><a name="p6687137121713"></a><a name="p6687137121713"></a>hi35xx\hi3516dv300\module_init\src</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p528302241710"><a name="p528302241710"></a><a name="p528302241710"></a>内核驱动初始化源代码、LICENSE文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row1897841071415"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p16793185961315"><a name="p16793185961315"></a><a name="p16793185961315"></a>hi35xx\hi3516dv300\soc\lib</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p14793959161317"><a name="p14793959161317"></a><a name="p14793959161317"></a>Hi3516DV300芯片的媒体库文件、LICENSE文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row1137581942013"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p19370171952013"><a name="p19370171952013"></a><a name="p19370171952013"></a>hi35xx\hi3516dv300\uboot\out\boot</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p137061910203"><a name="p137061910203"></a><a name="p137061910203"></a>采用hi35xx\third_party\uboot\u-boot-2020.01和hi35xx\hi3516dv300\uboot\reg\reg_info_hi3516dv300.bin编译成的uboot、README文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row1337421962012"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p837021982012"><a name="p837021982012"></a><a name="p837021982012"></a>hi35xx\hi3516dv300\uboot\reg</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p237031917201"><a name="p237031917201"></a><a name="p237031917201"></a>uboot配置文件、LICENSE文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row135651424162014"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p1072784514202"><a name="p1072784514202"></a><a name="p1072784514202"></a>hi35xx\hi3516dv300\uboot\secureboot_ohos</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p189415151506"><a name="p189415151506"></a><a name="p189415151506"></a>鸿蒙OS安全启动相关的编译脚本</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row656518242203"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p2900950132013"><a name="p2900950132013"></a><a name="p2900950132013"></a>hi35xx\hi3516dv300\uboot\secureboot_release</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p589812504207"><a name="p589812504207"></a><a name="p589812504207"></a>生成安全uboot的源代码、License目录</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
**表 4** hi3518ev300目录结构
|
||||
|
||||
<a name="table1769285811814"></a>
|
||||
<table><thead align="left"><tr id="row186921858681"><th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.1"><p id="p106927581786"><a name="p106927581786"></a><a name="p106927581786"></a>名称</p>
|
||||
</th>
|
||||
<th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.2"><p id="p1769220581982"><a name="p1769220581982"></a><a name="p1769220581982"></a>描述</p>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><tr id="row169217585818"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p2692758986"><a name="p2692758986"></a><a name="p2692758986"></a>hi35xx\hi3518ev300</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p116926581288"><a name="p116926581288"></a><a name="p116926581288"></a>Hi3518EV300芯片驱动软件,包括:媒体驱动子目录、媒体用户态库子目录、uboot的差异化内容目录、NOTICE文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row1269285819817"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p169219587818"><a name="p169219587818"></a><a name="p169219587818"></a>hi35xx\hi3518ev300\module_init\lib</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p1269210581689"><a name="p1269210581689"></a><a name="p1269210581689"></a>Hi3518EV300芯片媒体各模块驱动对应的库、LICENSE文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row86931358986"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p36937581882"><a name="p36937581882"></a><a name="p36937581882"></a>hi35xx\hi3518ev300\module_init\src</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p136931158287"><a name="p136931158287"></a><a name="p136931158287"></a>内核驱动初始化源代码、LICENSE文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row20693958681"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p11693258181"><a name="p11693258181"></a><a name="p11693258181"></a>hi35xx\hi3518ev300\soc\lib</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p1369315585818"><a name="p1369315585818"></a><a name="p1369315585818"></a>Hi3518EV300芯片的媒体库文件、LICENSE文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row369335817820"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p16931583815"><a name="p16931583815"></a><a name="p16931583815"></a>hi35xx\hi3518ev300\uboot\out\boot</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p269345817814"><a name="p269345817814"></a><a name="p269345817814"></a>采用hi35xx\third_party\uboot\u-boot-2020.01和hi35xx\hi3518ev300\uboot\reg\reg_info_hi3518ev300.bin编译成的uboot、README文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row769365813812"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p1669317585818"><a name="p1669317585818"></a><a name="p1669317585818"></a>hi35xx\hi3518ev300\uboot\reg</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p1469315585813"><a name="p1469315585813"></a><a name="p1469315585813"></a>uboot配置文件、LICENSE文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row9693185816812"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p126935586810"><a name="p126935586810"></a><a name="p126935586810"></a>hi35xx\hi3518ev300\uboot\secureboot_ohos</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p5693458781"><a name="p5693458781"></a><a name="p5693458781"></a>鸿蒙OS安全启动相关的编译脚本</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row26932581085"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p18693658184"><a name="p18693658184"></a><a name="p18693658184"></a>hi35xx\hi3518ev300\uboot\secureboot_release</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p106931358586"><a name="p106931358586"></a><a name="p106931358586"></a>生成安全uboot的源代码、License目录</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
**表 5** middleware目录结构
|
||||
|
||||
<a name="table9651175972417"></a>
|
||||
<table><thead align="left"><tr id="row1965112590241"><th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.1"><p id="p146513596248"><a name="p146513596248"></a><a name="p146513596248"></a>名称</p>
|
||||
</th>
|
||||
<th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.2"><p id="p10651859192419"><a name="p10651859192419"></a><a name="p10651859192419"></a>描述</p>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><tr id="row16653185915240"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p20653155942417"><a name="p20653155942417"></a><a name="p20653155942417"></a>hi35xx\middleware\source\common</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p1065385913243"><a name="p1065385913243"></a><a name="p1065385913243"></a>南向组件公共模块库目录</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row186531759192419"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p1865345914243"><a name="p1865345914243"></a><a name="p1865345914243"></a>hi35xx\middleware\source\component</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p19653205992414"><a name="p19653205992414"></a><a name="p19653205992414"></a>南向组件非公共模块库目录</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row6653125952412"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p5653105910248"><a name="p5653105910248"></a><a name="p5653105910248"></a>hi35xx\middleware\source\thirdparty</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p17653135914241"><a name="p17653135914241"></a><a name="p17653135914241"></a>南向插件依赖第三方开源软件目录</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
**表 6** platform目录结构
|
||||
|
||||
<a name="table397031661516"></a>
|
||||
<table><thead align="left"><tr id="row109701916151514"><th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.1"><p id="p16971121616153"><a name="p16971121616153"></a><a name="p16971121616153"></a>名称</p>
|
||||
</th>
|
||||
<th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.2"><p id="p17971616151513"><a name="p17971616151513"></a><a name="p17971616151513"></a>描述</p>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><tr id="row12971131610154"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p997151621512"><a name="p997151621512"></a><a name="p997151621512"></a>hi35xx\platform</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p1971161620156"><a name="p1971161620156"></a><a name="p1971161620156"></a>hi35xx平台驱动</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
**表 7** third\_party目录结构
|
||||
|
||||
<a name="table16381640161517"></a>
|
||||
<table><thead align="left"><tr id="row33814041510"><th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.1"><p id="p163812401154"><a name="p163812401154"></a><a name="p163812401154"></a>名称</p>
|
||||
</th>
|
||||
<th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.2"><p id="p163854019151"><a name="p163854019151"></a><a name="p163854019151"></a>描述</p>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><tr id="row12381640101512"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p14505145412188"><a name="p14505145412188"></a><a name="p14505145412188"></a>hi35xx\third_party\uboot\u-boot-2020.01</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p14381240161511"><a name="p14381240161511"></a><a name="p14381240161511"></a>uboot开源代码</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
## 约束<a name="section0364124983015"></a>
|
||||
|
||||
当前支持Hi3518EV300、Hi3516DV300芯片。
|
||||
|
||||
## 许可协议<a name="section1478215290"></a>
|
||||
|
||||
## hi3516dv300许可说明<a name="section172811306502"></a>
|
||||
|
||||
- hi35xx\\hi3516dv300\\module\_init\\lib和hi35xx\\hi3516dv300\\soc\\lib里面为海思(上海)的自研库,遵循海思(上海)的LICENSE,这两个目录下均有LICENSE文件,LICENSE文件结尾可以看到版权信息:
|
||||
|
||||
```
|
||||
Copyright (C) 2020 Hisilicon (Shanghai) Technologies Co., Ltd. All rights reserved.
|
||||
```
|
||||
|
||||
- hi35xx\\hi3516dv300\\module\_init\\src目录下为海思(上海)自研代码,使用基于Apache License Version 2.0许可的Hisilicon \(Shanghai\) 版权声明,在该目录下有Apache License Version 2.0的LICENSE文件,许可信息和版权信息通常可以在文件开头看到:
|
||||
|
||||
```
|
||||
/ *Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED. Licensed under the Apache License,* ... * /
|
||||
```
|
||||
|
||||
- hi35xx\\hi3516dv300\\uboot\\reg为海思(上海)的二进制文件,遵循海思(上海)的LICENSE,该目录下有LICENSE文件,LICENSE文件结尾可以看到:
|
||||
|
||||
```
|
||||
Copyright (C) 2020 Hisilicon (Shanghai) Technologies Co., Ltd. All rights reserved.
|
||||
```
|
||||
|
||||
- hi35xx\\hi3516dv300\\uboot\\out\\boot是由u-boot-2020.01和reg\_info\_hi3516dv300.bin编译成的uboot二进制文件,完全遵从u-boot-2020.01的整体协议,具体请参看hi35xx\\third\_party\\uboot\\u-boot-2020.01\\Licenses目录下的README。
|
||||
- hi35xx\\hi3516dv300\\uboot\\secureboot\_release为安全uboot的开源代码,其中自研的部分使用基于GPL许可的Hisilicon \(Shanghai\) 版权声明,在该目录下有License目录,许可信息和版权信息通常可以在文件开头看到:
|
||||
|
||||
```
|
||||
/ *Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
* ... * /
|
||||
```
|
||||
|
||||
|
||||
- hi35xx\\hi3516dv300\\NOTICE文件描述了使用到的三款开源软件:Das U-Boot 2020.01、mbed TLS 2.16.6、fdk-aac v2.0.1。
|
||||
|
||||
## hi3518ev300许可说明<a name="section172983094910"></a>
|
||||
|
||||
- hi35xx\\hi3518ev300\\module\_init\\lib和hi35xx\\hi3518ev300\\soc\\lib里面为海思(上海)的自研库,遵循海思(上海)的LICENSE,这两个目录下均有LICENSE文件,LICENSE文件结尾可以看到版权信息:
|
||||
|
||||
```
|
||||
Copyright (C) 2020 Hisilicon (Shanghai) Technologies Co., Ltd. All rights reserved.
|
||||
```
|
||||
|
||||
- hi35xx\\hi3518ev300\\module\_init\\src目录下为海思(上海)自研代码,使用基于Apache License Version 2.0许可的Hisilicon \(Shanghai\) 版权声明,在该目录下有Apache License Version 2.0的LICENSE文件,许可信息和版权信息通常可以在文件开头看到:
|
||||
|
||||
```
|
||||
/ *Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED. Licensed under the Apache License,* ... * /
|
||||
```
|
||||
|
||||
- hi35xx\\hi3518ev300\\uboot\\reg为海思(上海)的二进制文件,遵循海思(上海)的LICENSE,该目录下有LICENSE文件,LICENSE文件结尾可以看到:
|
||||
|
||||
```
|
||||
Copyright (C) 2020 Hisilicon (Shanghai) Technologies Co., Ltd. All rights reserved.
|
||||
```
|
||||
|
||||
- hi35xx\\hi3518ev300\\uboot\\out\\boot是由u-boot-2020.01和reg\_info\_hi3518ev300.bin编译成的uboot二进制文件,完全遵从u-boot-2020.01的整体协议,具体请参看hi35xx\\third\_party\\uboot\\u-boot-2020.01\\Licenses目录下的README。
|
||||
- hi35xx\\hi3518ev300\\uboot\\secureboot\_release为安全uboot的开源代码,其中自研的部分使用基于GPL许可的Hisilicon \(Shanghai\) 版权声明,在该目录下有License目录,许可信息和版权信息通常可以在文件开头看到:
|
||||
|
||||
```
|
||||
/ *Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
* ... * /
|
||||
```
|
||||
|
||||
- hi35xx\\hi3518ev300\\NOTICE文件描述了使用到的三款开源软件:Das U-Boot 2020.01、mbed TLS 2.16.6、fdk-aac v2.0.1。
|
||||
|
||||
## third\_party许可说明<a name="section148702720527"></a>
|
||||
|
||||
hi35xx\\third\_party\\uboot\\u-boot-2020.01为uboot开源代码,遵循软件版本自带的开源许可声明,具体请参看hi35xx\\third\_party\\uboot\\u-boot-2020.01\\Licenses目录下的README。
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"name": "@ohos/hi3516dv300_uboot",
|
||||
"version": "1.8.0",
|
||||
"publishAs": "code-segment",
|
||||
"description": "海思(上海)媒体软件开发包用于适配不同芯片复杂的底层处理,为“媒体子系统”提供基础的多媒体处理功能。主要功能有:音视频采集、音视频编解码、音视频输出、视频前处理、封装、解封装、文件管理、存储管理、日志系统等。该软件包功能对应\"媒体子系统\"框架中红色框标注部分,如图1所示。所对应的目录为:vendor\\hisi\\hi35xx。",
|
||||
"scripts": {
|
||||
"install": "DEST_PATH=${DEP_BUNDLE_BASE}/vendor/hisi/hi35xx/hi3516dv300/uboot &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH"
|
||||
},
|
||||
"keywords": [
|
||||
"vender"
|
||||
],
|
||||
"license": "Apache V2",
|
||||
"repository": "",
|
||||
"homepage": "",
|
||||
"tags": [
|
||||
"vendor"
|
||||
],
|
||||
"ohos": {
|
||||
"os": "1.0.0",
|
||||
"kernel": "liteos-a",
|
||||
"board": "hi3516"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,202 @@
|
||||
|
||||
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
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
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.
|
||||
@@ -0,0 +1,300 @@
|
||||
# Hi3518ev300介绍<a name="ZH-CN_TOPIC_0000001054508081"></a>
|
||||
|
||||
项目介绍
|
||||
|
||||
## 简介<a name="section469617221261"></a>
|
||||
|
||||
海思(上海)媒体软件开发包用于适配不同芯片复杂的底层处理,为“媒体子系统”提供基础的多媒体处理功能。主要功能有:音视频采集、音视频编解码、音视频输出、视频前处理、封装、解封装、文件管理、存储管理、日志系统等。该软件包功能对应"媒体子系统"框架中红色框标注部分,如图1所示。所对应的目录为:vendor\\hisi\\hi35xx。
|
||||
|
||||
**图 1** 多媒体子系统框架图<a name="fig108579114217"></a>
|
||||

|
||||
|
||||
## 目录<a name="section1464106163817"></a>
|
||||
|
||||
海思(上海)媒体软件开发包目录结构如表1所示:
|
||||
|
||||
**表 1** hardware目录结构
|
||||
|
||||
<a name="table15811112718910"></a>
|
||||
<table><thead align="left"><tr id="row1181112718915"><th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.1"><p id="p28116271096"><a name="p28116271096"></a><a name="p28116271096"></a>名称</p>
|
||||
</th>
|
||||
<th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.2"><p id="p28111727292"><a name="p28111727292"></a><a name="p28111727292"></a>描述</p>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><tr id="row581122715917"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p7463423141214"><a name="p7463423141214"></a><a name="p7463423141214"></a>hi35xx\hardware</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p164391323161216"><a name="p164391323161216"></a><a name="p164391323161216"></a>媒体南向接口实现、框架及芯片对接层库目录</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
**表 2** hi35xx\_init目录结构
|
||||
|
||||
<a name="table78291813141320"></a>
|
||||
<table><thead align="left"><tr id="row10829191361312"><th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.1"><p id="p8829813111314"><a name="p8829813111314"></a><a name="p8829813111314"></a>名称</p>
|
||||
</th>
|
||||
<th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.2"><p id="p1182901301317"><a name="p1182901301317"></a><a name="p1182901301317"></a>描述</p>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><tr id="row98296133139"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p582915130134"><a name="p582915130134"></a><a name="p582915130134"></a>hi35xx\hi35xx_init\hi3516dv300</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p1882971311313"><a name="p1882971311313"></a><a name="p1882971311313"></a>编译打包16dv300内核镜像的编译脚本</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row1316718286548"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p167506431548"><a name="p167506431548"></a><a name="p167506431548"></a>hi35xx\hi35xx_init\hi3518ev300</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p5165122819547"><a name="p5165122819547"></a><a name="p5165122819547"></a>编译打包18ev300内核镜像的编译脚本</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
**表 3** hi3516dv300目录结构
|
||||
|
||||
<a name="table2977131081412"></a>
|
||||
<table><thead align="left"><tr id="row7977610131417"><th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.1"><p id="p18792459121314"><a name="p18792459121314"></a><a name="p18792459121314"></a>名称</p>
|
||||
</th>
|
||||
<th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.2"><p id="p77921459191317"><a name="p77921459191317"></a><a name="p77921459191317"></a>描述</p>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><tr id="row17977171010144"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p1881003717317"><a name="p1881003717317"></a><a name="p1881003717317"></a>hi35xx\hi3516dv300</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p879375920132"><a name="p879375920132"></a><a name="p879375920132"></a>Hi3516DV300芯片驱动软件,包括:媒体驱动子目录、媒体用户态库子目录、uboot的差异化内容目录、NOTICE文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row6978161091412"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p98744311516"><a name="p98744311516"></a><a name="p98744311516"></a>hi35xx\hi3516dv300\module_init\lib</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p6793059171318"><a name="p6793059171318"></a><a name="p6793059171318"></a>Hi3516DV300芯片媒体各模块驱动对应的库、LICENSE文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row6978201031415"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p6687137121713"><a name="p6687137121713"></a><a name="p6687137121713"></a>hi35xx\hi3516dv300\module_init\src</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p528302241710"><a name="p528302241710"></a><a name="p528302241710"></a>内核驱动初始化源代码、LICENSE文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row1897841071415"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p16793185961315"><a name="p16793185961315"></a><a name="p16793185961315"></a>hi35xx\hi3516dv300\soc\lib</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p14793959161317"><a name="p14793959161317"></a><a name="p14793959161317"></a>Hi3516DV300芯片的媒体库文件、LICENSE文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row1137581942013"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p19370171952013"><a name="p19370171952013"></a><a name="p19370171952013"></a>hi35xx\hi3516dv300\uboot\out\boot</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p137061910203"><a name="p137061910203"></a><a name="p137061910203"></a>采用hi35xx\third_party\uboot\u-boot-2020.01和hi35xx\hi3516dv300\uboot\reg\reg_info_hi3516dv300.bin编译成的uboot、README文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row1337421962012"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p837021982012"><a name="p837021982012"></a><a name="p837021982012"></a>hi35xx\hi3516dv300\uboot\reg</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p237031917201"><a name="p237031917201"></a><a name="p237031917201"></a>uboot配置文件、LICENSE文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row135651424162014"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p1072784514202"><a name="p1072784514202"></a><a name="p1072784514202"></a>hi35xx\hi3516dv300\uboot\secureboot_ohos</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p189415151506"><a name="p189415151506"></a><a name="p189415151506"></a>鸿蒙OS安全启动相关的编译脚本</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row656518242203"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p2900950132013"><a name="p2900950132013"></a><a name="p2900950132013"></a>hi35xx\hi3516dv300\uboot\secureboot_release</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p589812504207"><a name="p589812504207"></a><a name="p589812504207"></a>生成安全uboot的源代码、License目录</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
**表 4** hi3518ev300目录结构
|
||||
|
||||
<a name="table1769285811814"></a>
|
||||
<table><thead align="left"><tr id="row186921858681"><th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.1"><p id="p106927581786"><a name="p106927581786"></a><a name="p106927581786"></a>名称</p>
|
||||
</th>
|
||||
<th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.2"><p id="p1769220581982"><a name="p1769220581982"></a><a name="p1769220581982"></a>描述</p>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><tr id="row169217585818"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p2692758986"><a name="p2692758986"></a><a name="p2692758986"></a>hi35xx\hi3518ev300</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p116926581288"><a name="p116926581288"></a><a name="p116926581288"></a>Hi3518EV300芯片驱动软件,包括:媒体驱动子目录、媒体用户态库子目录、uboot的差异化内容目录、NOTICE文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row1269285819817"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p169219587818"><a name="p169219587818"></a><a name="p169219587818"></a>hi35xx\hi3518ev300\module_init\lib</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p1269210581689"><a name="p1269210581689"></a><a name="p1269210581689"></a>Hi3518EV300芯片媒体各模块驱动对应的库、LICENSE文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row86931358986"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p36937581882"><a name="p36937581882"></a><a name="p36937581882"></a>hi35xx\hi3518ev300\module_init\src</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p136931158287"><a name="p136931158287"></a><a name="p136931158287"></a>内核驱动初始化源代码、LICENSE文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row20693958681"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p11693258181"><a name="p11693258181"></a><a name="p11693258181"></a>hi35xx\hi3518ev300\soc\lib</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p1369315585818"><a name="p1369315585818"></a><a name="p1369315585818"></a>Hi3518EV300芯片的媒体库文件、LICENSE文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row369335817820"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p16931583815"><a name="p16931583815"></a><a name="p16931583815"></a>hi35xx\hi3518ev300\uboot\out\boot</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p269345817814"><a name="p269345817814"></a><a name="p269345817814"></a>采用hi35xx\third_party\uboot\u-boot-2020.01和hi35xx\hi3518ev300\uboot\reg\reg_info_hi3518ev300.bin编译成的uboot、README文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row769365813812"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p1669317585818"><a name="p1669317585818"></a><a name="p1669317585818"></a>hi35xx\hi3518ev300\uboot\reg</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p1469315585813"><a name="p1469315585813"></a><a name="p1469315585813"></a>uboot配置文件、LICENSE文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row9693185816812"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p126935586810"><a name="p126935586810"></a><a name="p126935586810"></a>hi35xx\hi3518ev300\uboot\secureboot_ohos</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p5693458781"><a name="p5693458781"></a><a name="p5693458781"></a>鸿蒙OS安全启动相关的编译脚本</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row26932581085"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p18693658184"><a name="p18693658184"></a><a name="p18693658184"></a>hi35xx\hi3518ev300\uboot\secureboot_release</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p106931358586"><a name="p106931358586"></a><a name="p106931358586"></a>生成安全uboot的源代码、License目录</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
**表 5** middleware目录结构
|
||||
|
||||
<a name="table9651175972417"></a>
|
||||
<table><thead align="left"><tr id="row1965112590241"><th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.1"><p id="p146513596248"><a name="p146513596248"></a><a name="p146513596248"></a>名称</p>
|
||||
</th>
|
||||
<th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.2"><p id="p10651859192419"><a name="p10651859192419"></a><a name="p10651859192419"></a>描述</p>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><tr id="row16653185915240"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p20653155942417"><a name="p20653155942417"></a><a name="p20653155942417"></a>hi35xx\middleware\source\common</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p1065385913243"><a name="p1065385913243"></a><a name="p1065385913243"></a>南向组件公共模块库目录</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row186531759192419"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p1865345914243"><a name="p1865345914243"></a><a name="p1865345914243"></a>hi35xx\middleware\source\component</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p19653205992414"><a name="p19653205992414"></a><a name="p19653205992414"></a>南向组件非公共模块库目录</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row6653125952412"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p5653105910248"><a name="p5653105910248"></a><a name="p5653105910248"></a>hi35xx\middleware\source\thirdparty</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p17653135914241"><a name="p17653135914241"></a><a name="p17653135914241"></a>南向插件依赖第三方开源软件目录</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
**表 6** platform目录结构
|
||||
|
||||
<a name="table397031661516"></a>
|
||||
<table><thead align="left"><tr id="row109701916151514"><th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.1"><p id="p16971121616153"><a name="p16971121616153"></a><a name="p16971121616153"></a>名称</p>
|
||||
</th>
|
||||
<th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.2"><p id="p17971616151513"><a name="p17971616151513"></a><a name="p17971616151513"></a>描述</p>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><tr id="row12971131610154"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p79972101107"><a name="p79972101107"></a><a name="p79972101107"></a>hi35xx\platform</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p1099791016102"><a name="p1099791016102"></a><a name="p1099791016102"></a>hi35xx平台驱动</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
**表 7** third\_party目录结构
|
||||
|
||||
<a name="table16381640161517"></a>
|
||||
<table><thead align="left"><tr id="row33814041510"><th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.1"><p id="p163812401154"><a name="p163812401154"></a><a name="p163812401154"></a>名称</p>
|
||||
</th>
|
||||
<th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.2"><p id="p163854019151"><a name="p163854019151"></a><a name="p163854019151"></a>描述</p>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><tr id="row12381640101512"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p14505145412188"><a name="p14505145412188"></a><a name="p14505145412188"></a>hi35xx\third_party\uboot\u-boot-2020.01</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p14381240161511"><a name="p14381240161511"></a><a name="p14381240161511"></a>uboot开源代码</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
## 约束<a name="section0364124983015"></a>
|
||||
|
||||
当前支持Hi3518EV300、Hi3516DV300芯片。
|
||||
|
||||
## 许可协议<a name="section1478215290"></a>
|
||||
|
||||
## hi3516dv300许可说明<a name="section172811306502"></a>
|
||||
|
||||
- hi35xx\\hi3516dv300\\module\_init\\lib和hi35xx\\hi3516dv300\\soc\\lib里面为海思(上海)的自研库,遵循海思(上海)的LICENSE,这两个目录下均有LICENSE文件,LICENSE文件结尾可以看到版权信息:
|
||||
|
||||
```
|
||||
Copyright (C) 2020 Hisilicon (Shanghai) Technologies Co., Ltd. All rights reserved.
|
||||
```
|
||||
|
||||
- hi35xx\\hi3516dv300\\module\_init\\src目录下为海思(上海)自研代码,使用基于Apache License Version 2.0许可的Hisilicon \(Shanghai\) 版权声明,在该目录下有Apache License Version 2.0的LICENSE文件,许可信息和版权信息通常可以在文件开头看到:
|
||||
|
||||
```
|
||||
/ *Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED. Licensed under the Apache License,* ... * /
|
||||
```
|
||||
|
||||
- hi35xx\\hi3516dv300\\uboot\\reg为海思(上海)的二进制文件,遵循海思(上海)的LICENSE,该目录下有LICENSE文件,LICENSE文件结尾可以看到:
|
||||
|
||||
```
|
||||
Copyright (C) 2020 Hisilicon (Shanghai) Technologies Co., Ltd. All rights reserved.
|
||||
```
|
||||
|
||||
- hi35xx\\hi3516dv300\\uboot\\out\\boot是由u-boot-2020.01和reg\_info\_hi3516dv300.bin编译成的uboot二进制文件,完全遵从u-boot-2020.01的整体协议,具体请参看hi35xx\\third\_party\\uboot\\u-boot-2020.01\\Licenses目录下的README。
|
||||
- hi35xx\\hi3516dv300\\uboot\\secureboot\_release为安全uboot的开源代码,其中自研的部分使用基于GPL许可的Hisilicon \(Shanghai\) 版权声明,在该目录下有License目录,许可信息和版权信息通常可以在文件开头看到:
|
||||
|
||||
```
|
||||
/ *Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
* ... * /
|
||||
```
|
||||
|
||||
|
||||
- hi35xx\\hi3516dv300\\NOTICE文件描述了使用到的三款开源软件:Das U-Boot 2020.01、mbed TLS 2.16.6、fdk-aac v2.0.1。
|
||||
|
||||
## hi3518ev300许可说明<a name="section172983094910"></a>
|
||||
|
||||
- hi35xx\\hi3518ev300\\module\_init\\lib和hi35xx\\hi3518ev300\\soc\\lib里面为海思(上海)的自研库,遵循海思(上海)的LICENSE,这两个目录下均有LICENSE文件,LICENSE文件结尾可以看到版权信息:
|
||||
|
||||
```
|
||||
Copyright (C) 2020 Hisilicon (Shanghai) Technologies Co., Ltd. All rights reserved.
|
||||
```
|
||||
|
||||
- hi35xx\\hi3518ev300\\module\_init\\src目录下为海思(上海)自研代码,使用基于Apache License Version 2.0许可的Hisilicon \(Shanghai\) 版权声明,在该目录下有Apache License Version 2.0的LICENSE文件,许可信息和版权信息通常可以在文件开头看到:
|
||||
|
||||
```
|
||||
/ *Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED. Licensed under the Apache License,* ... * /
|
||||
```
|
||||
|
||||
- hi35xx\\hi3518ev300\\uboot\\reg为海思(上海)的二进制文件,遵循海思(上海)的LICENSE,该目录下有LICENSE文件,LICENSE文件结尾可以看到:
|
||||
|
||||
```
|
||||
Copyright (C) 2020 Hisilicon (Shanghai) Technologies Co., Ltd. All rights reserved.
|
||||
```
|
||||
|
||||
- hi35xx\\hi3518ev300\\uboot\\out\\boot是由u-boot-2020.01和reg\_info\_hi3518ev300.bin编译成的uboot二进制文件,完全遵从u-boot-2020.01的整体协议,具体请参看hi35xx\\third\_party\\uboot\\u-boot-2020.01\\Licenses目录下的README。
|
||||
- hi35xx\\hi3518ev300\\uboot\\secureboot\_release为安全uboot的开源代码,其中自研的部分使用基于GPL许可的Hisilicon \(Shanghai\) 版权声明,在该目录下有License目录,许可信息和版权信息通常可以在文件开头看到:
|
||||
|
||||
```
|
||||
/ *Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
* ... * /
|
||||
```
|
||||
|
||||
- hi35xx\\hi3518ev300\\NOTICE文件描述了使用到的三款开源软件:Das U-Boot 2020.01、mbed TLS 2.16.6、fdk-aac v2.0.1。
|
||||
|
||||
## third\_party许可说明<a name="section148702720527"></a>
|
||||
|
||||
hi35xx\\third\_party\\uboot\\u-boot-2020.01为uboot开源代码,遵循软件版本自带的开源许可声明,具体请参看hi35xx\\third\_party\\uboot\\u-boot-2020.01\\Licenses目录下的README。
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"name": "@ohos/hi3518ev300",
|
||||
"version": "1.8.0",
|
||||
"publishAs": "code-segment",
|
||||
"description": "海思(上海)媒体软件开发包用于适配不同芯片复杂的底层处理,为“媒体子系统”提供基础的多媒体处理功能。主要功能有:音视频采集、音视频编解码、音视频输出、视频前处理、封装、解封装、文件管理、存储管理、日志系统等。该软件包功能对应\"媒体子系统\"框架中红色框标注部分,如图1所示。所对应的目录为:vendor\\hisi\\hi35xx。",
|
||||
"scripts": {
|
||||
"install": "DEST_PATH=${DEP_BUNDLE_BASE}/vendor/hisi/hi35xx/ &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH"
|
||||
},
|
||||
"keywords": [
|
||||
"vender"
|
||||
],
|
||||
"license": "Apache V2",
|
||||
"repository": "",
|
||||
"homepage": "",
|
||||
"tags": [
|
||||
"vendor"
|
||||
],
|
||||
"ohos": {
|
||||
"os": "1.0.0",
|
||||
"kernel": "liteos-a",
|
||||
"board": "hi3518"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,202 @@
|
||||
|
||||
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
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
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.
|
||||
@@ -0,0 +1,300 @@
|
||||
# Hi3518ev300介绍<a name="ZH-CN_TOPIC_0000001054508081"></a>
|
||||
|
||||
项目介绍
|
||||
|
||||
## 简介<a name="section469617221261"></a>
|
||||
|
||||
海思(上海)媒体软件开发包用于适配不同芯片复杂的底层处理,为“媒体子系统”提供基础的多媒体处理功能。主要功能有:音视频采集、音视频编解码、音视频输出、视频前处理、封装、解封装、文件管理、存储管理、日志系统等。该软件包功能对应"媒体子系统"框架中红色框标注部分,如图1所示。所对应的目录为:vendor\\hisi\\hi35xx。
|
||||
|
||||
**图 1** 多媒体子系统框架图<a name="fig108579114217"></a>
|
||||

|
||||
|
||||
## 目录<a name="section1464106163817"></a>
|
||||
|
||||
海思(上海)媒体软件开发包目录结构如表1所示:
|
||||
|
||||
**表 1** hardware目录结构
|
||||
|
||||
<a name="table15811112718910"></a>
|
||||
<table><thead align="left"><tr id="row1181112718915"><th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.1"><p id="p28116271096"><a name="p28116271096"></a><a name="p28116271096"></a>名称</p>
|
||||
</th>
|
||||
<th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.2"><p id="p28111727292"><a name="p28111727292"></a><a name="p28111727292"></a>描述</p>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><tr id="row581122715917"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p7463423141214"><a name="p7463423141214"></a><a name="p7463423141214"></a>hi35xx\hardware</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p164391323161216"><a name="p164391323161216"></a><a name="p164391323161216"></a>媒体南向接口实现、框架及芯片对接层库目录</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
**表 2** hi35xx\_init目录结构
|
||||
|
||||
<a name="table78291813141320"></a>
|
||||
<table><thead align="left"><tr id="row10829191361312"><th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.1"><p id="p8829813111314"><a name="p8829813111314"></a><a name="p8829813111314"></a>名称</p>
|
||||
</th>
|
||||
<th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.2"><p id="p1182901301317"><a name="p1182901301317"></a><a name="p1182901301317"></a>描述</p>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><tr id="row98296133139"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p582915130134"><a name="p582915130134"></a><a name="p582915130134"></a>hi35xx\hi35xx_init\hi3516dv300</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p1882971311313"><a name="p1882971311313"></a><a name="p1882971311313"></a>编译打包16dv300内核镜像的编译脚本</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row1316718286548"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p167506431548"><a name="p167506431548"></a><a name="p167506431548"></a>hi35xx\hi35xx_init\hi3518ev300</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p5165122819547"><a name="p5165122819547"></a><a name="p5165122819547"></a>编译打包18ev300内核镜像的编译脚本</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
**表 3** hi3516dv300目录结构
|
||||
|
||||
<a name="table2977131081412"></a>
|
||||
<table><thead align="left"><tr id="row7977610131417"><th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.1"><p id="p18792459121314"><a name="p18792459121314"></a><a name="p18792459121314"></a>名称</p>
|
||||
</th>
|
||||
<th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.2"><p id="p77921459191317"><a name="p77921459191317"></a><a name="p77921459191317"></a>描述</p>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><tr id="row17977171010144"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p1881003717317"><a name="p1881003717317"></a><a name="p1881003717317"></a>hi35xx\hi3516dv300</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p879375920132"><a name="p879375920132"></a><a name="p879375920132"></a>Hi3516DV300芯片驱动软件,包括:媒体驱动子目录、媒体用户态库子目录、uboot的差异化内容目录、NOTICE文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row6978161091412"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p98744311516"><a name="p98744311516"></a><a name="p98744311516"></a>hi35xx\hi3516dv300\module_init\lib</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p6793059171318"><a name="p6793059171318"></a><a name="p6793059171318"></a>Hi3516DV300芯片媒体各模块驱动对应的库、LICENSE文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row6978201031415"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p6687137121713"><a name="p6687137121713"></a><a name="p6687137121713"></a>hi35xx\hi3516dv300\module_init\src</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p528302241710"><a name="p528302241710"></a><a name="p528302241710"></a>内核驱动初始化源代码、LICENSE文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row1897841071415"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p16793185961315"><a name="p16793185961315"></a><a name="p16793185961315"></a>hi35xx\hi3516dv300\soc\lib</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p14793959161317"><a name="p14793959161317"></a><a name="p14793959161317"></a>Hi3516DV300芯片的媒体库文件、LICENSE文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row1137581942013"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p19370171952013"><a name="p19370171952013"></a><a name="p19370171952013"></a>hi35xx\hi3516dv300\uboot\out\boot</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p137061910203"><a name="p137061910203"></a><a name="p137061910203"></a>采用hi35xx\third_party\uboot\u-boot-2020.01和hi35xx\hi3516dv300\uboot\reg\reg_info_hi3516dv300.bin编译成的uboot、README文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row1337421962012"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p837021982012"><a name="p837021982012"></a><a name="p837021982012"></a>hi35xx\hi3516dv300\uboot\reg</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p237031917201"><a name="p237031917201"></a><a name="p237031917201"></a>uboot配置文件、LICENSE文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row135651424162014"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p1072784514202"><a name="p1072784514202"></a><a name="p1072784514202"></a>hi35xx\hi3516dv300\uboot\secureboot_ohos</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p189415151506"><a name="p189415151506"></a><a name="p189415151506"></a>鸿蒙OS安全启动相关的编译脚本</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row656518242203"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p2900950132013"><a name="p2900950132013"></a><a name="p2900950132013"></a>hi35xx\hi3516dv300\uboot\secureboot_release</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p589812504207"><a name="p589812504207"></a><a name="p589812504207"></a>生成安全uboot的源代码、License目录</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
**表 4** hi3518ev300目录结构
|
||||
|
||||
<a name="table1769285811814"></a>
|
||||
<table><thead align="left"><tr id="row186921858681"><th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.1"><p id="p106927581786"><a name="p106927581786"></a><a name="p106927581786"></a>名称</p>
|
||||
</th>
|
||||
<th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.2"><p id="p1769220581982"><a name="p1769220581982"></a><a name="p1769220581982"></a>描述</p>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><tr id="row169217585818"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p2692758986"><a name="p2692758986"></a><a name="p2692758986"></a>hi35xx\hi3518ev300</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p116926581288"><a name="p116926581288"></a><a name="p116926581288"></a>Hi3518EV300芯片驱动软件,包括:媒体驱动子目录、媒体用户态库子目录、uboot的差异化内容目录、NOTICE文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row1269285819817"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p169219587818"><a name="p169219587818"></a><a name="p169219587818"></a>hi35xx\hi3518ev300\module_init\lib</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p1269210581689"><a name="p1269210581689"></a><a name="p1269210581689"></a>Hi3518EV300芯片媒体各模块驱动对应的库、LICENSE文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row86931358986"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p36937581882"><a name="p36937581882"></a><a name="p36937581882"></a>hi35xx\hi3518ev300\module_init\src</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p136931158287"><a name="p136931158287"></a><a name="p136931158287"></a>内核驱动初始化源代码、LICENSE文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row20693958681"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p11693258181"><a name="p11693258181"></a><a name="p11693258181"></a>hi35xx\hi3518ev300\soc\lib</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p1369315585818"><a name="p1369315585818"></a><a name="p1369315585818"></a>Hi3518EV300芯片的媒体库文件、LICENSE文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row369335817820"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p16931583815"><a name="p16931583815"></a><a name="p16931583815"></a>hi35xx\hi3518ev300\uboot\out\boot</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p269345817814"><a name="p269345817814"></a><a name="p269345817814"></a>采用hi35xx\third_party\uboot\u-boot-2020.01和hi35xx\hi3518ev300\uboot\reg\reg_info_hi3518ev300.bin编译成的uboot、README文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row769365813812"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p1669317585818"><a name="p1669317585818"></a><a name="p1669317585818"></a>hi35xx\hi3518ev300\uboot\reg</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p1469315585813"><a name="p1469315585813"></a><a name="p1469315585813"></a>uboot配置文件、LICENSE文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row9693185816812"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p126935586810"><a name="p126935586810"></a><a name="p126935586810"></a>hi35xx\hi3518ev300\uboot\secureboot_ohos</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p5693458781"><a name="p5693458781"></a><a name="p5693458781"></a>鸿蒙OS安全启动相关的编译脚本</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row26932581085"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p18693658184"><a name="p18693658184"></a><a name="p18693658184"></a>hi35xx\hi3518ev300\uboot\secureboot_release</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p106931358586"><a name="p106931358586"></a><a name="p106931358586"></a>生成安全uboot的源代码、License目录</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
**表 5** middleware目录结构
|
||||
|
||||
<a name="table9651175972417"></a>
|
||||
<table><thead align="left"><tr id="row1965112590241"><th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.1"><p id="p146513596248"><a name="p146513596248"></a><a name="p146513596248"></a>名称</p>
|
||||
</th>
|
||||
<th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.2"><p id="p10651859192419"><a name="p10651859192419"></a><a name="p10651859192419"></a>描述</p>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><tr id="row16653185915240"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p20653155942417"><a name="p20653155942417"></a><a name="p20653155942417"></a>hi35xx\middleware\source\common</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p1065385913243"><a name="p1065385913243"></a><a name="p1065385913243"></a>南向组件公共模块库目录</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row186531759192419"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p1865345914243"><a name="p1865345914243"></a><a name="p1865345914243"></a>hi35xx\middleware\source\component</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p19653205992414"><a name="p19653205992414"></a><a name="p19653205992414"></a>南向组件非公共模块库目录</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row6653125952412"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p5653105910248"><a name="p5653105910248"></a><a name="p5653105910248"></a>hi35xx\middleware\source\thirdparty</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p17653135914241"><a name="p17653135914241"></a><a name="p17653135914241"></a>南向插件依赖第三方开源软件目录</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
**表 6** platform目录结构
|
||||
|
||||
<a name="table397031661516"></a>
|
||||
<table><thead align="left"><tr id="row109701916151514"><th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.1"><p id="p16971121616153"><a name="p16971121616153"></a><a name="p16971121616153"></a>名称</p>
|
||||
</th>
|
||||
<th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.2"><p id="p17971616151513"><a name="p17971616151513"></a><a name="p17971616151513"></a>描述</p>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><tr id="row12971131610154"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p79972101107"><a name="p79972101107"></a><a name="p79972101107"></a>hi35xx\platform</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p1099791016102"><a name="p1099791016102"></a><a name="p1099791016102"></a>hi35xx平台驱动</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
**表 7** third\_party目录结构
|
||||
|
||||
<a name="table16381640161517"></a>
|
||||
<table><thead align="left"><tr id="row33814041510"><th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.1"><p id="p163812401154"><a name="p163812401154"></a><a name="p163812401154"></a>名称</p>
|
||||
</th>
|
||||
<th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.2"><p id="p163854019151"><a name="p163854019151"></a><a name="p163854019151"></a>描述</p>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><tr id="row12381640101512"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p14505145412188"><a name="p14505145412188"></a><a name="p14505145412188"></a>hi35xx\third_party\uboot\u-boot-2020.01</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p14381240161511"><a name="p14381240161511"></a><a name="p14381240161511"></a>uboot开源代码</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
## 约束<a name="section0364124983015"></a>
|
||||
|
||||
当前支持Hi3518EV300、Hi3516DV300芯片。
|
||||
|
||||
## 许可协议<a name="section1478215290"></a>
|
||||
|
||||
## hi3516dv300许可说明<a name="section172811306502"></a>
|
||||
|
||||
- hi35xx\\hi3516dv300\\module\_init\\lib和hi35xx\\hi3516dv300\\soc\\lib里面为海思(上海)的自研库,遵循海思(上海)的LICENSE,这两个目录下均有LICENSE文件,LICENSE文件结尾可以看到版权信息:
|
||||
|
||||
```
|
||||
Copyright (C) 2020 Hisilicon (Shanghai) Technologies Co., Ltd. All rights reserved.
|
||||
```
|
||||
|
||||
- hi35xx\\hi3516dv300\\module\_init\\src目录下为海思(上海)自研代码,使用基于Apache License Version 2.0许可的Hisilicon \(Shanghai\) 版权声明,在该目录下有Apache License Version 2.0的LICENSE文件,许可信息和版权信息通常可以在文件开头看到:
|
||||
|
||||
```
|
||||
/ *Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED. Licensed under the Apache License,* ... * /
|
||||
```
|
||||
|
||||
- hi35xx\\hi3516dv300\\uboot\\reg为海思(上海)的二进制文件,遵循海思(上海)的LICENSE,该目录下有LICENSE文件,LICENSE文件结尾可以看到:
|
||||
|
||||
```
|
||||
Copyright (C) 2020 Hisilicon (Shanghai) Technologies Co., Ltd. All rights reserved.
|
||||
```
|
||||
|
||||
- hi35xx\\hi3516dv300\\uboot\\out\\boot是由u-boot-2020.01和reg\_info\_hi3516dv300.bin编译成的uboot二进制文件,完全遵从u-boot-2020.01的整体协议,具体请参看hi35xx\\third\_party\\uboot\\u-boot-2020.01\\Licenses目录下的README。
|
||||
- hi35xx\\hi3516dv300\\uboot\\secureboot\_release为安全uboot的开源代码,其中自研的部分使用基于GPL许可的Hisilicon \(Shanghai\) 版权声明,在该目录下有License目录,许可信息和版权信息通常可以在文件开头看到:
|
||||
|
||||
```
|
||||
/ *Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
* ... * /
|
||||
```
|
||||
|
||||
|
||||
- hi35xx\\hi3516dv300\\NOTICE文件描述了使用到的三款开源软件:Das U-Boot 2020.01、mbed TLS 2.16.6、fdk-aac v2.0.1。
|
||||
|
||||
## hi3518ev300许可说明<a name="section172983094910"></a>
|
||||
|
||||
- hi35xx\\hi3518ev300\\module\_init\\lib和hi35xx\\hi3518ev300\\soc\\lib里面为海思(上海)的自研库,遵循海思(上海)的LICENSE,这两个目录下均有LICENSE文件,LICENSE文件结尾可以看到版权信息:
|
||||
|
||||
```
|
||||
Copyright (C) 2020 Hisilicon (Shanghai) Technologies Co., Ltd. All rights reserved.
|
||||
```
|
||||
|
||||
- hi35xx\\hi3518ev300\\module\_init\\src目录下为海思(上海)自研代码,使用基于Apache License Version 2.0许可的Hisilicon \(Shanghai\) 版权声明,在该目录下有Apache License Version 2.0的LICENSE文件,许可信息和版权信息通常可以在文件开头看到:
|
||||
|
||||
```
|
||||
/ *Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED. Licensed under the Apache License,* ... * /
|
||||
```
|
||||
|
||||
- hi35xx\\hi3518ev300\\uboot\\reg为海思(上海)的二进制文件,遵循海思(上海)的LICENSE,该目录下有LICENSE文件,LICENSE文件结尾可以看到:
|
||||
|
||||
```
|
||||
Copyright (C) 2020 Hisilicon (Shanghai) Technologies Co., Ltd. All rights reserved.
|
||||
```
|
||||
|
||||
- hi35xx\\hi3518ev300\\uboot\\out\\boot是由u-boot-2020.01和reg\_info\_hi3518ev300.bin编译成的uboot二进制文件,完全遵从u-boot-2020.01的整体协议,具体请参看hi35xx\\third\_party\\uboot\\u-boot-2020.01\\Licenses目录下的README。
|
||||
- hi35xx\\hi3518ev300\\uboot\\secureboot\_release为安全uboot的开源代码,其中自研的部分使用基于GPL许可的Hisilicon \(Shanghai\) 版权声明,在该目录下有License目录,许可信息和版权信息通常可以在文件开头看到:
|
||||
|
||||
```
|
||||
/ *Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
* ... * /
|
||||
```
|
||||
|
||||
- hi35xx\\hi3518ev300\\NOTICE文件描述了使用到的三款开源软件:Das U-Boot 2020.01、mbed TLS 2.16.6、fdk-aac v2.0.1。
|
||||
|
||||
## third\_party许可说明<a name="section148702720527"></a>
|
||||
|
||||
hi35xx\\third\_party\\uboot\\u-boot-2020.01为uboot开源代码,遵循软件版本自带的开源许可声明,具体请参看hi35xx\\third\_party\\uboot\\u-boot-2020.01\\Licenses目录下的README。
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"name": "@ohos/hi3518ev300_adapter",
|
||||
"version": "1.8.0",
|
||||
"publishAs": "code-segment",
|
||||
"description": "海思(上海)媒体软件开发包用于适配不同芯片复杂的底层处理,为“媒体子系统”提供基础的多媒体处理功能。主要功能有:音视频采集、音视频编解码、音视频输出、视频前处理、封装、解封装、文件管理、存储管理、日志系统等。该软件包功能对应\"媒体子系统\"框架中红色框标注部分,如图1所示。所对应的目录为:vendor\\hisi\\hi35xx。",
|
||||
"scripts": {
|
||||
"install": "DEST_PATH=${DEP_BUNDLE_BASE}/vendor/hisi/hi35xx/ &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH"
|
||||
},
|
||||
"keywords": [
|
||||
"vender"
|
||||
],
|
||||
"license": "Apache V2",
|
||||
"repository": "",
|
||||
"homepage": "",
|
||||
"tags": [
|
||||
"vendor"
|
||||
],
|
||||
"ohos": {
|
||||
"os": "1.0.0",
|
||||
"kernel": "liteos-a",
|
||||
"board": "hi3518"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,202 @@
|
||||
|
||||
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
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
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.
|
||||
@@ -0,0 +1,300 @@
|
||||
# Hi3518ev300介绍<a name="ZH-CN_TOPIC_0000001054508081"></a>
|
||||
|
||||
项目介绍
|
||||
|
||||
## 简介<a name="section469617221261"></a>
|
||||
|
||||
海思(上海)媒体软件开发包用于适配不同芯片复杂的底层处理,为“媒体子系统”提供基础的多媒体处理功能。主要功能有:音视频采集、音视频编解码、音视频输出、视频前处理、封装、解封装、文件管理、存储管理、日志系统等。该软件包功能对应"媒体子系统"框架中红色框标注部分,如图1所示。所对应的目录为:vendor\\hisi\\hi35xx。
|
||||
|
||||
**图 1** 多媒体子系统框架图<a name="fig108579114217"></a>
|
||||

|
||||
|
||||
## 目录<a name="section1464106163817"></a>
|
||||
|
||||
海思(上海)媒体软件开发包目录结构如表1所示:
|
||||
|
||||
**表 1** hardware目录结构
|
||||
|
||||
<a name="table15811112718910"></a>
|
||||
<table><thead align="left"><tr id="row1181112718915"><th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.1"><p id="p28116271096"><a name="p28116271096"></a><a name="p28116271096"></a>名称</p>
|
||||
</th>
|
||||
<th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.2"><p id="p28111727292"><a name="p28111727292"></a><a name="p28111727292"></a>描述</p>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><tr id="row581122715917"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p7463423141214"><a name="p7463423141214"></a><a name="p7463423141214"></a>hi35xx\hardware</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p164391323161216"><a name="p164391323161216"></a><a name="p164391323161216"></a>媒体南向接口实现、框架及芯片对接层库目录</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
**表 2** hi35xx\_init目录结构
|
||||
|
||||
<a name="table78291813141320"></a>
|
||||
<table><thead align="left"><tr id="row10829191361312"><th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.1"><p id="p8829813111314"><a name="p8829813111314"></a><a name="p8829813111314"></a>名称</p>
|
||||
</th>
|
||||
<th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.2"><p id="p1182901301317"><a name="p1182901301317"></a><a name="p1182901301317"></a>描述</p>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><tr id="row98296133139"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p582915130134"><a name="p582915130134"></a><a name="p582915130134"></a>hi35xx\hi35xx_init\hi3516dv300</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p1882971311313"><a name="p1882971311313"></a><a name="p1882971311313"></a>编译打包16dv300内核镜像的编译脚本</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row1316718286548"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p167506431548"><a name="p167506431548"></a><a name="p167506431548"></a>hi35xx\hi35xx_init\hi3518ev300</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p5165122819547"><a name="p5165122819547"></a><a name="p5165122819547"></a>编译打包18ev300内核镜像的编译脚本</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
**表 3** hi3516dv300目录结构
|
||||
|
||||
<a name="table2977131081412"></a>
|
||||
<table><thead align="left"><tr id="row7977610131417"><th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.1"><p id="p18792459121314"><a name="p18792459121314"></a><a name="p18792459121314"></a>名称</p>
|
||||
</th>
|
||||
<th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.2"><p id="p77921459191317"><a name="p77921459191317"></a><a name="p77921459191317"></a>描述</p>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><tr id="row17977171010144"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p1881003717317"><a name="p1881003717317"></a><a name="p1881003717317"></a>hi35xx\hi3516dv300</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p879375920132"><a name="p879375920132"></a><a name="p879375920132"></a>Hi3516DV300芯片驱动软件,包括:媒体驱动子目录、媒体用户态库子目录、uboot的差异化内容目录、NOTICE文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row6978161091412"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p98744311516"><a name="p98744311516"></a><a name="p98744311516"></a>hi35xx\hi3516dv300\module_init\lib</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p6793059171318"><a name="p6793059171318"></a><a name="p6793059171318"></a>Hi3516DV300芯片媒体各模块驱动对应的库、LICENSE文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row6978201031415"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p6687137121713"><a name="p6687137121713"></a><a name="p6687137121713"></a>hi35xx\hi3516dv300\module_init\src</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p528302241710"><a name="p528302241710"></a><a name="p528302241710"></a>内核驱动初始化源代码、LICENSE文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row1897841071415"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p16793185961315"><a name="p16793185961315"></a><a name="p16793185961315"></a>hi35xx\hi3516dv300\soc\lib</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p14793959161317"><a name="p14793959161317"></a><a name="p14793959161317"></a>Hi3516DV300芯片的媒体库文件、LICENSE文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row1137581942013"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p19370171952013"><a name="p19370171952013"></a><a name="p19370171952013"></a>hi35xx\hi3516dv300\uboot\out\boot</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p137061910203"><a name="p137061910203"></a><a name="p137061910203"></a>采用hi35xx\third_party\uboot\u-boot-2020.01和hi35xx\hi3516dv300\uboot\reg\reg_info_hi3516dv300.bin编译成的uboot、README文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row1337421962012"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p837021982012"><a name="p837021982012"></a><a name="p837021982012"></a>hi35xx\hi3516dv300\uboot\reg</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p237031917201"><a name="p237031917201"></a><a name="p237031917201"></a>uboot配置文件、LICENSE文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row135651424162014"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p1072784514202"><a name="p1072784514202"></a><a name="p1072784514202"></a>hi35xx\hi3516dv300\uboot\secureboot_ohos</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p189415151506"><a name="p189415151506"></a><a name="p189415151506"></a>鸿蒙OS安全启动相关的编译脚本</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row656518242203"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p2900950132013"><a name="p2900950132013"></a><a name="p2900950132013"></a>hi35xx\hi3516dv300\uboot\secureboot_release</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p589812504207"><a name="p589812504207"></a><a name="p589812504207"></a>生成安全uboot的源代码、License目录</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
**表 4** hi3518ev300目录结构
|
||||
|
||||
<a name="table1769285811814"></a>
|
||||
<table><thead align="left"><tr id="row186921858681"><th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.1"><p id="p106927581786"><a name="p106927581786"></a><a name="p106927581786"></a>名称</p>
|
||||
</th>
|
||||
<th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.2"><p id="p1769220581982"><a name="p1769220581982"></a><a name="p1769220581982"></a>描述</p>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><tr id="row169217585818"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p2692758986"><a name="p2692758986"></a><a name="p2692758986"></a>hi35xx\hi3518ev300</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p116926581288"><a name="p116926581288"></a><a name="p116926581288"></a>Hi3518EV300芯片驱动软件,包括:媒体驱动子目录、媒体用户态库子目录、uboot的差异化内容目录、NOTICE文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row1269285819817"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p169219587818"><a name="p169219587818"></a><a name="p169219587818"></a>hi35xx\hi3518ev300\module_init\lib</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p1269210581689"><a name="p1269210581689"></a><a name="p1269210581689"></a>Hi3518EV300芯片媒体各模块驱动对应的库、LICENSE文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row86931358986"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p36937581882"><a name="p36937581882"></a><a name="p36937581882"></a>hi35xx\hi3518ev300\module_init\src</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p136931158287"><a name="p136931158287"></a><a name="p136931158287"></a>内核驱动初始化源代码、LICENSE文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row20693958681"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p11693258181"><a name="p11693258181"></a><a name="p11693258181"></a>hi35xx\hi3518ev300\soc\lib</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p1369315585818"><a name="p1369315585818"></a><a name="p1369315585818"></a>Hi3518EV300芯片的媒体库文件、LICENSE文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row369335817820"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p16931583815"><a name="p16931583815"></a><a name="p16931583815"></a>hi35xx\hi3518ev300\uboot\out\boot</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p269345817814"><a name="p269345817814"></a><a name="p269345817814"></a>采用hi35xx\third_party\uboot\u-boot-2020.01和hi35xx\hi3518ev300\uboot\reg\reg_info_hi3518ev300.bin编译成的uboot、README文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row769365813812"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p1669317585818"><a name="p1669317585818"></a><a name="p1669317585818"></a>hi35xx\hi3518ev300\uboot\reg</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p1469315585813"><a name="p1469315585813"></a><a name="p1469315585813"></a>uboot配置文件、LICENSE文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row9693185816812"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p126935586810"><a name="p126935586810"></a><a name="p126935586810"></a>hi35xx\hi3518ev300\uboot\secureboot_ohos</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p5693458781"><a name="p5693458781"></a><a name="p5693458781"></a>鸿蒙OS安全启动相关的编译脚本</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row26932581085"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p18693658184"><a name="p18693658184"></a><a name="p18693658184"></a>hi35xx\hi3518ev300\uboot\secureboot_release</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p106931358586"><a name="p106931358586"></a><a name="p106931358586"></a>生成安全uboot的源代码、License目录</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
**表 5** middleware目录结构
|
||||
|
||||
<a name="table9651175972417"></a>
|
||||
<table><thead align="left"><tr id="row1965112590241"><th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.1"><p id="p146513596248"><a name="p146513596248"></a><a name="p146513596248"></a>名称</p>
|
||||
</th>
|
||||
<th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.2"><p id="p10651859192419"><a name="p10651859192419"></a><a name="p10651859192419"></a>描述</p>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><tr id="row16653185915240"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p20653155942417"><a name="p20653155942417"></a><a name="p20653155942417"></a>hi35xx\middleware\source\common</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p1065385913243"><a name="p1065385913243"></a><a name="p1065385913243"></a>南向组件公共模块库目录</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row186531759192419"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p1865345914243"><a name="p1865345914243"></a><a name="p1865345914243"></a>hi35xx\middleware\source\component</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p19653205992414"><a name="p19653205992414"></a><a name="p19653205992414"></a>南向组件非公共模块库目录</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row6653125952412"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p5653105910248"><a name="p5653105910248"></a><a name="p5653105910248"></a>hi35xx\middleware\source\thirdparty</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p17653135914241"><a name="p17653135914241"></a><a name="p17653135914241"></a>南向插件依赖第三方开源软件目录</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
**表 6** platform目录结构
|
||||
|
||||
<a name="table397031661516"></a>
|
||||
<table><thead align="left"><tr id="row109701916151514"><th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.1"><p id="p16971121616153"><a name="p16971121616153"></a><a name="p16971121616153"></a>名称</p>
|
||||
</th>
|
||||
<th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.2"><p id="p17971616151513"><a name="p17971616151513"></a><a name="p17971616151513"></a>描述</p>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><tr id="row12971131610154"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p79972101107"><a name="p79972101107"></a><a name="p79972101107"></a>hi35xx\platform</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p1099791016102"><a name="p1099791016102"></a><a name="p1099791016102"></a>hi35xx平台驱动</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
**表 7** third\_party目录结构
|
||||
|
||||
<a name="table16381640161517"></a>
|
||||
<table><thead align="left"><tr id="row33814041510"><th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.1"><p id="p163812401154"><a name="p163812401154"></a><a name="p163812401154"></a>名称</p>
|
||||
</th>
|
||||
<th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.2"><p id="p163854019151"><a name="p163854019151"></a><a name="p163854019151"></a>描述</p>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><tr id="row12381640101512"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p14505145412188"><a name="p14505145412188"></a><a name="p14505145412188"></a>hi35xx\third_party\uboot\u-boot-2020.01</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p14381240161511"><a name="p14381240161511"></a><a name="p14381240161511"></a>uboot开源代码</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
## 约束<a name="section0364124983015"></a>
|
||||
|
||||
当前支持Hi3518EV300、Hi3516DV300芯片。
|
||||
|
||||
## 许可协议<a name="section1478215290"></a>
|
||||
|
||||
## hi3516dv300许可说明<a name="section172811306502"></a>
|
||||
|
||||
- hi35xx\\hi3516dv300\\module\_init\\lib和hi35xx\\hi3516dv300\\soc\\lib里面为海思(上海)的自研库,遵循海思(上海)的LICENSE,这两个目录下均有LICENSE文件,LICENSE文件结尾可以看到版权信息:
|
||||
|
||||
```
|
||||
Copyright (C) 2020 Hisilicon (Shanghai) Technologies Co., Ltd. All rights reserved.
|
||||
```
|
||||
|
||||
- hi35xx\\hi3516dv300\\module\_init\\src目录下为海思(上海)自研代码,使用基于Apache License Version 2.0许可的Hisilicon \(Shanghai\) 版权声明,在该目录下有Apache License Version 2.0的LICENSE文件,许可信息和版权信息通常可以在文件开头看到:
|
||||
|
||||
```
|
||||
/ *Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED. Licensed under the Apache License,* ... * /
|
||||
```
|
||||
|
||||
- hi35xx\\hi3516dv300\\uboot\\reg为海思(上海)的二进制文件,遵循海思(上海)的LICENSE,该目录下有LICENSE文件,LICENSE文件结尾可以看到:
|
||||
|
||||
```
|
||||
Copyright (C) 2020 Hisilicon (Shanghai) Technologies Co., Ltd. All rights reserved.
|
||||
```
|
||||
|
||||
- hi35xx\\hi3516dv300\\uboot\\out\\boot是由u-boot-2020.01和reg\_info\_hi3516dv300.bin编译成的uboot二进制文件,完全遵从u-boot-2020.01的整体协议,具体请参看hi35xx\\third\_party\\uboot\\u-boot-2020.01\\Licenses目录下的README。
|
||||
- hi35xx\\hi3516dv300\\uboot\\secureboot\_release为安全uboot的开源代码,其中自研的部分使用基于GPL许可的Hisilicon \(Shanghai\) 版权声明,在该目录下有License目录,许可信息和版权信息通常可以在文件开头看到:
|
||||
|
||||
```
|
||||
/ *Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
* ... * /
|
||||
```
|
||||
|
||||
|
||||
- hi35xx\\hi3516dv300\\NOTICE文件描述了使用到的三款开源软件:Das U-Boot 2020.01、mbed TLS 2.16.6、fdk-aac v2.0.1。
|
||||
|
||||
## hi3518ev300许可说明<a name="section172983094910"></a>
|
||||
|
||||
- hi35xx\\hi3518ev300\\module\_init\\lib和hi35xx\\hi3518ev300\\soc\\lib里面为海思(上海)的自研库,遵循海思(上海)的LICENSE,这两个目录下均有LICENSE文件,LICENSE文件结尾可以看到版权信息:
|
||||
|
||||
```
|
||||
Copyright (C) 2020 Hisilicon (Shanghai) Technologies Co., Ltd. All rights reserved.
|
||||
```
|
||||
|
||||
- hi35xx\\hi3518ev300\\module\_init\\src目录下为海思(上海)自研代码,使用基于Apache License Version 2.0许可的Hisilicon \(Shanghai\) 版权声明,在该目录下有Apache License Version 2.0的LICENSE文件,许可信息和版权信息通常可以在文件开头看到:
|
||||
|
||||
```
|
||||
/ *Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED. Licensed under the Apache License,* ... * /
|
||||
```
|
||||
|
||||
- hi35xx\\hi3518ev300\\uboot\\reg为海思(上海)的二进制文件,遵循海思(上海)的LICENSE,该目录下有LICENSE文件,LICENSE文件结尾可以看到:
|
||||
|
||||
```
|
||||
Copyright (C) 2020 Hisilicon (Shanghai) Technologies Co., Ltd. All rights reserved.
|
||||
```
|
||||
|
||||
- hi35xx\\hi3518ev300\\uboot\\out\\boot是由u-boot-2020.01和reg\_info\_hi3518ev300.bin编译成的uboot二进制文件,完全遵从u-boot-2020.01的整体协议,具体请参看hi35xx\\third\_party\\uboot\\u-boot-2020.01\\Licenses目录下的README。
|
||||
- hi35xx\\hi3518ev300\\uboot\\secureboot\_release为安全uboot的开源代码,其中自研的部分使用基于GPL许可的Hisilicon \(Shanghai\) 版权声明,在该目录下有License目录,许可信息和版权信息通常可以在文件开头看到:
|
||||
|
||||
```
|
||||
/ *Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
* ... * /
|
||||
```
|
||||
|
||||
- hi35xx\\hi3518ev300\\NOTICE文件描述了使用到的三款开源软件:Das U-Boot 2020.01、mbed TLS 2.16.6、fdk-aac v2.0.1。
|
||||
|
||||
## third\_party许可说明<a name="section148702720527"></a>
|
||||
|
||||
hi35xx\\third\_party\\uboot\\u-boot-2020.01为uboot开源代码,遵循软件版本自带的开源许可声明,具体请参看hi35xx\\third\_party\\uboot\\u-boot-2020.01\\Licenses目录下的README。
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"name": "@ohos/hi3518ev300_uboot",
|
||||
"version": "1.8.0",
|
||||
"publishAs": "code-segment",
|
||||
"description": "海思(上海)媒体软件开发包用于适配不同芯片复杂的底层处理,为“媒体子系统”提供基础的多媒体处理功能。主要功能有:音视频采集、音视频编解码、音视频输出、视频前处理、封装、解封装、文件管理、存储管理、日志系统等。该软件包功能对应\"媒体子系统\"框架中红色框标注部分,如图1所示。所对应的目录为:vendor\\hisi\\hi35xx。",
|
||||
"scripts": {
|
||||
"install": "DEST_PATH=${DEP_BUNDLE_BASE}/vendor/hisi/hi35xx/hi3518ev300/uboot &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH"
|
||||
},
|
||||
"keywords": [
|
||||
"vender"
|
||||
],
|
||||
"license": "Apache V2",
|
||||
"repository": "",
|
||||
"homepage": "",
|
||||
"tags": [
|
||||
"vendor"
|
||||
],
|
||||
"ohos": {
|
||||
"os": "1.0.0",
|
||||
"kernel": "liteos-a",
|
||||
"board": "hi3518"
|
||||
}
|
||||
}
|
||||
+202
@@ -0,0 +1,202 @@
|
||||
|
||||
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
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
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.
|
||||
@@ -0,0 +1,178 @@
|
||||
# Hi3861V100介绍<a name="ZH-CN_TOPIC_0000001054467126"></a>
|
||||
|
||||
## 简介<a name="section469617221261"></a>
|
||||
|
||||
Hi3861V100是一款高度集成的2.4GHz WiFi SoC芯片,集成IEEE 802.11b/g/n基带和RF电路,RF电路包括功率放大器PA、低 噪声放大器LNA、RF balun、天线开关以及电源管理等模块;支持20MHz标准带宽和5MHz/10MHz窄带宽,提供最大72.2Mbit/s 物理层速率。 Hi3861V100 WiFi基带支持正交频分复用(OFDM)技术,并向下兼容直接序列扩频(DSSS)和补码键控(CCK)技术,支 持IEEE 802.11 b/g/n协议的各种数据速率。 Hi3861V100芯片集成高性能32bit微处理器、硬件安全引擎以及丰富的外设接口,外设接口包括SPI、UART、I2C、PWM、 GPIO和多路ADC,同时支持高速SDIO2.0 Slave接口,最高时钟可达50MHz;芯片内置SRAM和Flash,可独立运行,并支持 在Flash上运行程序。 Hi3861V100芯片适应于智能家电等物联网智能终端领域。
|
||||
|
||||
## 架构<a name="section15884114210197"></a>
|
||||
|
||||
海思Hi3861系列的平台软件对应用层实现了底层屏蔽,并对应用软件直接提供API\(Application Programming Interface\)接口完成相应功能。典型的系统应用架构如下:
|
||||
|
||||
**图 1** 系统应用框架图<a name="fig16620102217403"></a>
|
||||
|
||||
|
||||

|
||||
|
||||
该框架可以分为以下几个层次:
|
||||
|
||||
- APP层:即应用层。SDK提供的代码示例在SDK的代码目录:app\\demo\\src。
|
||||
- API层:提供基于SDK开发的通用接口。
|
||||
- Platform平台层:提供SOC系统板级支持包,包括如下功能:
|
||||
- 芯片和外围器件驱动
|
||||
- 操作系统
|
||||
- 系统管理
|
||||
|
||||
- Service服务层:提供包含WiFi等应用协议栈。用于上层应用软件进行数据收发等操作。
|
||||
- 第三方库:提供给Service服务层或提供给应用层使用的第三方软件库。
|
||||
|
||||
## 特点<a name="section12212842173518"></a>
|
||||
|
||||
**稳定、可靠的通信能力**
|
||||
|
||||
- 支持复杂环境下 TPC、自动速率、弱干扰免疫等可靠性通信算法
|
||||
|
||||
**灵活的组网能力**
|
||||
|
||||
- 支持 256 节点 Mesh 组网
|
||||
- 支持标准 20M 带宽组网和 5M/10M 窄带组网
|
||||
|
||||
**完善的网络支持**
|
||||
|
||||
- 支持 IPv4/IPv6 网络功能
|
||||
- 支持 DHCPv4/DHCPv6 Client/Server
|
||||
- 支持 DNS Client 功能
|
||||
- 支持 mDNS 功能
|
||||
- 支持 CoAP/MQTT/HTTP/JSON 基础组件
|
||||
|
||||
**强大的安全引擎**
|
||||
|
||||
- 硬件实现 AES128/256 加解密算法
|
||||
- 硬件实现 HASH-SHA256、HMAC\_SHA256 算法
|
||||
- 硬件实现 RSA、ECC 签名校验算法
|
||||
- 硬件实现真随机数生成,满足 FIPS140-2 随机测试标准
|
||||
- 硬件支持 TLS/DTLS 加速
|
||||
- 内部集成 EFUSE,支持安全存储、安全启动、硬件 ID
|
||||
- 内部集成 MPU 特性,支持内存隔离特性
|
||||
|
||||
**开放的操作系统**
|
||||
|
||||
- 丰富的低功耗、小内存、高稳定性、高实时性机制
|
||||
- 灵活的协议支撑和扩展能力
|
||||
- 二次开发接口
|
||||
- 多层级开发接口:操作系统适配接口和系统诊断接口、 链路层接口、网络层接口
|
||||
|
||||
## 目录<a name="section1464106163817"></a>
|
||||
|
||||
SDK根目录结构如下图所示:
|
||||
|
||||
<a name="table13927142512394"></a>
|
||||
<table><thead align="left"><tr id="row15927132514396"><th class="cellrowborder" valign="top" width="27.38%" id="mcps1.1.3.1.1"><p id="p11927325113916"><a name="p11927325113916"></a><a name="p11927325113916"></a>目录</p>
|
||||
</th>
|
||||
<th class="cellrowborder" valign="top" width="72.61999999999999%" id="mcps1.1.3.1.2"><p id="p1292722593913"><a name="p1292722593913"></a><a name="p1292722593913"></a>说明</p>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><tr id="row292882517399"><td class="cellrowborder" valign="top" width="27.38%" headers="mcps1.1.3.1.1 "><p id="p159281025163910"><a name="p159281025163910"></a><a name="p159281025163910"></a>app</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="72.61999999999999%" headers="mcps1.1.3.1.2 "><p id="p417918234"><a name="p417918234"></a><a name="p417918234"></a>应用层代码(其中包含demo程序为参考示例)。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row13791175961418"><td class="cellrowborder" valign="top" width="27.38%" headers="mcps1.1.3.1.1 "><p id="p1279265920148"><a name="p1279265920148"></a><a name="p1279265920148"></a>boot</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="72.61999999999999%" headers="mcps1.1.3.1.2 "><p id="p1579211591149"><a name="p1579211591149"></a><a name="p1579211591149"></a>Flash bootloader代码。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row19928225163913"><td class="cellrowborder" valign="top" width="27.38%" headers="mcps1.1.3.1.1 "><p id="p2928122511393"><a name="p2928122511393"></a><a name="p2928122511393"></a>build</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="72.61999999999999%" headers="mcps1.1.3.1.2 "><p id="p1192882518398"><a name="p1192882518398"></a><a name="p1192882518398"></a>SDK构建所需的库文件、链接文件、配置文件。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row12928225173915"><td class="cellrowborder" valign="top" width="27.38%" headers="mcps1.1.3.1.1 "><p id="p199281425143911"><a name="p199281425143911"></a><a name="p199281425143911"></a>config</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="72.61999999999999%" headers="mcps1.1.3.1.2 "><p id="p792802515395"><a name="p792802515395"></a><a name="p792802515395"></a>SDK系统配置文件。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row18928182533911"><td class="cellrowborder" valign="top" width="27.38%" headers="mcps1.1.3.1.1 "><p id="p145973615257"><a name="p145973615257"></a><a name="p145973615257"></a>documents</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="72.61999999999999%" headers="mcps1.1.3.1.2 "><p id="p41400225239"><a name="p41400225239"></a><a name="p41400225239"></a>文档目录(包括:SDK说明文档)。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row15928132512396"><td class="cellrowborder" valign="top" width="27.38%" headers="mcps1.1.3.1.1 "><p id="p3928172518391"><a name="p3928172518391"></a><a name="p3928172518391"></a>include</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="72.61999999999999%" headers="mcps1.1.3.1.2 "><p id="p0346235152311"><a name="p0346235152311"></a><a name="p0346235152311"></a>API头文件存放目录。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row971803313228"><td class="cellrowborder" valign="top" width="27.38%" headers="mcps1.1.3.1.1 "><p id="p171813332218"><a name="p171813332218"></a><a name="p171813332218"></a>license</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="72.61999999999999%" headers="mcps1.1.3.1.2 "><p id="p14718533192216"><a name="p14718533192216"></a><a name="p14718533192216"></a>SDK开源license声明</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row15928192593911"><td class="cellrowborder" valign="top" width="27.38%" headers="mcps1.1.3.1.1 "><p id="p12928182573915"><a name="p12928182573915"></a><a name="p12928182573915"></a>output</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="72.61999999999999%" headers="mcps1.1.3.1.2 "><p id="p05488436238"><a name="p05488436238"></a><a name="p05488436238"></a>编译时生成的目标文件与中间文件(包括:库文件、打印log、生成的二进制文件等)。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row2050315115427"><td class="cellrowborder" valign="top" width="27.38%" headers="mcps1.1.3.1.1 "><p id="p9503161154215"><a name="p9503161154215"></a><a name="p9503161154215"></a>platform</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="72.61999999999999%" headers="mcps1.1.3.1.2 "><p id="p155032116427"><a name="p155032116427"></a><a name="p155032116427"></a>SDK平台相关的文件(包括:镜像、内核驱动模块等)。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row1783061594218"><td class="cellrowborder" valign="top" width="27.38%" headers="mcps1.1.3.1.1 "><p id="p2083021554215"><a name="p2083021554215"></a><a name="p2083021554215"></a>third_party</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="72.61999999999999%" headers="mcps1.1.3.1.2 "><p id="p15830715194212"><a name="p15830715194212"></a><a name="p15830715194212"></a>开源第三方软件目录。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row69981918194210"><td class="cellrowborder" valign="top" width="27.38%" headers="mcps1.1.3.1.1 "><p id="p159981318154216"><a name="p159981318154216"></a><a name="p159981318154216"></a>tools</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="72.61999999999999%" headers="mcps1.1.3.1.2 "><p id="p5998121854210"><a name="p5998121854210"></a><a name="p5998121854210"></a>SDK提供的Linux系统和Windows系统上使用的工具(包括:NV制作工具、签名工具、Menuconfig等)。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row415218166102"><td class="cellrowborder" valign="top" width="27.38%" headers="mcps1.1.3.1.1 "><p id="p515281614109"><a name="p515281614109"></a><a name="p515281614109"></a>SConstruct</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="72.61999999999999%" headers="mcps1.1.3.1.2 "><p id="p1615231614109"><a name="p1615231614109"></a><a name="p1615231614109"></a>SCons编译脚本。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row75842056117"><td class="cellrowborder" valign="top" width="27.38%" headers="mcps1.1.3.1.1 "><p id="p2058415591118"><a name="p2058415591118"></a><a name="p2058415591118"></a>build.sh</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="72.61999999999999%" headers="mcps1.1.3.1.2 "><p id="p558420511112"><a name="p558420511112"></a><a name="p558420511112"></a>启动编译脚本,同时支持“sh build.sh menuconfig”进行客制化配置。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row152262035269"><td class="cellrowborder" valign="top" width="27.38%" headers="mcps1.1.3.1.1 "><p id="p42263352615"><a name="p42263352615"></a><a name="p42263352615"></a>build_patch.sh</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="72.61999999999999%" headers="mcps1.1.3.1.2 "><p id="p1422613353614"><a name="p1422613353614"></a><a name="p1422613353614"></a>解压开源源码包和patch文件编译脚本。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row07472124410"><td class="cellrowborder" valign="top" width="27.38%" headers="mcps1.1.3.1.1 "><p id="p1574821211416"><a name="p1574821211416"></a><a name="p1574821211416"></a>Makefile</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="72.61999999999999%" headers="mcps1.1.3.1.2 "><p id="p126461354552"><a name="p126461354552"></a><a name="p126461354552"></a>支持makefile编译,使用“make”或“make all”启动编译。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row26011201747"><td class="cellrowborder" valign="top" width="27.38%" headers="mcps1.1.3.1.1 "><p id="p1601420844"><a name="p1601420844"></a><a name="p1601420844"></a>non_factory.mk</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="72.61999999999999%" headers="mcps1.1.3.1.2 "><p id="p14611201340"><a name="p14611201340"></a><a name="p14611201340"></a>非厂测版本编译脚本。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row17747172410413"><td class="cellrowborder" valign="top" width="27.38%" headers="mcps1.1.3.1.1 "><p id="p974719241849"><a name="p974719241849"></a><a name="p974719241849"></a>factory.mk</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="72.61999999999999%" headers="mcps1.1.3.1.2 "><p id="p87471724848"><a name="p87471724848"></a><a name="p87471724848"></a>厂测版本编译脚本。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row28411416998"><td class="cellrowborder" valign="top" width="27.38%" headers="mcps1.1.3.1.1 "><p id="p1842161613918"><a name="p1842161613918"></a><a name="p1842161613918"></a>NOTICE</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="72.61999999999999%" headers="mcps1.1.3.1.2 "><p id="p58427168912"><a name="p58427168912"></a><a name="p58427168912"></a>第三方软件开源声明</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
## 许可协议<a name="section1478215290"></a>
|
||||
|
||||
- Hi3861V100自研代码使用基于Apache License Version 2.0许可的hisi版权声明。许可信息和版权信息通常可以在代码开头看到:
|
||||
|
||||
```
|
||||
/ *Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.Licensed under the Apache License,* ... * /
|
||||
```
|
||||
|
||||
- Hi3861V100使用的第三方代码遵循软件版本自带的开源许可声明。
|
||||
- 将生成的库文件统一存放于根目录下的build/libs下。
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"name": "@ohos/hi3861",
|
||||
"version": "1.8.0",
|
||||
"publishAs": "code-segment",
|
||||
"description": "Hi3861V100是一款高度集成的2.4GHz WiFi SoC芯片,集成IEEE 802.11b/g/n基带和RF电路,RF电路包括功率放大器PA、低 噪声放大器LNA、RF balun、天线开关以及电源管理等模块;支持20MHz标准带宽和5MHz/10MHz窄带宽,提供最大72.2Mbit/s 物理层速率。 Hi3861V100 WiFi基带支持正交频分复用(OFDM)技术,并向下兼容直接序列扩频(DSSS)和补码键控(CCK)技术,支 持IEEE 802.11 b/g/n协议的各种数据速率。 Hi3861V100芯片集成高性能32bit微处理器、硬件安全引擎以及丰富的外设接口,外设接口包括SPI、UART、I2C、PWM、 GPIO和多路ADC,同时支持高速SDIO2.0 Slave接口,最高时钟可达50MHz;芯片内置SRAM和Flash,可独立运行,并支持 在Flash上运行程序。 Hi3861V100芯片适应于智能家电等物联网智能终端领域。",
|
||||
"scripts": {
|
||||
"install": "DEST_PATH=${DEP_BUNDLE_BASE}/vendor/hisi/hi3861/hi3861 &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH"
|
||||
},
|
||||
"keywords": [
|
||||
"vender"
|
||||
],
|
||||
"license": "Apache V2",
|
||||
"repository": "",
|
||||
"homepage": "",
|
||||
"tags": [
|
||||
"vendor"
|
||||
],
|
||||
"ohos": {
|
||||
"os": "1.0.0",
|
||||
"kernel": "liteos-m",
|
||||
"board": "hi3861"
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user