diff --git a/BUILD.gn b/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..c6f5bc38a7178038c428a4acb1f00311a7fa6f59 --- /dev/null +++ b/BUILD.gn @@ -0,0 +1,93 @@ +# Copyright (C) 2024 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. + +# lame build +import("//build/ohos.gni") + +config("lame_config") { + include_dirs = [ + "//third_party/lame/include", + ] + + cflags = [ + "-O2", + "-Wall", + "-Wno-sign-compare", + "-Wimplicit-function-declaration", + "-Wno-parentheses", + "-Wno-string-conversion", + "-Wno-string-plus-int", + "-Wno-asm-operand-widths", + "-Wno-pointer-sign", + "-Wno-deprecated-declarations", + "-Wno-implicit-int", + "-Wno-switch", + "-Wno-incompatible-pointer-types-discards-qualifiers", + "-Wno-int-conversion", + "-Wno-absolute-value", + "-Wno-unused-function", + "-Wno-unused-label", + "-Wno-unused-const-variable", + "-Wno-unused-variable", + "-Wno-visibility", + "-Wno-incompatible-pointer-types", + "-Wno-sometimes-uninitialized", + "-Wno-format", + "-Wno-tautological-constant-out-of-range-compare", + "-Wno-macro-redefined", + "-Wno-array-parameter", + "-Wno-deprecated-pragma", + "-DSTDC_HEADERS", + "-DHAVE_LIMITS_H", + "-Wno-shift-negative-value", + "-Wno-tautological-pointer-compare", + "-Wno-unused-but-set-variable", + ] + + cflags_cc = [ + "-std=c++17", + "-fno-rtti", + ] +} + +ohos_shared_library("lame") { + configs = [ + ":lame_config", + ] + + sources = [ + "//third_party/lame/libmp3lame/bitstream.c", + "//third_party/lame/libmp3lame/encoder.c", + "//third_party/lame/libmp3lame/fft.c", + "//third_party/lame/libmp3lame/gain_analysis.c", + "//third_party/lame/libmp3lame/id3tag.c", + "//third_party/lame/libmp3lame/lame.c", + "//third_party/lame/libmp3lame/mpglib_interface.c", + "//third_party/lame/libmp3lame/newmdct.c", + "//third_party/lame/libmp3lame/presets.c", + "//third_party/lame/libmp3lame/psymodel.c", + "//third_party/lame/libmp3lame/quantize.c", + "//third_party/lame/libmp3lame/quantize_pvt.c", + "//third_party/lame/libmp3lame/reservoir.c", + "//third_party/lame/libmp3lame/set_get.c", + "//third_party/lame/libmp3lame/tables.c", + "//third_party/lame/libmp3lame/takehiro.c", + "//third_party/lame/libmp3lame/util.c", + "//third_party/lame/libmp3lame/vbrquantize.c", + "//third_party/lame/libmp3lame/VbrTag.c", + "//third_party/lame/libmp3lame/version.c", + ] + + part_name = "lame" + subsystem_name = "thirdparty" +} diff --git a/OAT.xml b/OAT.xml new file mode 100644 index 0000000000000000000000000000000000000000..dbafe7f93e9ce1a6b1524860063fd66d6a447daa --- /dev/null +++ b/OAT.xml @@ -0,0 +1,121 @@ + + + + + + COPYING + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/README.OpenSource b/README.OpenSource new file mode 100644 index 0000000000000000000000000000000000000000..25bf31fb80e711dd98557d8057a372acdbf81227 --- /dev/null +++ b/README.OpenSource @@ -0,0 +1,11 @@ +[ + { + "Name":"lame", + "License":"LGPL", + "License File":"LICENSE", + "Version Number":"3.100", + "Owner":"yangpeng43@huawei.com", + "Upstream URL":"https://github.com/lameproject/lame.git", + "Description":"LAME is a high quality MPEG Audio Layer III (MP3) encoder licensed under the LGPL." + } +] diff --git a/README_zh.md b/README_zh.md new file mode 100644 index 0000000000000000000000000000000000000000..6659deffa90ab8358cc05ad749f15101a72adae6 --- /dev/null +++ b/README_zh.md @@ -0,0 +1,53 @@ +# lame + +LAME是LGPL协议授权的高质量MP3编码器。 + +OpenHarmony上引入LAME主要用于MP3编码。 + +## 主要目录结构 + +``` +doc #文档 +include #包含头文件 +libmp3lame #MP3编码主要源代码 +test #测试代码 +Dll #Windows dll接口 +vc_solution #vs解决方案 +Makefile #编译描述文件 +INSTALL #安装(编译)指导 +API #接口说明 +COPYING #版权声明 +LICENSE #版权补充说明 +README.md #软件说明 +``` + +## OpenHarmony对于lame的适配 + +lame引入openharmony的thirdparty目录下, +使用OpenHarmony中依赖部件的方式进行编译。 +1. 主干代码下载 + ``` + repo init -u https://gitee.com/openharmony/manifest.git -b master --no-repo-verify + repo sync -c + repo forall -c 'git lfs pull' + ``` +2. 在使用的模块进行依赖 + ``` + deps = [ "//third_party/lame:lame" ] + ``` +3. 预处理 + ``` + ./build/prebuilts_download.sh + ``` +4. 编译 + ``` + ./build.sh --product-name rk3568 --ccache + ``` +编译生成物对应路径:`out/rk3568/thirdparty/lame/liblame.z.so`。 + +## 许可证 + +本项目遵从[COPYING](https://gitee.com/openharmony-sig/third_party_lame/blob/master/COPYING)和[LICENSE](https://gitee.com/openharmony-sig/third_party_lame/blob/master/LICENSE)中所描述的许可证。 + +## 相关仓 +[lame](https://gitee.com/openharmony-sig/third_party_lame) diff --git a/bundle.json b/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..aaa2f687ac9c6b4934136e3b0397a42ad5e82025 --- /dev/null +++ b/bundle.json @@ -0,0 +1,41 @@ +{ + "name": "@ohos/lame", + "description": "lame is a high quality MP3 encoder.", + "version": "3.100", + "license": "LGPL", + "publishAs": "code-segment", + "segment": { + "destPath": "third_party/lame" + }, + "dirs": {}, + "scripts": {}, + "licensePath": "LICENSE", + "component": { + "name": "lame", + "subsystem": "thirdparty", + "syscap": [], + "features": [], + "adapted_system_type": [ "standard" ], + "rom": "", + "ram": "", + "deps": { + "components": [], + "third_party": [] + }, + "build": { + "sub_component": ["//third_party/lame:lame"], + "inner_kits": [ + { + "name": "//third_party/lame:lame", + "header": { + "header_files": [ + "lame.h" + ], + "header_base": "//third_party/lame/include" + } + } + ], + "test": [] + } + } +}