diff --git a/BUILD.gn b/BUILD.gn index 5465f7228572f661b4e3797ed22c161e90988d1a..36480fd53d80a65ffcea80f5543185a4b041fdbc 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -47,6 +47,9 @@ ohos_source_set("astc_encoder_static") { (defined(global_parts_info.graphic_graphic_2d_ext) || defined(global_parts_info.product_hmos_sdk_product_hmos_sdk))) { defines = [ "ASTC_CUSTOMIZED_ENABLE" ] + sources += [ + "//third_party/astc-encoder/Source/astcenccli_platform_dependents.cpp", + ] if (target_cpu == "arm64" || is_emulator) { defines += [ "SUT_PATH_X64" ] } @@ -55,7 +58,6 @@ ohos_source_set("astc_encoder_static") { defined(global_parts_info.product_hmos_sdk_product_hmos_sdk)) { defines += [ "BUILD_HMOS_SDK" ] } - external_deps = [ "hilog:libhilog" ] part_name = "astc-encoder" subsystem_name = "thirdparty" } diff --git a/Source/astcenc_internal.h b/Source/astcenc_internal.h index c6f5153c9108a0317c06865cc6cb8c8ee751a03e..0a8a8ee0b31a0ee50ea06965afacd7a097a3e516 100644 --- a/Source/astcenc_internal.h +++ b/Source/astcenc_internal.h @@ -35,37 +35,6 @@ #ifdef ASTC_CUSTOMIZED_ENABLE #include #include -#include "hilog/log.h" -#define ASTCENC_LOG_DOMAIN 0x2102 -#define ASTCENC_OHOS_LOG_TAG "astcenc" - -#ifdef MS_COMPILE_WITH_OHOS_NDK -#define ASTCENC_DEBUG(content, args...) \ - { OH_LOG_Print(LOG_APP, LOG_DEBUG, ASTCENC_LOG_DOMAIN, ASTCENC_OHOS_LOG_TAG, \ - "%s:%d " #content, __func__, __LINE__, ##args); } -#define ASTCENC_WARN(content, args...) \ - { OH_LOG_Print(LOG_APP, LOG_WARN, ASTCENC_LOG_DOMAIN, ASTCENC_OHOS_LOG_TAG, \ - "%s:%d " #content, __func__, __LINE__, ##args); } -#define ASTCENC_INFO(content, args...) \ - { OH_LOG_Print(LOG_APP, LOG_INFO, ASTCENC_LOG_DOMAIN, ASTCENC_OHOS_LOG_TAG, \ - "%s:%d " #content, __func__, __LINE__, ##args); } -#define ASTCENC_ERROR(content, args...) \ - { OH_LOG_Print(LOG_APP, LOG_ERROR, ASTCENC_LOG_DOMAIN, ASTCENC_OHOS_LOG_TAG, \ - "%s:%d " #content, __func__, __LINE__, ##args); } -#else -#define ASTCENC_DEBUG(content, args...) \ - { HiLogPrint(LOG_APP, LOG_DEBUG, ASTCENC_LOG_DOMAIN, ASTCENC_OHOS_LOG_TAG, \ - "%s:%d " #content, __func__, __LINE__, ##args); } -#define ASTCENC_WARN(content, args...) \ - { HiLogPrint(LOG_APP, LOG_WARN, ASTCENC_LOG_DOMAIN, ASTCENC_OHOS_LOG_TAG, \ - "%s:%d " #content, __func__, __LINE__, ##args); } -#define ASTCENC_INFO(content, args...) \ - { HiLogPrint(LOG_APP, LOG_INFO, ASTCENC_LOG_DOMAIN, ASTCENC_OHOS_LOG_TAG, \ - "%s:%d " #content, __func__, __LINE__, ##args); } -#define ASTCENC_ERROR(content, args...) \ - { HiLogPrint(LOG_APP, LOG_ERROR, ASTCENC_LOG_DOMAIN, ASTCENC_OHOS_LOG_TAG, \ - "%s:%d " #content, __func__, __LINE__, ##args); } -#endif #if defined(_WIN32) && !defined(__CYGWIN__) #define NOMINMAX #include @@ -2319,22 +2288,20 @@ public: } ~AstcCustomizedSoManager() { - if (!astcCustomizedSoOpened_ || astcCustomizedSoHandle_ == nullptr) + if (astcCustomizedSoOpened_ && astcCustomizedSoHandle_ != nullptr) { - ASTCENC_DEBUG("astcenc customized so is not opened when dlclose!"); - return; - } #if defined(_WIN32) && !defined(__CYGWIN__) - if (!FreeLibrary(astcCustomizedSoHandle_)) - { - ASTCENC_ERROR("astc dll FreeLibrary failed: %{public}s", g_astcCustomizedSo); - } + if (!FreeLibrary(astcCustomizedSoHandle_)) + { + printf("astc dll FreeLibrary failed: %s\n", g_astcCustomizedSo); + } #else - if (dlclose(astcCustomizedSoHandle_) != 0) - { - ASTCENC_ERROR("astcenc so dlclose failed: %{public}s", g_astcCustomizedSo.c_str()); - } + if (dlclose(astcCustomizedSoHandle_) != 0) + { + printf("astcenc so dlclose failed: %s\n", g_astcCustomizedSo.c_str()); + } #endif + } } IsCustomizedBlockMode isCustomizedBlockModeFunc_; CustomizedMaxPartitions customizedMaxPartitionsFunc_; @@ -2347,13 +2314,13 @@ public: #if defined(_WIN32) && !defined(__CYGWIN__) if ((_access(g_astcCustomizedSo, 0) == -1)) { - ASTCENC_WARN("astc customized dll(%{public}s) is not found!", g_astcCustomizedSo); + printf("astc customized dll(%s) is not found!\n", g_astcCustomizedSo); return false; } astcCustomizedSoHandle_ = LoadLibrary(g_astcCustomizedSo); if (astcCustomizedSoHandle_ == nullptr) { - ASTCENC_ERROR("astc libAstcCustomizedEnc LoadLibrary failed!"); + printf("astc libAstcCustomizedEnc LoadLibrary failed!\n"); return false; } isCustomizedBlockModeFunc_ = @@ -2361,10 +2328,10 @@ public: "IsCustomizedBlockMode")); if (isCustomizedBlockModeFunc_ == nullptr) { - ASTCENC_ERROR("astc isCustomizedBlockModeFunc_ GetProcAddress failed!"); + printf("astc isCustomizedBlockModeFunc_ GetProcAddress failed!\n"); if (!FreeLibrary(astcCustomizedSoHandle_)) { - ASTCENC_ERROR("astc isCustomizedBlockModeFunc_ FreeLibrary failed!"); + printf("astc isCustomizedBlockModeFunc_ FreeLibrary failed!\n"); } return false; } @@ -2373,10 +2340,10 @@ public: "CustomizedMaxPartitions")); if (customizedMaxPartitionsFunc_ == nullptr) { - ASTCENC_ERROR("astc customizedMaxPartitionsFunc_ GetProcAddress failed!"); + printf("astc customizedMaxPartitionsFunc_ GetProcAddress failed!\n"); if (!FreeLibrary(astcCustomizedSoHandle_)) { - ASTCENC_ERROR("astc customizedMaxPartitionsFunc_ FreeLibrary failed!"); + printf("astc customizedMaxPartitionsFunc_ FreeLibrary failed!\n"); } return false; } @@ -2385,24 +2352,24 @@ public: "CustomizedBlockMode")); if (customizedBlockModeFunc_ == nullptr) { - ASTCENC_ERROR("astc customizedBlockModeFunc_ GetProcAddress failed!"); + printf("astc customizedBlockModeFunc_ GetProcAddress failed!\n"); if (!FreeLibrary(astcCustomizedSoHandle_)) { - ASTCENC_ERROR("astc customizedBlockModeFunc_ FreeLibrary failed!"); + printf("astc customizedBlockModeFunc_ FreeLibrary failed!\n"); } return false; } - ASTCENC_INFO("astcenc customized dll load success: %{public}s!", g_astcCustomizedSo); + printf("astcenc customized dll load success: %s!\n", g_astcCustomizedSo); #else if (access(g_astcCustomizedSo.c_str(), F_OK) == -1) { - ASTCENC_WARN("astc customized so(%{public}s) is not found!", g_astcCustomizedSo.c_str()); + printf("astc customized so(%s) is not found!\n", g_astcCustomizedSo.c_str()); return false; } astcCustomizedSoHandle_ = dlopen(g_astcCustomizedSo.c_str(), 1); if (astcCustomizedSoHandle_ == nullptr) { - ASTCENC_ERROR("astc libAstcCustomizedEnc dlopen failed!"); + printf("astc libAstcCustomizedEnc dlopen failed!\n"); return false; } isCustomizedBlockModeFunc_ = @@ -2410,7 +2377,7 @@ public: "IsCustomizedBlockMode")); if (isCustomizedBlockModeFunc_ == nullptr) { - ASTCENC_ERROR("astc isCustomizedBlockModeFunc_ dlsym failed!"); + printf("astc isCustomizedBlockModeFunc_ dlsym failed!\n"); dlclose(astcCustomizedSoHandle_); astcCustomizedSoHandle_ = nullptr; return false; @@ -2420,7 +2387,7 @@ public: "CustomizedMaxPartitions")); if (customizedMaxPartitionsFunc_ == nullptr) { - ASTCENC_ERROR("astc customizedMaxPartitionsFunc_ dlsym failed!"); + printf("astc customizedMaxPartitionsFunc_ dlsym failed!\n"); dlclose(astcCustomizedSoHandle_); astcCustomizedSoHandle_ = nullptr; return false; @@ -2430,12 +2397,12 @@ public: "CustomizedBlockMode")); if (customizedBlockModeFunc_ == nullptr) { - ASTCENC_ERROR("astc customizedBlockModeFunc_ dlsym failed!"); + printf("astc customizedBlockModeFunc_ dlsym failed!\n"); dlclose(astcCustomizedSoHandle_); astcCustomizedSoHandle_ = nullptr; return false; } - ASTCENC_INFO("astcenc customized so dlopen success: %{public}s", g_astcCustomizedSo.c_str()); + printf("astcenc customized so dlopen success: %s\n", g_astcCustomizedSo.c_str()); #endif astcCustomizedSoOpened_ = true; } diff --git a/bundle.json b/bundle.json index e3fe09c8243ea9a9696d488a0eb283ea29319698..6432ff2dd9ee75d300b912f21f0ad1a4db9f1a20 100644 --- a/bundle.json +++ b/bundle.json @@ -19,7 +19,7 @@ "rom": "", "ram": "", "deps": { - "components": [ "hilog" ], + "components": [], "third_party": [] }, "build": {