首先在我们的vendor/xingyun/t113_nand/config.json文件中添加组件ace后,如下图所示组件
{
"subsystem": "ace",
"components": [
{ "component": "ace_engine_lite", "features":[ "" ] }
]
}
一进行编译发现会报错如下,但是我们芯片根本就不是海思啊。所以需要追踪下是哪里引用了这个文件夹路径参与编译的。
[OHOS INFO] ohos_build_compiler: clang
[OHOS INFO] //kernel/linux/build:linux_kernel is marked as prebuilts
[OHOS INFO] //prebuilts/lite/sysroot/build:build_sysroot is marked as prebuilts
[OHOS INFO] ERROR at //device/hisilicon/hardware/BUILD.gn:20:39: Undefined identifier
[OHOS INFO] command = "./build.sh ${outdir} ${board} ${ohos_kernel_type} ${ohos_build_compiler} ${storage_type}"
[OHOS INFO] ^----
[OHOS INFO] See //foundation/multimedia/camera_lite/frameworks/BUILD.gn:51:5: which caused the file to be included.
[OHOS INFO] "//device/hisilicon/hardware:hardware_media_sdk",
[OHOS INFO] ^-----------------------------------------------
[OHOS ERROR] you can check build log in /home/d1/openHarmony/t113/out/t113_nand_linux/xingyun_t113_nand_board/build.log
[OHOS ERROR] command: "/home/d1/openHarmony/t113/prebuilts/build-tools/linux-x86/bin/gn gen /home/d1/openHarmony/t113/out/t113_nand_linux/xingyun_t113_nand_board --root=/home/d1/openHarmony/t113 --dotfile=/home/d1/openHarmony/t113/build/lite/.gn --script-executable=/usr/bin/python3 --args=ohos_build_compiler_specified="clang" ohos_build_compiler_dir="//prebuilts/clang/ohos/linux-x86_64/llvm" product_path="/home/d1/openHarmony/t113/vendor/xingyun/t113_nand" device_path="/home/d1/openHarmony/t113/device/xingyunelec/t113_nand_linux/sdk_linux" ohos_kernel_type="linux" enable_graphic_font = true enable_screensaver = true ohos_build_type="debug" ohos_build_time="1649272105265" ohos_build_datetime="2022-04-07 11:08:25" ohos_full_compile=true" failed
[OHOS ERROR] return code: 1
[OHOS ERROR] execution path: /home/d1/openHarmony/t113
d1@d1-virtual-machine:~/openHarmony/t113(master)$ ag "foundation/multimedia/camera_lite/frameworks"
根据报错信息 foundation/multimedia/camera_lite/frameworks/BUILD.gn,我们可以查看build/lite/components/ace.json文件,确定需要编译的内容如下图所示。
打开foundation/ace/ace_engine_lite/frameworks/BUILD.gn文件,搜索看有没有foundation/multimedia/camera_lite/frameworks相关字段,可以看到是包含了的。
针对以上情况,有两种解决方案给出,如果是使用摄像头产品,肯定是修改对应引用的文件去进行修改,这样也稳妥,不会出现对应奇怪的问题,比如我这边是直接暴力修改
diff --git a/build/lite/components/ace.json b/build/lite/components/ace.json
index 810397070f..8fde142422 100755
--- a/build/lite/components/ace.json
+++ b/build/lite/components/ace.json
@@ -8,8 +8,7 @@
"foundation/ace/ace_engine_lite"
],
"targets": [
- "//foundation/ace/ace_engine_lite/frameworks:jsfwk",
- "//foundation/ace/ace_engine_lite/test:unittest"
+ "//foundation/ace/ace_engine_lite/frameworks:jsfwk"^M
],
"rom": "521KB",
"ram": "~82KB",
diff --git a/foundation/ace/ace_engine_lite/frameworks/BUILD.gn b/foundation/ace/ace_engine_lite/frameworks/BUILD.gn
index 5b96908b2e..d7d619ffa5 100755
--- a/foundation/ace/ace_engine_lite/frameworks/BUILD.gn
+++ b/foundation/ace/ace_engine_lite/frameworks/BUILD.gn
@@ -54,8 +54,8 @@ shared_library("ace_lite") {
"//build/lite/config/component/cJSON:cjson_shared",
"//foundation/graphic/surface:lite_surface",
"//foundation/graphic/ui:lite_ui",
- "//foundation/multimedia/camera_lite/frameworks:camera_lite",
- "//foundation/multimedia/media_lite/frameworks/player_lite:player_lite",
+ #"//foundation/multimedia/camera_lite/frameworks:camera_lite",
+ #"//foundation/multimedia/media_lite/frameworks/player_lite:player_lite",
"//third_party/bounds_checking_function:libsec_shared",
"//third_party/jerryscript/jerry-core:jerry-core_shared",
"//third_party/jerryscript/jerry-ext:jerry-ext_shared",
diff --git a/foundation/ace/ace_engine_lite/frameworks/module_manager/BUILD.gn b/foundation/ace/ace_engine_lite/frameworks/module_manager/BUILD.gn
index 074281270a..9050ad7bd7 100644
--- a/foundation/ace/ace_engine_lite/frameworks/module_manager/BUILD.gn
+++ b/foundation/ace/ace_engine_lite/frameworks/module_manager/BUILD.gn
@@ -50,7 +50,7 @@ shared_library("ace_module_manager") {
"$ace_frameworks_root/native_engine:ace_native_engine_lite",
"${appexecfwk_lite_path}/interfaces/kits/bundle_lite/js/builtin:capability_api",
"//base/security/huks/frameworks/crypto_lite/js/builtin:ace_kit_cipher",
- "//foundation/multimedia/media_lite/interfaces/kits/player_lite/js/builtin:audio_lite_api",
+ #"//foundation/multimedia/media_lite/interfaces/kits/player_lite/js/builtin:audio_lite_api",
"//third_party/bounds_checking_function:libsec_shared",
"//third_party/jerryscript/jerry-core:jerry-core_shared",
"//utils/native/lite/js/builtin:ace_utils_kits",
但是编译会报错
[OHOS ERROR] In file included from ../../../foundation/ace/ace_engine_lite/frameworks/src/core/components/video_component.cpp:17:
[OHOS ERROR] In file included from ../../../foundation/ace/ace_engine_lite/frameworks/src/core/components/video_component.h:28:
[OHOS ERROR] ../../../foundation/ace/ace_engine_lite/frameworks/src/core/components/video_view.h:28:10: fatal error: 'player.h' file not found
[OHOS ERROR] #include "player.h"
[OHOS ERROR] ^~~~~~~~~~
[OHOS ERROR] 1 error generated.
[OHOS ERROR] [516/2340] clang++ obj/foundation/ace/ace_engine_lite/frameworks/src/core/context/libace_lite.ace_ability.o
[OHOS ERROR] FAILED: obj/foundation/ace/ace_engine_lite/frameworks/src/core/context/libace_lite.ace_ability.o
[OHOS ERROR] /home/d1/openHarmony/t113/prebuilts/clang/ohos/linux-x86_64/llvm/bin/clang++ -DJS_PROFILER=1 -D_LIBCPP_HAS_MUSL_LIBC -D__BUILD_LINUX_WITH_CLANG -D_XOPEN_SOURCE=700 -DOHOS_DEBUG -D_FORTIFY_SOURCE=2 -D__linux__ -D__LINUX__ -DENABLE_VECTOR_FONT=1 -DENABLE_BITMAP_FONT=0 -DENABLE_SHAPING=0 -DENABLE_ICU=1 -DENABLE_MULTI_FONT=0 -DDEFAULT_ANIMATION=1 -DRESOURCE_DIR=\"/storage/data/\" -I../../../foundation/graphic/ui/interfaces/kits/config -I../../../foundation/graphic/ui/interfaces/kits/animator -I../../../foundation/graphic/ui/interfaces/kits/common -I../../../foundation/graphic/ui/interfaces/kits/components -I../../../foundation/graphic/ui/interfaces/kits/dfx -I../../../foundation/graphic/ui/interfaces/kits/events -I../../../foundation/graphic/ui/interfaces/kits/font -I../../../foundation/graphic/ui/interfaces/kits/layout -I../../../foundation/graphic/ui/interfaces/kits/themes -I../../../foundation/graphic/ui/interfaces/innerkits/common -I../../../foundation/communication/ipc_lite/interfaces/kits -I../../../utils/native/lite/include -I../../../foundation/aafwk/aafwk_lite/interfaces/kits/ability_lite -I../../../foundation/aafwk/aafwk_lite/interfaces/kits/want_lite -I../../../foundation/aafwk/aafwk_lite/interfaces/innerkits/abilitymgr_lite -I../../../foundation/appexecfwk/appexecfwk_lite/interfaces/kits/bundle_lite -I../../../foundation/appexecfwk/appexecfwk_lite/utils/bundle_lite -I../../../third_party/bounds_checking_function/include -I../../../foundation/ace/ace_engine_lite/interfaces/innerkits/builtin/async -I../../../foundation/ace/ace_engine_lite/interfaces/innerkits/builtin/base -I../../../foundation/ace/ace_engine_lite/interfaces/innerkits/builtin/jsi -I../../../foundation/ace/ace_engine_lite/frameworks/include/context -I../../../foundation/ace/ace_engine_lite/frameworks/include/base -I../../../foundation/ace/ace_engine_lite/frameworks/include/modules -I../../../foundation/ace/ace_engine_lite/frameworks/include/resource -I../../../foundation/ace/ace_engine_lite/frameworks/src/core -I../../../foundation/ace/ace_engine_lite/frameworks/src/core/animation -I../../../foundation/ace/ace_engine_lite/frameworks/src/core/base -I../../../foundation/ace/ace_engine_lite/frameworks/src/core/components -I../../../foundation/ace/ace_engine_lite/frameworks/src/core/context -I../../../foundation/ace/ace_engine_lite/frameworks/src/core/directive -I../../../foundation/ace/ace_engine_lite/frameworks/src/core/router -I../../../foundation/ace/ace_engine_lite/frameworks/src/core/modules -I../../../foundation/ace/ace_engine_lite/frameworks/src/core/router -I../../../foundation/ace/ace_engine_lite/frameworks/src/core/stylemgr -I../../../foundation/ace/ace_engine_lite/frameworks/src/core/wrapper -I../../../foundation/ace/ace_engine_lite/frameworks/targets -I../../../foundation/ace/ace_engine_lite/frameworks/common/log -I../../../foundation/ace/ace_engine_lite/frameworks/common/memory -I../../../foundation/ace/ace_engine_lite/frameworks/common/memory/cache -I../../../foundation/ace/ace_engine_lite/frameworks/common/utils -I../../../foundation/ace/ace_engine_lite/frameworks/native_engine -I../../../foundation/ace/ace_engine_lite/frameworks/native_engine/jsi -I../../../foundation/ace/ace_engine_lite/frameworks/module_manager -I../../../third_party/jerryscript/jerry-core/include -I../../../third_party/jerryscript/jerry-ext/include/jerryscript-ext -I../../../third_party/jerryscript/jerry-port/default/include -I../../../third_party/cJSON -I../../../utils/native/lite/timer_task/include -I../../../third_party/freetype/include -I../../../base/global/resmgr_lite/interfaces/innerkits/include -I../../../base/global/i18n_lite/interfaces/kits/i18n/include -I../../../foundation/ace/ace_engine_lite/frameworks/targets/linux -I../../../third_party/cJSON -I../../../foundation/graphic/surface/interfaces/innerkits -I../../../foundation/graphic/surface/interfaces/kits -I../../../foundation/graphic/utils/interfaces/kits -I../../../foundation/graphic/utils/interfaces/innerkits -I../../../foundation/graphic/utils/interfaces/kits -I../../../base/hiviewdfx/hilog_lite/interfaces/native/innerkits/hilog -I../../../base/hiviewdfx/hilog_lite/interfaces/native/innerkits -I../../../third_party/bounds_checking_function/include -I../../../third_party/bounds_checking_function/include -I../../../foundation/graphic/ui/interfaces/kits -I../../../foundation/graphic/ui/interfaces/innerkits -Wall -Oz -flto -mfloat-abi=softfp -mfpu=neon-vfpv4 -mfloat-abi=softfp -mfpu=neon-vfpv4 -mcpu=cortex-a7 -fno-common -fno-builtin -fno-strict-aliasing -Wall -fstack-protector-all -fexceptions -fPIC -std=c++14 --target=arm-linux-ohosmusl --sysroot=/home/d1/openHarmony/t113/out/t113_nand_linux/xingyun_t113_nand_board/sysroot -c ../../../foundation/ace/ace_engine_lite/frameworks/src/core/context/ace_ability.cpp -o obj/foundation/ace/ace_engine_lite/frameworks/src/core/context/libace_lite.ace_ability.o
[OHOS ERROR] ../../../foundation/ace/ace_engine_lite/frameworks/src/core/context/ace_ability.cpp:57:5: error: use of undeclared identifier 'SetUIContent'
[OHOS ERROR] SetUIContent(rootView);
[OHOS ERROR] ^
[OHOS ERROR] 1 error generated.
[OHOS ERROR] [517/2340] clang++ obj/foundation/ace/ace_engine_lite/frameworks/src/core/context/libace_lite.js_app_context.o
[OHOS ERROR] FAILED: obj/foundation/ace/ace_engine_lite/frameworks/src/core/context/libace_lite.js_app_context.o
[OHOS ERROR] /home/d1/openHarmony/t113/prebuilts/clang/ohos/linux-x86_64/llvm/bin/clang++ -DJS_PROFILER=1 -D_LIBCPP_HAS_MUSL_LIBC -D__BUILD_LINUX_WITH_CLANG -D_XOPEN_SOURCE=700 -DOHOS_DEBUG -D_FORTIFY_SOURCE=2 -D__linux__ -D__LINUX__ -DENABLE_VECTOR_FONT=1 -DENABLE_BITMAP_FONT=0 -DENABLE_SHAPING=0 -DENABLE_ICU=1 -DENABLE_MULTI_FONT=0 -DDEFAULT_ANIMATION=1 -DRESOURCE_DIR=\"/storage/data/\" -I../../../foundation/graphic/ui/interfaces/kits/config -I../../../foundation/graphic/ui/interfaces/kits/animator -I../../../foundation/graphic/ui/interfaces/kits/common -I../../../foundation/graphic/ui/interfaces/kits/components -I../../../foundation/graphic/ui/interfaces/kits/dfx -I../../../foundation/graphic/ui/interfaces/kits/events -I../../../foundation/graphic/ui/interfaces/kits/font -I../../../foundation/graphic/ui/interfaces/kits/layout -I../../../foundation/graphic/ui/interfaces/kits/themes -I../../../foundation/graphic/ui/interfaces/innerkits/common -I../../../foundation/communication/ipc_lite/interfaces/kits -I../../../utils/native/lite/include -I../../../foundation/aafwk/aafwk_lite/interfaces/kits/ability_lite -I../../../foundation/aafwk/aafwk_lite/interfaces/kits/want_lite -I../../../foundation/aafwk/aafwk_lite/interfaces/innerkits/abilitymgr_lite -I../../../foundation/appexecfwk/appexecfwk_lite/interfaces/kits/bundle_lite -I../../../foundation/appexecfwk/appexecfwk_lite/utils/bundle_lite -I../../../third_party/bounds_checking_function/include -I../../../foundation/ace/ace_engine_lite/interfaces/innerkits/builtin/async -I../../../foundation/ace/ace_engine_lite/interfaces/innerkits/builtin/base -I../../../foundation/ace/ace_engine_lite/interfaces/innerkits/builtin/jsi -I../../../foundation/ace/ace_engine_lite/frameworks/include/context -I../../../foundation/ace/ace_engine_lite/frameworks/include/base -I../../../foundation/ace/ace_engine_lite/frameworks/include/modules -I../../../foundation/ace/ace_engine_lite/frameworks/include/resource -I../../../foundation/ace/ace_engine_lite/frameworks/src/core -I../../../foundation/ace/ace_engine_lite/frameworks/src/core/animation -I../../../foundation/ace/ace_engine_lite/frameworks/src/core/base -I../../../foundation/ace/ace_engine_lite/frameworks/src/core/components -I../../../foundation/ace/ace_engine_lite/frameworks/src/core/context -I../../../foundation/ace/ace_engine_lite/frameworks/src/core/directive -I../../../foundation/ace/ace_engine_lite/frameworks/src/core/router -I../../../foundation/ace/ace_engine_lite/frameworks/src/core/modules -I../../../foundation/ace/ace_engine_lite/frameworks/src/core/router -I../../../foundation/ace/ace_engine_lite/frameworks/src/core/stylemgr -I../../../foundation/ace/ace_engine_lite/frameworks/src/core/wrapper -I../../../foundation/ace/ace_engine_lite/frameworks/targets -I../../../foundation/ace/ace_engine_lite/frameworks/common/log -I../../../foundation/ace/ace_engine_lite/frameworks/common/memory -I../../../foundation/ace/ace_engine_lite/frameworks/common/memory/cache -I../../../foundation/ace/ace_engine_lite/frameworks/common/utils -I../../../foundation/ace/ace_engine_lite/frameworks/native_engine -I../../../foundation/ace/ace_engine_lite/frameworks/native_engine/jsi -I../../../foundation/ace/ace_engine_lite/frameworks/module_manager -I../../../third_party/jerryscript/jerry-core/include -I../../../third_party/jerryscript/jerry-ext/include/jerryscript-ext -I../../../third_party/jerryscript/jerry-port/default/include -I../../../third_party/cJSON -I../../../utils/native/lite/timer_task/include -I../../../third_party/freetype/include -I../../../base/global/resmgr_lite/interfaces/innerkits/include -I../../../base/global/i18n_lite/interfaces/kits/i18n/include -I../../../foundation/ace/ace_engine_lite/frameworks/targets/linux -I../../../third_party/cJSON -I../../../foundation/graphic/surface/interfaces/innerkits -I../../../foundation/graphic/surface/interfaces/kits -I../../../foundation/graphic/utils/interfaces/kits -I../../../foundation/graphic/utils/interfaces/innerkits -I../../../foundation/graphic/utils/interfaces/kits -I../../../base/hiviewdfx/hilog_lite/interfaces/native/innerkits/hilog -I../../../base/hiviewdfx/hilog_lite/interfaces/native/innerkits -I../../../third_party/bounds_checking_function/include -I../../../third_party/bounds_checking_function/include -I../../../foundation/graphic/ui/interfaces/kits -I../../../foundation/graphic/ui/interfaces/innerkits -Wall -Oz -flto -mfloat-abi=softfp -mfpu=neon-vfpv4 -mfloat-abi=softfp -mfpu=neon-vfpv4 -mcpu=cortex-a7 -fno-common -fno-builtin -fno-strict-aliasing -Wall -fstack-protector-all -fexceptions -fPIC -std=c++14 --target=arm-linux-ohosmusl --sysroot=/home/d1/openHarmony/t113/out/t113_nand_linux/xingyun_t113_nand_board/sysroot -c ../../../foundation/ace/ace_engine_lite/frameworks/src/core/context/js_app_context.cpp -o obj/foundation/ace/ace_engine_lite/frameworks/src/core/context/libace_lite.js_app_context.o
[OHOS ERROR] In file included from ../../../foundation/ace/ace_engine_lite/frameworks/src/core/context/js_app_context.cpp:25:
[OHOS ERROR] In file included from ../../../foundation/ace/ace_engine_lite/frameworks/src/core/components/component_factory.h:25:
[OHOS ERROR] ../../../foundation/ace/ace_engine_lite/frameworks/src/core/components/camera_component.h:23:10: fatal error: 'camera_kit.h' file not found
[OHOS ERROR] #include "camera_kit.h"
[OHOS ERROR] ^~~~~~~~~~~~~~
[OHOS ERROR] 1 error generated.
[OHOS ERROR] you can check build log in /home/d1/openHarmony/t113/out/t113_nand_linux/xingyun_t113_nand_board/build.log
[OHOS ERROR] command: "/home/d1/openHarmony/t113/prebuilts/build-tools/linux-x86/bin/ninja -w dupbuild=warn -C /home/d1/openHarmony/t113/out/t113_nand_linux/xingyun_t113_nand_board" failed
[OHOS ERROR] return code: 1
[OHOS ERROR] execution path: /home/d1/openHarmony/t113
所以不太推荐此种方式,所以添加另外一种方式,也是最简单的,直接在device/hisilicon/hardware/BUILD.gn中添加我们的板卡名即可。
目前我是这样解决的
diff --git a/foundation/multimedia/camera_lite/frameworks/BUILD.gn b/foundation/multimedia/camera_lite/frameworks/BUILD.gn
index b51cd0fbc9..093c4cca8d 100755
--- a/foundation/multimedia/camera_lite/frameworks/BUILD.gn
+++ b/foundation/multimedia/camera_lite/frameworks/BUILD.gn
@@ -45,14 +45,27 @@ shared_library("camera_lite") {
cflags = [ "-fPIC" ]
cflags += [ "-Wall" ]
cflags_cc = cflags
- deps = [
- "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared",
- "//base/security/permission/services/permission_lite/pms_client:pms_client",
- "//device/hisilicon/hardware:hardware_media_sdk",
- "//device/hisilicon/modules/middleware:middleware_source_sdk",
- "//foundation/distributedschedule/samgr_lite/samgr:samgr",
- "//third_party/bounds_checking_function:libsec_shared",
- ]
+print("$board_name")
+
+ if (board_name == "t113_nand_linux" ) {
+ deps = [
+ "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared",
+ "//base/security/permission/services/permission_lite/pms_client:pms_client",
+ "//device/xingyunelec/hardware/media:hardware_media_sdk",
+ "//device/xingyunelec/modules/middleware:middleware_source_sdk",
+ "//foundation/distributedschedule/samgr_lite/samgr:samgr",
+ "//third_party/bounds_checking_function:libsec_shared",
+ ]
+ } else {
+ deps = [
+ "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared",
+ "//base/security/permission/services/permission_lite/pms_client:pms_client",
+ "//device/hisilicon/hardware:hardware_media_sdk",
+ "//device/hisilicon/modules/middleware:middleware_source_sdk",
+ "//foundation/distributedschedule/samgr_lite/samgr:samgr",
+ "//third_party/bounds_checking_function:libsec_shared",
+ ]
+ }
public_deps = [
"//foundation/graphic/surface:lite_surface",
"//foundation/multimedia/media_lite/frameworks/recorder_lite:recorder_lite",
另一个主要编译依赖配置文件
diff --git a/foundation/multimedia/utils/lite/BUILD.gn b/foundation/multimedia/utils/lite/BUILD.gn
index dff89f1e37..df59e497ea 100755
--- a/foundation/multimedia/utils/lite/BUILD.gn
+++ b/foundation/multimedia/utils/lite/BUILD.gn
@@ -23,10 +23,20 @@ shared_library("media_common") {
"interfaces/kits",
"//third_party/bounds_checking_function/include",
]
- public_deps = [
- "$ohos_board_adapter_dir:hardware_media_sdk",
- "$ohos_board_adapter_dir/../modules/middleware:middleware_source_sdk",
- "//foundation/graphic/surface:lite_surface",
- "//third_party/bounds_checking_function:libsec_shared",
- ]
+
+ if (board_name == "t113_nand_linux" ) {
+ public_deps = [
+ "$ohos_board_adapter_dir/media:hardware_media_sdk",
+ "$ohos_board_adapter_dir/../modules/middleware:middleware_source_sdk",
+ "//foundation/graphic/surface:lite_surface",
+ "//third_party/bounds_checking_function:libsec_shared",
+ ]
+ } else {
+ public_deps = [
+ "$ohos_board_adapter_dir:hardware_media_sdk",
+ "$ohos_board_adapter_dir/../modules/middleware:middleware_source_sdk",
+ "//foundation/graphic/surface:lite_surface",
+ "//third_party/bounds_checking_function:libsec_shared",
+ ]
+ }
}
然后在device/xingyunelec/hardware/目录添加media/文件夹,文件夹下新增的文件如下,其中这些库文件都是先使用海思目录下的库文件。
new file: device/xingyunelec/hardware/media/BUILD.gn
new file: device/xingyunelec/hardware/media/audio/BUILD.gn
new file: device/xingyunelec/hardware/media/audio/libaudio_hw.so
new file: device/xingyunelec/hardware/media/audio/libaudio_input_port.so
new file: device/xingyunelec/hardware/media/audio/libaudio_output_port.so
new file: device/xingyunelec/hardware/media/camera/BUILD.gn
new file: device/xingyunelec/hardware/media/camera/libhdi_camera.so
new file: device/xingyunelec/hardware/media/codec/BUILD.gn
new file: device/xingyunelec/hardware/media/codec/libcodec.so
new file: device/xingyunelec/hardware/media/codec/libhiaacdec.so
new file: device/xingyunelec/hardware/media/codec/libhimp3dec.so
new file: device/xingyunelec/hardware/media/codec/libplugin_adec_35xx.so
new file: device/xingyunelec/hardware/media/codec/libplugin_aenc_35xx.so
new file: device/xingyunelec/hardware/media/codec/libplugin_vdec_35xx.so
new file: device/xingyunelec/hardware/media/codec/libplugin_venc_35xx.so
new file: device/xingyunelec/hardware/media/common/BUILD.gn
new file: device/xingyunelec/hardware/media/common/libmedia_hal_common.so
new file: device/xingyunelec/hardware/media/format/BUILD.gn
new file: device/xingyunelec/hardware/media/format/libformat_hw.so
new file: device/xingyunelec/hardware/media/format/libplugin_demuxer_ffmpeg.so
new file: device/xingyunelec/hardware/media/format/libplugin_demuxer_mpf.so
new file: device/xingyunelec/hardware/media/format/libplugin_demuxer_raw.so
new file: device/xingyunelec/hardware/media/format/libplugin_muxer_recorder.so
new file: device/xingyunelec/hardware/media/videodisplay/BUILD.gn
new file: device/xingyunelec/hardware/media/videodisplay/libhdi_videodisplayer.so
new file: device/xingyunelec/modules/middleware/BUILD.gn
添加的文件夹整体目录如下,
文件device/xingyunelec/hardware/media/BUILD.gn内容如下,对接上文两处修改的文件。
import("//build/lite/config/component/lite_component.gni")
group("hardware_media_sdk") {
deps = [
"audio:lib_audio",
"codec:lib_codec",
"format:lib_format",
"common:lib_common",
"camera:lib_camera",
"videodisplay:lib_videodisplay",
]
}
这里放出一个子目录具体实现。后面依此类推即可。
BUILD.gn内容如下
import("//build/lite/config/component/lite_component.gni")
copy("audio_hw") {
sources = [ "//device/${device_company}/hardware/media/audio/libaudio_hw.so" ]
outputs = [ "$root_out_dir/libaudio_hw.so" ]
}
copy("audio_input_port") {
sources = [ "//device/${device_company}/hardware/media/audio/libaudio_input_port.so" ]
outputs = [ "$root_out_dir/libaudio_input_port.so" ]
}
copy("audio_output_port") {
sources = [ "//device/${device_company}/hardware/media/audio/libaudio_output_port.so" ]
outputs = [ "$root_out_dir/libaudio_output_port.so" ]
}
group("lib_audio") {
deps = [
":audio_hw",
":audio_input_port",
":audio_output_port",
]
}
修改完成后,执行编译,可以成功编译,后期就可以我们自己添加自己的文件进行编译即可,不会和海思目录文件强绑定了。