diff --git a/thirdparty/soundtouch-ijk/CMakeLists.txt b/thirdparty/soundtouch-ijk/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..00fd5cd07ca668012365956913be16736ca5feb1 --- /dev/null +++ b/thirdparty/soundtouch-ijk/CMakeLists.txt @@ -0,0 +1,25 @@ +cmake_minimum_required(VERSION 3.4.1) +project(soundtouch) + +include_directories(${CMAKE_CURRENT_LIST_DIR}) +include_directories(${CMAKE_CURRENT_LIST_DIR}/include) + +add_library(soundtouch STATIC source/SoundTouch/AAFilter.cpp + source/SoundTouch/FIFOSampleBuffer.cpp + source/SoundTouch/FIRFilter.cpp + source/SoundTouch/cpu_detect_x86.cpp + source/SoundTouch/sse_optimized.cpp + source/SoundTouch/RateTransposer.cpp + source/SoundTouch/InterpolateCubic.cpp + source/SoundTouch/InterpolateLinear.cpp + source/SoundTouch/InterpolateShannon.cpp + source/SoundTouch/TDStretch.cpp + source/SoundTouch/BPMDetect.cpp + source/SoundTouch/PeakFinder.cpp + source/SoundTouch/SoundTouch.cpp + source/SoundTouch/mmx_optimized.cpp + ijksoundtouch_wrap.cpp) + + + + diff --git a/thirdparty/soundtouch-ijk/HPKBUILD b/thirdparty/soundtouch-ijk/HPKBUILD new file mode 100644 index 0000000000000000000000000000000000000000..f93bfbaa56b2d531ce62f548d8aef0a7eadd794c --- /dev/null +++ b/thirdparty/soundtouch-ijk/HPKBUILD @@ -0,0 +1,66 @@ +# Copyright (c) 2023 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. + +# Contributor: yaofangyong <2385605052@qq.com> +# Maintainer: yaofangyong <2385605052@qq.com> + +pkgname=soundtouch +pkgver=ijk-r0.1.2-dev +pkgrel=0 +pkgdesc="SoundTouch is an open-source audio processing library that allows changing the sound tempo, pitch and playback rate parameters independently from each other" +url="https://github.com/bilibili/soundtouch/branches" +archs=("armeabi-v7a" "arm64-v8a") +license=("LGPL-2.1") +depends=() +makedepends=() +install= +source="https://codeload.github.com/bilibili/$pkgname/zip/refs/heads/$pkgver" +autounpack=ture +downloadpackage=ture +builddir=$pkgname +packagename=$builddir-$pkgver.zip + +prepare() { + mkdir -p $builddir/$ARCH-build + cp -rf ./$builddir-$pkgver/* ./$builddir/ + cp soundtouch_config.h ./$builddir/include/ + cp CMakeLists.txt $builddir/ +} + +build() { + cd $builddir + ${OHOS_SDK}/native/build-tools/cmake/bin/cmake "$@" -DOHOS_ARCH=$ARCH -B$ARCH-build -S./ -L + ${MAKE} -C $ARCH-build + ret=$? + cd $OLDPWD + return $ret +} + +package() { + cd $builddir + mkdir -p $LYCIUM_ROOT/usr/$pkgname/$ARCH/include/ + mkdir -p $LYCIUM_ROOT/usr/$pkgname/$ARCH/lib + cp -rf include/* $LYCIUM_ROOT/usr/$pkgname/$ARCH/include/ + cp -rf $ARCH-build/*.a $LYCIUM_ROOT/usr/$pkgname/$ARCH/lib/ + ret=$? + cd $OLDPWD + return $ret +} + +check() { + echo "Test MUST on OpenHarmony device!" +} + +cleanbuild(){ + rm -rf ${PWD}/$builddir ${PWD}/$builddir-$pkgver ${PWD}/$pkgname +} diff --git a/thirdparty/soundtouch-ijk/README_zh.md b/thirdparty/soundtouch-ijk/README_zh.md new file mode 100644 index 0000000000000000000000000000000000000000..32e51ec87768f9f50f3bfeb0b73857c8f9505d13 --- /dev/null +++ b/thirdparty/soundtouch-ijk/README_zh.md @@ -0,0 +1,62 @@ +# soundtouch-ijk三方库说明 + +## 前言 + +​ soundtouch-ijk是为适配[ohos_ijkplayer](https://gitee.com/openharmony-sig/ohos_ijkplayer)的指定版本,Branches:ijk-r0.1.2-dev。 + + + +## 构建准备 + +[准备三方库构建环境](../../lycium/README.md#1编译环境准备) + + + +## 构建方式 + +``` +#编译库 +cd tpc_c_cplusplus/lycium +./build.sh soundtouch-ijk + +#库所在目录 +tpc_c_cplusplus/lycium/usr/soundtouch +``` + + + +## 如何在[ohos_ijkplayer](https://gitee.com/openharmony-sig/ohos_ijkplayer) 中使用 + +1.在库目录中取出openssl以及FFmpeg的文件夹,存放到工程的ijkplayer/src/main/cpp/thirdparty下,如图所示 + +![img](./pic/dir.png) + +2.修改ijkplayer/src/main/cpp/下的CMakeLists.txt文件以及ijkplayer、ijksdl中的CMakeLists.txt文件,总共三个CMakeLists.txt文件,请注意 + +``` +#ijkplayer/src/main/cpp/ijkplayer中的CMakeLists.txt添加如下内容 +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../third_party/soundtouch/include) + +add_library(soundtouch STATIC IMPORTED) +set_target_properties(soundtouch PROPERTIES IMPORTED_LOCATION + ${CMAKE_CURRENT_SOURCE_DIR}/../third_party/soundtouch/${OHOS_ARCH}/libsoundtouch.a) + +target_link_libraries(ijkplayer soundtouch) +``` + +``` +#ijkplayer/src/main/cpp/ijksdl中的CMakeLists.txt添加如下内容 +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../third_party/soundtouch/include) +``` + +``` +#ijkplayer/src/main/cpp/中的CMakeLists.txt添加如下内容 +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/third_party/soundtouch/include) + +修改 +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-int-conversion") +替换成 +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-int-conversion -Wl,-Bsymbolic") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-int-conversion -Wl,-Bsymbolic") +``` + diff --git a/thirdparty/soundtouch-ijk/pic/dir.png b/thirdparty/soundtouch-ijk/pic/dir.png new file mode 100644 index 0000000000000000000000000000000000000000..f99e961556a89067a57c935f185f024611c73319 Binary files /dev/null and b/thirdparty/soundtouch-ijk/pic/dir.png differ diff --git a/thirdparty/soundtouch-ijk/soundtouch_config.h b/thirdparty/soundtouch-ijk/soundtouch_config.h new file mode 100644 index 0000000000000000000000000000000000000000..3942afe48e56a2f0f9df056d8c7fcddf01635a3c --- /dev/null +++ b/thirdparty/soundtouch-ijk/soundtouch_config.h @@ -0,0 +1,3 @@ +// autotools configuration step replaces this file with a configured version. +// this empty file stub is provided to avoid error about missing include file +// when not using autotools build