From 572ab0769c14e22ad9586bf06c3340e081c20d84 Mon Sep 17 00:00:00 2001 From: liushang Date: Sun, 6 Apr 2025 20:34:53 +0800 Subject: [PATCH 1/4] fix ut Signed-off-by: liushang --- .../image_processing_native_base.cpp | 10 +++---- .../video_processing_capi_capability.cpp | 6 ++++ test/BUILD.gn | 28 +++++++++++++++++-- 3 files changed, 36 insertions(+), 8 deletions(-) diff --git a/framework/capi/image_processing/image_processing_native_base.cpp b/framework/capi/image_processing/image_processing_native_base.cpp index e099559..0914946 100644 --- a/framework/capi/image_processing/image_processing_native_base.cpp +++ b/framework/capi/image_processing/image_processing_native_base.cpp @@ -149,7 +149,7 @@ ImageProcessing_ErrorCode ImageProcessingNativeBase::ConvertColorSpace( [[maybe_unused]] const std::shared_ptr& sourceImage, [[maybe_unused]] std::shared_ptr& destinationImage) { - return IMAGE_PROCESSING_SUCCESS; + return IMAGE_PROCESSING_ERROR_UNSUPPORTED_PROCESSING; } ImageProcessing_ErrorCode ImageProcessingNativeBase::Compose( @@ -157,7 +157,7 @@ ImageProcessing_ErrorCode ImageProcessingNativeBase::Compose( [[maybe_unused]] const std::shared_ptr& sourceGainmap, [[maybe_unused]] std::shared_ptr& destinationImage) { - return IMAGE_PROCESSING_SUCCESS; + return IMAGE_PROCESSING_ERROR_UNSUPPORTED_PROCESSING; } ImageProcessing_ErrorCode ImageProcessingNativeBase::Decompose( @@ -165,18 +165,18 @@ ImageProcessing_ErrorCode ImageProcessingNativeBase::Decompose( [[maybe_unused]] std::shared_ptr& destinationImage, [[maybe_unused]] std::shared_ptr& destinationGainmap) { - return IMAGE_PROCESSING_SUCCESS; + return IMAGE_PROCESSING_ERROR_UNSUPPORTED_PROCESSING; } ImageProcessing_ErrorCode ImageProcessingNativeBase::GenerateMetadata( [[maybe_unused]] const std::shared_ptr& sourceImage) { - return IMAGE_PROCESSING_SUCCESS; + return IMAGE_PROCESSING_ERROR_UNSUPPORTED_PROCESSING; } ImageProcessing_ErrorCode ImageProcessingNativeBase::EnhanceDetail( [[maybe_unused]] const std::shared_ptr& sourceImage, [[maybe_unused]] std::shared_ptr& destinationImage) { - return IMAGE_PROCESSING_SUCCESS; + return IMAGE_PROCESSING_ERROR_UNSUPPORTED_PROCESSING; } diff --git a/framework/capi/video_processing/video_processing_capi_capability.cpp b/framework/capi/video_processing/video_processing_capi_capability.cpp index 91c3350..2c787db 100644 --- a/framework/capi/video_processing/video_processing_capi_capability.cpp +++ b/framework/capi/video_processing/video_processing_capi_capability.cpp @@ -301,6 +301,9 @@ bool VideoProcessingCapiCapability::IsColorSpaceConversionSupported( const VideoProcessing_ColorSpaceInfo* sourceVideoInfo, const VideoProcessing_ColorSpaceInfo* destinationVideoInfo) { + if (!access("/system/lib64/libvideoprocessingengine_ext.z.so", 0)) { + return false; + } CHECK_AND_RETURN_RET_LOG(sourceVideoInfo != nullptr, false, "sourceVideoInfo is null!"); CHECK_AND_RETURN_RET_LOG(destinationVideoInfo != nullptr, false, "destinationVideoInfo is null!"); CscvSupportKey keySource = VideoColorSpaceInfoToCscvKey(sourceVideoInfo, destinationVideoInfo); @@ -349,6 +352,9 @@ MetaSupportKey VideoColorSpaceInfoToMetaKey(const VideoProcessing_ColorSpaceInfo bool VideoProcessingCapiCapability::IsMetadataGenerationSupported( const VideoProcessing_ColorSpaceInfo* sourceVideoInfo) { + if (!access("/system/lib64/libvideoprocessingengine_ext.z.so", 0)) { + return false; + } CHECK_AND_RETURN_RET_LOG(sourceVideoInfo != nullptr, false, "sourceVideoInfo is null!"); MetaSupportKey keySource = VideoColorSpaceInfoToMetaKey(sourceVideoInfo); auto it = VIDEO_META_SUPPORT_MAP.find(keySource); diff --git a/test/BUILD.gn b/test/BUILD.gn index fc8b879..cfc1498 100644 --- a/test/BUILD.gn +++ b/test/BUILD.gn @@ -31,6 +31,25 @@ declare_args() { aihdr_enhancer_unit_test = true } +if (defined(global_parts_info) && + defined(global_parts_info.multimedia_video_processing_engine_ext)) { + vpe_support_demo_test = false + vpe_support_unit_test = false + vpe_support_module_test = false + cscv_support_demo_test = false + cscv_support_unit_test = false + video_support_demo_test = false + image_processing_unit_test = false + detail_enhancer_video_unit_test = false + detail_enhancer_unit_test = false + detail_enhancer_video_ndk_unit_test = false + colorSpace_converter_video_ndk_unit_test = false + metadata_gen_video_ndk_unit_test = false + video_variable_refreshrate_unit_test = false + aihdr_enhancer_video_unit_test = false + aihdr_enhancer_unit_test = false +} + group("demo_test") { testonly = true deps = [] @@ -55,7 +74,9 @@ group("unit_test") { deps += [ "unittest/detail_enhancer_video:detail_enhancer_video_unit_test" ] } if (detail_enhancer_video_ndk_unit_test) { - deps += [ "unittest/detail_enhancer_video_ndk:detail_enhancer_video_ndk_unit_test" ] + deps += [ + "unittest/detail_enhancer_video_ndk:detail_enhancer_video_ndk_unit_test", + ] } if (cscv_support_unit_test) { deps += [ "unittest/colorspace_converter_video:colorspace_converter_video_unit_test" ] @@ -64,7 +85,8 @@ group("unit_test") { deps += [ "unittest/colorSpace_converter_video_ndk:colorSpace_converter_video_ndk_unit_test" ] } if (metadata_gen_video_ndk_unit_test) { - deps += [ "unittest/metadata_gen_video_ndk:metadata_gen_video_ndk_unit_test" ] + deps += + [ "unittest/metadata_gen_video_ndk:metadata_gen_video_ndk_unit_test" ] } if (video_variable_refreshrate_unit_test) { deps += [ "unittest/video_variable_refreshrate_test:video_variable_refreshrate_unit_test" ] @@ -83,8 +105,8 @@ group("module_test") { if (vpe_support_module_test) { deps += [ "moduletest/colorspace_converter:colorspace_converter_module_test", - "moduletest/metadata_generator:metadata_generator_module_test", "moduletest/colorspace_converter_video:colorspace_converter_video_module_test", + "moduletest/metadata_generator:metadata_generator_module_test", "moduletest/metadata_generator_video:metadata_generator_video_module_test", ] } -- Gitee From fb221f5fb6e0280ea227a4b1fa71bd26a03fe8fb Mon Sep 17 00:00:00 2001 From: liushang Date: Sun, 6 Apr 2025 20:50:13 +0800 Subject: [PATCH 2/4] fix ut Signed-off-by: liushang --- .../video_processing/video_processing_capi_capability.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/framework/capi/video_processing/video_processing_capi_capability.cpp b/framework/capi/video_processing/video_processing_capi_capability.cpp index 2c787db..5ede00e 100644 --- a/framework/capi/video_processing/video_processing_capi_capability.cpp +++ b/framework/capi/video_processing/video_processing_capi_capability.cpp @@ -301,7 +301,7 @@ bool VideoProcessingCapiCapability::IsColorSpaceConversionSupported( const VideoProcessing_ColorSpaceInfo* sourceVideoInfo, const VideoProcessing_ColorSpaceInfo* destinationVideoInfo) { - if (!access("/system/lib64/libvideoprocessingengine_ext.z.so", 0)) { + if (access("/system/lib64/libvideoprocessingengine_ext.z.so", 0)) { return false; } CHECK_AND_RETURN_RET_LOG(sourceVideoInfo != nullptr, false, "sourceVideoInfo is null!"); @@ -352,7 +352,7 @@ MetaSupportKey VideoColorSpaceInfoToMetaKey(const VideoProcessing_ColorSpaceInfo bool VideoProcessingCapiCapability::IsMetadataGenerationSupported( const VideoProcessing_ColorSpaceInfo* sourceVideoInfo) { - if (!access("/system/lib64/libvideoprocessingengine_ext.z.so", 0)) { + if (access("/system/lib64/libvideoprocessingengine_ext.z.so", 0)) { return false; } CHECK_AND_RETURN_RET_LOG(sourceVideoInfo != nullptr, false, "sourceVideoInfo is null!"); -- Gitee From 045a7b525bb160c0d1a73c95b5b0ea70417676a4 Mon Sep 17 00:00:00 2001 From: liushang Date: Mon, 7 Apr 2025 12:16:04 +0800 Subject: [PATCH 3/4] fix ut Signed-off-by: liushang --- framework/capi/image_processing/image_processing_factory.cpp | 5 +++++ framework/capi/video_processing/video_processing_factory.cpp | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/framework/capi/image_processing/image_processing_factory.cpp b/framework/capi/image_processing/image_processing_factory.cpp index 455e158..c907d28 100644 --- a/framework/capi/image_processing/image_processing_factory.cpp +++ b/framework/capi/image_processing/image_processing_factory.cpp @@ -47,6 +47,11 @@ const std::unordered_map Date: Mon, 7 Apr 2025 12:39:32 +0800 Subject: [PATCH 4/4] fix ut Signed-off-by: liushang --- framework/capi/image_processing/image_processing_factory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/capi/image_processing/image_processing_factory.cpp b/framework/capi/image_processing/image_processing_factory.cpp index c907d28..ab7b047 100644 --- a/framework/capi/image_processing/image_processing_factory.cpp +++ b/framework/capi/image_processing/image_processing_factory.cpp @@ -48,7 +48,7 @@ const std::unordered_map