From 7e2ca6d275db091ce5b7237b01c1f5b8e85623e1 Mon Sep 17 00:00:00 2001 From: "Chen, Tianmi" Date: Sat, 9 Apr 2022 22:50:01 +0800 Subject: [PATCH] Add Android.bp in mediasdk Tracked-On: Signed-off-by: Chen, Tianmi --- Android.bp.bk | 75 ++++++++++++ _studio/Android.bp | 170 ++++++++++++++++++++++++++++ _studio/enctools/Android.bp | 14 +++ _studio/shared/asc/Android.bp | 58 ++++++++++ _studio/shared/mfx_trace/Android.bp | 11 ++ _studio/shared/umc/codec/Android.bp | 78 +++++++++++++ _studio/shared/umc/core/Android.bp | 20 ++++ _studio/shared/umc/io/Android.bp | 17 +++ android/Android.bp | 76 +++++++++++++ 9 files changed, 519 insertions(+) create mode 100644 Android.bp.bk create mode 100644 _studio/Android.bp create mode 100644 _studio/enctools/Android.bp create mode 100644 _studio/shared/asc/Android.bp create mode 100644 _studio/shared/mfx_trace/Android.bp create mode 100644 _studio/shared/umc/codec/Android.bp create mode 100644 _studio/shared/umc/core/Android.bp create mode 100644 _studio/shared/umc/io/Android.bp diff --git a/Android.bp.bk b/Android.bp.bk new file mode 100644 index 000000000..31560ee58 --- /dev/null +++ b/Android.bp.bk @@ -0,0 +1,75 @@ +cc_defaults { + name: "mfx_defs_defaults", + + cflags: [ + "-DANDROID", + "-DMEDIA_VERSION=21.1.3", + "-DMFX_ANDROID_VERSION=MFX_R", + "-DMFX_VERSION=1035", + "-DMEDIA_VERSION_STR=21.1.3.pre", + "-DMFX_VA", + "-include mfx_android_config.h", + "-Wno-error", + "-Wno-unused-parameter", + "-Wno-deprecated-declarations", + "-Wno-implicit-fallthrough", + "-Wno-missing-field-initializers", + "-fstack-protector", + "-fexceptions", + "-fPIC", + "-fPIE", + "-D_FORTIFY_SOURCE=2", + "-Wformat", + "-Wformat-security", + "-DENABLE_MAX_NUM_REORDER_FRAMES_OUTPUT", + "-DLIBVA_SUPPORT", + "-DLIBVA_ANDROID_SUPPORT", + ], + + rtti: true, + + ldflags: [ + "-z noexecstack", + "-z relro", + "-z now", + ], + + header_libs: [ + "soong_libmfx_headers", + ], + + include_dirs: [ + "out/target/product/caas/obj/include/libva", + "vendor/intel/external/mediasdk_opensource/_studio/shared/include", + "vendor/intel/external/mediasdk_opensource/_studio/shared/asc/include", + "vendor/intel/external/mediasdk_opensource/_studio/shared/umc/core/umc/include", + "vendor/intel/external/mediasdk_opensource/_studio/shared/umc/core/vm/include", + "vendor/intel/external/mediasdk_opensource/_studio/shared/umc/core/vm_plus/include", + "vendor/intel/external/mediasdk_opensource/_studio/shared/umc/io/umc_va/include", + "vendor/intel/external/mediasdk_opensource/_studio/shared/mfx_trace/include", + "vendor/intel/external/mediasdk_opensource/_studio/mfx_lib/shared/include", + "vendor/intel/external/mediasdk_opensource/_studio/enctools/aenc/include", + "vendor/intel/external/mediasdk_opensource/_studio/enctools/include", + ], + + compile_multilib: "both", + + arch: { + x86: { + cflags: [ + "-DLINUX32", + ] + }, + + x86_64: { + cflags: [ + "-DLINUX32", + "-DLINUX64", + ] + } + }, + + vendor: true, + + owner: "intel", +} diff --git a/_studio/Android.bp b/_studio/Android.bp new file mode 100644 index 000000000..7e55692ba --- /dev/null +++ b/_studio/Android.bp @@ -0,0 +1,170 @@ +cc_library_headers { + name: "libmfx_lib_hw_headers", + + export_include_dirs: [ + "mfx_lib/decode/h265/include", + "mfx_lib/decode/h264/include", + "mfx_lib/decode/mpeg2/include", + "mfx_lib/decode/vc1/include", + "mfx_lib/decode/mjpeg/include", + "mfx_lib/decode/vp8/include", + "mfx_lib/decode/vp9/include", + "mfx_lib/decode/av1/include", + "mfx_lib/vpp/include", + "mfx_lib/encode_hw/vp9/include", + "mfx_lib/encode_hw/h264/include", + "mfx_lib/encode_hw/h265/include", + "mfx_lib/encode_hw/mjpeg/include", + "mfx_lib/encode_hw/hevc", + "mfx_lib/encode_hw/hevc/agnostic", + "mfx_lib/encode_hw/hevc/agnostic/base", + "mfx_lib/encode_hw/hevc/agnostic/g12", + "mfx_lib/encode_hw/hevc/linux/base", + "mfx_lib/encode_hw/hevc/linux/g12", + "mfx_lib/encode_hw/shared", + "mfx_lib/genx/h264_encode/isa", + "mfx_lib/genx/field_copy/isa", + "mfx_lib/genx/copy_kernels/isa", + "mfx_lib/genx/mctf/isa", + "mfx_lib/genx/asc/isa", + "mfx_lib/fei/include", + "mfx_lib/scheduler/linux/include", + "mfx_lib/cmrt_cross_platform/include", + "mfx_lib/mctf_package/mctf/include", + "shared/include", + "shared/asc/include", + ], + + vendor: true, +} + +cc_library_static { + name: "libmfx_lib_merged_hw_bp", + + defaults: ["mfx_defs_defaults"], + + header_libs: [ + "libmfx_lib_hw_headers", + "libumc_codecs_headers", + ], + + srcs: [ + "mfx_lib/scheduler/linux/src/*.cpp", + "mfx_lib/fei/src/*.cpp", + "mfx_lib/decode/h265/src/*.cpp", + "mfx_lib/decode/h264/src/*.cpp", + "mfx_lib/decode/mpeg2/src/*.cpp", + "mfx_lib/decode/vc1/src/*.cpp", + "mfx_lib/decode/mjpeg/src/*.cpp", + "mfx_lib/decode/vp8/src/*.cpp", + "mfx_lib/decode/vp9/src/*.cpp", + "mfx_lib/decode/av1/src/*.cpp", + "mfx_lib/vpp/src/*.cpp", + "mfx_lib/encode_hw/h265/src/*.cpp", + "mfx_lib/encode_hw/h264/src/*.cpp", + "mfx_lib/encode_hw/vp9/src/*.cpp", + "mfx_lib/encode_hw/mjpeg/src/*.cpp", + "mfx_lib/cmrt_cross_platform/src/*.cpp", + "mfx_lib/mctf_package/mctf/src/*.cpp", + "mfx_lib/genx/h264_encode/isa/*.cpp", + "mfx_lib/encode_hw/hevc/*.cpp", + "mfx_lib/encode_hw/hevc/agnostic/*.cpp", + "mfx_lib/encode_hw/hevc/agnostic/base/*.cpp", + "mfx_lib/encode_hw/hevc/agnostic/g12/*.cpp", + "mfx_lib/encode_hw/hevc/linux/base/*.cpp", + "mfx_lib/encode_hw/hevc/linux/g12/*.cpp", + "mfx_lib/encode_hw/shared/*.cpp", + "mfx_lib/shared/src/mfx_brc_common.cpp", + "mfx_lib/shared/src/mfx_common_int.cpp", + "mfx_lib/shared/src/mfx_enc_common.cpp", + "mfx_lib/shared/src/mfx_vc1_dec_common.cpp", + "mfx_lib/shared/src/mfx_vpx_dec_common.cpp", + "mfx_lib/shared/src/mfx_common_decode_int.cpp", + "mfx_lib/shared/src/mfx_h264_enc_common_hw.cpp", + "mfx_lib/shared/src/mfx_h264_encode_vaapi.cpp", + "mfx_lib/shared/src/mfx_h264_encode_factory.cpp", + "mfx_lib/genx/asc/isa/*.cpp", + "mfx_lib/genx/copy_kernels/isa/*.cpp", + "mfx_lib/genx/field_copy/isa/*.cpp", + "mfx_lib/genx/mctf/isa/*.cpp", + ], +} + +cc_defaults { + name: "libmfx_lib_shared_defaults", + + defaults: [ + "mfx_defs_defaults", + ], + + header_libs: [ + "libmfx_lib_hw_headers", + "libumc_codecs_headers", + ], + + srcs: [ + "mfx_lib/shared/src/libmfxsw.cpp", + "mfx_lib/shared/src/libmfxsw_async.cpp", + "mfx_lib/shared/src/libmfxsw_decode.cpp", + "mfx_lib/shared/src/libmfxsw_enc.cpp", + "mfx_lib/shared/src/libmfxsw_encode.cpp", + "mfx_lib/shared/src/libmfxsw_pak.cpp", + "mfx_lib/shared/src/libmfxsw_plugin.cpp", + "mfx_lib/shared/src/libmfxsw_query.cpp", + "mfx_lib/shared/src/libmfxsw_session.cpp", + "mfx_lib/shared/src/libmfxsw_vpp.cpp", + "mfx_lib/shared/src/mfx_session.cpp", + "mfx_lib/shared/src/mfx_user_plugin.cpp", + "mfx_lib/shared/src/mfx_critical_error_handler.cpp", + "shared/src/cm_mem_copy.cpp", + "shared/src/fast_copy.cpp", + "shared/src/fast_copy_c_impl.cpp", + "shared/src/fast_copy_sse4_impl.cpp", + "shared/src/mfx_vpp_vaapi.cpp", + "shared/src/libmfx_allocator.cpp", + "shared/src/libmfx_allocator_vaapi.cpp", + "shared/src/libmfx_core.cpp", + "shared/src/libmfx_core_hw.cpp", + "shared/src/libmfx_core_factory.cpp", + "shared/src/libmfx_core_vaapi.cpp", + "shared/src/mfx_umc_alloc_wrapper.cpp", + "shared/src/mfx_umc_mjpeg_vpp.cpp", + ], + + static_libs: [ + "libmfx_lib_merged_hw_bp", + "libumc_codecs_merged_hw_bp", + "libumc_codecs_merged_bp", + "libumc_io_merged_hw_bp", + "libumc_core_merged_hw_bp", + "libmfx_trace_hw_bp", + "libasc_bp", + "libaenc_bp", + ], + + shared_libs: [ + "libva_bp", + ], + + ldflags: [ + "-Wl", + ], + + version_script: "mfx_lib/libmfxhw.map", +} + +cc_library_shared { + name: "libmfxhw32bp", + + defaults: ["libmfx_lib_shared_defaults"], + + compile_multilib: "32", +} + +cc_library_shared { + name: "libmfxhw64bp", + + defaults: ["libmfx_lib_shared_defaults"], + + compile_multilib: "64", +} diff --git a/_studio/enctools/Android.bp b/_studio/enctools/Android.bp new file mode 100644 index 000000000..1dbcf1b1f --- /dev/null +++ b/_studio/enctools/Android.bp @@ -0,0 +1,14 @@ +cc_library_static { + name: "libaenc_bp", + + defaults: ["mfx_defs_defaults"], + + srcs: [ + "enctools.cpp", + "src/mfx_enctools_brc.cpp", + "src/mfx_enctools_common.cpp", + "src/mfx_enctools_aenc.cpp", + "src/mfx_enctools_utils.cpp", + ] +} + diff --git a/_studio/shared/asc/Android.bp b/_studio/shared/asc/Android.bp new file mode 100644 index 000000000..42bb542d4 --- /dev/null +++ b/_studio/shared/asc/Android.bp @@ -0,0 +1,58 @@ +cc_defaults { + name: "libasc_defaults", + + defaults: ["mfx_defs_defaults"], + + include_dirs: [ + "vendor/intel/external/mediasdk_opensource/_studio/mfx_lib/cmrt_cross_platform/include", + "vendor/intel/external/mediasdk_opensource/_studio/mfx_lib/genx/asc/isa", + ], + + export_include_dirs: [ + "include", + ], + + header_libs: [ + "soong_libmfx_headers" + ], + + cflags: [ + "-msse4.1", + "-mavx2", + ], +} + +cc_library_static { + name: "libasc_bp", + + defaults: ["mfx_defs_defaults"], + + include_dirs: [ + "vendor/intel/external/mediasdk_opensource/_studio/mfx_lib/cmrt_cross_platform/include", + "vendor/intel/external/mediasdk_opensource/_studio/mfx_lib/genx/asc/isa", + ], + + export_include_dirs: [ + "include", + ], + + header_libs: [ + "soong_libmfx_headers" + ], + + cflags: [ + "-msse4.1", + "-mavx2", + ], + + srcs: [ + "src/asc_sse4_impl.cpp", + "src/asc_avx2_impl.cpp", + "src/asc.cpp", + "src/asc_c_impl.cpp", + "src/asc_common_impl.cpp", + "src/iofunctions.cpp", + "src/motion_estimation_engine.cpp", + "src/tree.cpp" + ], +} diff --git a/_studio/shared/mfx_trace/Android.bp b/_studio/shared/mfx_trace/Android.bp new file mode 100644 index 000000000..72e719a7e --- /dev/null +++ b/_studio/shared/mfx_trace/Android.bp @@ -0,0 +1,11 @@ +cc_library_static { + name: "libmfx_trace_hw_bp", + + defaults: ["mfx_defs_defaults"], + + srcs: ["src/*.cpp"], + + include_dirs: [ + "vendor/intel/external/mediasdk_opensource/api/mediasdk_structures", + ], +} diff --git a/_studio/shared/umc/codec/Android.bp b/_studio/shared/umc/codec/Android.bp new file mode 100644 index 000000000..99b0fb44a --- /dev/null +++ b/_studio/shared/umc/codec/Android.bp @@ -0,0 +1,78 @@ +cc_library_headers { + name: "libumc_codecs_headers", + + export_include_dirs: [ + "brc/include", + "h264_enc/include", + "vc1_common/include", + "jpeg_common/include", + "mpeg2_dec/include", + "h265_dec/include", + "h264_dec/include", + "vc1_dec/include", + "jpeg_dec/include", + "vp9_dec/include", + "av1_dec/include" + ], + + vendor: true, +} + +cc_library_static { + name: "libumc_codecs_merged_bp", + + defaults: ["mfx_defs_defaults"], + + srcs: [ + "brc/src/umc_brc.cpp", + "brc/src/umc_h264_brc.cpp", + "brc/src/umc_mpeg2_brc.cpp", + "brc/src/umc_video_brc.cpp", + "vc1_common/src/umc_vc1_common.cpp", + "vc1_common/src/umc_vc1_common_tables.cpp", + "vc1_common/src/umc_vc1_common_tables_adv.cpp", + "vc1_common/src/umc_vc1_spl_frame_constr.cpp", + "vc1_common/src/umc_vc1_spl_tbl.cpp", + "jpeg_common/src/bitstreamin.cpp", + "jpeg_common/src/bitstreamout.cpp", + "jpeg_common/src/colorcomp.cpp", + "jpeg_common/src/jpegbase.cpp", + "jpeg_common/src/membuffin.cpp", + "jpeg_common/src/membuffout.cpp", + ], + + local_include_dirs: [ + "brc/include", + "h264_enc/include", + "vc1_common/include", + "jpeg_common/include", + ] +} + +cc_library_static { + name: "libumc_codecs_merged_hw_bp", + + defaults: ["mfx_defs_defaults"], + + local_include_dirs: [ + "mpeg2_dec/include", + "h265_dec/include", + "h264_dec/include", + "vc1_dec/include", + "jpeg_dec/include", + "vp9_dec/include", + "av1_dec/include", + "jpeg_common/include", + "vc1_common/include", + ], + + srcs: [ + "mpeg2_dec/src/*.cpp", + "h265_dec/src/*.cpp", + "h264_dec/src/*.cpp", + "vc1_dec/src/*.cpp", + "jpeg_dec/src/*.cpp", + "vp9_dec/src/*.cpp", + "av1_dec/src/*.cpp", + ] +} diff --git a/_studio/shared/umc/core/Android.bp b/_studio/shared/umc/core/Android.bp new file mode 100644 index 000000000..9b65d38cb --- /dev/null +++ b/_studio/shared/umc/core/Android.bp @@ -0,0 +1,20 @@ +cc_library_static { + name: "libumc_core_merged_hw_bp", + + defaults: ["mfx_defs_defaults"], + + srcs: [ + "vm/src/*.c", + "vm_plus/src/*.c", + "umc/src/*.c", + "vm/src/*.cpp", + "vm_plus/src/*.cpp", + "umc/src/*.cpp", + ], + + local_include_dirs: [ + "vm/include", + "vm_plus/include", + "umc/include", + ] +} diff --git a/_studio/shared/umc/io/Android.bp b/_studio/shared/umc/io/Android.bp new file mode 100644 index 000000000..63b7d6363 --- /dev/null +++ b/_studio/shared/umc/io/Android.bp @@ -0,0 +1,17 @@ +cc_library_static { + name: "libumc_io_merged_hw_bp", + + defaults: ["mfx_defs_defaults"], + + srcs: [ + "umc_va/src/umc_va.cpp", + "umc_va/src/umc_va_fei.cpp", + "umc_va/src/umc_va_linux.cpp", + "umc_va/src/umc_va_linux_protected.cpp", + "umc_va/src/umc_va_video_processing.cpp", + ], + + local_include_dirs: [ + "umc_va/include", + ] +} diff --git a/android/Android.bp b/android/Android.bp index 9d06e3419..75838018c 100644 --- a/android/Android.bp +++ b/android/Android.bp @@ -15,3 +15,79 @@ cc_library_headers { vendor: true, } + +cc_defaults { + name: "mfx_defs_defaults", + + cflags: [ + "-DANDROID", + "-DMEDIA_VERSION=21.1.3", + "-DMFX_ANDROID_VERSION=MFX_R", + "-DMFX_VERSION=1035", + "-DMEDIA_VERSION_STR=\"21.1.3.pre\"", + "-DMFX_VA", + "-include mfx_android_config.h", + "-Wno-error", + "-Wno-unused-parameter", + "-Wno-deprecated-declarations", + "-Wno-implicit-fallthrough", + "-Wno-missing-field-initializers", + "-fstack-protector", + "-fexceptions", + "-fPIC", + "-fPIE", + "-D_FORTIFY_SOURCE=2", + "-Wformat", + "-Wformat-security", + "-DENABLE_MAX_NUM_REORDER_FRAMES_OUTPUT", + "-DLIBVA_SUPPORT", + "-DLIBVA_ANDROID_SUPPORT", + ], + + rtti: true, + + ldflags: [ + "-z noexecstack", + "-z relro", + "-z now", + ], + + header_libs: [ + "soong_libmfx_headers", + ], + + include_dirs: [ + "out/target/product/caas/obj/include/libva", + "vendor/intel/external/mediasdk_opensource/_studio/shared/include", + "vendor/intel/external/mediasdk_opensource/_studio/shared/asc/include", + "vendor/intel/external/mediasdk_opensource/_studio/shared/umc/core/umc/include", + "vendor/intel/external/mediasdk_opensource/_studio/shared/umc/core/vm/include", + "vendor/intel/external/mediasdk_opensource/_studio/shared/umc/core/vm_plus/include", + "vendor/intel/external/mediasdk_opensource/_studio/shared/umc/io/umc_va/include", + "vendor/intel/external/mediasdk_opensource/_studio/shared/mfx_trace/include", + "vendor/intel/external/mediasdk_opensource/_studio/mfx_lib/shared/include", + "vendor/intel/external/mediasdk_opensource/_studio/enctools/aenc/include", + "vendor/intel/external/mediasdk_opensource/_studio/enctools/include", + ], + + compile_multilib: "both", + + arch: { + x86: { + cflags: [ + "-DLINUX32", + ] + }, + + x86_64: { + cflags: [ + "-DLINUX32", + "-DLINUX64", + ] + } + }, + + vendor: true, + + owner: "intel", +}