diff --git a/test/fuzztest/iamgecompose_fuzzer/iamgecompose_fuzzer.cpp b/test/fuzztest/iamgecompose_fuzzer/iamgecompose_fuzzer.cpp index 25d8d7e..4e68ece 100644 --- a/test/fuzztest/iamgecompose_fuzzer/iamgecompose_fuzzer.cpp +++ b/test/fuzztest/iamgecompose_fuzzer/iamgecompose_fuzzer.cpp @@ -19,6 +19,11 @@ #include "native_color_space_manager.h" #include #include +#include +#include +#include +#include +#include constexpr uint32_t DEFAULT_WIDTH = 3840; constexpr uint32_t DEFAULT_HEIGHT = 2160; diff --git a/test/fuzztest/iamgecompose_fuzzer/iamgecompose_fuzzer.h b/test/fuzztest/iamgecompose_fuzzer/iamgecompose_fuzzer.h deleted file mode 100644 index 21a169f..0000000 --- a/test/fuzztest/iamgecompose_fuzzer/iamgecompose_fuzzer.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (C) 2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef IMAGE_COMPOSE_FUZZER_HEADER -#define IMAGE_COMPOSE_FUZZER_HEADER - -#include -#include -#include -#include -#include -#include - -#endif \ No newline at end of file diff --git a/test/fuzztest/iamgesdr2hdr_fuzzer/imagesdr2hdr_fuzzer.cpp b/test/fuzztest/iamgesdr2hdr_fuzzer/imagesdr2hdr_fuzzer.cpp index cfbae46..21c14a0 100644 --- a/test/fuzztest/iamgesdr2hdr_fuzzer/imagesdr2hdr_fuzzer.cpp +++ b/test/fuzztest/iamgesdr2hdr_fuzzer/imagesdr2hdr_fuzzer.cpp @@ -19,6 +19,11 @@ #include "native_color_space_manager.h" #include #include +#include +#include +#include +#include +#include using namespace OHOS; using namespace OHOS::Media; diff --git a/test/fuzztest/iamgesdr2hdr_fuzzer/imagesdr2hdr_fuzzer.h b/test/fuzztest/iamgesdr2hdr_fuzzer/imagesdr2hdr_fuzzer.h deleted file mode 100644 index 7dd0768..0000000 --- a/test/fuzztest/iamgesdr2hdr_fuzzer/imagesdr2hdr_fuzzer.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef IMAGE_SDR2HDR_FUZZER_HEADER -#define IMAGE_SDR2HDR_FUZZER_HEADER - -#include -#include -#include -#include -#include -#include - -#endif diff --git a/test/fuzztest/imagedecompose_fuzzer/imagedecompose_fuzzer.cpp b/test/fuzztest/imagedecompose_fuzzer/imagedecompose_fuzzer.cpp index 30c592d..61d5781 100644 --- a/test/fuzztest/imagedecompose_fuzzer/imagedecompose_fuzzer.cpp +++ b/test/fuzztest/imagedecompose_fuzzer/imagedecompose_fuzzer.cpp @@ -19,6 +19,11 @@ #include "native_color_space_manager.h" #include #include +#include +#include +#include +#include +#include constexpr uint32_t DEFAULT_WIDTH = 3840; constexpr uint32_t DEFAULT_HEIGHT = 2160; diff --git a/test/fuzztest/imagedecompose_fuzzer/imagedecompose_fuzzer.h b/test/fuzztest/imagedecompose_fuzzer/imagedecompose_fuzzer.h deleted file mode 100644 index 429bdbc..0000000 --- a/test/fuzztest/imagedecompose_fuzzer/imagedecompose_fuzzer.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (C) 2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef IMAGE_DECOMPOSE_FUZZER_HEADER -#define IMAGE_DECOMPOSE_FUZZER_HEADER - -#include -#include -#include -#include -#include -#include - -#endif \ No newline at end of file diff --git a/test/fuzztest/imagehdr2sdr_fuzzer/imagehdr2sdr_fuzzer.cpp b/test/fuzztest/imagehdr2sdr_fuzzer/imagehdr2sdr_fuzzer.cpp index c282136..eaf2890 100644 --- a/test/fuzztest/imagehdr2sdr_fuzzer/imagehdr2sdr_fuzzer.cpp +++ b/test/fuzztest/imagehdr2sdr_fuzzer/imagehdr2sdr_fuzzer.cpp @@ -19,6 +19,11 @@ #include "native_color_space_manager.h" #include #include +#include +#include +#include +#include +#include constexpr uint32_t DEFAULT_WIDTH = 3840; constexpr uint32_t DEFAULT_HEIGHT = 2160; diff --git a/test/fuzztest/imagehdr2sdr_fuzzer/imagehdr2sdr_fuzzer.h b/test/fuzztest/imagehdr2sdr_fuzzer/imagehdr2sdr_fuzzer.h deleted file mode 100644 index d47275e..0000000 --- a/test/fuzztest/imagehdr2sdr_fuzzer/imagehdr2sdr_fuzzer.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (C) 2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef IMAGE_HDR2HDR_FUZZER_HEADER -#define IMAGE_HDR2HDR_FUZZER_HEADER - -#include -#include -#include -#include -#include -#include - -#endif \ No newline at end of file diff --git a/test/fuzztest/imagemetadatagen_fuzzer/imagemetadatagen_fuzzer.cpp b/test/fuzztest/imagemetadatagen_fuzzer/imagemetadatagen_fuzzer.cpp index 89a7e57..725904f 100644 --- a/test/fuzztest/imagemetadatagen_fuzzer/imagemetadatagen_fuzzer.cpp +++ b/test/fuzztest/imagemetadatagen_fuzzer/imagemetadatagen_fuzzer.cpp @@ -19,6 +19,11 @@ #include "native_color_space_manager.h" #include #include +#include +#include +#include +#include +#include constexpr uint32_t DEFAULT_WIDTH = 3840; constexpr uint32_t DEFAULT_HEIGHT = 2160; diff --git a/test/fuzztest/imagemetadatagen_fuzzer/imagemetadatagen_fuzzer.h b/test/fuzztest/imagemetadatagen_fuzzer/imagemetadatagen_fuzzer.h deleted file mode 100644 index 95de34a..0000000 --- a/test/fuzztest/imagemetadatagen_fuzzer/imagemetadatagen_fuzzer.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (C) 2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef IMAGE_METADATA_GEN_FUZZER_HEADER -#define IMAGE_METADATA_GEN_FUZZER_HEADER - -#include -#include -#include -#include -#include -#include - -#endif \ No newline at end of file diff --git a/test/fuzztest/imagesdr2sdr_fuzzer/imagesdr2sdr_fuzzer.cpp b/test/fuzztest/imagesdr2sdr_fuzzer/imagesdr2sdr_fuzzer.cpp index fb95c68..83cff27 100644 --- a/test/fuzztest/imagesdr2sdr_fuzzer/imagesdr2sdr_fuzzer.cpp +++ b/test/fuzztest/imagesdr2sdr_fuzzer/imagesdr2sdr_fuzzer.cpp @@ -19,6 +19,11 @@ #include "native_color_space_manager.h" #include #include +#include +#include +#include +#include +#include constexpr uint32_t DEFAULT_WIDTH = 3840; constexpr uint32_t DEFAULT_HEIGHT = 2160; diff --git a/test/fuzztest/imagesdr2sdr_fuzzer/imagesdr2sdr_fuzzer.h b/test/fuzztest/imagesdr2sdr_fuzzer/imagesdr2sdr_fuzzer.h deleted file mode 100644 index 657458b..0000000 --- a/test/fuzztest/imagesdr2sdr_fuzzer/imagesdr2sdr_fuzzer.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (C) 2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef IMAGE_SDR2SDR_FUZZER_HEADER -#define IMAGE_SDR2SDR_FUZZER_HEADER - -#include -#include -#include -#include -#include -#include - -#endif \ No newline at end of file diff --git a/test/fuzztest/videohdrtohdr_fuzzer/video_sample.cpp b/test/fuzztest/videohdrtohdr_fuzzer/video_sample.cpp index 4e66a8a..cad24e7 100644 --- a/test/fuzztest/videohdrtohdr_fuzzer/video_sample.cpp +++ b/test/fuzztest/videohdrtohdr_fuzzer/video_sample.cpp @@ -25,6 +25,7 @@ using namespace std; constexpr int64_t NANOS_IN_SECOND = 1000000000L; constexpr int64_t NANOS_IN_MICRO = 1000L; +constexpr int64_t SLEEP_MICROSECONDS = 33333L; static int64_t GetSystemTimeUs() { @@ -165,7 +166,7 @@ int32_t VideoSample::InputFunc(const uint8_t *data, size_t size) CHECK_AND_RETURN_RET(err == 0, err, "OH_NativeWindow_NativeWindowFlushBuffer failed."); err = OH_NativeWindow_SetColorSpace(inWindow, param_.inColorSpace); CHECK_AND_RETURN_RET(err == 0, err, "OH_NativeWindow_SetColorSpace failed."); - usleep(33333); + usleep(SLEEP_MICROSECONDS); return err; } diff --git a/test/fuzztest/videohdrtohdr_fuzzer/videohdrtohdr_fuzzer.h b/test/fuzztest/videohdrtohdr_fuzzer/videohdrtohdr_fuzzer.h deleted file mode 100644 index eacce3d..0000000 --- a/test/fuzztest/videohdrtohdr_fuzzer/videohdrtohdr_fuzzer.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (C) 2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef VIDEO_HDRTOHDR_FUZZER_HEADER -#define VIDEO_HDRTOHDR_FUZZER_HEADER - -#include -#include -#include -#include -#include -#include - -#endif \ No newline at end of file diff --git a/test/fuzztest/videohdrvividtohdr_fuzzer/video_sample.h b/test/fuzztest/videohdrvividtohdr_fuzzer/video_sample.h index 52b3fa7..c57764c 100644 --- a/test/fuzztest/videohdrvividtohdr_fuzzer/video_sample.h +++ b/test/fuzztest/videohdrvividtohdr_fuzzer/video_sample.h @@ -23,6 +23,8 @@ using namespace OHOS; using namespace std; constexpr int64_t NANOS_IN_SECOND = 1000000000L; constexpr int64_t NANOS_IN_MICRO = 1000L; +constexpr int64_t SLEEP_MICROSECONDS = 33333L; +constexpr int THREE = 3; static int64_t GetSystemTimeUs() { @@ -153,13 +155,13 @@ int32_t VideoSample::InputFunc(const uint8_t *data, size_t size) err = OH_NativeBuffer_Map(nativeBuffer, &virAddr); CHECK_AND_RETURN_RET(err == 0, err, "OH_NativeBuffer_Map failed."); uint8_t *addr = reinterpret_cast(virAddr); - memcpy_s(addr, config.stride * config.height * 3, data, size); + memcpy_s(addr, config.stride * config.height * THREE, data, size); NativeWindowHandleOpt(inWindow, SET_UI_TIMESTAMP, GetSystemTimeUs()); err = OH_NativeBuffer_Unmap(nativeBuffer); CHECK_AND_RETURN_RET(err == 0, err, "OH_NativeBuffer_Unmap failed."); err = OH_NativeWindow_NativeWindowFlushBuffer(inWindow, ohNativeWindowBuffer, -1, region); CHECK_AND_RETURN_RET(err == 0, err, "OH_NativeWindow_NativeWindowFlushBuffer failed."); - usleep(33333); + usleep(SLEEP_MICROSECONDS); return err; } diff --git a/test/fuzztest/videohdrvividtohdr_fuzzer/videohdrvividtohdr_fuzzer.cpp b/test/fuzztest/videohdrvividtohdr_fuzzer/videohdrvividtohdr_fuzzer.cpp index 69b1da9..4389827 100644 --- a/test/fuzztest/videohdrvividtohdr_fuzzer/videohdrvividtohdr_fuzzer.cpp +++ b/test/fuzztest/videohdrvividtohdr_fuzzer/videohdrvividtohdr_fuzzer.cpp @@ -17,6 +17,11 @@ #include "video_sample.h" #include #include +#include +#include +#include +#include +#include namespace OHOS { VideoSample *sample = nullptr; diff --git a/test/fuzztest/videohdrvividtohdr_fuzzer/videohdrvividtohdr_fuzzer.h b/test/fuzztest/videohdrvividtohdr_fuzzer/videohdrvividtohdr_fuzzer.h deleted file mode 100644 index 648fe19..0000000 --- a/test/fuzztest/videohdrvividtohdr_fuzzer/videohdrvividtohdr_fuzzer.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (C) 2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef VIDEO_HDRVIVID_TO_HDR_FUZZERR_HEADER -#define VIDEO_HDRVIVID_TO_HDR_FUZZERR_HEADER - -#include -#include -#include -#include -#include -#include - -#endif \ No newline at end of file diff --git a/test/fuzztest/videohdrvividtosdr_fuzzer/videohdrvividtosdr_fuzzer.cpp b/test/fuzztest/videohdrvividtosdr_fuzzer/videohdrvividtosdr_fuzzer.cpp index 1c27a90..f54b0f4 100644 --- a/test/fuzztest/videohdrvividtosdr_fuzzer/videohdrvividtosdr_fuzzer.cpp +++ b/test/fuzztest/videohdrvividtosdr_fuzzer/videohdrvividtosdr_fuzzer.cpp @@ -17,6 +17,11 @@ #include "video_sample.h" #include #include +#include +#include +#include +#include +#include namespace OHOS { VideoSample *sample = nullptr; diff --git a/test/fuzztest/videohdrvividtosdr_fuzzer/videohdrvividtosdr_fuzzer.h b/test/fuzztest/videohdrvividtosdr_fuzzer/videohdrvividtosdr_fuzzer.h deleted file mode 100644 index 1f2a2ba..0000000 --- a/test/fuzztest/videohdrvividtosdr_fuzzer/videohdrvividtosdr_fuzzer.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (C) 2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef VIDEO_HDRVIVID_TO_SDR_FUZZER_HEADER -#define VIDEO_HDRVIVID_TO_SDR_FUZZER_HEADER - -#include -#include -#include -#include -#include -#include - -#endif \ No newline at end of file diff --git a/test/fuzztest/videometadatagen_fuzzer/video_sample.h b/test/fuzztest/videometadatagen_fuzzer/video_sample.h index 06135e9..78a998c 100644 --- a/test/fuzztest/videometadatagen_fuzzer/video_sample.h +++ b/test/fuzztest/videometadatagen_fuzzer/video_sample.h @@ -26,7 +26,8 @@ constexpr int64_t NANOS_IN_MICRO = 1000L; constexpr int64_t SLEEP_MICROSECONDS = 33333L; constexpr int THREE = 3; -static int64_t GetSystemTimeUs() +namespace { +int64_t GetSystemTimeUs() { struct timespec now; (void)clock_gettime(CLOCK_BOOTTIME, &now); @@ -34,24 +35,25 @@ static int64_t GetSystemTimeUs() return nanoTime / NANOS_IN_MICRO; } -static void OnError(OH_VideoProcessing* videoProcessor, VideoProcessing_ErrorCode error, void* userData) +void OnError(OH_VideoProcessing* videoProcessor, VideoProcessing_ErrorCode error, void* userData) { (void)videoProcessor; (void)error; (void)userData; } -static void OnState(OH_VideoProcessing* videoProcessor, VideoProcessing_State state, void* userData) +void OnState(OH_VideoProcessing* videoProcessor, VideoProcessing_State state, void* userData) { (void)videoProcessor; (void)state; (void)userData; } -static void OnNewOutputBuffer(OH_VideoProcessing* videoProcessor, uint32_t index, void* userData) +void OnNewOutputBuffer(OH_VideoProcessing* videoProcessor, uint32_t index, void* userData) { OH_VideoProcessing_RenderOutputBuffer(videoProcessor, index); } +} class VPEConsumerListener : public IBufferConsumerListener { public: diff --git a/test/fuzztest/videosdrtosdr_fuzzer/videosdrtosdr_fuzzer.cpp b/test/fuzztest/videosdrtosdr_fuzzer/videosdrtosdr_fuzzer.cpp index 1870bfa..002f102 100644 --- a/test/fuzztest/videosdrtosdr_fuzzer/videosdrtosdr_fuzzer.cpp +++ b/test/fuzztest/videosdrtosdr_fuzzer/videosdrtosdr_fuzzer.cpp @@ -13,6 +13,10 @@ * limitations under the License. */ + +#include +#include +#include #include #include #include diff --git a/test/ndk/moduletest/common/yuv_viewer.h b/test/ndk/moduletest/common/yuv_viewer.h index a259283..de44fca 100644 --- a/test/ndk/moduletest/common/yuv_viewer.h +++ b/test/ndk/moduletest/common/yuv_viewer.h @@ -19,7 +19,7 @@ #include "surface/native_image.h" #include "surface/native_buffer.h" namespace OHOS { -class YuvViewer{ +class YuvViewer { public: ~YuvViewer(); OHNativeWindow *CreateWindow(uint32_t width, uint32_t height, diff --git a/test/ndk/moduletest/video/reli_test.cpp b/test/ndk/moduletest/video/reli_test.cpp index 44eb89c..f1508ac 100644 --- a/test/ndk/moduletest/video/reli_test.cpp +++ b/test/ndk/moduletest/video/reli_test.cpp @@ -121,8 +121,8 @@ void CheckCapability(VideoProcessing_ColorSpaceInfo inputFormat) formatImage.colorSpace == OH_COLORSPACE_DISPLAY_P3_SRGB || formatImage.colorSpace == OH_COLORSPACE_DISPLAY_BT2020_SRGB) { if(formatImage.pixelFormat == NATIVEBUFFER_PIXEL_FMT_YCBCR_420_SP || - formatImage.pixelFormat == NATIVEBUFFER_PIXEL_FMT_YCRCB_420_SP || - formatImage.pixelFormat == NATIVEBUFFER_PIXEL_FMT_RGBA_8888){ + formatImage.pixelFormat == NATIVEBUFFER_PIXEL_FMT_YCRCB_420_SP || + formatImage.pixelFormat == NATIVEBUFFER_PIXEL_FMT_RGBA_8888) { if (!access("/system/lib64/ndk/libvideo_processing_capi_impl.so", 0)) { if (!access("/system/lib64/media/", 0)) { ASSERT_EQ(true, OH_ImageProcessing_IsMetadataGenerationSupported(formatImage)); @@ -133,11 +133,11 @@ void CheckCapability(VideoProcessing_ColorSpaceInfo inputFormat) } } if(formatImage.colorSpace == OH_COLORSPACE_DISPLAY_P3_SRGB || - formatImage.colorSpace == OH_COLORSPACE_DISPLAY_P3_HLG || - formatImage.colorSpace == OH_COLORSPACE_DISPLAY_P3_PQ) { + formatImage.colorSpace == OH_COLORSPACE_DISPLAY_P3_HLG || + formatImage.colorSpace == OH_COLORSPACE_DISPLAY_P3_PQ) { if(formatImage.pixelFormat == NATIVEBUFFER_PIXEL_FMT_YCBCR_420_SP || - formatImage.pixelFormat == NATIVEBUFFER_PIXEL_FMT_YCRCB_420_SP || - formatImage.pixelFormat == NATIVEBUFFER_PIXEL_FMT_RGBA_8888) { + formatImage.pixelFormat == NATIVEBUFFER_PIXEL_FMT_YCRCB_420_SP || + formatImage.pixelFormat == NATIVEBUFFER_PIXEL_FMT_RGBA_8888) { if (!access("/system/lib64/ndk/libvideo_processing_capi_impl.so", 0)) { if (!access("/system/lib64/media/", 0)) { ASSERT_EQ(true, OH_ImageProcessing_IsMetadataGenerationSupported(formatImage)); @@ -148,10 +148,10 @@ void CheckCapability(VideoProcessing_ColorSpaceInfo inputFormat) } } if(formatImage.colorSpace == OH_COLORSPACE_ADOBERGB_FULL || - formatImage.colorSpace == OH_COLORSPACE_ADOBERGB_LIMIT) { + formatImage.colorSpace == OH_COLORSPACE_ADOBERGB_LIMIT) { if(formatImage.pixelFormat == NATIVEBUFFER_PIXEL_FMT_YCBCR_420_SP || - formatImage.pixelFormat == NATIVEBUFFER_PIXEL_FMT_YCRCB_420_SP || - formatImage.pixelFormat == NATIVEBUFFER_PIXEL_FMT_RGBA_8888) { + formatImage.pixelFormat == NATIVEBUFFER_PIXEL_FMT_YCRCB_420_SP || + formatImage.pixelFormat == NATIVEBUFFER_PIXEL_FMT_RGBA_8888) { if (!access("/system/lib64/ndk/libvideo_processing_capi_impl.so", 0)) { if (!access("/system/lib64/media/", 0)) { ASSERT_EQ(true, OH_ImageProcessing_IsMetadataGenerationSupported(formatImage)); diff --git a/test/ndk/moduletest/video/video_sample.cpp b/test/ndk/moduletest/video/video_sample.cpp index 205e783..c167bdc 100644 --- a/test/ndk/moduletest/video/video_sample.cpp +++ b/test/ndk/moduletest/video/video_sample.cpp @@ -150,8 +150,10 @@ void VideoSample::SetInputWindowParam() metaDataFile->seekg(0, ios::end); metadataSize = metaDataFile->tellg(); metaDataFile->seekg(0, ios::beg); - metaData = new uint8_t[metadataSize]; - metaDataFile->read(reinterpret_cast(metaData), metadataSize); + if (metadataSize > 0) { + metaData = new uint8_t[metadataSize]; + metaDataFile->read(reinterpret_cast(metaData), metadataSize); + } } rect = new Region::Rect(); rect->x = 0; diff --git a/test/ndk/moduletest/video/video_sample.h b/test/ndk/moduletest/video/video_sample.h index c37be5f..4180d74 100644 --- a/test/ndk/moduletest/video/video_sample.h +++ b/test/ndk/moduletest/video/video_sample.h @@ -25,7 +25,7 @@ #include "native_buffer.h" inline int CheckAndRet(bool cond, int ret, char* msg) { - if (!(cond)) { + if (!cond) { std::cout<< msg <<" ErrCode:"<< ret << std::endl; return ret; }