!5 merge dav1d_0115 into master

add dav1d readme

Created-by: zhaona45
Commit-by: zhaona45
Merged-by: openharmony_ci
Description: ### 一、内容说明(相关的Issue)

https://gitcode.com/openharmony-sig/third_party_dav1d/issues/3

### 二、建议测试周期和提测地址  
  建议测试完成时间:xxxx.xx.xx  
  投产上线时间:xxxx.xx.xx  
  提测地址:CI环境/压测环境  
  测试账号:  

### 三、变更内容
  * 3.1 关联PR列表

  * 3.2 数据库和部署说明  
    1. 常规更新 
    2. 重启unicorn
    3. 重启sidekiq
    4. 迁移任务:是否有迁移任务,没有写 "无"
    5. rake脚本:`bundle exec xxx RAILS_ENV = production`;没有写 "无"

  * 3.4 其他技术优化内容(做了什么,变更了什么)
    - 重构了 xxxx 代码
    - xxxx 算法优化


  * 3.5 废弃通知(什么字段、方法弃用?)



  * 3.6  后向不兼容变更(是否有无法向后兼容的变更?)


  
### 四、研发自测点(自测哪些?冒烟用例全部自测?)
  自测测试结论:


### 五、测试关注点(需要提醒QA重点关注的、可能会忽略的地方)
  检查点:

| 需求名称 | 是否影响xx公共模块 | 是否需要xx功能 | 需求升级是否依赖其他子产品 |
|------|------------|----------|---------------|
| xxx  | 否          | 需要       | 不需要           |
|      |            |          |               |

  接口测试:

  性能测试:

  并发测试:

  其他:


See merge request: openharmony-sig/third_party_dav1d!5
This commit is contained in:
openharmony_ci
2026-01-15 16:39:05 +08:00
5 changed files with 208 additions and 0 deletions
+7
View File
@@ -15,6 +15,12 @@ import("//build/ohos.gni")
dav1d_root_dir = "//third_party/dav1d"
config("dav1d_public_cfg") {
include_dirs = [
"$dav1d_root_dir/include/dav1d",
]
}
config("dav1d_config") {
cflags = [
"-fno-rtti",
@@ -243,6 +249,7 @@ ohos_shared_library("dav1d_ohos") {
":dav1d_bitdepth_16",
]
configs = [ ":dav1d_config" ]
public_configs = [ ":dav1d_public_cfg" ]
part_name = "dav1d"
subsystem_name = "thirdparty"
+23
View File
@@ -0,0 +1,23 @@
Copyright © 2018-2025, VideoLAN and dav1d authors
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+37
View File
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (c) 2021 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
This is the configuration file template for OpenHarmony OSS Audit Tool, please copy it to your project root dir and modify it refer to OpenHarmony/tools_oat/README.
-->
<configuration>
<oatconfig>
<licensefile>LICENSE</licensefile>
<policylist>
<policy name="projectPolicy" desc="">
<policyitem type="license" name="BSD-2-Clause" path=".*" desc="Dynamically linked by module X"/>
</policy>
</policylist>
<filefilterlist>
<filefilter name="defaultFilter" desc="Files not to check">
<filteritem type="filename" name="*.png" desc="original files"/>
<filteritem type="filename" name="PATENTS" desc="original files"/>
<filteritem type="filename" name="getopt.h" desc="original files"/>
<filteritem type="filename" name="LICENSE" desc="LICENSE"/>
</filefilter>
</filefilterlist>
</oatconfig>
</configuration>
+73
View File
@@ -0,0 +1,73 @@
# dav1d
Original Repositoryhttps://code.videolan.org/videolan/dav1d
The repository includes the third-party open-source software dav1d, which is a video codec implementation for the av1 standars. In OpenHarmony, dav1d serves as a fundamental component of the media subsystem, providing decoding capabilities for av1 video stream.
## Directory Structure
```
//third_party_dav1d
|-- BUILD.gn
|-- bundle.json
|-- av1
|-- doc
|-- examples
|-- examples
|-- include
|-- package
|-- patches
|-- src
|-- tests
|-- tools
```
## How to Use dav1d in OpenHarmony
System components in OpenHarmony need to reference the dav1d component in BUILD.gn to use it.
```
// BUILD.gn
external_deps + = [dav1d:dav1d_ohos]
```
### Decoding Steps Using dav1d
1Decoder Initialization
```
DAV1D_API void dav1d_default_settings(Dav1dSettings *s)
s: Input settings context.
```
2open decoder instance
```
DAV1D_API int dav1d_open(Dav1dContext **c_out, const Dav1dSettings *s)
c_outThe decoder instance to open. c_out will be set to the allocated context.
sInput settings context.
noteThe context must be freed using dav1d_close() when decoding is finished.
return0 on success, or < 0 (a negative DAV1D_ERR code) on error.
```
3Decode one frame
```
DAV1D_API int dav1d_send_data(Dav1dContext *c, Dav1dData *in)
cInput decoder instance.
inInput bitstream data. On success, ownership of the reference is passed to the library.
return0: Success, and the data was consumed.
DAV1D_ERR(EAGAIN)The data can't be consumed. dav1d_get_picture() should be called to get one or more frames before the function can consume new data.
Other negative DAV1D_ERR codes: Error during decoding or because of invalid passed-in arguments. The reference remains owned by the caller.
```
4Get the decoded image
```
DAV1D_API int dav1d_get_picture(Dav1dContext *c, Dav1dPicture *out)
cInput decoder instance.
outOutput frame. The caller assumes ownership of the returned reference.
return0: Success, and a frame is returned.
DAV1D_ERR(EAGAIN): Not enough data to output a frame. dav1d_send_data() should be called with new input.
Other negative DAV1D_ERR codes: Error during decoding or because of invalid passed-in arguments.
noteTo drain buffered frames from the decoder (i.e. on end of stream), call this function until it returns DAV1D_ERR(EAGAIN).
```
5Destroy the decoder
```
DAV1D_API void dav1d_close(Dav1dContext **c_out)
c_outThe decoder instance to close. c_out will be set to NULL.
```
## Feature Support
OpenHarmony currently integrates only the decoding capability of dav1d, used to parse VP8 and VP9 bitstreams. Video encoding is not supported yet.
## License
See the LICENSE.md file in the root directory for details.
+68
View File
@@ -0,0 +1,68 @@
# dav1d
原始仓来源:https://code.videolan.org/videolan/dav1d
仓库包含第三方开源软件dav1d,dav1d是av1标准的视频编解码器。在OpenHarmony中,dav1d主要是媒体子系统的基础组件,提供av1码流的解码能力。
## 目录结构
```
//third_party_dav1d
|-- BUILD.gn
|-- bundle.json
|-- av1
|-- doc
|-- examples
|-- examples
|-- include
|-- package
|-- patches
|-- src
|-- tests
|-- tools
```
## OpenHarmony如何使用dav1d
OpenHarmony的系统部件需要在BUILG.gn中引用dav1d部件以使用libav1。
```
// BUILD.gn
external_deps + = [dav1d:dav1d_ohos]
```
### 使用dav1d库解码步骤
1)解码器初始化
```
DAV1D_API void dav1d_default_settings(Dav1dSettings *s)
s:解码器参数设置
```
2)打开解码器实例
```
DAV1D_API int dav1d_open(Dav1dContext **c_out, const Dav1dSettings *s)
c_out:要打开的解码器实例。c_out将被设置为新分配的解码器实例
s:解码器配置
注意:解码完成后必须使用dav1d_close()释放实例
返回值:0解码成功,非0解码失败,参考DAV1D_ERR中错误码的说明
```
3)输送数据进行解码
```
DAV1D_API int dav1d_send_data(Dav1dContext *c, Dav1dData *in)
c:输入解码器实例
in:输入比特流数据。成功后,数据输送至库中
返回值:0解码成功,数据已输送
DAV1D_ERR(EAGAIN):数据未被输送。在函数输送新数据之前,应调用dav1d_get_picture()来获取一个或多个帧
其他DAV1D_ERR错误码:解码过程中出现错误,或由于传入的参数无效。该数据的所有权仍归调用者所有
```
4)获取解码后图像
```
DAV1D_API int dav1d_get_picture(Dav1dContext *c, Dav1dPicture *out)
c:输入解码器实例
out:输出帧。调用者取得返回引用的所有权
返回值:0解码成功,返回一帧
DAV1D_ERR(EAGAIN):数据不足,无法输出帧。应调用dav1d_send_data()输入新数据
其他DAV1D_ERR错误码:解码过程中出错或入参无效
注意:如需排空解码器内部缓存的帧(即在流结束时),请循环调用本函数,直到返回DAV1D_ERR(EAGAIN)为止
```
5)销毁解码器
```
DAV1D_API void dav1d_close(Dav1dContext **c_out)
c_out:要关闭的解码器实例。c_out将被设置为NULL
```
## 功能支持说明
OpenHarmony目前仅集成了dav1d的解码能力,用于解析av1的码流,暂不支持视频编码功能。
## License
详见仓库目录下的LICENSE.md文件