1#!/bin/bash 2# Copyright (c) 2021 HiSilicon (Shanghai) Technologies CO., LIMITED. 3# Licensed under the Apache License, Version 2.0 (the "License"); 4# you may not use this file except in compliance with the License. 5# You may obtain a copy of the License at 6# 7# http://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, 11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12# See the License for the specific language governing permissions and 13# limitations under the License. 14# 15# Compile middleware project, this is the entrance script 16 17# error out on errors 18set -e 19OUT_DIR="$1" 20BOARD_NAME="$2" 21KERNEL_TYPE="$3" 22CC_PATH="$4" 23 24function main(){ 25 CUR_DIR=$(cd $(dirname "$0");pwd) 26 27 OS_TYPE=$KERNEL_TYPE 28 if [ "$KERNEL_TYPE" = "linux" ];then 29 OS_TYPE="linux_small" 30 fi 31 32 echo "BOARD_NAME=${BOARD_NAME} OS_TYPE=${OS_TYPE} CC_PATH=${CC_PATH}" 33 ####################################### 34 # build ffmpeg library 35 ####################################### 36 ./ffmpeg_adapt/build_ffmpeg.sh $OUT_DIR $BOARD_NAME $OS_TYPE $CC_PATH 37 38 cp -rf $CUR_DIR/component/fileformat/mp4/lib/$OS_TYPE/libmp4.so $OUT_DIR/ 39 cp -rf $CUR_DIR/component/fileformat/ts/lib/$OS_TYPE/libts.so $OUT_DIR/ 40 cp -rf $CUR_DIR/component/fileformat/exif/lib/$OS_TYPE/libexif.so $OUT_DIR/ 41 cp -rf $CUR_DIR/component/fileformat/common/lib/$OS_TYPE/libfileformat.so $OUT_DIR/ 42 cp -rf $CUR_DIR/component/recorder_pro/lib/$OS_TYPE/librecorder_pro.so $OUT_DIR/ 43 cp -rf $CUR_DIR/component/dtcf/lib/$OS_TYPE/libdtcf.so $OUT_DIR/ 44 cp -rf $CUR_DIR/component/fstool/lib/$OS_TYPE/libfstool.so $OUT_DIR/ 45 cp -rf $CUR_DIR/common/hitimer/lib/$OS_TYPE/libhitimer.so $OUT_DIR/ 46 cp -rf $CUR_DIR/common/mbuffer/lib/$OS_TYPE/libmbuf.so $OUT_DIR/ 47 cp -rf $CUR_DIR/common/log/lib/$OS_TYPE/libmwlog.so $OUT_DIR/ 48} 49 50if [ "x" != "x$5" ]; then 51export SYSROOT_PATH=$5 52fi 53if [ "x" != "x$6" ]; then 54export ARCH_CFLAGS="$6" 55fi 56main "$@" 57