diff --git a/thirdparty/libyuv-ijk/CMakeLists.txt b/thirdparty/libyuv-ijk/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..482b63fea33c2918a4d5eb6321e0eed2fef841da --- /dev/null +++ b/thirdparty/libyuv-ijk/CMakeLists.txt @@ -0,0 +1,70 @@ +cmake_minimum_required(VERSION 3.4.1) +project(yuv) + +include_directories(${CMAKE_CURRENT_LIST_DIR}) +include_directories(${CMAKE_CURRENT_LIST_DIR}/include) + +if(${OHOS_ARCH} STREQUAL "armeabi-v7a") + +add_library(yuv STATIC source/compare.cc + source/compare_common.cc + source/compare_posix.cc + source/convert.cc + source/convert_argb.cc + source/convert_from.cc + source/convert_from_argb.cc + source/convert_to_argb.cc + source/convert_to_i420.cc + source/cpu_id.cc + source/format_conversion.cc + source/planar_functions.cc + source/rotate.cc + source/rotate_argb.cc + source/rotate_mips.cc + source/row_any.cc + source/row_common.cc + source/row_mips.cc + source/row_posix.cc + source/scale.cc + source/scale_argb.cc + source/scale_common.cc + source/scale_mips.cc + source/scale_posix.cc + source/video_common.cc) + +else() +add_library(yuv STATIC source/compare.cc + source/compare_common.cc + source/compare_posix.cc + source/convert.cc + source/convert_argb.cc + source/convert_from.cc + source/convert_from_argb.cc + source/convert_to_argb.cc + source/convert_to_i420.cc + source/cpu_id.cc + source/format_conversion.cc + source/planar_functions.cc + source/rotate.cc + source/rotate_argb.cc + source/rotate_mips.cc + source/row_any.cc + source/row_common.cc + source/row_mips.cc + source/row_posix.cc + source/scale.cc + source/scale_argb.cc + source/scale_common.cc + source/scale_mips.cc + source/scale_posix.cc + source/video_common.cc + source/compare_neon64.cc + source/rotate_neon64.cc + source/row_neon64.cc + source/scale_neon64.cc) +endif() + + + + + diff --git a/thirdparty/libyuv-ijk/HPKBUILD b/thirdparty/libyuv-ijk/HPKBUILD new file mode 100644 index 0000000000000000000000000000000000000000..604a7779942fc42d2446a0f4a091a49f772ec3b1 --- /dev/null +++ b/thirdparty/libyuv-ijk/HPKBUILD @@ -0,0 +1,65 @@ +# 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=yuv +pkgver=ijk-r0.2.1-dev +pkgrel=0 +pkgdesc="libyuv is an open source project that includes YUV conversion and scaling functionality." +url="https://github.com/bilibili/libyuv/branches" +archs=("armeabi-v7a" "arm64-v8a") +license=("BSD 3-Clause "New" or "Revised" License") +depends=() +makedepends=() +install= +source="https://codeload.github.com/bilibili/libyuv/zip/refs/heads/$pkgver" +autounpack=ture +downloadpackage=ture +builddir=$pkgname +packagename=$builddir-$pkgver.zip + +prepare() { + mkdir -p $builddir/$ARCH-build + cp -rf ./lib$builddir-$pkgver/* ./$builddir/ + 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}/lib$builddir-$pkgver ${PWD}/$pkgname +} diff --git a/thirdparty/libyuv-ijk/README_zh.md b/thirdparty/libyuv-ijk/README_zh.md new file mode 100644 index 0000000000000000000000000000000000000000..6665121074a25161ebc03f78db2527420fd82a4a --- /dev/null +++ b/thirdparty/libyuv-ijk/README_zh.md @@ -0,0 +1,62 @@ +# libyuv-ijk三方库说明 + +## 前言 + +​ libyuv-ijk是为适配[ohos_ijkplayer](https://gitee.com/openharmony-sig/ohos_ijkplayer)的指定版本,Branches:ijk-r0.2.1-dev。 + + + +## 构建准备 + +[准备三方库构建环境](../../lycium/README.md#1编译环境准备) + + + +## 构建方式 + +``` +#编译库 +cd tpc_c_cplusplus/lycium +./build.sh libyuv-ijk + +#库所在目录 +tpc_c_cplusplus/lycium/usr/yuv +``` + + + +## 如何在[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/yuv/include) +``` + +``` +#ijkplayer/src/main/cpp/ijksdl中的CMakeLists.txt添加如下内容 +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../third_party/yuv/include) + +target_link_libraries(ijksdl yuv) + +add_library(yuv STATIC IMPORTED) +set_target_properties(yuv PROPERTIES IMPORTED_LOCATION + ${CMAKE_CURRENT_SOURCE_DIR}/../third_party/yuv/${OHOS_ARCH}/libyuv.a) +``` + +``` +#ijkplayer/src/main/cpp/中的CMakeLists.txt添加如下内容 +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/third_party/yuv/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/libyuv-ijk/pic/dir.png b/thirdparty/libyuv-ijk/pic/dir.png new file mode 100644 index 0000000000000000000000000000000000000000..521a1b143ae34d5d8679e87b1e0ee5f8bd0653b1 Binary files /dev/null and b/thirdparty/libyuv-ijk/pic/dir.png differ