From 5cad43e0c263dd4d6bdd98eacde0ef3142a18614 Mon Sep 17 00:00:00 2001 From: pwx1285814 Date: Mon, 11 Mar 2024 20:15:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=97=A0=E7=94=A8=E7=9A=84?= =?UTF-8?q?=E4=BE=9D=E8=B5=96libyuv?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: pwx1285814 --- bundle.json | 3 +-- distributedscreen.gni | 4 ---- .../imageJpeg/src/jpeg_image_processor.cpp | 21 ------------------- .../screentransport/screensinktrans/BUILD.gn | 5 ----- .../screensourcetrans/BUILD.gn | 5 ----- 5 files changed, 1 insertion(+), 37 deletions(-) diff --git a/bundle.json b/bundle.json index 69c5530d..fbe85d7e 100644 --- a/bundle.json +++ b/bundle.json @@ -43,8 +43,7 @@ "c_utils", "player_framework", "window_manager", - "distributed_hardware_fwk", - "libyuv" + "distributed_hardware_fwk" ], "third_party": [ "libjpeg-turbo" diff --git a/distributedscreen.gni b/distributedscreen.gni index 9b03bc42..596bfeeb 100644 --- a/distributedscreen.gni +++ b/distributedscreen.gni @@ -28,7 +28,3 @@ fwk_services_path = "${distributedhardwarefwk_path}/services" fwk_interfaces_path = "${distributedhardwarefwk_path}/interfaces" ipc_interfaces_path = "${ipc_path}/interfaces" build_flags = [ "-Werror" ] - -declare_args() { - distributed_screen_common = true -} diff --git a/services/common/imageJpeg/src/jpeg_image_processor.cpp b/services/common/imageJpeg/src/jpeg_image_processor.cpp index c8c5a2be..a49cd110 100644 --- a/services/common/imageJpeg/src/jpeg_image_processor.cpp +++ b/services/common/imageJpeg/src/jpeg_image_processor.cpp @@ -22,10 +22,6 @@ #include #include -#ifdef LIBYUV -#include -#endif - #include "dscreen_errcode.h" #include "dscreen_log.h" @@ -277,21 +273,10 @@ void JpegImageProcessor::DecompressJpegToNV12(size_t jpegSize, uint8_t *inputDat JSAMPARRAY buffer = (*cinfo.mem->alloc_sarray)((j_common_ptr)&cinfo, JPOOL_IMAGE, row_stride, 1); uint32_t uvIndex = cinfo.output_width * cinfo.output_height; int32_t i = 0; -#ifdef LIBYUV - uint8_t *rgb = new uint8_t[cinfo.output_width * cinfo.output_height * RGBA_CHROMA]; - int32_t rgbIndex = 0; -#else int32_t yIndex = 0; -#endif while (cinfo.output_scanline < cinfo.output_height) { (void)jpeg_read_scanlines(&cinfo, buffer, 1); for (unsigned int j = 0 ; j < cinfo.output_width ; j++) { -#ifdef LIBYUV - rgb[rgbIndex++] = buffer[0][j * RGB_CHROMA + TWO]; - rgb[rgbIndex++] = buffer[0][j * RGB_CHROMA + 1]; - rgb[rgbIndex++] = buffer[0][j * RGB_CHROMA]; - rgb[rgbIndex++] = 0xff; -#else int32_t y = ((YR_PARAM * buffer[0][j * RGB_CHROMA] + YG_PARAM * buffer[0][j * RGB_CHROMA + 1] + YB_PARAM * buffer[0][j * RGB_CHROMA + TWO] + UA_PARAM) >> MOVEBITS) + YA_PARAM; int32_t u = ((UB_PARAM * buffer[0][j * RGB_CHROMA + TWO] - UR_PARAM * buffer[0][j * RGB_CHROMA] - @@ -303,17 +288,11 @@ void JpegImageProcessor::DecompressJpegToNV12(size_t jpegSize, uint8_t *inputDat outputData[uvIndex++] = static_cast((u < 0) ? 0 : (u > YUV_PARAM) ? YUV_PARAM : u); outputData[uvIndex++] = static_cast((v < 0) ? 0 : (v > YUV_PARAM) ? YUV_PARAM : v); } -#endif } ++i; } (void)jpeg_finish_decompress(&cinfo); jpeg_destroy_decompress(&cinfo); -#ifdef LIBYUV - libyuv::ARGBToNV12(rgb, cinfo.output_width * RGBA_CHROMA, outputData, cinfo.output_width, - outputData + uvIndex, cinfo.output_width, cinfo.output_width, cinfo.output_height); - delete [] rgb; -#endif } } // namespace DistributedHardware } // namespace OHOS \ No newline at end of file diff --git a/services/screentransport/screensinktrans/BUILD.gn b/services/screentransport/screensinktrans/BUILD.gn index fa1bb0de..21829486 100644 --- a/services/screentransport/screensinktrans/BUILD.gn +++ b/services/screentransport/screensinktrans/BUILD.gn @@ -85,11 +85,6 @@ ohos_shared_library("distributed_screen_sinktrans") { "player_framework:media_client", ] - if (!distributed_screen_common) { - cflags = [ "-DLIBYUV" ] - external_deps += [ "libyuv:yuv" ] - } - subsystem_name = "distributedhardware" part_name = "distributed_screen" diff --git a/services/screentransport/screensourcetrans/BUILD.gn b/services/screentransport/screensourcetrans/BUILD.gn index 49aa88c3..0dde974a 100644 --- a/services/screentransport/screensourcetrans/BUILD.gn +++ b/services/screentransport/screensourcetrans/BUILD.gn @@ -85,11 +85,6 @@ ohos_shared_library("distributed_screen_sourcetrans") { "player_framework:media_client", ] - if (!distributed_screen_common) { - cflags = [ "-DLIBYUV" ] - external_deps += [ "libyuv:yuv" ] - } - subsystem_name = "distributedhardware" part_name = "distributed_screen" -- Gitee