diff --git a/thirdparty/lame/HPKBUILD b/thirdparty/lame/HPKBUILD new file mode 100644 index 0000000000000000000000000000000000000000..6f7a0ca3c9dbdccabb5272e5727f9761fbd58770 --- /dev/null +++ b/thirdparty/lame/HPKBUILD @@ -0,0 +1,72 @@ +# Contributor: liulihong +# Maintainer: liulihong + +pkgname=lame +pkgver=3.100 +pkgrel=0 +pkgdesc="LAME is an educational tool to be used for learning about MP3 encoding." +url="" +archs=("armeabi-v7a" "arm64-v8a") +license=("LGPLv2" "GPLv2") +depends=() +makedepends=() + +source="https://nchc.dl.sourceforge.net/project/$pkgname/$pkgname/$pkgver/$pkgname-$pkgver.tar.gz" +builddir=$pkgname-$pkgver +packagename=$builddir.tar.gz +buildtools="configure" + +source envset.sh +host= +prepare() { + mkdir -p $builddir/$ARCH-build + if [ $ARCH == "armeabi-v7a" ] + then + setarm32ENV + host=arm-linux + fi + if [ $ARCH == "arm64-v8a" ] + then + setarm64ENV + host=aarch64-linux + fi + cd $builddir + cd $OLDPWD +} + +build() { + + cd $builddir/$ARCH-build + ../configure "$@" --host=$host > `pwd`/build.log 2>&1 + make -j4 >> `pwd`/build.log 2>&1 + ret=$? + cd $OLDPWD + return $ret +} + +package() { + cd $builddir/$ARCH-build + make install >> `pwd`/build.log 2>&1 + cd $OLDPWD + unset host +} + +check() { + cd $builddir/$ARCH-build + make check >> `pwd`/build.log 2>&1 + cd $OLDPWD + if [ $ARCH == "armeabi-v7a" ] + then + unsetarm32ENV + fi + if [ $ARCH == "arm64-v8a" ] + then + unsetarm64ENV + fi + echo "The test must be on an OpenHarmony device!" + # 在构建目录下,执行make test +} + +cleanbuild() { + rm -rf ${PWD}/$builddir #${PWD}/packagename +} diff --git a/thirdparty/lame/OAT.xml b/thirdparty/lame/OAT.xml new file mode 100644 index 0000000000000000000000000000000000000000..96937ea08644b79312d0ced7c0b3eb1e845108ee --- /dev/null +++ b/thirdparty/lame/OAT.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/thirdparty/lame/README.OpenSource b/thirdparty/lame/README.OpenSource new file mode 100644 index 0000000000000000000000000000000000000000..b9e8fd24877902bd4ed0f929efae9e32c98ed59d --- /dev/null +++ b/thirdparty/lame/README.OpenSource @@ -0,0 +1,11 @@ +[ + { + "Name": "lame", + "License": "LGPLv2/GPLv2 license", + "License File": "LICENSES", + "Version Number": "3.100", + "Owner": "cmxud@isoftstone.com", + "Upstream URL": "https://sourceforge.net/projects/lame/files/lame/3.100/lame-3.100.tar.gz", + "Description": "lame is A high quality MP3 encoder" + } +] diff --git a/thirdparty/lame/README_zh.md b/thirdparty/lame/README_zh.md new file mode 100644 index 0000000000000000000000000000000000000000..324aae2ba44a4cca8b3becce291f8ef400ae23f6 --- /dev/null +++ b/thirdparty/lame/README_zh.md @@ -0,0 +1,12 @@ +# lame三方库说明 +## 功能简介 +lame是非常优秀的一种MP3编码器。 +## 使用约束 +- IDE版本:DevEco Studio 3.1 Beta2 +- SDK版本:ohos_sdk_public 3.2.11.9 (API Version 9 Release) +- 三方库版本:3.100 +- 当前适配的功能:MP3编码器 +- [LGPLv2/GPLv2 license](https://sourceforge.net/projects/lame/) + +## 集成方式 ++ [应用hap包集成](docs/hap_integrate.md) diff --git a/thirdparty/lame/SHA512SUM b/thirdparty/lame/SHA512SUM new file mode 100644 index 0000000000000000000000000000000000000000..38f2cbae715370d7dfc4f02a8cb76409c0afd35a --- /dev/null +++ b/thirdparty/lame/SHA512SUM @@ -0,0 +1 @@ +0844b9eadb4aacf8000444621451277de365041cc1d97b7f7a589da0b7a23899310afd4e4d81114b9912aa97832621d20588034715573d417b2923948c08634b lame-3.100.tar.gz diff --git a/thirdparty/lame/docs/hap_integrate.md b/thirdparty/lame/docs/hap_integrate.md new file mode 100644 index 0000000000000000000000000000000000000000..ddcdb6f2e54282eab613436b473909ade2ad0d90 --- /dev/null +++ b/thirdparty/lame/docs/hap_integrate.md @@ -0,0 +1,90 @@ +# lame集成到应用hap + +本库是在RK3568开发板上基于OpenHarmony3.2 Release版本的镜像验证的,如果是从未使用过RK3568,可以先查看[润和RK3568开发板标准系统快速上手](https://gitee.com/openharmony-sig/knowledge_demo_temp/tree/master/docs/rk3568_helloworld)。 + +## 开发环境 + +- ubuntu20.04 +- [OpenHarmony3.2Release镜像](https://gitee.com/link?target=https%3A%2F%2Frepo.huaweicloud.com%2Fopenharmony%2Fos%2F3.2-Release%2Fdayu200_standard_arm32.tar.gz) +- [ohos_sdk_public 3.2.11.9 (API Version 9 Release)](https://gitee.com/link?target=https%3A%2F%2Frepo.huaweicloud.com%2Fopenharmony%2Fos%2F3.2-Release%2Fohos-sdk-windows_linux-public.tar.gz) +- [DevEco Studio 3.1 Beta2](https://gitee.com/link?target=https%3A%2F%2Fcontentcenter-vali-drcn.dbankcdn.cn%2Fpvt_2%2FDeveloperAlliance_package_901_9%2Ff3%2Fv3%2FuJyuq3syQ2ak4hE1QZmAug%2Fdevecostudio-windows-3.1.0.400.zip%3FHW-CC-KV%3DV1%26HW-CC-Date%3D20230408T013335Z%26HW-CC-Expire%3D315360000%26HW-CC-Sign%3D96262721EDC9B34E6F62E66884AB7AE2A94C2A7B8C28D6F7FC891F46EB211A70) +- [准备三方库构建环境](../../../tools/README.md#编译环境准备) +- [准备三方库测试环境](../../../tools/README.md#ci环境准备) + +## 编译三方库 + +- 下载本仓库 + + ```shell + git clone https://gitee.com/openharmony-sig/tpc_c_cplusplus.git --depth=1 + ``` + +- 三方库目录结构 + + ```shell + tpc_c_cplusplus/thirdparty/lame #三方库lame的目录结构如下 + ├── docs #三方库相关文档的文件夹 + ├── HPKBUILD #构建脚本 + ├── SHA512SUM #三方库校验文件 + ├── README.OpenSource #说明三方库源码的下载地址,版本,license等信息 + ├── README_zh.md + ``` + +- 将lame拷贝至tools/main目录下 + + ```shell + cd tpc_c_cplusplus + cp thirdparty/lame tools/main -rf + ``` + +- 在tools目录下编译三方库 + + 编译环境的搭建参考[准备三方库构建环境](../../../tools/README.md#编译环境准备) + + ```shell + cd tools + ./build.sh lame + ``` + +- 三方库头文件及生成的库 + + 在tools目录下会生成usr目录,该目录下存在已编译完成的32位和64位三方库和头文件 + + ```shell + lame/arm64-v8a lame/armeabi-v7a + ``` +- [测试三方库](#测试三方库) + +## 应用中使用三方库 + +- 在IDE的cpp目录下新增thirdparty目录,将编译生成的头文件拷贝到该目录下,将编译生成的三方库全部(动态库名字带版本号和不带版本号的都需要)拷贝到工程的libs目录下,如下图所示 +   + + ![thirdparty_install_dir](pic/lame_install_dir.png) + +- 在最外层(cpp目录下)CMakeLists.txt中添加如下语句 + + ```cmake + #将三方库加入工程中 + target_link_libraries(entry PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../../libs/${OHOS_ARCH}/libmp3lame.so.0) + #将三方库的头文件加入工程中 + target_include_directories(entry PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/lame/${OHOS_ARCH}/include) + ``` + + ![lame_usage](pic/lame_usage.png) + +## 测试三方库 + +三方库的测试使用原库自带的测试用例来做测试,[准备三方库测试环境](../../../tools/README.md#ci环境准备) + +进入到构建目录,执行如下命令make test(arm64-v8a-build为构建64位的目录,armeabi-v7a-build为构建32位的目录) + + + ![lame_test](pic/lame_test.png) + +## 参考资料 + +- [润和RK3568开发板标准系统快速上手](https://gitee.com/openharmony-sig/knowledge_demo_temp/tree/master/docs/rk3568_helloworld) +- [OpenHarmony三方库地址](https://gitee.com/openharmony-tpc) +- [OpenHarmony知识体系](https://gitee.com/openharmony-sig/knowledge) +- [通过DevEco Studio开发一个NAPI工程](https://gitee.com/openharmony-sig/knowledge_demo_temp/blob/master/docs/napi_study/docs/hello_napi.md) diff --git a/thirdparty/lame/docs/pic/lame_install_dir.png b/thirdparty/lame/docs/pic/lame_install_dir.png new file mode 100644 index 0000000000000000000000000000000000000000..f18c3c8b11c9dab6d79ba7bc716f98cfd41e127c Binary files /dev/null and b/thirdparty/lame/docs/pic/lame_install_dir.png differ diff --git a/thirdparty/lame/docs/pic/lame_test.png b/thirdparty/lame/docs/pic/lame_test.png new file mode 100644 index 0000000000000000000000000000000000000000..46d48c6e8986bd839a50690d5d6c3e14886f7ee4 Binary files /dev/null and b/thirdparty/lame/docs/pic/lame_test.png differ diff --git a/thirdparty/lame/docs/pic/lame_usage.png b/thirdparty/lame/docs/pic/lame_usage.png new file mode 100644 index 0000000000000000000000000000000000000000..6f435b9a467935273883a58a5d707174b25f00e4 Binary files /dev/null and b/thirdparty/lame/docs/pic/lame_usage.png differ