From 6647e04cf6786fd1d7529e714b729c06bd42dbf9 Mon Sep 17 00:00:00 2001 From: Cao Chuan Date: Wed, 21 Jun 2023 17:08:56 +0800 Subject: [PATCH] Fix api changing Signed-off-by: Cao Chuan --- .../src/main/cpp/napi/image_pixel_map_imgndk_test.cpp | 5 +++-- .../entry/src/main/cpp/napi/imagePixelmap.cpp | 10 +++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/multimedia/image/image_js_standard/imagePixelMapNDK/entry/src/main/cpp/napi/image_pixel_map_imgndk_test.cpp b/multimedia/image/image_js_standard/imagePixelMapNDK/entry/src/main/cpp/napi/image_pixel_map_imgndk_test.cpp index 5364791c0..be1ff6f05 100644 --- a/multimedia/image/image_js_standard/imagePixelMapNDK/entry/src/main/cpp/napi/image_pixel_map_imgndk_test.cpp +++ b/multimedia/image/image_js_standard/imagePixelMapNDK/entry/src/main/cpp/napi/image_pixel_map_imgndk_test.cpp @@ -162,7 +162,8 @@ napi_value ImagePixelMapNDKTest::CreatePixelMap(napi_env env, napi_callback_info if (!parseCreateOptions(env, argValue[NUM_1], &createOps)) { return udfVar; } - int32_t res = OH_PixelMap_CreatePixelMap(env, createOps, buffer, bufferSize, &pixelmap); + int32_t res = OH_PixelMap_CreatePixelMap(env, createOps, + static_cast(buffer), bufferSize, &pixelmap); if (res != OHOS_IMAGE_RESULT_SUCCESS || pixelmap == nullptr) { return udfVar; } @@ -587,7 +588,7 @@ napi_value ImagePixelMapNDKTest::AccessPixels(napi_env env, napi_callback_info i return result; } - void* pixelAddr = nullptr; + uint8_t* pixelAddr = nullptr; int32_t res = OH_PixelMap_AccessPixels(native, &pixelAddr); if (res != OHOS_IMAGE_RESULT_SUCCESS || pixelAddr == nullptr) { return result; diff --git a/multimedia/image/image_js_standard/image_ndk_test/entry/src/main/cpp/napi/imagePixelmap.cpp b/multimedia/image/image_js_standard/image_ndk_test/entry/src/main/cpp/napi/imagePixelmap.cpp index 8b9ea8440..502cd6963 100644 --- a/multimedia/image/image_js_standard/image_ndk_test/entry/src/main/cpp/napi/imagePixelmap.cpp +++ b/multimedia/image/image_js_standard/image_ndk_test/entry/src/main/cpp/napi/imagePixelmap.cpp @@ -29,8 +29,8 @@ static napi_value TestGetImageInfo(napi_env env, napi_callback_info info) napi_get_cb_info(env, info, &argCount, argValue, &thisVar, nullptr); - OHOS::Media::OhosPixelMapInfo pixelMapInfo; - OHOS::Media::OH_GetImageInfo(env, argValue[0], &pixelMapInfo); + OhosPixelMapInfo pixelMapInfo; + OH_GetImageInfo(env, argValue[0], &pixelMapInfo); return result; } @@ -45,8 +45,8 @@ static napi_value TestAccessPixels(napi_env env, napi_callback_info info) napi_get_cb_info(env, info, &argCount, argValue, &thisVar, nullptr); - void* addrPtr = nullptr; - OHOS::Media::OH_AccessPixels(env, argValue[0], &addrPtr); + uint8_t* addrPtr = nullptr; + OH_AccessPixels(env, argValue[0], &addrPtr); return result; } @@ -61,7 +61,7 @@ static napi_value TestUnAccessPixels(napi_env env, napi_callback_info info) napi_get_cb_info(env, info, &argCount, argValue, &thisVar, nullptr); - OHOS::Media::OH_UnAccessPixels(env, argValue[0]); + OH_UnAccessPixels(env, argValue[0]); return result; } -- GitLab